Part VII opens on the application quantum computing is most often justified by, and the one with the
Prerequisites
- 24
- 32
- 35
Learning Objectives
- Build molecular Hamiltonians and measure qubit and term counts.
- Compare Jordan-Wigner and Bravyi-Kitaev on the quantity that actually differs.
- Measure an active space's approximation error against a larger space.
- Price VQE at the claimed classical crossover and name the real baseline.
In This Chapter
- 36.1 The electronic structure problem
- 36.2 From molecules to qubits
- 36.3 What the mapping actually changes
- 36.4 The active space, and what it costs
- 36.5 VQE, and the error that is not the problem
- 36.6 The classical baseline, which is not full CI
- 36.7 The crossover, priced
- 36.8 What would actually have to change
- What we measured
Chapter 36: Quantum Chemistry with VQE
Part VII opens on the application quantum computing is most often justified by, and the one with the best claim to being natural: simulating molecules.
The argument is Feynman's and it is strong. A molecule is a quantum system, its electronic structure is an eigenvalue problem in an exponentially large Hilbert space, and Chapter 35 established that when the data is quantum the encoding problem disappears. Chemistry is not a task quantum computers were retrofitted to — it is the task they were proposed for.
This chapter builds it properly and measures every step, and the central result is not about VQE at all.
VQE works. On a LiH active space it reaches the exact answer to $2.04 \times 10^{-9}$ Hartree — six orders of magnitude inside chemical accuracy, from three parameters.
And that active space is wrong by $0.0201$ Hartree — 12.62 kcal/mol, about 12.6× chemical accuracy, and $10^7$ times larger than the VQE error it contains.
The approximation made to fit the molecule onto the device is larger than the effect the calculation exists to compute. That is the chapter.
36.1 The electronic structure problem
Fix the nuclei (the Born–Oppenheimer approximation) and the question is the ground-state energy of the electrons:
$$H = \sum_{pq} h_{pq}\, a^\dagger_p a_q + \tfrac{1}{2}\sum_{pqrs} h_{pqrs}\, a^\dagger_p a^\dagger_q a_r a_s$$
The one- and two-electron integrals $h_{pq}$ and $h_{pqrs}$ come from a classical Hartree–Fock calculation; the hard part is the correlation energy the mean-field solution misses.
Why this is the natural target: the Hilbert space grows as $\binom{2n}{n_e}$ in the number of orbitals, so exact classical solution is exponential — and the answer is a single number per molecule, so Chapter 32's output-readout problem does not bite either. Both ends of Chapter 32's input problem are absent.
Where the integrals come from, and why there are four indices
The two integrals above are the entire cost model of this chapter, so they are worth writing out. In a basis of molecular orbitals $\{\phi_p\}$ produced by the Hartree–Fock calculation:
$$h_{pq} = \int \phi_p^*(\mathbf{r})\left[-\tfrac{1}{2}\nabla^2 - \sum_A \frac{Z_A}{|\mathbf{r}-\mathbf{R}_A|}\right]\phi_q(\mathbf{r})\, d\mathbf{r}$$
$$h_{pqrs} = \iint \frac{\phi_p^*(\mathbf{r}_1)\,\phi_q^*(\mathbf{r}_2)\,\phi_r(\mathbf{r}_2)\,\phi_s(\mathbf{r}_1)}{|\mathbf{r}_1 - \mathbf{r}_2|}\, d\mathbf{r}_1\, d\mathbf{r}_2$$
The first collects everything a single electron does on its own — kinetic energy, and attraction to every nucleus. Two orbital labels, so $n^2$ of them.
The second is the electron–electron repulsion, and it needs four labels because two electrons each have a before and an after. Electron 1 goes from $\phi_s$ to $\phi_p$, electron 2 goes from $\phi_r$ to $\phi_q$, and the $1/r_{12}$ operator couples them. Four labels, $n^4$ integrals.
That is the whole origin of the $\mathcal{O}(n^4)$ that prices the rest of the chapter. The exponent is not an artefact of a mapping, a framework, or a device — it is the arity of the Coulomb interaction between pairs of electrons, and no amount of hardware negotiates with it.
Permutational symmetry claws some of it back. For real orbitals, $h_{pqrs}$ is invariant under swapping $p\!\leftrightarrow\!s$, $q\!\leftrightarrow\!r$, and the two electrons as a pair — an eight-fold symmetry that leaves roughly $n^4/8$ distinct values. For LiH's six spatial orbitals that is $6^4 = 1{,}296$ integrals stored as about $162$ distinct numbers. (That $162$ reappears in §36.7's crossover table as the UCCSD parameter count at six orbitals, and not by coincidence: both are counting four-index objects over the same orbital set.)
Two things follow that are easy to get backwards.
The integrals are computed classically, before any quantum code runs. At 50 orbitals that is $6.25\times10^6$ numbers — about 50 MB in double precision. At 100 orbitals, $10^8$ numbers and 800 MB. Large, entirely routine, and not the bottleneck. People new to the area often assume the classical preprocessing is what quantum computing removes. It is not; §36.7 shows what is.
And the Hamiltonian does not know how many electrons there are. $H$ is an operator on the whole Fock space. The electron count enters through the state, not the operator — a fact that §36.2's BeH₂-versus-H₂O comparison turns on, and that the correction there had to be measured to settle.
📐 Math Aside: the qubit register is larger than the problem it holds.
A register of $2n$ qubits spans $2^{2n}$ basis states — every possible occupation pattern, including all the ones with the wrong number of electrons. The physical problem lives in a single particle-number sector of dimension $\binom{2n}{n_e}$.
text molecule qubits register 2^q physical sector wasted H2 4 16 C(4,2)= 6 2.7x LiH 12 4,096 C(12,4)=495 8.3x BeH2 14 16,384 C(14,6)=3,003 5.5x H2O 14 16,384 C(14,10)=1,001 16.4xTwo consequences run through the rest of the chapter. The ansatz has to stay inside the sector — which is exactly why §36.5's circuit is built from
SingleExcitationandDoubleExcitationgates rather than generic rotations, since those preserve particle number by construction. And §36.6's exact diagonalization is diagonalizing the full $4{,}096\times4{,}096$ matrix when the answer lives in a 495-dimensional block: the 22.996 s it took is 8.3× more work than the physics required.Symmetry tapering exploits the same slack to remove two to four qubits from a typical molecular Hamiltonian for free. It does not change the term count, so §36.7's arithmetic is untouched.
Why chemical accuracy is 1 kcal/mol, and not a numerical-analysis number
The threshold this chapter measures everything against is 1 kcal/mol = 0.0016 Hartree, and it is worth being precise about where it comes from, because it is a chemistry fact and it is routinely presented as a convergence tolerance.
Reaction rates and equilibrium constants depend exponentially on energy differences. At room temperature,
$$RT = 0.0019872 \times 298.15 = 0.5925 \text{ kcal/mol}$$
so an energy error $\Delta$ multiplies a computed rate constant by $e^{\Delta/RT}$:
energy error e^(error/RT) what it means
1.00 kcal/mol 5.4x a rate wrong by half an order of magnitude
2.00 kcal/mol 29.2x a wrong answer about which pathway dominates
12.62 kcal/mol 1.78 x 10^9 not chemistry
One kcal/mol is the point at which a computed rate stops being useful, not the point at which a number stops converging. Getting a barrier wrong by 1 kcal/mol misplaces a rate by a factor of five, which a chemist can work around. Getting it wrong by 2 misidentifies the dominant pathway.
Now apply it to the number §36.4 will measure. The (2e,2o) active space's 12.62 kcal/mol error corresponds to being wrong about a reaction rate by a factor of 1.78 billion. That is the same finding as "12.6× chemical accuracy," restated in the units the calculation exists to serve, and it is considerably harder to shrug at.
Note also that $0.0016 \times 627.509 = 1.0040$ kcal/mol. The Hartree figure is the round chemistry number converted, not the other way round — which is the tell that the threshold was set by chemists.
36.2 From molecules to qubits
Building the qubit Hamiltonian is one call:
H, n_qubits = qml.qchem.molecular_hamiltonian(symbols, coordinates)
Measured, in the STO-3G minimal basis:
molecule electrons orbitals qubits JW terms BK terms build s
H2 2 2 4 15 15 0.03
LiH 4 6 12 631 631 1.27
BeH2 6 7 14 666 666 1.54
H2O 10 7 14 1,086 1,086 1.97
Qubits = 2 × spatial orbitals — one per spin orbital.
And the term count grows as $\mathcal{O}(n^4)$, from the two-electron integrals:
molecule qubits terms (measured) n^4/16 (fit)
H2 4 15 16
LiH 12 631 1,296
BeH2 14 666 2,401
H2O 14 1,086 2,401
The fit is rough and the exponent is right. Every one of those terms needs its own measurement basis, which is Chapter 24 §24.3's third scaling direction arriving with a name.
⚠️ Two molecules, the same qubit count, 420 different terms. BeH₂ and H₂O both need 14 qubits and differ by 63%. The qubit count does not determine the term count — molecular point-group symmetry does, because symmetry is what makes four-index integrals vanish. BeH₂ here is linear and H₂O is bent, and §36.2's correction below measures that swapping the geometries swaps the term counts while the electron counts stay put.
This matters more than it looks. Device capability is quoted in qubits, and the shot bill is denominated in terms. A device sized in qubits is not a device sized for a molecule, and the $n^4/16$ fit that the rest of this chapter prices with is the right shape and the wrong number for any particular system — it over-predicts BeH₂ by 261% and H₂O by 121%.
The fit, decoded
The $n^4/16$ in that table is written in qubits, which conceals what it is. Substitute $n_{\text{qubits}} = 2n_{\text{orbitals}}$:
$$\frac{n_{\text{qubits}}^4}{16} = \frac{(2n_{\text{orbitals}})^4}{16} = \frac{16\,n_{\text{orbitals}}^4}{16} = n_{\text{orbitals}}^4$$
The fit is exactly $n_{\text{orbitals}}^4$ — one term per ordered four-tuple of spatial orbitals, which is the count of two-electron integrals from §36.1 with no reductions applied at all. That is why it is an over-estimate rather than a wrong-shaped guess:
molecule orbitals qubits measured n_q^4/16 = n_orb^4 measured/fit
H2 2 4 15 16 0.938
LiH 6 12 631 1,296 0.487
BeH2 7 14 666 2,401 0.277
H2O 7 14 1,086 2,401 0.452
Two things shrink the real count below the fit. Integrals that vanish by molecular symmetry never generate a term. And Pauli strings that coincide get collected — many distinct fermionic terms map onto the same Pauli operator and add their coefficients.
The second effect is easy to measure and larger than it looks. LiH's fermionic Hamiltonian holds 1,861 terms — one constant, 36 one-body, 1,824 two-body — which Jordan–Wigner collapses onto 631 distinct Pauli strings. That is a 2.95× collection, achieved for free by the mapping, and it happens before any commuting-group optimization is applied.
The measured/fit ratio falls from 0.94 at two orbitals to 0.28 at seven, and that direction matters: §36.7 extrapolates this fit to fifty orbitals, so its headline shot budget is probably an over-estimate by a factor of two to four. Say it plainly, because the chapter's conclusion should not depend on a flattering fit. Against a deficit of eight orders of magnitude, a factor of 3.6 changes $6.06\times10^8$ QPU-years to $1.7\times10^8$ QPU-years. The conclusion is not sensitive to it, and a conclusion that were sensitive to it would need the fit replaced by a count.
★ A correction: the 420 terms are geometry, not electron count
The callout above attributes BeH₂ and H₂O's 420-term gap to the electron count. Building this expansion, that attribution was tested rather than repeated, and it does not survive the measurement. The corrected explanation is below; the practical lesson the callout draws is unchanged and in fact strengthened.
The test is the obvious one: change the geometry and leave the electrons alone.
system electrons orbitals qubits terms
BeH2 linear (book geometry) 6 7 14 666
BeH2 bent to 104.5 deg 6 7 14 1,086
H2O bent (book geometry) 10 7 14 1,086
H2O straightened to 180 deg 10 7 14 666
Bending BeH₂ raises its term count from 666 to exactly H₂O's 1,086, with its six electrons untouched. Straightening H₂O drops it from 1,086 to exactly BeH₂'s 666, with its ten electrons untouched. The two molecules swap numbers when they swap shapes.
Sweeping the bond angle shows the effect is a cliff, not a slope:
BeH2 angle terms H2O angle terms
180.0 666 180.0 666
179.0 1,086 150.0 1,086
170.0 1,086 120.0 1,086
150.0 1,086 104.5 1,086
120.0 1,086 90.0 1,086
104.5 1,086
90.0 1,086
One degree off linear is worth 420 terms. That is the signature of a point-group symmetry: a linear AB₂ molecule sits in $D_{\infty h}$, where a large set of two-electron integrals is forced to zero by orbital symmetry. Bend it by any amount and the symmetry drops to $C_{2v}$, those integrals become non-zero, and their Pauli strings appear in the Hamiltonian. Nothing about the electron count moved.
The complementary test holds the active-orbital count fixed — so the qubit count is fixed — and varies the electrons:
system active space qubits terms
BeH2 linear (2e,5o) 10 156
BeH2 linear (4e,5o) 10 156
BeH2 linear (6e,5o) 10 156
BeH2 bent 104.5 (2e,5o) 10 252
BeH2 bent 104.5 (4e,5o) 10 252
BeH2 bent 104.5 (6e,5o) 10 276
Two to six electrons in linear BeH₂, five active orbitals throughout: 156 terms every time. The
residual movement in the bent case (252, 252, 276) is not an electron effect either — changing
active_electrons changes how many core orbitals are frozen, so the three rows are five different
orbitals, not the same five with different occupancies.
The corrected statement: the term count is set by the number of active spatial orbitals and by which two-electron integrals survive the molecule's point-group symmetry. The electron count enters only indirectly, by selecting which window of orbitals is active. §36.1's derivation predicts exactly this and was never checked against the callout — $H$ is an operator on Fock space, and the electron number is a property of the state, not of the operator. The two sections had been inconsistent with each other since they were written, and neither was read against the other until a measurement forced it.
(For reproducibility: the bent-BeH₂ geometry keeps the 2.5 Bohr bond length of the book's linear one, and the straightened H₂O keeps its 1.811 Bohr bond length. Only the angle changed.)
🔬 Honest Assessment: what the correction costs, and what it does not.
Everything the original callout concludes stands. The qubit count still does not determine the term count. A device sized in qubits is still not a device sized for a molecule. The $n^4/16$ fit still over-predicts BeH₂ by 261% and H₂O by 121%, and §36.7's arithmetic is untouched.
The practical lesson gets worse, not better. An electron count is at least printed on the periodic table. A term count that swings by 63% on one degree of bond angle cannot be read off any spec sheet, by anyone, before the Hamiltonian is built. The number that determines the shot bill is not merely different from the qubit count — it is not predictable from the molecular formula either.
And note the shape of the error, because it is a new one for this book. The seven corrections documented elsewhere were all of the same kind: a conclusion drawn from too small a sample. This one is a plausible causal story attached to a correct measurement. The numbers — 666 and 1,086 at 14 qubits each — were right all along. The explanation was the part nobody checked, because the explanation was not a number, and this book's discipline had been aimed entirely at numbers.
A mechanism is a claim. It is testable, it was cheap to test, and it was wrong.
⚙️ Under the Transpiler: 631 terms is not 631 circuits, and it is not one circuit either.
A Pauli term is measured by rotating its qubits into the $Z$ basis and reading out. $Z$ needs nothing, $X$ needs an $H$, $Y$ needs $S^\dagger$ then $H$. So a weight-$w$ term costs at most $2w$ single-qubit gates appended to whatever the ansatz already is — and single-qubit gates are the ones Chapter 31 measured as nearly free:
rzat 0.0 ns because it is a virtual frame change,sxat 56.9 ns.The expensive part is not the basis change. It is that terms which do not commute cannot share a circuit, so each measurement setting is a separate job submission — and Chapter 39 measured what a job submission costs when the queue is five minutes and the circuit is seven milliseconds.
Grouping commuting terms is therefore not a shot-count optimization in the first instance. It is a job-count optimization, and Chapter 39 §39.3's finding that batching 100 circuits into one job is worth 99.8× is the same lever seen from the other end.
One transpiler consequence is easy to miss: appending different basis-change layers to the same ansatz produces circuits the transpiler may lay out differently, and Chapter 39 measured a 14-qubit circuit's fidelity moving from 0.5755 to 0.7911 on transpiler seed alone. Two Hamiltonian terms measured through two different layouts are not two measurements of the same state.
36.3 What the mapping actually changes
Fermions anticommute; qubits do not. A mapping encodes fermionic operators into Pauli strings while preserving that antisymmetry, and the two standard choices are Jordan–Wigner and Bravyi–Kitaev.
The common claim is that Bravyi–Kitaev "reduces the number of terms." Measured on LiH:
jordan_wigner 12 qubits, 631 terms
weight: mean 6.16 median 6.0 max 12
bravyi_kitaev 12 qubits, 631 terms
weight: mean 5.62 median 6.0 max 10
The term count is identical. What changes is the Pauli weight — how many non-identity factors each term has:
JW: w=1:12 w=2:74 w=4:180 w=6:104 w=8:92 w=10:116 w=12:28
BK: w=1:10 w=2:23 w=3:72 w=4:83 w=5:105 w=6:108 w=7:117 w=8:64 w=9:42 w=10:6
Jordan–Wigner's distribution has a long tail out to weight 12 — full-width strings across every qubit. Bravyi–Kitaev's is concentrated in the middle and caps at 10.
⚛️ The Physics Underneath: the two mappings store different things locally.
Jordan–Wigner stores occupation locally — qubit $j$ is the occupation of spin-orbital $j$ — and pays for it in parity, which requires a $Z$-string over every preceding mode. A single $a^\dagger_p a_q$ becomes a Pauli string of length $\mathcal{O}(n)$.
Bravyi–Kitaev stores a mixture, so both occupation and parity are recoverable from $\mathcal{O}(\log n)$ qubits, and terms have $\mathcal{O}(\log n)$ weight.
Weight matters because it sets the measurement-circuit depth per term, and Chapter 12 measured what depth costs.
At 12 qubits the improvement is modest — mean 6.16 to 5.62, max 12 to 10. The $\mathcal{O}(n)$ versus $\mathcal{O}(\log n)$ separation needs more qubits to show, which is worth saying because the usual presentation implies it is dramatic at any size.
Deriving the Jordan–Wigner string
The callout states the mechanism. Writing it out explains every bin of the measured histogram.
A qubit lowering operator is local: $\sigma^- = |0\rangle\langle1| = (X + iY)/2$, and two of them on different qubits commute. Fermionic annihilation operators must anticommute:
$$\{a_j, a_k^\dagger\} = \delta_{jk}, \qquad \{a_j, a_k\} = 0 \;\;\text{for all}\; j,k$$
Jordan–Wigner buys the missing sign with a string of $Z$s:
$$a_j = \left(\bigotimes_{k The $Z$ string measures the parity of occupation below mode $j$, and because $Z$ anticommutes with $X$
and $Y$, moving one operator past another picks up exactly the minus sign fermions require. The
non-locality is not a design flaw. It is the anticommutation, made explicit. Now cost the terms, and compare against the measured LiH histogram: The diagonal number operator. $a_j^\dagger a_j = (I - Z_j)/2$ — the strings sit on the same modes
and cancel. Weight 1. LiH has 12 spin orbitals, and the histogram has exactly The off-diagonal hop. For $p < q$, the strings cancel below $p$ and above $q$ and survive strictly
between them: $$a_p^\dagger a_q + a_q^\dagger a_p = \tfrac{1}{2}\left(X_p Z_{p+1}\cdots Z_{q-1} X_q + Y_p Z_{p+1}\cdots Z_{q-1} Y_q\right)$$ Weight $= (q - p) + 1$. Linear in the distance between modes, and that is the whole
$\mathcal{O}(n)$: a hop between the ends of a 12-qubit register is a weight-12 Pauli string. The
histogram's Two-body terms contain four ladder operators, so up to two disjoint $Z$ segments survive, and the
weight is again bounded by the register width. ⚠️ Common Pitfall: Jordan–Wigner weight depends on an ordering you chose arbitrarily. The weight of a hop is $q - p + 1$, where $p$ and $q$ are indices into a list you wrote down.
Relabel the spin orbitals and the weight distribution changes without a single physical quantity
moving. This is why the 6.16-versus-5.62 comparison in §36.3 is a comparison of two encodings and not of
two physical facts, and why a paper reporting a Jordan–Wigner weight without stating its orbital
ordering has reported a number you cannot reproduce. Locality in the qubit register is a property
of the bookkeeping, not of the molecule — which is also the opening for every "better ordering"
heuristic in the literature. Jordan–Wigner is one endpoint of a trade-off: occupation stored perfectly locally, parity stored
maximally non-locally. The parity mapping — which PennyLane 0.45.1 also accepts, as
Bravyi–Kitaev sits between them, using a Fenwick-tree layout in which qubit $j$ stores the parity
of a block of modes whose extent is read off the binary representation of $j$. Recovering what a single
ladder operator needs then touches three sets of qubits: Each set has $\mathcal{O}(\log_2 n)$ elements, because that is the depth of the tree. One ladder
operator therefore has $\mathcal{O}(\log n)$ weight instead of $\mathcal{O}(n)$. That is the asymptotic claim, and here is why it does almost nothing at 12 qubits. A Hamiltonian term
has up to four ladder operators, not one. So the honest comparison of the two bounds is $n$ against
roughly $4\log_2 n$: The two bounds cross at 16 qubits, and LiH is 12. Below the crossing, Bravyi–Kitaev's asymptotic
advantage has not started paying; §36.3's measurement lands exactly where this predicts, with a modest
improvement (max 12 to 10) rather than a dramatic one. Bravyi–Kitaev in fact beats its own crude bound —
10 against 14.3 — but not by enough to matter at this size. The separation is real and it is asymptotic, and asymptotic claims are checked at the size you are
running. At 100 qubits the same arithmetic predicts a 3.8× weight reduction, which would be worth
having. That is a prediction from the bounds, not a measurement, and it is stated as one. 📐 Math Aside: the histograms above account for 606 and 630 of 631 terms. Add up the two distributions printed in §36.3. Jordan–Wigner's bins sum to 606 terms; Bravyi–Kitaev's
to 630. Both Hamiltonians have 631 terms. The printed lines were transcribed from the run and are
incomplete. Re-running with the full counter: ```text
JW w=0:1 w=1:12 w=2:74 w=3:8 w=4:180 w=5:4 w=6:104
w=7:4 w=8:92 w=9:4 w=10:116 w=11:4 w=12:28
-> 631 terms, total weight 3,888 BK w=0:1 w=1:10 w=2:23 w=3:72 w=4:83 w=5:105
w=6:108 w=7:117 w=8:64 w=9:42 w=10:6
-> 631 terms, total weight 3,546
``` The published means survive the correction exactly: $3888/631 = 6.1616$ and $3546/631 = 5.6197$,
matching the reported 6.16 and 5.62. The analysis was right; the transcription dropped bins. The dropped bins are worth having. And Jordan–Wigner's missing odd bins are the derivation above, visible. A hop has weight
$q-p+1$; PennyLane interleaves spin orbitals $(\alpha,\beta,\alpha,\beta,\dots)$, so spin conservation
forces $p$ and $q$ to share index parity, $q-p$ is even, and the weight is odd. The diagonal case
$q = p$ is the same formula at distance zero, giving the 12 weight-1 terms. Mapping LiH's one-body part on its own confirms it exactly — 37 Pauli terms, of which every one of
the 36 non-identity terms has odd weight: Those are precisely the odd bins of the full 631-term Hamiltonian, and there are no others. The
two-body part does contribute to the same 36 strings — a term like $a_p^\dagger a_q^\dagger a_q a_s$
contracts onto one-body support — but it introduces no odd-weight string of its own. Bravyi–Kitaev shows no such structure — 285 even against 346 odd — because its Pauli support is a
tree neighbourhood rather than a contiguous interval. The same structural fact that lowers its
maximum weight destroys the parity pattern, and both are consequences of the tree. 🔀 In Another Framework: PennyLane is doing more here than its competitors do. The one-line What is worth knowing is that the division of labour is the same everywhere, because the physics
forces it: Steps 1–3 are classical chemistry and every framework outsources them, usually to PySCF. Only step
4 is quantum-specific, and it is the cheapest step in the list. A framework comparison for chemistry
is therefore mostly a comparison of how gracefully each one wraps the same classical code — which is
Chapter 18's finding arriving in a new domain. No current device runs 12 qubits' worth of chemistry usefully, so the standard move is an active
space: freeze the core electrons, keep a chosen window of orbitals, and solve the smaller problem. Measured on LiH, against exact diagonalization of each Hamiltonian: A (2e,2o) active space takes LiH from 12 qubits to 4 and from 631 terms to 27 — and is wrong by
12.62 kcal/mol, about 12.6× chemical accuracy. ⚠️ Common Pitfall: the active space is a physics decision that dominates every engineering decision
downstream, and it is made before any quantum code runs. Every optimization in Part V — layout, transpilation, shape, mitigation — operates on a Hamiltonian
whose accuracy was fixed by this choice. A 3× reduction in qubits bought a 12.6× violation of the
target accuracy. "Freeze the core, keep a window" is the recipe. In practice it is three steps, and a fourth that almost
nobody performs. 1. Freeze the core. Deep core orbitals — Li's $1s$, oxygen's $1s$ — are doubly occupied in every
chemically relevant state, and their energy very nearly cancels in any energy difference. PennyLane's
2. Keep the frontier. Choose a window of orbitals around the HOMO–LUMO gap, because that is where
the correlation the mean-field solution missed actually lives. 3. Check the occupation numbers. The defensible version of step 2 does not guess. Run a cheap
correlated method — MP2, CCSD, or a small CASSCF — and read off the natural orbital occupation
numbers. An orbital sitting at 2.00 or 0.00 is not doing correlation work and can leave; orbitals with
fractional occupations are the ones that must stay. This is the step that separates a chosen active
space from an assumed one. 4. Measure the error against a larger space. §36.4's table is step 4, and it is the reason this
chapter has a number where most reports have a decision. Be honest about why step 4 is skipped: validating an active space means solving the larger problem,
which is the thing the active space existed to avoid. That is a real objection, and for LiH it is
also a false one. §36.6 diagonalizes the full 12-qubit Hamiltonian in 22.996 seconds. Skipping validation here saved 23 seconds and cost 12.62 kcal/mol. The argument for skipping it is
sound in general and indefensible at the sizes anyone is currently running, which is a fair summary of
the whole field's position. The table gives cumulative errors. Differencing them says something the cumulative form hides: The first cut costs 95.4% of the total error and removes a third of the qubits. The remaining two cuts
halve the qubit count again for 4.6% of the error. Per qubit removed, the first four qubits are about
twenty times more expensive than the next four — the reverse of the intuition that each further
truncation hurts more than the last. The middle row is the interesting one. The $(4e,4o)\to(2e,3o)$ step is where the lithium $1s$ core
gets frozen, and it costs 0.000141 Ha — 0.088 kcal/mol, a tenth of chemical accuracy. That is step 1
of the recipe above, measured, and it confirms what a chemist would have asserted for free: core
freezing is nearly harmless. The damage came from step 2, dropping two virtual orbitals that were
carrying real correlation. 📊 What the Numbers Say: the truncation error is not smooth in the qubit count, so it cannot be
interpolated. Given the 12-qubit and 4-qubit errors, a linear guess at the 8-qubit error gives about 6.3 kcal/mol.
The measured value is 12.04. A quantity that jumps 95% of its range in the first step and then flattens
cannot be estimated from its endpoints, which means "we validated the small space, so the medium one
is fine" is not an argument. It also means the useful validation is the first reduction, not the last. If you are going to spend
23 seconds, spend them on the step that is about to cost you twelve kcal/mol, not the one that costs
you half of one. 🐛 Debug This: the ansatz built for the wrong electron count. Build an active-space Hamiltonian, then build the ansatz from the molecule's total electron count
instead of the active one: ```python
H, n_qubits = qml.qchem.molecular_hamiltonian(
symbols, coords, active_electrons=2, active_orbitals=3) # 6 qubits, 62 terms hf = qml.qchem.hf_state(4, n_qubits) # 4 is LiH's TOTAL electron count
singles, doubles = qml.qchem.excitations(4, n_qubits)
``` Nothing raises. Worse, the parameter counts are identical: ```text
excitations(2, 6) -> 4 singles + 4 doubles = 8 parameters
excitations(4, 6) -> 4 singles + 4 doubles = 8 parameters hf_state(2, 6) = [1 1 0 0 0 0] correct
hf_state(4, 6) = [1 1 1 1 0 0] the bug
``` So every shape assertion passes, the optimizer converges smoothly, and the energy is wrong — because
```text
lowest eigenvalue, 2-electron sector (15 determinants): -7.86307962 Ha correct
lowest eigenvalue, 4-electron sector (15 determinants): -7.38079784 Ha what you get error: 0.482282 Ha = 302.64 kcal/mol
``` 302 kcal/mol — twenty-four times the active-space error this whole chapter is about — from passing
one integer. The fix is to keep The general lesson is Chapter 26 §26.6's: this bug is invisible to every check that does not know the
answer, because the failure mode is a clean convergence to the wrong eigenvalue. A particle-number
assertion on the final state catches it in one line. Chapter 27's habit, applied to chemistry. Run VQE properly on the (2e,2o) space: Hartree–Fock reference, a UCCSD-style ansatz built from the
allowed single and double excitations, Adam, 120 steps. Three parameters, and VQE finds the active space's exact answer to two parts in a billion. That is a genuine and reproducible success, and Chapter 24 §24.2 found the same thing on H₂. The
variational method is not the weak link. Now put the two errors side by side: 🔬 Honest Assessment: the approximation made to fit the device is ten million times larger than the
error of the method being demonstrated. Reporting the VQE energy to nine decimal places is arithmetically correct and physically
meaningless — the third decimal place is already wrong, and it was wrong before the circuit ran. A calculation is only as accurate as its worst approximation, and the worst approximation here is
the one nobody reports. Three parameters reaching $2\times10^{-9}$ Ha looks like a small miracle. Counting the space explains
it, and the explanation makes the result less impressive and the chapter's argument stronger. A Now count what those three parameters have to cover. Determinants with two electrons in four spin
orbitals: $\binom{4}{2} = 6$. Of those, the ones with $S_z = 0$ — one $\alpha$ from $\{0,2\}$, one
$\beta$ from $\{1,3\}$ — number $2 \times 2 = 4$. The remaining two, $|1010\rangle$ and $|0101\rangle$,
have both electrons in the same spin channel and the singlet ground state has no amplitude on them. The ground state lives in a four-dimensional space. A normalized real vector there has three free
parameters. The ansatz has three. $$\dim(\text{S}_z\!=\!0\text{ sector}) - 1 = 4 - 1 = 3 = n_{\text{singles}} + n_{\text{doubles}}$$ So the "variational ansatz" at That is worth stating clearly because it cuts both ways. It removes any suggestion that the result was
tuned or lucky — the ansatz was exact, so of course it converged. And it removes any suggestion
that the result demonstrates VQE scaling, because the same construction at LiH's full 📊 What the Numbers Say: $2.04\times10^{-9}$ is a convergence diagnostic, not an accuracy — and the
ratio is the least stable number in this chapter. Look at what each half of The numerator, $2.01\times10^{-2}$ Ha, is a physics quantity. It is the difference between two
exactly-diagonalized Hamiltonians. Re-run it on any machine, in any framework, in any decade, and it
reproduces to every digit printed. The denominator, $2.04\times10^{-9}$ Ha, is wherever Adam happened to stop after 120 steps. Run
200 steps and it falls. Run 20 and it rises by orders of magnitude. Change the learning rate, the
seed, or the optimizer and it moves again — without one physical fact changing. So quote the numerator. "The active space is wrong by 12.62 kcal/mol" is the finding, and it is
stable. "Ten million times larger" is the rhetoric, and it is the half that moves. A reader who
remembers only the ratio has kept the fragile number and discarded the durable one, which is a
specific and avoidable way to misremember a correct result. The last column of §36.4 was produced by exact diagonalization — full configuration interaction,
the exact answer within the basis. Milliseconds. Chapter 24 §24.7 stated that every molecule currently in reach is exactly solvable
classically; this is that statement, measured. But full CI is not the baseline a quantum method has to beat, because nobody runs full CI at scale
— it is exponential and dies around 20 orbitals. The real competition: CCSD(T) is called the gold standard because it reaches chemical accuracy on most main-group
chemistry at around a hundred orbitals. That is the baseline, and Chapter 21 §21.7's lesson
applies: benchmarking against full CI rather than CCSD(T) is comparing against the method nobody
uses. The honest statement of where quantum computing could help is therefore narrower than "chemistry":
strongly-correlated systems where CCSD(T) breaks down and DMRG's structure assumptions fail —
transition-metal catalysis, some excited states, bond-breaking. That is a real and important set of
problems. It is not all of chemistry, and it is not most of it. The scaling column is the easy half of that table. The assumption is what decides whether a method is
usable on your molecule, and it is what the narrowing above is built from. Full CI assumes nothing beyond the basis set. That is why it is exact and why it is exponential:
$\binom{2n}{n_e}$ determinants, which at 50 orbitals and 50 electrons is $\binom{100}{50} \approx
1.0\times10^{29}$. It does not break; it becomes unaffordable, at around 20 orbitals. CCSD(T) assumes a single dominant reference determinant — that Hartree–Fock is qualitatively
right and correlation is a correction to it. When that holds it is superb, and $\mathcal{O}(n^7)$ is
affordable to about 100 orbitals. When it fails it fails without warning in the energy, which is why
the field uses diagnostics: a $T_1$ amplitude norm above roughly 0.02 is the standard signal that the
single-reference picture is in trouble. It breaks on bond dissociation, biradicals, and transition
metals with near-degenerate $d$ shells. DMRG assumes the entanglement in the ground state obeys something close to an area law along a
chosen ordering of the orbitals — that the system is, in the relevant sense, one-dimensional. Its
cost $\mathcal{O}(n^3M^3)$ is polynomial in the bond dimension $M$ you choose, and the accuracy is
whatever that $M$ bought. It is outstanding on chains and conjugated systems and degrades on
three-dimensionally connected strong correlation, where $M$ must grow exponentially to keep up. DFT assumes an exchange–correlation functional that nobody can write down exactly. At
$\mathcal{O}(n^3)$ it reaches thousands of atoms, which is why it is the most-used method in chemistry
by an enormous margin. 🔬 Honest Assessment: only one of these four tells you how wrong it is, and it is the one nobody can
run. Full CI is exact. DMRG converges in $M$ and you can watch it converge, so its error is bounded from
inside the method. CCSD(T) has diagnostics that flag its own failure mode without quantifying it.
DFT has neither — there is no knob you can turn that provably converges a functional to the exact
answer, so a DFT error cannot be bounded from within DFT. This matters more than it first appears, because systematic improvability is precisely what a
quantum method claims as its advantage. "Exact in principle, limited only by resources" is a claim
on the same axis DFT loses on, and it is the strongest form of the quantum case in chemistry. It also creates the problem Case Study 36.2 hits. Beating an approximate classical method requires a
third number better than both — and past 20 orbitals nobody has one. At exactly the sizes where a
quantum method could matter, the referee is missing. That is Chapter 21 §21.7's "compared to what?"
in its hardest form: not a lazy baseline, but no available arbiter at all. Chapter 24 §24.7 put the classical crossover around 50+ correlated orbitals. What would VQE cost
there? Chemical accuracy needs $(\sigma/\epsilon)^2 = (0.5/0.0016)^2 = 97{,}656$ shots per energy evaluation.
A gradient costs $2p+1$ evaluations. Every term needs its own measurement. And there are 200 iterations
of the loop: Six hundred million QPU-years at the crossover, at 10,000 shots per second. 🔬 Honest Assessment: the crossover is not where VQE becomes useful. It is where classical methods
stop being exact. Those are different points and they are conflated constantly. Chapter 24 §24.7's three barriers —
shot budget, barren plateaus, hardware noise — all bind long before the classical methods run
out, and the first one binds by a factor of $10^8$. Even generous corrections do not close it. Grouping commuting terms saves a constant factor of maybe
10–100 (Chapter 24 §24.3). Classical shadows (Chapter 35 §35.5) help by roughly $\sqrt{n_{\text{terms}}}$.
Better ansätze reduce the parameter count. Together they are worth perhaps four orders of magnitude
against a deficit of eight. $1.91\times10^{20}$ is a number nobody can hold. Factor it, and it becomes four numbers that can each
be argued with separately: The two non-negotiable factors multiply to $6.10\times10^{11}$ shots, and that product has a
meaning worth stating on its own: it is the cost of one energy evaluation at chemical accuracy on a
50-orbital Hamiltonian. No optimizer, no gradient, no iteration — just reading the energy of a state
somebody hands you. $$97{,}656 \times 6{,}250{,}000 = 6.10\times10^{11} \text{ shots} = 1.94 \text{ QPU-years}$$ Two QPU-years to evaluate one point on one potential energy surface, at 10,000 shots per second,
before any optimization begins. Everything else in §36.7's table — the entire $3.1\times10^8$ from the
right-hand column — is the price of searching on top of the price of looking. That split is the chapter's most useful export, because the two halves have completely different
futures. Better optimizers, gradient-free methods, ADAPT-style ansätze and warm starts all attack the
right-hand column, which is the smaller one and the one that is already shrinking. Nothing in the
variational framing touches the left-hand column at all. 💰 Cost and Queue: Chapter 39 already priced this chapter's own run, and it is worth reading the
receipt carefully. Chapter 39 §39.5 lists an experiment called $$7 \text{ evaluations} \times 97{,}656 \text{ shots} \times 27 \text{ terms} = 18{,}456{,}984$$ — with 27 the measured term count from §36.4, not the fitted 16. It is exactly one gradient step
of the run in §36.5. That run took 120 of them. A calculation that took 2.5 seconds on an exact simulator is somewhere between an hour and three
days of device time and between six thousand and twenty-two million dollars — for an answer already
known to be wrong by 12.62 kcal/mol. And note the two rates, because the book contains both and they differ by 59×. Chapter 39 §39.2
measured circuit duration — 1.69 µs for a shallow circuit, or 592,000 shots per second if nothing
but the circuit costs anything. §36.7 prices at 10,000 shots per second, a throughput figure that
includes reset, readout and classical turnaround. The first is what the physics permits; the second
is what a device delivers. The gap between them is Chapter 39's entire subject, and the honest
version of any shot-budget estimate says which one it used. 📉 Noise Report: noise does not break the variational bound. Error mitigation does. The variational principle guarantees $\langle\psi|H|\psi\rangle \ge E_0$. A common worry is that a
noisy device violates it. It does not — noise produces a mixed state $\rho$, and
$\mathrm{Tr}(\rho H) \ge E_0$ holds for any valid density matrix. A noisy VQE energy is still an upper
bound. Zero-noise extrapolation is what breaks it. An extrapolated expectation value is not the
expectation of any state, so it carries no variational guarantee and can land below the true ground
state. Chapter 13's methods are correct and useful, and applying them to a VQE energy converts an
honest upper bound into an estimate with error bars — a different object that is frequently reported
as the first one. The damage noise does do is subtler and worse. The optimizer minimizes the noisy functional, not the
true one, so it converges to parameters that exploit the noise rather than the physics. And the bias
is not uniform across terms: Chapter 30 measured two-qubit error rates on one chip spanning 0.00750 to
0.07205 — a factor of 9.6 — so where a Hamiltonian term's qubits happen to land changes its bias
by an order of magnitude. Summing 631 differently-biased terms into one energy does not average the
error out; it accumulates it with unknown sign. Chapter 31 is the cautionary note on fixing this by reflex: dynamical decoupling made things
significantly worse there, XX at $-0.0053 \pm 0.0012$, a 4.4-standard-error effect in the wrong
direction. There is no mitigation that is free and none that is unconditionally helpful. Being specific about this is more useful than pessimism. Fault tolerance, and then phase estimation instead of VQE. Quantum phase estimation reaches a target
precision in $\mathcal{O}(1/\epsilon)$ rather than $\mathcal{O}(1/\epsilon^2)$ — it does not have a shot
budget in the same sense, because the precision comes from circuit depth rather than from sampling.
Chapter 22 §22.4 built that route and Chapter 25 §25.10 explained why it is gated on
error correction. The route that survives the arithmetic is the one that needs fault tolerance. Better measurement, not better optimization. The dominant term is shots, not steps. Chapter 35's
classical shadows, commuting-set grouping, and low-rank factorizations of the two-electron integrals
all attack the right quantity. And an honest active-space story. Whatever the device does, if the active space is wrong by 12
kcal/mol the answer is wrong by 12 kcal/mol. This is the part that is not gated on hardware at all,
and it is where a quantum chemist's judgement is worth more than any circuit. §36.7's factor table makes "what would have to change" a concrete question rather than a mood. Four
answers, in descending order of how much they move. 1. Fault tolerance, and then phase estimation. Delete the two negotiable factors — an
outer-loop-free method has no $2p+1$ and no 200 iterations — and $1.91\times10^{20}$ becomes
$6.10\times10^{11}$. Replace $1/\epsilon^2$ sampling with $1/\epsilon$ precision-from-depth, turning
$(0.5/0.0016)^2 = 97{,}656$ into $0.5/0.0016 = 312.5$, and it becomes: Eight orders of magnitude become about two, and then the remaining cost leaves the sampling column
entirely and reappears as circuit depth. That is where Chapter 25 §25.10's surface-code overhead and
Chapter 15's measurement — 450 physical qubits for a circuit with no T gates, 2,882 with one — take
over the accounting. The arithmetic does not disappear. It changes currency, and that is the point. Chapter 24 §24.7's
rule is that every remedy is denominated in the currency of the disease; a remedy denominated in a
different currency is the only kind that has ever helped, and it is why this route is the one the
chapter endorses despite being further away. 2. A term count that is not $n^4$. Double factorization and tensor hypercontraction restructure the
two-electron integrals into a low-rank form with far fewer distinct measurement settings. If the
effective count fell from $n^4$ to $n^2$, at 50 orbitals that is $6{,}250{,}000 \to 2{,}500$ — a 2,500×
cut. This is the only lever in the chapter that attacks a factor §36.7 marked non-negotiable, which
is why it deserves more attention than its size alone would earn. Stated as a prediction from the
scaling, not a measured result. 3. A smaller $\sigma$. The $(\sigma/\epsilon)^2$ uses $\sigma = 0.5$ for the observable's spread.
Chapter 24 §24.3's own table shows what that assumption is worth: $\sigma = 0.1$ needs 3,906 shots
against 97,657 — a 25× cut, bought entirely by measurement design rather than hardware. Grouping
terms into low-variance sets is doing this, and it is the reason grouping is worth more than its
"constant factor" description suggests. 4. A cheaper active-space validation. Not on this table at all, because it is not gated on hardware
— and it is the one that would improve every result already published. Worth listing, because each of these is proposed regularly. Every negotiable factor eliminated entirely still leaves 1.94 QPU-years for a single energy
evaluation. That is the sentence to carry out of this chapter, and it is arithmetic, not opinion. 🧪 Run It: find out whether §36.2's symmetry cliff is real or a numerical tolerance. The angle sweep in §36.2 shows 666 terms at exactly 180.0° and 1,086 at 179.0°. That looks like a
point-group symmetry switching off, and the explanation given says so. But So the cliff may be a symmetry boundary or it may be a threshold crossing, and the two are
distinguishable in about a minute: If the term count steps up at some intermediate angle, you have found the tolerance rather than the
symmetry. If it jumps at the first departure from 180° no matter how small, the symmetry account
holds. Then settle it properly. This is a question this chapter's own new measurement raised and did not settle, and it is exactly
the kind of check the measurement deserves before anybody quotes it. 🗝️ Version Note: verified against PennyLane 0.45.1. Chapter 24 §24.3 recorded the other change that affects this chapter's code: setting And the durable observation. The integrals in §36.1 were written down in the 1920s and the active
space concept in the 1970s. The function names in this chapter change every few releases. Chapter
31 opened with Chapter 37 turns to optimization, where the classical baselines are even stronger and the claims are,
if anything, louder. The theme: a calculation is only as accurate as its worst approximation — and in quantum
chemistry the worst approximation is the one made before the circuit runs, and the one nobody reports.w=1:12: one
weight-1 Pauli per spin orbital, with nothing left over.w=12:28 is 28 terms that touch every qubit in the machine.
And why Bravyi–Kitaev is $\mathcal{O}(\log n)$
mapping="parity" — is the other endpoint: qubit $j$ holds the cumulative parity up to $j$, so parity
is free and occupation becomes the $\mathcal{O}(n)$ quantity. Neither endpoint helps, because a
Hamiltonian term needs both. occupation set which qubits determine mode j's occupation
parity set which qubits give the parity of all modes below j
update set which qubits must flip when mode j's occupancy changes
qubits n JW bound n BK bound ~4 log2(n) ratio
12 12 14.3 0.84
16 16 16.0 1.00
32 32 20.0 1.60
64 64 24.0 2.67
100 100 26.6 3.76
w=0:1 is the identity — nuclear repulsion plus the frozen-core
energy, a constant added to every evaluation. It is one of 631 terms and it costs zero shots,
which is the only free term in the entire budget of §36.7.text
one-body only: w=0:1 w=1:12 w=3:8 w=5:4 w=7:4 w=9:4 w=11:4 -> 37 termsqml.qchem.molecular_hamiltonian(symbols, coordinates) that opens §36.2 is unusual.
Verified against this book's environment: neither Qiskit 2.5.1 nor Cirq 1.7.0 ships a
molecular-Hamiltonian builder at all — neither package exposes anything chemistry-shaped in its top
level. Both delegate to separate projects (qiskit-nature and OpenFermion respectively), neither of
which is installed here, so this book does not report their APIs.text
1. geometry + basis -> Hartree-Fock classical, seconds
2. HF orbitals -> h_pq, h_pqrs classical, O(n^4)
3. integrals -> fermionic operator bookkeeping
4. fermionic op -> Pauli strings the MAPPING, this section
5. Pauli strings -> measurement circuits Chapter 12's problem
36.4 The active space, and what it costs
active space qubits terms exact E (Ha) error vs full kcal/mol
all (4e,6o) 12 631 -7.88240283 0.000000 0.00
(4e,4o) 8 193 -7.86322133 0.019182 12.04
(2e,3o) 6 62 -7.86307962 0.019323 12.13
(2e,2o) 4 27 -7.86228738 0.020115 12.62
chemical accuracy = 0.0016 Ha = 1.00 kcal/mol
How a chemist actually chooses one
active_electrons argument is exactly this control: it freezes $(n_e - n_{\text{active}})/2$ orbitals,
which is why (2e,5o) on a ten-electron molecule leaves only two orbitals spare.(2e,2o) is the floor: the highest
occupied and lowest unoccupied orbital, and nothing else.Where the 12.62 kcal/mol is actually incurred
reduction cost (Ha) kcal/mol share of total
12 -> 8 qubits (all -> 4e,4o) 0.019182 12.037 95.4%
8 -> 6 qubits (4e,4o -> 2e,3o) 0.000141 0.088 0.7%
6 -> 4 qubits (2e,3o -> 2e,2o) 0.000792 0.497 3.9%
TOTAL 0.020115 12.622 100.0%
SingleExcitation and DoubleExcitation preserve particle number, so the run never leaves the
four-electron sector it was started in. Diagonalizing each sector of the same 62-term Hamiltonian:active_electrons in a variable and use it everywhere, never the
molecule's own count.
36.5 VQE, and the error that is not the problem
singles, doubles = qml.qchem.excitations(n_electrons, n_qubits)
@qml.qnode(dev)
def circuit(params):
qml.BasisState(hf_state, wires=range(n_qubits))
for i, d in enumerate(doubles):
qml.DoubleExcitation(params[i], wires=d)
for j, s in enumerate(singles):
qml.SingleExcitation(params[len(doubles) + j], wires=s)
return qml.expval(H)
UCCSD-style ansatz: 2 singles + 1 double = 3 parameters
exact (this active space): -7.8622873762 Ha
VQE: -7.8622873742 Ha
error: 2.04e-09 Ha CHEMICAL ACCURACY
trained in 2.5 s on an exact simulator
VQE's error vs the active space's exact answer: 2.04e-09 Ha
The active space's error vs the full Hamiltonian: 2.01e-02 Ha
ratio: 9,870,104x
Why three parameters is exactly the right number
(2e,2o) space is 2 electrons in 4 spin orbitals. PennyLane interleaves them, so index 0 is spatial
orbital 0 with spin $\alpha$, index 1 is orbital 0 with spin $\beta$, and so on. The Hartree–Fock
reference is hf_state(2, 4) = [1 1 0 0], and the spin-conserving excitations out of it are: singles: [0, 2] alpha -> alpha
[1, 3] beta -> beta
doubles: [0, 1, 2, 3] both at once
2 singles + 1 double = 3 parameters
(2e,2o) is a full configuration interaction ansatz wearing a
circuit. It does not approximate the space; it spans it. The exact minimum is inside the ansatz's
reach by construction, and the only thing $2.04\times10^{-9}$ Ha measures is whether Adam found it.(4e,6o) space
needs 92 parameters for a 495-determinant sector, and at 50 orbitals §36.7's table needs 781,250.
9,870,104 is made of.
36.6 The classical baseline, which is not full CI
active space qubits Hilbert dim exact diag
all (4e,6o) 12 4,096 22.996 s
(4e,4o) 8 256 0.044 s
(2e,3o) 6 64 0.002 s
(2e,2o) 4 16 0.001 s
method scaling reach
full CI (exact) O(binom(2n,ne)) -- exponential ~20 orbitals
CCSD(T) O(n^7) ~100+ orbitals, GOLD STANDARD
DMRG O(n^3 M^3), M = bond dimension strong correlation, 1D-like systems
DFT O(n^3) thousands of atoms, approximate
What each method assumes, and where it breaks
36.7 The crossover, priced
orbitals qubits terms ~n^4/16 params (UCCSD) shots/gradient total (200 iters) QPU years
2 4 16 3 1.09e+07 2.19e+09 6.94e-03
6 12 1,296 162 4.11e+10 8.23e+12 2.61e+01
10 20 10,000 1,250 2.44e+12 4.88e+14 1.55e+03
25 50 390,625 48,828 3.73e+15 7.45e+17 2.37e+06
50 100 6,250,000 781,250 9.54e+17 1.91e+20 6.06e+08
The budget, factor by factor
factor value origin negotiable?
shots per energy, (sigma/eps)^2 97,657 Chapter 24 §24.3 NO -- sampling
Hamiltonian terms, n_orbitals^4 6,250,000 §36.2, four-index Coulomb NO -- physics
energy evaluations per gradient, 2p+1 1,562,501 Chapter 16 §16.4 yes -- optimizer
outer optimizer iterations 200 a choice yes -- optimizer
PRODUCT 1.91e+20
Ch.36 VQE LiH (2e,2o) at 18,456,984 shots. That number
is not arbitrary:text
120 gradient steps 2,214,838,080 shots
at Chapter 39's measured 1.69 us/shot 62.4 minutes of device time
at this chapter's 10,000 shots/second 2.56 days
per-minute, $96/min $5,989
per-shot, $0.00035 + task fees $891,833
per-shot, $0.01 + task fees $22,265,021
36.8 What would actually have to change
Where this would flip, priced
VQE at 50 orbitals 1.91e+20 shots 6.06e+08 QPU-years
minus (2p+1) and 200 iterations 6.10e+11 shots 1.94 QPU-years
and 1/eps instead of 1/eps^2 1.95e+09 shots 2.26 days
And what would not flip it
molecular_hamiltonian
applies its mapping with a hard-coded tol=1.0e-10, and an integral that is symmetry-forbidden at
exactly 180° is merely tiny at 179.9999°. A coefficient below the tolerance is dropped, and a
coefficient above it is a term.python
for angle in (180.0, 179.99999, 179.999, 179.9, 179.0):
H, n = qml.qchem.molecular_hamiltonian(["Be", "H", "H"], geometry(angle))
print(angle, len(H.terms()[0]))molecular_hamiltonian does not expose that tolerance, so build the
fermionic Hamiltonian with qml.qchem.fermionic_hamiltonian(mol)() and map it yourself with
qml.jordan_wigner(..., tol=t) for several values of t. A boundary that moves with t was never
a symmetry.text
qml.qchem.molecular_hamiltonian (*args, **kwargs) -- dispatched
qml.qchem.excitations (electrons, orbitals, delta_sz=0, fermionic=False)
qml.qchem.hf_state (electrons, orbitals, basis='occupation_number')molecular_hamiltonian is registered through functools.singledispatch, so inspect.signature
reports only (*args, **kwargs) — you cannot introspect its arguments and must read the
docstring. Its mapping keyword accepts "jordan_wigner", "parity" and "bravyi_kitaev", and
anything else raises rather than falling back to a default.shots on the
device is deprecated in favour of the qml.set_shots transform, and the two forms consume
randomness differently, so the same seed does not give the same draws.qiskit.pulse being removed outright in Qiskit 2.0. Learn the object, not the call.
What we measured