OpenFermion

The open source chemistry package for quantum computers
from openfermion import FermionOperator, MolecularData
from openfermion import fermi_hubbard, get_ground_state, get_sparse_operator

# Construct a fermion operators
my_first_fermion = FermionOperator(‘1^ 0 2^ 3’)
print(my_first_fermion)

# Build a Molecule
geometry = [[‘H’, [0, 0, 0]], [‘H’, [0, 0, 1.4]]]
multiplicity = 1
basis = ‘cc-pvdz’
charge = 0
molecule = MolecularData(geometry, basis, multiplicity, charge)

# Create model hamiltonians on a 1 x 10 lattice
hubbard = fermi_hubbard(1, 10, tunneling=1, coulomb=4, periodic=True)
print(hubbard)

# Get ground states
gs_energy, gs_eigvec = get_ground_state(get_sparse_operator(hubbard))
OpenFermion is a library for compiling and analyzing quantum algorithms to simulate fermionic systems, including quantum chemistry. The package provides everything from efficient data structures for representing fermionic operators to fermionic circuit primitives for execution on quantum devices. Plugins to OpenFermion provide users with an efficient, and low overhead, means of translating electronic structure calculations into quantum circuit calculations.

Features and updates

Learn more about the OpenFermion data structures, organization, capabilities, and contributing guidelines in our release paper.
Announcing Openfermion, an open source platform for translating problems in chemistry and materials science into quantum circuits that can be executed on existing platforms.
Learn how to use OpenFermion to run chemistry simulations on Sycamore.
OpenFermion interfaces with common electronic structure codes and allows users to easily execute chemistry simulation processing. Currently supported plugins are to open source codes Psi4, Pyscf, and Dirac.