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 --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.5.tar.gz (69.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ffsim-0.0.5-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.5-cp38-abi3-macosx_10_9_x86_64.whl (424.5 kB view details)

Uploaded CPython 3.8+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ffsim-0.0.5.tar.gz
  • Upload date:
  • Size: 69.3 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.5.tar.gz
Algorithm Hash digest
SHA256 306a7ed2442652770c3f51044d408046ad7e27544f3768d67fa61f0229a70868
MD5 8d0b6f276fdf9daabd0abae32ae5a4bc
BLAKE2b-256 f898f6499a5ad4193a9f5dcf9e2e1fdef5d786d89a55dc0a308b8b41824fd985

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffsim-0.0.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 caa9b756577f031dd925687f5fd8bf708f68d78447fa4654aad442bcc4e2f7e0
MD5 47a445ad42e13bcea827dae581e9532f
BLAKE2b-256 1c0447677aedc186f452397b8ecbdf6b6cfc9f2c3f06669f9c2476ecbee67d4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ffsim-0.0.5-cp38-abi3-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 424.5 kB
  • Tags: CPython 3.8+, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ffsim-0.0.5-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6414599d0d6143c1c98b52733d9aa6eb1cce66070bf24324d55647c81a972ea
MD5 88c43c46f442fdb3ee566e0792fa218b
BLAKE2b-256 925e4da8793e0963a4d078f570d45d3604048f9e7aa8f4f4d7472679f0d18d31

See more details on using hashes here.

Supported by

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