qrunch.chemistry.calculators.tools.hamiltonian_and_ansatz
Building the second quantized Hamiltonian and initial circuit ansatz of a ground state problem.
Functions
Get the fermionic Hamiltonian and initial ansatz from a previous VQE result. |
|
Get the fermionic Hamiltonian and a Hartree-Fock initial ansatz for a given ground state problem. |
|
Get the paired Hamiltonian and initial ansatz from a previous VQE result. |
|
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:
ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem the VQE result was computed for.
initial_vqe_result (AdaptiveVqeGroundStateProblemCalculatorResult) – The VQE result to use as the starting point for the calculation.
- 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:
ground_state_problem (RestrictedGroundStateProblem | UnrestrictedGroundStateProblem) – The ground state problem the VQE result was computed for.
initial_vqe_result (AdaptiveVqeGroundStateProblemCalculatorResult) – The VQE result to use as the starting point for the calculation.
- Return type:
- 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: