fastfermion is a Python package written in C++ for the efficient manipulation of polynomials in Pauli, Fermi and Majorana operators.
Computing the Jordan-Wigner transform of a CrO molecule Hamiltonian with > 105 terms
Features
- Algebraic manipulation of polynomials in Pauli operators, Fermionic creation/annihilation operators, and Majorana operators.
- Fermionic and Majorana operators are automatically put in normal ordered form
- Conversion between Pauli, Fermi, and Majorana representations (Jordan-Wigner and reverse Jordan-Wigner)
- Sparse matrix representations
- Heisenberg evolution: Propagate polynomial through a sequence of unitaries/gates with possible truncation by degree
- Interface with OpenFermion and Cirq
- Up to 200x faster than OpenFermion
- More to come ...
fastfermion is available on PyPI:
pip3 install fastfermionThen you should be able to
import fastfermionfrom Python. See the examples folder to get started, or check out this tour of fastfermion.
Assuming you have a modern C++ compiler, simply run from the root directory of the package:
make ffcoreThis will create a binary file ffcore... inside the fastfermion subdirectory.
To import the package in Python, just add the root fastfermion directory in your path, e.g.,
>>> import sys
>>> sys.path.insert(0,"/path/to/fastfermion")
>>> import fastfermionYou could also use the library directly in your C++ project (even though the library was primarily intended to be used in Python). It is header-only, so you can just include the relevant header files from src/.