qrunch.chemistry.calculators.tools.hamiltonian_and_ansatz

Building the second quantized Hamiltonian and initial circuit ansatz of a ground state problem.

Functions

get_fermion_hamiltonian_and_ansatz_from_vqe_result(...)

Get the fermionic Hamiltonian and initial ansatz from a previous VQE result.

get_fermion_hamiltonian_and_initial_circuit_ansatz(...)

Get the fermionic Hamiltonian and a Hartree-Fock initial ansatz for a given ground state problem.

get_paired_hamiltonian_and_ansatz_from_vqe_result(...)

Get the paired Hamiltonian and initial ansatz from a previous VQE result.

get_paired_hamiltonian_and_initial_circuit_ansatz(...)

Get the paired Hamiltonian and a paired Hartree-Fock initial ansatz for a given ground state problem.

get_fermion_hamiltonian_and_ansatz_from_vqe_result(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem, initial_vqe_result: AdaptiveVqeGroundStateProblemCalculatorResult) tuple[Circuit, FermionHermitianSum]

Get the fermionic Hamiltonian and initial ansatz from a previous VQE result.

The ansatz is taken from the final circuit of the VQE result. The Hamiltonian is taken from the final operator of the VQE result, or created from the ground state problem when no final operator is available.

Parameters:
Return type:

tuple[Circuit, FermionHermitianSum]

get_fermion_hamiltonian_and_initial_circuit_ansatz(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) tuple[Circuit, FermionHermitianSum]

Get the fermionic Hamiltonian and a Hartree-Fock initial ansatz for a given ground state problem.

Parameters:

ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem to get the fermionic Hamiltonian and initial ansatz for.

Return type:

tuple[Circuit, FermionHermitianSum]

get_paired_hamiltonian_and_ansatz_from_vqe_result(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem, initial_vqe_result: AdaptiveVqeGroundStateProblemCalculatorResult) tuple[Circuit, PairedHardcoreBosonHermitianSum]

Get the paired Hamiltonian and initial ansatz from a previous VQE result.

The ansatz is taken from the final circuit of the VQE result. The Hamiltonian is taken from the final operator of the VQE result, or created from the ground state problem when no final operator is available.

Parameters:
Return type:

tuple[Circuit, PairedHardcoreBosonHermitianSum]

get_paired_hamiltonian_and_initial_circuit_ansatz(ground_state_problem: RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) tuple[Circuit, PairedHardcoreBosonHermitianSum]

Get the paired Hamiltonian and a paired Hartree-Fock initial ansatz for a given ground state problem.

Parameters:

ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem to get the paired Hamiltonian and initial ansatz for.

Return type:

tuple[Circuit, PairedHardcoreBosonHermitianSum]