qrunch.chemistry.calculators.tools.initial_ansatz.hartree_fock

Module designed to generate an initial state circuit that corresponds to a Hartree-Fock wave function.

The Hartree-Fock wave function is an approximation that assumes that the wave function of the electronic system can be taken as s single Slater determinant, or a single spin-adapted configuration state function (CSF) which is a linear combination of Slater determinants that are eigenfunctions of the :math:S^{2} operator. However, in this implementation we do not implement the CSF.

The resulting quantum circuit will have a number of qubits equal to the number of spin orbitals (twice the number of spatial orbitals).

Classes

HartreeFockAnsatz

Class to generate and store information about a Hartree-Fock state.

HartreeFockAnsatzBuilder

Builder for constructing Hartree-Fock initial ansatzes from a ground state problem.

class HartreeFockAnsatz

Bases: InitialAnsatz

Class to generate and store information about a Hartree-Fock state.

This state is intended to be used as an initial state for quantum chemistry calculations with quantum computers. Generally, this state will correspond to a classical bitstring (1, 1, 0,…,1, 1, 0,…,0) where the total number of qubits is 2 * N_s, where N_s = number_of_spatial_orbitals. Each spatial orbital can be populated by an alpha and a beta electron simultaneously. The qubit sites are indexed according to: alpha sites (0, N_s - 1) and beta sites (N_s, 2 * N_s -1).

__init__(molecular_electron_configuration: MolecularElectronConfiguration) None

Initialize a HartreeFockAnsatz.

Parameters:

molecular_electron_configuration (MolecularElectronConfiguration) – Molecular electron configuration to use.

Raises:
  • ValueError – If the number of alpha electrons is larger than the number of spatial orbitals.

  • ValueError – If the number of beta electrons is larger than the number of spatial orbitals.

Return type:

None

create_circuit() Circuit

Generate the Hartree-Fock initial circuit.

Applies XGates to the list of sites corresponding to the populated alpha and beta orbitals.

Return type:

Circuit

class HartreeFockAnsatzBuilder

Bases: InitialAnsatzBuilder

Builder for constructing Hartree-Fock initial ansatzes from a ground state problem.

__init__(*args, **kwargs)
build_ansatz(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) HartreeFockAnsatz

Build a Hartree-Fock ansatz for a fermionic ground state problem.

Parameters:

ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem containing the electron configuration.

Return type:

HartreeFockAnsatz

build_paired_ansatz(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) ElectronPairHartreeFockAnsatz

Build an electron-pair Hartree-Fock ansatz for a paired-electron ground state problem.

Parameters:

ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem containing the electron configuration.

Return type:

ElectronPairHartreeFockAnsatz