The PennyLane quantum chemistry library.


To access the qml.qchem package, pennylane-qchem must be installed via pip:

pip install pennylane-qchem

The PennyLane quantum chemistry package. Supports OpenFermion, PySCF, and Psi4 for quantum chemistry calculations using PennyLane.


read_structure(filepath[, outpath])

Reads the molecular structure from a file and creates a list containing the symbol and Cartesian coordinates of the atomic species.

meanfield_data(mol_name, geometry, charge, …)

Launches the meanfield (Hartree-Fock) electronic structure calculation.

active_space(mol_name, hf_data[, …])

Builds the active space by partitioning the set of Hartree-Fock molecular orbitals.

decompose_hamiltonian(mol_name, hf_data[, …])

Decomposes the electronic Hamiltonian into a linear combination of Pauli operators using OpenFermion tools.


Converts OpenFermion QubitOperator to a 2-tuple of coefficients and PennyLane Pauli observables.

_terms_to_qubit_operator(coeffs, ops)

Converts a 2-tuple of complex coefficients and PennyLane operations to OpenFermion QubitOperator.


Checks equivalence between OpenFermion QubitOperator and Pennylane VQE Hamiltonian (Tensor product of Pauli matrices).


Converts OpenFermion QubitOperator Hamiltonian to Pennylane VQE Hamiltonian

generate_hamiltonian(mol_name, mol_geo_file, …)

Generates the qubit Hamiltonian based on geometry and mean field electronic structure.

sd_excitations(n_electrons, n_orbitals[, …])

Generates single and double excitations from a Hartree-Fock (HF) reference state.

hf_state(n_electrons, m_spin_orbitals)

Generates the occupation-number vector representing the Hartree-Fock (HF) state of \(N\) electrons in a basis of \(M\) spin orbitals.