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
In the future, binary wheels will be made available on PyPI. For now, you can install from source.
Installing 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.
- Run
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ffsim-0.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4e8d2854431d7079cbed0e8cbe14bfcd9121cec3259bb0203ec31633ed8bc1 |
|
MD5 | ec9ff0aeb800650c67c7b8e1235d1430 |
|
BLAKE2b-256 | d956a96a01c6fd238631cda9a1db38d0339d14a8e5e6407831a9d9a1c524bc4b |
Hashes for ffsim-0.0.0-cp38-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f92b821b155c257f72a89e78e9c34dccfa8295dc228d5d93f50b651ab5d221b |
|
MD5 | 837684ae25dfbf3601a1a06dc183bcc7 |
|
BLAKE2b-256 | a8c3a7487a62ea1864ea5a80887e7d509d9f0d58027aaee84f109b15671c60a6 |