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.

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 a Rust compiler to be present on the system. A Rust compiler can be installed by following the instructions here. Once the Rust compiler is installed, ffsim can be installed by running the command

pip install .

from the root directory of the code repository.

Installing from source has only been tested in a Linux environment.

Known issues

  • It may be a bit tricky to get OpenBLAS to link successfully. If you have issues, try the following:
    • Run pip install patchelf.
    • Run pip install -e . twice in a row.

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.4.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.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

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

ffsim-0.0.4-cp38-abi3-macosx_10_9_x86_64.whl (424.4 kB view details)

Uploaded CPython 3.8+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ffsim-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3a4ce0c2f3f7c99fa8197e24d409786af4f49e0264c49e2ad0aee700cd0ebae6
MD5 a6d56cdcbc62826ba9c085cb6ea596fe
BLAKE2b-256 c3eb3be1ee940ebe87c5ce72cde21fe898b19850937a9f789b2c60d6583a2507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffsim-0.0.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d1ad1169938e237b26d4ec1bd5d9957802454ed8b50d45c854648623faeb48b
MD5 56396e907b7915ae25ae1ea2b8dcb718
BLAKE2b-256 c0787d79b852fba373f86c55ea40b3fdb8607d26d459ca52c8ff488c0fb58367

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffsim-0.0.4-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f4e7fbdf5f25ce5c6e7d9e8d4699beddc6c9c9d6a1996025926c57fda0b35bd0
MD5 6dd7b11ee615e145507ea9bf1f8344dc
BLAKE2b-256 7701de904fe3f658ea90775ea07ee434504d1d7ecf8b59bfa5bdd77d547620ce

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