Driver#
Qibochem provides the Molecule class to store the data structure of a molecule object, and to drive the classical quantum chemistry calculation to obtain necessary quantities for subsequent quantum compute calculations.
Molecule class#
- class qibochem.driver.molecule.Molecule(geometry=None, charge=0, multiplicity=1, basis=None, xyz_file=None, active=None)#
Class representing a single molecule
- Parameters:
geometry (list) – Molecular coordinates in OpenFermion format, e.g.
[('H', (0.0, 0.0, 0.0)), ('H', (0.0, 0.0, 0.7))]
charge (int) – Net charge of molecule
multiplicity (int) – Spin multiplicity of molecule
basis (str) – Atomic orbital basis set, used for the PySCF/PSI4 calculations. Default: “STO-3G” (minimal basis)
xyz_file (str) – .xyz file containing the molecular coordinates. The comment line should follow “{charge} {multiplicity}”
active – Iterable representing the set of MOs to be included in the quantum simulation e.g.
list(range(3,6))
for an active space with orbitals 3, 4 and 5.
- run_pyscf(max_scf_cycles=50)#
- Run a Hartree-Fock calculation with PySCF to obtain molecule quantities and
molecular integrals
- Parameters:
max_scf_cycles – Maximum number of SCF cycles in PySCF
- run_psi4(output=None)#
- Run a Hartree-Fock calculation with PSI4 to obtain the molecular quantities and
molecular integrals
- Parameters:
output – Name of PSI4 output file.
None
suppresses the output on non-Windows systems, and usespsi4_output.dat
otherwise
- hf_embedding(active=None, frozen=None)#
- Turns on HF embedding for a given active/frozen space, and fills in the class attributes:
inactive_energy
,embed_oei
, andembed_tei
.
- Parameters:
active – Iterable representing the active-space for quantum simulation
frozen – Iterable representing the occupied orbitals to be removed from the simulation
- hamiltonian(ham_type=None, oei=None, tei=None, constant=None, ferm_qubit_map=None)#
Builds a molecular Hamiltonian using the one-/two- electron integrals
- Parameters:
ham_type – Format of molecular Hamiltonian returned. The available options are:
("f", "ferm")
: OpenFermionFermionOperator
,("q", "qubit")
: OpenFermionQubitOperator
, or("s", "sym")
: QiboSymbolicHamiltonian
(default)oei – 1-electron integrals. Default:
self.oei
(MO basis)tei – 2-electron integrals in 2ndQ notation. Default:
self.tei
(MO basis)constant – For inactive Fock energy if embedding used. Default: 0.0
ferm_qubit_map – Which fermion to qubit transformation to use. Must be either
jw
(default) orbk
- Returns:
Molecular Hamiltonian in the format of choice
- static eigenvalues(hamiltonian)#
- Finds the lowest 6 exact eigenvalues of the molecular Hamiltonian
Note: Uses the
eigenvalues()
class method for a QiboSymbolicHamiltonian
object
- Parameters:
hamiltonian – Molecular Hamiltonian, given as a
FermionOperator
,QubitOperator
, orSymbolicHamiltonian
(not recommended)