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 method solve_exact of the class GroundStateSolver returns the exact ground state of the molecule.

In the following example we show how get the exact ground state of a hydrogen molecule.

from classiq.interface.chemistry.molecule import Molecule
from classiq.interface.chemistry.ground_state_problem import MoleculeProblem
from classiq.interface.chemistry.ground_state_solver import 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()