ffsim¶
Gates¶
Fermionic quantum computation gates. See State vectors and gates.
|
Apply time evolution by a (rotated) diagonal Coulomb operator. |
|
Apply an fSim gate. |
|
Apply an FSWAP gate. |
|
Apply a Givens rotation gate. |
|
Apply a hop gate. |
|
Apply a number interaction gate. |
|
Apply a number-number interaction gate. |
|
Apply interaction gate for product of number operators. |
|
Apply time evolution by a (rotated) linear combination of number operators. |
|
Apply an on-site interaction gate. |
|
Apply an orbital rotation to a vector. |
|
Apply time evolution by a quadratic Hamiltonian. |
|
Apply a tunneling interaction gate. |
Hamiltonians¶
Classes for representing Hamiltonians. See Hamiltonians.
|
A diagonal Coulomb Hamiltonian. |
|
A Hamiltonian in the double-factorized representation. |
|
A molecular Hamiltonian. |
|
A spinless molecular Hamiltonian. |
|
A Hamiltonian in the single-factorized representation. |
Initialize cache¶
The init_cache function prepares ffsim to perform operations with given values
of norb and nelec. Typically there is no need to call this function.
|
Initialize cached objects. |
The MolecularData class¶
The MolecularData class stores molecular integrals, geometry, energies, and other data. It can be saved to and loaded from JSON (lossless) and FCIDUMP (integrals only) formats.
|
Class for storing molecular data. |
Operators¶
The FermionOperator class and functions to construct FermionOperators. See The FermionOperator class.
|
A fermionic action. |
|
A fermionic operator. |
|
Restricted coupled cluster, singles and doubles (CCSD) generator. |
|
Unrestricted coupled cluster, singles and doubles (CCSD) generator. |
|
Create a fermion. |
|
Create a fermion with spin alpha. |
|
Create a fermion with spin beta. |
|
Destroy a fermion. |
|
Destroy a fermion with spin alpha. |
|
Destroy a fermion with spin beta. |
Restricted doubles excitations operator. |
|
Unrestricted doubles excitations operator. |
|
|
One-dimensional Fermi-Hubbard model Hamiltonian. |
|
Two-dimensional Fermi-Hubbard model Hamiltonian on a square lattice. |
|
Occupation number operator. |
|
Spin lowering operator. |
|
Spin raising operator. |
|
Total spin operator \(S^2\). |
|
Spin X operator. |
|
Spin Y operator. |
|
Spin Z operator. |
Restricted singles excitations operator. |
|
Unrestricted singles excitations operator. |
|
|
Restricted unitary coupled cluster, singles and doubles (UCCSD) generator. |
|
Unestricted unitary coupled cluster, singles and doubles (UCCSD) generator. |
Protocols¶
Python protocols defined in ffsim. See Protocols.
|
An object that can apply a unitary transformation to a vector. |
|
An object that can be compared approximately. |
|
A linear operator whose diagonal entries can be returned. |
|
An object that can be converted to a FermionOperator. |
|
An object that can be converted to a SciPy LinearOperator. |
|
A linear operator whose trace can be computed. |
|
Apply a unitary transformation to a vector. |
|
Return whether two objects are approximately equal. |
|
Return the diagonal entries of the linear operator. |
|
Return a FermionOperator representing the object. |
|
Return a SciPy LinearOperator representing the object. |
|
Return the trace of the linear operator. |
States¶
Functions for creating and manipulating fermionic quantum states. See State vectors and gates.
|
Enumeration for indicating the data type of bitstrings. |
|
A linear combination of product states. |
|
Class to store one- and two-body reduced density matrices. |
|
Enumeration for indicating alpha, beta, or both spins. |
|
A state vector in the FCI representation. |
|
Convert state vector addresses to bitstrings. |
|
Get the dimension of the FCI space. |
|
Get the dimensions of the FCI space. |
|
Expectation of power of one-body operator w.r.t. |
|
Expectation of product of one-body operators w.r.t. |
|
Return the Hartree-Fock state. |
|
Return the reduced density matrices of a state vector. |
|
Collect samples of electronic configurations from a Slater determinant. |
|
Sample bitstrings from a state vector. |
|
Return a Slater determinant. |
|
Compute state vector amplitudes for a Slater determinant. |
|
Return the reduced density matrices of a Slater determinant. |
|
Expectation value of spin squared operator on a state vector. |
|
Convert a spinful 1-RDM to a spinless 1-RDM. |
|
Convert a spinful 2-RDM to a spinless 2-RDM. |
|
Convert a spinful state vector to a spinless state vector. |
|
Convert bitstrings to state vector addresses. |
Hamiltonian simulation¶
Functions to approximate time evolution by Hamiltonians.
|
Double-factorized Hamiltonian simulation via qDRIFT. |
|
Diagonal Coulomb Hamiltonian simulation using split-operator method. |
|
Double-factorized Hamiltonian simulation using Trotter-Suzuki formula. |
Variational ansatzes¶
Variational ansatz classes and related functions. See Variational ansatzes.
|
A Givens rotation ansatz operator. |
|
A hop gate ansatz operator. |
|
A number-number interaction ansatz operator. |
|
Restricted unitary coupled cluster, singles and doubles operator. |
|
Real-valued restricted unitary coupled cluster, singles and doubles operator. |
|
Unrestricted unitary coupled cluster, singles and doubles operator. |
|
Real unrestricted unitary coupled cluster, singles and doubles operator. |
|
A spin-balanced UCJ operator parameterized by gate rotation angles. |
|
A spin-balanced unitary cluster Jastrow operator. |
|
A spinless unitary cluster Jastrow operator. |
|
A spin-unbalanced unitary cluster Jastrow operator. |
|
Compute multireference energy and state. |
|
Compute multireference state for a product ansatz operator. |
|
Find orbitals that minimize the energy of a pair of one- and two-RDMs. |