Skip to content

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(
        ("H", (0.0, 0.0, 0.0)),
        ("H", (0.0, 0.0, 0.735)),
gs_problem = MoleculeProblem(

gs_solver = GroundStateSolver(
exact_result = gs_solver.solve_exact()