Skip to main content

Faster simulations of fermionic quantum circuits.

Project description

ffsim

Faster simulations of fermionic quantum circuits.

What is ffsim?

ffsim is a software library for simulating fermionic quantum circuits that preserve particle number and the Z component of spin. This category includes many quantum circuits used for quantum chemistry simulations. By exploiting the symmetries and using specialized algorithms, ffsim can simulate these circuits much faster than a generic quantum circuit simulator.

Experimental disclaimer: ffsim is currently an experimental release. Breaking changes may be introduced without warning.

Features

  • Fast simulation of fermionic quantum circuits that preserve particle number and the Z component of spin. ffsim supports the simulation of basic fermionic gates and includes specialized routines for simulation of molecular Hamiltonians in the "double-factorized" representation.
  • Compatible with PySCF. State vectors use the same indexing convention as PySCF's fci module.

Limitations

  • There is no support for operations that do not preserve particle number and the Z component of spin.

Supported platforms

ffsim is supported on Linux, macOS, and the Windows Subsystem for Linux (WSL). It is not supported on Windows.

Installation

From PyPI

ffsim is available on PyPI. It can be installed by running the command

pip install ffsim

From source

Installing ffsim from source requires the following system dependencies:

  • A Rust compiler. See these instructions.

  • A BLAS implementation. For example:

    • Arch Linux:

      sudo pacman -S blas-openblas
      
    • Fedora:

      sudo dnf install openblas-devel
      
    • Ubuntu:

      sudo apt install libopenblas-dev
      

Once these dependencies are satisfied, ffsim can be installed by running the command

pip install .

from the root directory of the code repository.

Development

To set up ffsim for development, install it from source in editable mode along with the development requirements:

pip install -e ".[dev]"

If you add or modify any Rust modules, rebuild them by running the command

maturin develop

If you are benchmarking the code, then pass the --release flag:

maturin develop --release

Tests and other code checks are managed using tox. To run the default tox environments, simply run

tox

To run a specific environment, for example, to run the lint checks, do

tox run -e lint

You can also use pytest to run the tests directly. For example,

pytest tests/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffsim-0.0.7.tar.gz (72.1 kB view details)

Uploaded Source

Built Distributions

ffsim-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

ffsim-0.0.7-cp38-abi3-macosx_10_9_x86_64.whl (430.9 kB view details)

Uploaded CPython 3.8+ macOS 10.9+ x86-64

File details

Details for the file ffsim-0.0.7.tar.gz.

File metadata

  • Download URL: ffsim-0.0.7.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ffsim-0.0.7.tar.gz
Algorithm Hash digest
SHA256 647d3fcb9c941077da39915355edadce4ba4739d54458fab78fc5dfa4f702f88
MD5 24a0318cbd4929e2cc2dd5f4e875978e
BLAKE2b-256 3f373dd6fb4bcea68e3a1113398e4148ff2aad5ca03d0b0b2725c490bb8faf73

See more details on using hashes here.

Provenance

File details

Details for the file ffsim-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ffsim-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff52e9a275d393299f3189d209758b2d8bffb680077bba535a53ef24b9def313
MD5 f9d4f4677449db8d9f2acd677d6427c3
BLAKE2b-256 27d3cacc3bbedb6bf14bd4e0ea239882c493d5120c0ba414b2574068433634e1

See more details on using hashes here.

Provenance

File details

Details for the file ffsim-0.0.7-cp38-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ffsim-0.0.7-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2848b9f9ad25a6d2a5ef26067aa1bc4d0f1ab17e41edc124c59b4f175e2218be
MD5 103410c1170cc381e17db6309aa2f42e
BLAKE2b-256 96e4a49a8abb2c9ecde16ccde1c53be3f2096cca896e26b9b06f27f9849dbbec

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page