Exact Solution¶
Currently, quantum algorithms for chemistry investigate relatively small molecules. For many of these molecules, the exact ground state can be calculated using full Hamiltonian diagonalization. This can serve as the ground truth for evaluating the results obtained by quantum methods.
The solve_exact
method of the GroundStateSolver
class returns the exact ground state of the molecule.
The following example shows how to get the exact ground state of a hydrogen molecule.
from classiq.applications.chemistry import Molecule, MoleculeProblem, GroundStateSolver
molecule = Molecule(
atoms=[
("H", (0.0, 0.0, 0.0)),
("H", (0.0, 0.0, 0.735)),
],
)
gs_problem = MoleculeProblem(
molecule=molecule,
mapping="jordan_wigner",
)
gs_solver = GroundStateSolver(
ground_state_problem=gs_problem,
)
exact_result = gs_solver.solve_exact()