Estimating a molecule’s ground-state energy with a quantum computer is a staged workflow, not a single circuit call. This practical quantum chemistry tutorial explains how to choose a molecule and basis set, build and reduce its molecular Hamiltonian, map that Hamiltonian to qubits, select a variational ansatz, optimise parameters, measure the energy, and validate the result against a classical reference. It also shows how to plan repeatable experiments as you move from a simulator to hardware.
Overview
The ground-state energy is the lowest possible energy of a molecular system under a chosen model. In quantum chemistry, that model depends on decisions such as the molecular geometry, basis set, treatment of electrons, and active space. A quantum algorithm does not remove those choices; it provides a different computational route for estimating the energy of the resulting electronic-structure problem.
A typical near-term workflow uses the variational quantum eigensolver, or VQE. The classical part of the workflow proposes circuit parameters, while the quantum part estimates the expectation value of a Hamiltonian. The optimiser then updates the parameters to search for a lower energy.
In simplified form, the objective is:
E(θ) = ⟨ψ(θ)|H|ψ(θ)⟩
Here, H is the molecular Hamiltonian, |ψ(θ)⟩ is the trial quantum state, and θ represents the adjustable circuit parameters. The reported value is meaningful only when the Hamiltonian, state-preparation circuit, measurement process, and validation reference are documented together.
The workflow can be summarised as:
- Define the molecule, geometry, charge, spin, basis set, and electronic-structure model.
- Generate one- and two-electron integrals with a classical chemistry package.
- Construct the second-quantised molecular Hamiltonian.
- Optionally reduce the problem using symmetry, freezing core orbitals, or choosing an active space.
- Map fermionic operators to qubit operators.
- Prepare a physically sensible trial state with an ansatz.
- Optimise the ansatz parameters using measured expectation values.
- Validate the energy, uncertainty, convergence, and implementation against a classical calculation.
How to estimate
1. Define the chemical problem
Start with a precise specification rather than a molecule name alone. Record the molecular geometry and units, total charge, spin multiplicity, basis set, orbital assumptions, and whether the calculation is intended as a demonstration or a chemically useful estimate. A small molecule at a fixed geometry is usually a better first target than a larger system with several competing modelling decisions.
Geometry matters because the electronic Hamiltonian changes when nuclear positions change. If you are studying a bond scan, treat every geometry as a separate calculation and retain the same conventions across the scan. This makes differences in energy easier to interpret.
2. Build the electronic Hamiltonian
A classical quantum-chemistry driver calculates the molecular integrals. These are assembled into a second-quantised Hamiltonian containing terms for one-electron contributions, such as kinetic energy and attraction to nuclei, and two-electron interactions.
The resulting fermionic operator must be converted into a sum of Pauli operators before it can be measured on qubits:
H = Σj cjPj
Each coefficient cj is a real number and each Pj is a tensor product of Pauli operators. The energy estimate is obtained by measuring the expectation value of each term and adding the weighted results:
E = Σj cj⟨Pj⟩
This is where qubit count and measurement cost begin to emerge. Reducing the Hamiltonian before circuit construction can make an experiment substantially easier to run, but the reduction must be recorded because it changes the exact problem being implemented.
3. Choose a fermion-to-qubit mapping
Mappings such as Jordan–Wigner, parity, and Bravyi–Kitaev encode occupation information into qubits in different ways. They produce equivalent descriptions when implemented consistently, but they can differ in operator structure, locality, and opportunities for symmetry-based reduction.
For a first experiment, prioritise a mapping that is well supported by your chosen framework and easy to inspect. When comparing mappings, compare the resulting qubit count, Pauli-term structure, circuit depth, and measurement requirements rather than treating one mapping as universally best.
4. Select an ansatz and optimise it
The ansatz is the parameterised circuit used to represent candidate molecular states. A chemically informed ansatz may encode excitation patterns suggested by the reference electronic configuration. A hardware-efficient ansatz may use the native gate set and connectivity of a target device, often at the cost of a less direct chemical interpretation.
There is a practical trade-off:
| Approach | Strength | Risk or limitation | Useful starting point |
|---|---|---|---|
| Chemistry-inspired ansatz | Uses information about electronic excitations | Can require more specialised circuit construction | Small, structured molecules and simulator studies |
| Hardware-efficient ansatz | Can be adapted to device connectivity and gates | May be difficult to interpret and optimise | Hardware-oriented experiments |
| Problem-specific ansatz | Can target known symmetries or a restricted active space | Requires more domain knowledge | Controlled research comparisons |
Initial parameters should prepare a state with the correct particle number and, where practical, the desired spin or symmetry sector. During each optimisation step, execute the circuit, estimate all required Pauli expectations, calculate the energy, and return that value to a classical optimiser.
5. Measure and validate the result
Expectation values are estimated from repeated circuit shots, so the energy is a statistical estimate rather than an exact number. Track the number of shots per term, the variance of individual measurements, optimiser history, stopping criteria, and any error-mitigation procedure.
Validation should include at least one independent classical reference using the same geometry and clearly documented modelling assumptions. Compare the variational energy with an appropriate reference, but do not present agreement as proof that every part of the workflow is correct. Also inspect particle number, symmetry, convergence, and whether the final state is stable under repeated runs.
Inputs and assumptions
A repeatable quantum computing molecular simulation needs an input record. At minimum, capture:
- Molecular definition: atom coordinates, coordinate units, charge, and spin multiplicity.
- Electronic-structure model: basis set, orbital treatment, active-space selection, and any frozen-core assumption.
- Encoding: fermion-to-qubit mapping, qubit ordering, and symmetry reductions.
- Circuit design: reference state, ansatz family, number of layers, parameter initialisation, and gate decomposition.
- Optimisation: optimiser, initial parameters, iteration limit, convergence tolerance, and restart policy.
- Measurement: shots, grouping method, basis rotations, estimator settings, and uncertainty calculation.
- Execution: simulator or hardware backend, noise model if used, transpilation settings, and calibration context.
- Validation: classical reference method, energy units, and comparison metric.
Keep units consistent. Chemistry packages may report energies in hartrees, while some reports convert them to electronvolts or other units. Never compare values without recording the unit and sign convention. Likewise, distinguish the electronic energy from the total molecular energy if nuclear-repulsion energy is added separately.
Before using hardware, test the complete workflow on an ideal simulator and then on a noisy simulator when available. A simulator comparison and benchmarking workflow can expose incorrect qubit ordering, operator signs, missing basis rotations, and measurement bugs before hardware noise obscures the cause. For circuit-level checks, see How to Debug Quantum Circuits and How to Test Quantum Programs.
Worked examples
Example 1: A two-orbital hydrogen model
Hydrogen in a minimal basis is a useful first reference because the molecular description can be kept small enough to inspect directly. Define a fixed bond length, neutral charge, and the desired spin state. Generate the Hamiltonian, apply a mapping, reduce symmetries only if you can verify the reduced interpretation, and prepare a reference state representing the occupied orbital.
Run VQE first with an ideal simulator. Record the final energy, optimiser iterations, parameter values, and expectation values. Then compare the result with a classical calculation using the same basis and geometry. Repeat at several bond lengths if you want to test whether the workflow tracks a potential-energy curve rather than a single point.
Example 2: A minimal helium-hydride model
A small charged or neutral diatomic system can reveal issues that a single hydrogen example may hide, including charge conventions, orbital occupation, and ansatz expressibility. Keep the basis and geometry fixed while comparing two ansatzes. Use the same optimiser budget and measurement settings so that the comparison focuses on circuit design rather than unequal experiment conditions.
Report the number of qubits before and after reduction, the number of Pauli terms, circuit depth after transpilation, final energy, and an uncertainty estimate. If one ansatz reaches a lower energy in simulation, check whether it used more parameters or a different symmetry sector before drawing conclusions.
Example 3: Moving from simulation to hardware
Do not treat a hardware run as a direct replacement for the simulator run. First transpile the circuit for the target connectivity, inspect added gates, and estimate how measurement overhead will change. Run a small number of repeated trials, compare raw and corrected estimates where appropriate, and track whether the observed energy is consistent with the expected variational behaviour.
Hardware results should be accompanied by device and circuit metadata. The guide to quantum hardware experiments provides a useful pre-run checklist, while Quantum Hardware Metrics Explained covers metrics such as coherence, gate fidelity, readout error, and connectivity.
When to recalculate
Recalculate the estimate whenever a scientific or implementation input changes. A new molecular geometry, basis set, charge, spin state, active space, mapping, ansatz, optimiser, shot budget, or backend creates a new experiment. Even a framework update can alter default circuit construction, operator ordering, estimator behaviour, or supported backend interfaces, so record the software versions used for reproducibility.
For an ongoing project, establish a review cycle at least whenever the chemistry libraries, quantum programming framework, simulator, or hardware target changes materially. Re-run a small reference suite before trusting a larger result. The suite can include one simple molecule, one geometry variation, and one hardware or noisy-simulation test.
Use this action checklist before publishing or comparing an energy estimate:
- Freeze and record geometry, charge, spin, basis, and energy units.
- Verify the Hamiltonian and qubit ordering with small operator tests.
- Run an ideal-simulator baseline and save the reference result.
- Compare ansatzes using the same optimisation and measurement budget.
- Check particle number, symmetry, convergence, and statistical uncertainty.
- Document transpilation, backend, shots, noise assumptions, and mitigation.
- Compare against a classical reference with matching assumptions.
- Recalculate after changing any input that affects the Hamiltonian or measurement process.
The most useful quantum chemistry workflow is not the one that produces a single impressive number. It is the one that makes every number traceable to a molecule, a model, a circuit, a measurement procedure, and a validation reference.