QEncode Benchmark
qencode-benchmark 4.5.0
No chemistry stack
16 molecules

You have a VQE energy. Is it any good?

Answering that means comparing it against the exact ground state of the same active-space Hamiltonian — and computing one normally costs a PySCF install and a wait.

QEncode ships those reference energies for all 16 suite molecules inside the package. Scoring is one function call, imports no chemistry stack, and needs no network.

Two steps

pip install qencode-benchmark
import qencode

s = qencode.score(-7.9835,               # your energy, in Hartree
                  molecule="LiH",
                  active_space=(4, 4),   # checked, not assumed
                  optimizer="COBYLA",
                  ansatz="hea")
print(s.report())

Which prints:

  your energy             -7.9835000000 Ha
  exact ground state      -7.9837729770 Ha   (CASCI in the declared active space)
  gap                      0.0002729770 Ha   = 0.273 mHa

  reaches CHEMICAL ACCURACY (< 1.6 mHa) and would meet the 10 mHa certification threshold
  margin             9.727e-03 Ha (97.3% of the threshold)

  optimiser          COBYLA (gradient-free)
  amplifying         YES -- gradient-free optimiser on an unstructured
                     ansatz. Re-run elsewhere, energies in this class
                     have moved by up to 1e-2 Ha.

  among published    #3 of 4 QEncode entries for this problem
  best published gap 0.003 mHa

What the five numbers mean

01
The gap. The distance from your energy to exact diagonalisation of the same active-space Hamiltonian. Not to experiment, and not to a complete-basis limit — those errors are shared by every method solving the same problem, so removing them isolates what the algorithm is responsible for.
02
The tier. Chemical accuracy is 1.6 mHa (1 kcal/mol) — roughly where a computed reaction energy becomes useful to a chemist. The QEncode certification threshold is a deliberately looser 10 mHa, so an entry can be a well-executed reproducible calculation without also being chemically useful.
03
The margin. 10 mHa minus your gap: how far the energy can move before the result stops meeting the threshold. Below 20% of the threshold is thin.
04
Whether it will move. Margin bounds how far a result can drift; it says nothing about how far it will. That depends on your optimiser and ansatz — see below.
05
Where it ranks. Against the published QEncode entries for the same problem. Gaps are comparable within a molecule and never across molecules.

The part you cannot get anywhere else

A gradient-free optimiser picks its next step by comparing two nearly equal energies, so a difference in the thirteenth decimal — a different BLAS, a different NumPy — can flip a comparison and send the run into a different local minimum. That much is known.

What we measured is that the optimiser alone is not the rule. Holding molecule, basis, mapping and environment fixed on H₄ and changing only the ansatz:

H₄ entryOptimiserEnergy moved
ADAPTCOBYLA inner3.4 × 10⁻⁸ Ha
HEAplain COBYLA8.8 × 10⁻⁴ Ha

A factor of 25,595, with the same optimiser family on both rows. ADAPT-VQE selects its operators by analytic gradient, so the ansatz structure is gradient-determined and the gradient-free optimiser only polishes a small, well-conditioned parameter set. An unstructured ansatz hands the same optimiser a landscape full of near-degenerate minima. The risk is the conjunction: gradient-free and unstructured — which is what the amplifying flag reports.

What it refuses to do

A scoring tool that always returns a number is easy to write and easy to mislead yourself with. These are the cases where it raises or warns instead.

A mismatched active space raises

Declare an active space that differs from the reference and it raises rather than scoring. A gap measured between two different problems is not a worse number — it is a meaningless one.

An energy below the variational minimum is reported first

The variational principle forbids a wavefunction energy below the exact ground state. If yours is lower, the problem you solved is not the one you think — a different geometry, active space, charge or spin, or a Hamiltonian missing its nuclear repulsion. That warning comes before any gap.

Nothing is ever called certified

Scoring says a self-reported number would meet the threshold. Certification requires the pipeline: pinned environment, recorded provenance, a SHA-256 content hash and an Ed25519 signature. There is no field named certified, and a test enforces the wording.

An unknown molecule raises, with the list

Only the 16 suite molecules have published references. Anything else raises and tells you what is available, rather than silently comparing against the closest match.

What can be scored

All 16 Suite v4 problems, at the cc-pVDZ basis. Your geometry, charge, spin and active space must match the reference — the exact values are printed by qencode.reference("LiH").

MoleculeActive spaceOrbitalsExact E₀ (Ha)Entries
H2[2e, 2o]hf-1.1312876
HF[2e, 2o]hf-100.0194836
BeH2[4e, 4o]hf-15.7684114
C4H4[4e, 4o]casscf-153.6734274
C4H6[4e, 4o]hf-154.9218971
H2CO[4e, 4o]hf-113.8969531
H2O[4e, 4o]hf-76.0273383
H4[4e, 4o]hf-2.1862324
LiH[4e, 4o]hf-7.9837733
NH3[4e, 4o]hf-56.1978893
water_dimer[4e, 4o]hf-152.0627194
benzene[6e, 6o]casscf-230.7871373
H6[6e, 6o]casscf-3.3168693
N2[6e, 6o]casscf-109.0899587
H8[8e, 8o]casscf-4.4145461
H10[10e, 10o]casscf-5.5128491

Reference energies are exact diagonalisation (CASCI) of the qubit Hamiltonian in the declared active space, generated from the 54 published entries. The same table ships inside the package, and a test fails if the two copies disagree. Entries counts every published entry for that problem — certified and research tier alike. N₂ has seven published entries and three that meet the threshold; a research-tier entry is a real result that hit the method's limit, not a discarded one.

Not on the list? QEncode has no reference for it, so this cannot score it — but qencode run computes the CASCI reference as part of generating an entry. That path does need the chemistry stack.

If the score looks good

The honest next step is to stop self-reporting it. Generate a real entry: the same procedure, but with the environment pinned, the provenance recorded, and a content hash over the result — which is what makes it something a reviewer can rebuild.

qencode run --molecule LiH --mapping jordan_wigner --ansatz-type uccsd
Runs the fixed pipeline and writes a JSON entry with full provenance
Anyone can re-check it with scripts/verify_entry.py from a clean checkout
Certified and research-tier entries are both published — nothing is discarded for missing a threshold