Chapter 7: Advanced Eigenstate Algorithms: The Rodeo Algorithm and Filtering#
This chapter develops resolution refinement and spectral filtering as complementary approaches to eigenstate preparation. A coarse state is prolonged and evolved along a chosen path, whose gap and coarse-state errors must be assessed. We derive the one-ancilla rodeo filter, its acceptance-weighted convergence bound, the effects of target-energy detuning, and the cost of restarting after rejection. Pairing, Lipkin, Heisenberg and Hubbard examples connect these methods to the models, encodings, phase estimation and variational calculations of earlier chapters. Comparisons identify their spectral prior information and separate per-attempt evolution costs from preparation, scanning and repetition. Explicit gate constructions expose product-formula errors, encoding choices and compilation overheads. Fixed-step diagnostics are distinguished from the variable-step filter actually simulated, and illustrative noise estimates show why such calculations call for quantum error correction.
# Put every BookPrograms/chapter*/ and BookPrograms/common/ on sys.path
import sys, pathlib
root = pathlib.Path.cwd().resolve()
while not (root / 'BookPrograms').is_dir() and root.parent != root:
root = root.parent
sys.path[:0] = sorted(str(p) for p in (root / 'BookPrograms').iterdir() if p.is_dir())
import numpy as np
Introduction#
Chapters 5 and 6 separated several costs of an eigenstate calculation: preparing an input with useful overlap, evolving it accurately, measuring observables, and assessing the resulting state. Phase estimation resolves eigenphases probabilistically and conditions the system on a finite-resolution measurement. VQE supplies a trial state; its exact expectation value is variational, but optimization, expressivity and finite-shot estimation must be assessed separately. Here we combine state preparation with projective spectral filtering.
For \(\vert\psi\rangle=\sum_jc_j\vert E_j\rangle\), a spectral filter multiplies each coefficient by \(F(E_j)\) and retains the corresponding measurement branch. It improves the relative weight of a target only when that weight is initially nonzero and the filter discriminates it from unwanted levels. A degenerate energy selects an eigenspace, not a unique vector. Phase estimation is one example; polynomial filters [LinTong2020,Dong2022] and measurement-based projection [Stetcu2023] provide others. We develop the rodeo algorithm [Choi2021,Qian2024], using one measured and reused ancilla and controlled evolutions of randomly chosen duration. At an exactly known target energy, well-separated unwanted spectral weights are approximately halved per cycle in the unnormalized ensemble. This yields geometric suppression of the accepted ensemble’s infidelity under explicit gap and overlap assumptions.
An ideal energy filter cannot create missing overlap. With initial target weight \(p\), exact resonance and independent repetitions, the acceptance approaches \(p\) as filtering becomes sharp, giving a repetition cost near \(1/p\). This is not an identity at finite cycle count, nor a general lower bound for algorithms using coherent amplitude amplification. An uninformed trial can have exponentially small overlap [Lee2023], while favorable structured problems need not. We therefore first study resolution refinement [Bogner2026]: solve a coarse problem, prolong its state, and follow an interpolation to the fine Hamiltonian. Success requires a suitable prolongation, a controlled coarse-state error and an appropriate gapped path; shared low-energy physics motivates these conditions but does not prove them. The examples then test whether a short refinement followed by filtering is more economical than prolonged adiabatic evolution alone.
The prerequisites are already developed in Chapters 1–3: state amplitudes and conditional measurement, fermionic model spaces and variational energies, and the mappings and controlled rotations needed to implement the Hamiltonians. Chapters 5 and 6 supply finite-resolution filters and trial states, and Chapter 4 the product formulas and the adiabatic evolution along a path of Hamiltonians.
The order of the chapter follows this logic. Section Resolution refinement
develops resolution refinement and runs it on the pairing model of
Section The pairing model, refined from two single-particle levels to
four. Section The rodeo algorithm derives the rodeo algorithm from its
one-ancilla circuit, works through a one-qubit example by hand, and
establishes the convergence criterion. Section Refinement and rodeo together: the pairing model end to end puts
the two together, end to end, on the pairing Hamiltonian with four
particles on four levels, eight qubits in the Jordan–Wigner encoding of
Section The four models on a qubit register, where every stage can be checked against
exact diagonalization. Section The pairing model three ways: rodeo, phase estimation and VQE sets the result
against the variational calculations of Chapter 6 and the
phase-estimation results of Chapter 5 for the same
Hamiltonian, comparing their state-preparation accuracy, evolution time per attempt,
and repetition costs. Section The other three Hamiltonians carries the pipeline over to the
other three Hamiltonians of the book, the Lipkin model, the Heisenberg
ring and the Hubbard ring, each with the resolution hierarchy that suits
it, and to a genuine two-stage lattice refinement. The chapter closes, in
Section Circuits, depth and the bottlenecks of quantum computing, with what is perhaps its most broadly
useful part: explicit gate constructions and counts are given, the
product-formula errors are put back in, the gates are counted, and the
count is held against what quantum hardware can execute. The resulting
budget is an overview, on one fully controlled example, of the
bottlenecks of quantum computing for many-body physics: overlap,
coherent depth, Trotter error, encoding, optimization, and noise. The
programs are in LectureMaterial/BookPrograms/chapter7/, with reproducibility checks and a generated notebook. Exact-diagonalization
information used to assess these small examples is identified explicitly.
Resolution refinement#
The idea#
Every calculation in this book has a resolution. For the pairing model it is the number \(k\) of single-particle levels; for a lattice model it is the lattice spacing; for a nucleus it is the size of the harmonic oscillator basis; for a molecule the size of the orbital basis. The resolution sets the number of qubits, \(2k\) for \(k\) doubly degenerate levels in the Jordan–Wigner encoding, and with it the cost of every gate sequence. Changing resolution generally changes discretization and truncation errors. A useful coarse Hamiltonian approximates the relevant fine-space states after prolongation; achieving this may require effective interactions or retuned couplings. Equality of low-energy physics is an objective, not an automatic consequence of using fewer orbitals. The analogy with classical multigrid is that a coarse solution supplies a useful fine-grid starting point.
Resolution refinement [Bogner2026] is the quantum version of the multigrid idea, and it has three steps:
prepare an eigenstate \(\vert\psi_{\mathrm{low}}\rangle\) of \(\hat{H}_{\mathrm{low}}\) on a small register, by any method; the register is smaller, so variational preparation, phase estimation or classical solution followed by state loading may be feasible; their costs must still be included;
prolong it into the large register, \(\vert\Phi_0\rangle=\hat{P}\vert\psi_{\mathrm{low}}\rangle\), with an isometry \(\hat{P}\) that is cheap to implement;
refine it by evolving adiabatically from a Hamiltonian of which \(\vert\Phi_0\rangle\) is an eigenstate to \(\hat{H}_{\mathrm{high}}\).
The third step is adiabatic preparation, related to the adiabatic origin of QAOA in Section The ansatz and where it comes from. Its cost depends on the path’s gap, derivatives, length and schedule [Albash2018]. Favorable inverse-gap scaling has been obtained for structured refinement families [Bogner2026]; it is not a theorem for arbitrary coarse and fine Hamiltonians. Even identical endpoint spectra do not suffice: with \(P=\mathbb{1}\), \(H_{\mathrm{low}}=-Z\) and \(H_{\mathrm{high}}=Z\), the schedule below has a zero gap at \(s=1/2\). Both endpoints have eigenvalues \(\{-1,1\}\) but orthogonal ground states. Each stage of a refinement hierarchy needs its own symmetry, overlap and gap assessment.
The prolongation operator#
The prolongation \(\hat{P}\) maps the coarse \(N\)-particle space into the fine one. It is an isometry, \(\hat{P}^\dagger\hat{P}=\mathbb{1}\), while \(\hat{P}\hat{P}^\dagger\) is the projector onto the image of the coarse space inside the fine space, and \(\hat{P}^\dagger\) annihilates everything outside that image. The most general form we need acts on the creation operators,
where \(c\) labels coarse and \(f\) fine single-particle states. A coarse Slater determinant with occupied states \(C=\{c_1<\dots<c_N\}\) is then mapped, by expanding the product of the \(N\) sums and using the anticommutation relations, to
with \(W_{FC}\) the \(N\times N\) submatrix of \(W\) with rows \(F\) and columns
\(C\). This is the formula behind the method orbital of Prolongation in
refinement.py. Two special cases cover everything in this
chapter.
Basis refinement. When the fine basis contains the coarse one, as for the pairing model with \(k_{\mathrm{low}}<k_{\mathrm{high}}\) levels, \(W\) is a rectangular identity: every coarse level is the fine level with the same label and the new levels are left empty. With the mode ordering of Chapter 3, mode \(2p+s_\sigma\) for level \(p\), with spin index \(s_+=0\), \(s_-=1\), the prolonged register is the coarse register followed by \(2(k_{\mathrm{high}}-k_{\mathrm{low}})\) qubits in \(\vert 0\rangle\),
and the Jordan–Wigner strings of the old modes do not reach the new qubits. Appending initialized vacuum qubits costs no additional unitary gates. A different orbital ordering can require fermionic swaps or rotations. For the nested pairing Hamiltonians with unchanged couplings, \(\hat{H}_{\mathrm{high}}\) restricted to states with the new levels empty is \(\hat{H}_{\mathrm{low}}\); the prolonged state has \(\langle\Phi_0\vert\hat{H}_{\mathrm{high}}\vert\Phi_0\rangle=E_{\mathrm{low}}\) exactly.
Lattice refinement. When a lattice is refined by halving its spacing, a particle on coarse site \(c\) is distributed over the two fine sites \(2c\) and \(2c+1\) that replace it, \(W_{2c,c}=W_{2c+1,c}=1/\sqrt2\). With a compatible local mode ordering, this is a single-excitation rotation of the kind met in Section Reference states and fermionic rotations between two neighboring qubits, a constant number of gates per site, so that the prolongation costs \(\bigO(N_{\mathrm{sites}})\) gates per spatial direction [Bogner2026]. The energy scale changes with the lattice spacing, so \(\langle\Phi_0\vert\hat{H}_{\mathrm{high}}\vert\Phi_0\rangle\) is no longer \(E_{\mathrm{low}}\); Section The other three Hamiltonians returns to this.
The refinement path#
The prolonged state is refined by following the ground state of the interpolated, energy-shifted Hamiltonian
from \(s=0\) to \(s=1\) in a total time \(T\). Three features of this expression deserve a comment.
The first is the shift \(\mu\). At \(s=0\) the Hamiltonian is \(\hat{P}(\hat{H}_{\mathrm{low}}-\mu)\hat{P}^\dagger\). On the image of the coarse space it has the eigenvalues \(E^{\mathrm{low}}_j-\mu\); on everything else, a space that is exponentially larger, it vanishes. If the coarse ground state is to be the ground state of \(\hat{H}(0)\), and separated from that enormous null space by a gap, it must have a negative eigenvalue, which requires \(\mu>E_{\mathrm{low}}\). We write
with \(\mu_{\mathrm{buf}}>0\). For an exact, nondegenerate coarse ground state and a nonempty complement of the image of \(P\), the initial gap is
omitting the coarse excitation gap when the coarse space is one-dimensional. Increasing \(\mu\) does not reorder the coarse levels; the buffer need not be the smallest gap of the full path.
If the prepared coarse state is approximate, its expectation \(E_{\mathrm{low}}=\langle H_{\mathrm{low}}\rangle\) can still define a shift, but that shift does not turn it into an eigenstate. A useful simulation diagnostic is the residual \(\|(H_{\mathrm{low}}-E_{\mathrm{low}})\psi_{\mathrm{low}}\|\) and its weight in the coarse ground eigenspace. In the adiabatic limit, excited components generally follow excited branches rather than disappear. The code reports these diagnostics for the multistage example.
The second is the schedule. The functions \(\cos^2\) and \(\sin^2\) add to one, and both have zero slope at the two ends of the path, so that the Hamiltonian changes slowly where the adiabatic evolution begins and ends. The adiabatic theorem explains why this matters. For a state \(\vert n(s)\rangle\) that follows the instantaneous ground state, the amplitude for a transition to the instantaneous level \(m\) is, to first order in \(1/T\),
Here the instantaneous eigenvectors use a parallel-transport gauge. Differentiating their eigenvalue equation gives
Inserting this identity into \(c_m=-\int\langle m|\partial_s n\rangle e^{iT\int(E_m-E_n)}ds\) gives the positive sign displayed above. Writing \(\Delta_{mn}=E_m-E_n\) and \(A_{mn}=\langle m|\partial_sH|n\rangle\), integration by parts gives
A finite gap and bounded derivatives are essential. With sufficient smoothness and vanishing endpoint derivatives, another integration by parts gives an \(O(T^{-2})\) transition amplitude and an \(O(T^{-4})\) infidelity bound for a fixed finite-dimensional path. This is not a general exponential convergence law. An estimate such as \(T\gg\|\partial_sH\|/\Delta_{\min}^2\) also contains matrix-element and derivative scales. Reducing it to inverse-gap behavior requires additional control of those scales. The buffer scan below is a finite numerical example, not a universal scaling proof.
For comparison with the linear-path analysis of Ref. [Bogner2026], put \(V=H(1)-H(0)\) and define
For a fixed smooth gapped family, the leading boundary estimate gives \(1-\mathcal F\lesssim4B/(T^2\Delta_{\min}^2)\), with higher-order terms requiring control of path derivatives. Thus inverse-gap scaling at fixed infidelity is plausible when \(B\) and the remainder constants remain controlled as the gap or system size changes. This states the extra refinement condition explicitly; the endpoint-smoothed schedule used here has different leading boundary behavior.
The third is the cost of one time step. On a quantum computer the evolution is a product of short-time propagators \(e^{-i\hat{H}(s_j)\Delta t}\), each split by a product formula as in Eq. (3.47). The second term of Eq. (7.4) is the fine Hamiltonian with a rescaled time step. The first term is the coarse Hamiltonian acting on the old qubits, multiplied by the projector onto the new qubits being empty, \(\hat{P}\hat{P}^\dagger=\prod_{q\,\mathrm{new}}(1-n_q)\); in the simplest case below it reduces to a multiply controlled phase. We count its gates in Section Circuits, depth and the bottlenecks of quantum computing. Until then the slices \(e^{-i\hat{H}(s_j)\Delta t}\) are applied exactly, so that the properties of the path can be separated from the errors of the product formula. Exact exponentials within midpoint slices still approximate the time-ordered evolution. Slice convergence must be checked separately; likewise, the reported minimum gaps are minima on a sampled grid, not certified bounds on the continuous path.
A first example: the pairing model from two levels to four#
The pairing Hamiltonian of Eq. (3.29) has \(k\) doubly degenerate levels with spacing \(\xi=1\) and a pairing force of strength \(g\) that scatters time-reversed pairs between the levels,
where we label the levels from zero, so that level \(p\) and spin \(\sigma\) corresponds to mode \(2p+s_\sigma\), with \(s_+=0\) and \(s_-=1\). It is the natural laboratory for this chapter. It conserves the number of broken pairs, the seniority, and for the attractive pairing cases studied here the ground state of an even number of particles lives in the small space of pair configurations; it is exactly solvable by the Richardson equations [Richardson1963,Dukelsky2004]; and “resolution” has an obvious meaning, the number of levels \(k\) at fixed particle number \(N\). With \(N=4\) the \(N\)-particle sector has dimension \(\binom{2k}{4}\): one state at \(k=2\), where the two lowest levels are simply full, \(15\) at \(k=3\), \(70\) at \(k=4\) and \(1820\) at \(k=8\), on \(2k\) qubits. The Hartree–Fock determinant fills the two lowest levels and has the energy \(2\xi-g=1\) at \(g=1\), whatever \(k\).
For \(N=4\) and \(k_{\mathrm{low}}=2\) the coarse space is that single determinant. The “coarse solver” has nothing to do, the prolonged state is the Hartree–Fock determinant of the larger space, and \(\hat{P}(\hat{H}_{\mathrm{low}}-\mu)\hat{P}^\dagger =-\mu_{\mathrm{buf}}\vert\Phi_0\rangle\langle\Phi_0\vert\) is a projector. This is the simplest possible instance, and a good one to start from because it isolates the path; a coarse stage that does real work follows in Section Two chains to the same state. For \(N=2\) the coarse space has six states and the coarse ground state is already correlated. In the programs the whole calculation is three lines:
from refinement import pairing_refinement
rr = pairing_refinement(k_low=2, k_high=4, N=4, g=1.0, buffer=0.6)
print(rr.overlap(rr.phi0), rr.energy(rr.phi0)) # 0.8676 1.0 (= E_low)
psi = rr.evolve(T=30, n_steps=160) # exact slices of Eq. (8.path)
print(rr.overlap(psi), rr.energy(psi), rr.E_high, rr.min_gap())
0.8676375677137009 1.0
0.9987571885676829 0.63965368653837 0.635548473575598 0.6000000000000001
which prints the overlap \(0.9988\), the energy \(0.6397\) against the exact \(E_0=0.635548\), and the minimum gap \(0.600\).

Figure 7.1: Resolution refinement of the pairing model from \(k=2\) to \(k=4\) levels at \(g=1\), \(\mu_{\mathrm{buf}}=0.6\). Left: the missing overlap \(1-p\) of the evolved state with the exact ground state against the total adiabatic time \(T\), for two and four particles. Right: the lowest eigenvalues of \(\hat{H}(s)\) of Eq. (7.4) for \(N=4\); the tracked level (thick) starts at \(-\mu_{\mathrm{buf}}\) below the null space of \(\hat{P}^\dagger\) and stays separated from it along the whole path. Produced by refinement.py.

Figure 7.2: Four particles refined from \(k=2\) to \(k_{\mathrm{high}}=3\) and \(4\): overlap (left) and energy \(\langle\hat{H}_{\mathrm{high}}\rangle\) (right) against \(T\). The energy approaches the exact value (dotted) from above, as it must for any state, while the overlap approaches one. Produced by refinement.py.
Figure 7.1 shows what happens. The prolonged state already has an overlap of \(0.963\) with the \(k=4\) ground state for two particles and \(0.868\) for four; this is the multigrid effect, the coarse solution is a good first guess. Over the displayed interval the missing overlap decreases rapidly, by a factor of a hundred between \(T=0\) and \(T=30\) for \(N=4\), where \(p=0.9988\). The right panel shows why this works: the tracked level starts at \(-\mu_{\mathrm{buf}}=-0.6\), all other levels start at zero, and the sampled gap never falls below its initial value. Figure 7.2 adds the energy and the intermediate resolution \(k=3\): the prolonged overlaps are \(0.917\) and \(0.868\), the overlaps at \(T=30\) are \(0.9994\) and \(0.9988\), and the energies \(0.7964\) and \(0.6397\) sit above the exact \(0.794697\) and \(0.635548\). The larger space starts with less overlap and converges more slowly in this comparison; two sizes do not establish a size-scaling law. The time to reach an overlap of \(0.99\), which we call \(T^*\), is \(12\) for \(k=3\) and \(16\) for \(k=4\). The program requires the threshold at a grid point and at the next three points; this is a sampled operational definition.
Long-time checks give \(1-p=1.4\times10^{-4}\) at \(T=50\), \(2.9\times10^{-5}\) at \(T=70\) and \(4.0\times10^{-6}\) at \(T=110\), using eight midpoint slices per unit time. Extrapolating a straight line from the short-time logarithmic plot would underestimate the time needed for the last digits. Filtering supplies another way to reduce this tail.
What sets the time: the gap, and the state one starts from#
We can test the sensitivity to the buffer directly. The right panel of Fig. 7.3 varies \(\mu_{\mathrm{buf}}\) from \(0.3\) to \(1.5\) at \(g=1\). The sampled minimum gap is close to the buffer and \(T^*\) falls from \(42\) to \(5\). The fit \(T^*\simeq13.9/\Delta E_{\min}-5.7\) describes these seven operating points. Its negative intercept and limited range make extrapolation inappropriate. Increasing the buffer also changes the path derivatives and simulation cost; it need not monotonically improve an arbitrary refinement.

Figure 7.3: Left: the adiabatic time \(T^*\) needed for an overlap of \(0.99\) in the refinement \(k=2\to4\) (\(N=4\), \(\mu_{\mathrm{buf}}=0.6\)) against the pairing strength \(g\); the labels are the overlaps of the prolonged state. The minimum gap stays close to \(0.6\) throughout, and \(T^*\) grows while the starting overlap falls; the path matrix elements also change. Right: \(T^*\) against the inverse minimum gap, varied through the buffer at \(g=1\), with a linear fit. Produced by pairing_pipeline.py.
The left panel varies the physics instead. From \(g=0.3\) to \(g=4\) at a fixed buffer the minimum gap hardly moves, from \(0.600\) to \(0.568\), but \(T^*\) grows from \(1\) to \(51\). What changes is the overlap of the prolonged state, which falls from \(0.99\) to \(0.38\) as the pairing correlations spread the ground state over more and more levels: at a fixed gap, a poorer starting state has more rearranging to do through the same bottleneck. In this scan poor prolonged overlap is a useful diagnostic, although it alone does not determine the time. One possible improvement is to start higher in the resolution hierarchy, where the coarse state already contains the correlations; Section Two chains to the same state does so.
A remark on fairness. Resolution refinement is not the only gapped
adiabatic path to the pairing ground state. One can stay at \(k=4\)
throughout and ramp the coupling, \(\hat{H}(s)=\hat{H}(g=0)+s\,\hat{V}\),
starting from the Hartree–Fock determinant, and for this model the ramp
is excellent: refinement.py finds \(p=0.9994\) at \(T=10\), where
the refinement with \(\mu_{\mathrm{buf}}=0.6\) has \(0.977\). The reason is
that the uncorrelated pairing model has a gap of \(2\xi\) within the invariant
seniority-zero sector (the full fixed-\(N\) sector has gap \(\xi\)), larger than any
buffer we used, and no level crossing on the way to \(g=1\). The example
is a reminder that an adiabatic method is as good as its path and that
paths should be compared. A coupling ramp needs a preparable starting state and a suitable path;
refinement needs a suitable coarse problem and prolongation. Neither
choice has a general gap guarantee for realistic many-body systems.
Exercise 7.3 explores this comparison.
The rodeo algorithm#
One cycle#
Recall the one-control-qubit form of phase estimation, Section Phase estimation with one control qubit: a Hadamard gate on the ancilla, a controlled power of \(U=e^{-i\hat{H}t}\), a phase rotation, a second Hadamard gate, and a measurement whose outcome is read as one bit of the phase. The rodeo algorithm [Choi2021] uses the same circuit, Fig. 7.4, and asks a different question of it. It does not try to read the energy from the ancilla. It chooses an energy \(E\), encodes it in the phase rotation, and uses the measurement outcome to decide whether the system register is kept.

Figure 7.4: One cycle of the rodeo algorithm. The ancilla is put in superposition, controls the time evolution of the \(n\)-qubit system register for a time \(t_k\), receives the phase \(P(Et_k)=\mathrm{diag}(1,e^{iEt_k})\) that encodes the target energy \(E\), and is measured after a second Hadamard gate. The ancilla is then reset and reused. A run is accepted if all \(M\) outcomes are \(0\).
Follow the register through the circuit. After the first Hadamard gate and the controlled evolution the state is \(\big(\vert 0\rangle\vert\psi\rangle+\vert 1\rangle e^{-i\hat{H}t}\vert\psi\rangle\big)/\sqrt2\). The phase gate multiplies the second term by \(e^{iEt}\), and the second Hadamard gate gives
A measurement of the ancilla with outcome \(0\) therefore applies to the system register the non-unitary operator
which is the reason for the phase gate: it shifts the Hamiltonian by the target energy. Like the power method of Section The power method and its quantum relatives, the cycle applies a function of \(\hat{H}\) that favors the wanted eigenvalue. On an eigenstate,
so that the outcome \(0\) occurs with probability
and leaves the eigenstate unchanged. If \(E=E_j\) the outcome is \(0\) with certainty, for every \(t\). If \(E\neq E_j\) it is \(0\) or \(1\) with probabilities that oscillate in \(t\). For a general input \(\vert\psi\rangle=\sum_jc_j\vert E_j\rangle\) the outcome \(0\) has the probability \(\sum_j\vert c_j\vert^2\cos^2[(E_j-E)t/2]\) and rescales every amplitude by \(e^{-i(E_j-E)t/2}\cos[(E_j-E)t/2]\) before normalization: components at the target energy pass untouched, the others are reduced.
Many cycles and random times#
A single cosine is a poor filter, since it returns to one periodically. The remedy is to repeat the cycle \(M\) times with different times \(t_1,\dots,t_M\). The filters of Eq. (7.13) commute with one another, being functions of \(\hat{H}\), so that the probability of the all-zero record for an eigenstate input is the product
Random times suppress recurring pass bands within a finite energy interval; a finite sequence does not give uniform suppression over an unbounded spectrum. Choi et al. [Choi2021] draw the times from a Gaussian distribution of zero mean and width \(\sigma\). Averaging one factor with \(\cos^2x=(1+\cos2x)/2\) and \(\langle\cos(\omega t)\rangle=e^{-\omega^2\sigma^2/2}\) gives
and since the times are independent,
For resolved levels this produces peaks near the energies present in the input. Their finite-\(M\) heights include leakage from other levels; only as the unwanted factors vanish do they approach the spectral weights. Overlapping peaks can also shift the maximum. Near an isolated level, \(f(\delta)^M\simeq\exp(-M\sigma^2\delta^2/4)\), so the central full width at half maximum is approximately \(4\sqrt{\ln2}/(\sigma\sqrt M)\) after neglecting the background. Far from all levels the background approaches \(2^{-M}\).
This linewidth is not an energy-estimation confidence interval. A scan requires an energy grid, repeated preparations and measurement shots at each grid point. The mean absolute evolution time of a full attempt is \(M\sigma\sqrt{2/\pi}\); Gaussian times have no finite worst-case cutoff. The scans below average exact probabilities over time sets and therefore exclude finite-shot noise. Their finely interpolated maxima should not be interpreted as experimental energy precision.
One qubit, worked through#
The smallest example is the one that Chapters 5 and 6 also used: the two-level pairing Hamiltonian with one pair, tapered to a single qubit in Eq. (3.80), \(\hat{H}=\tfrac12\mathbb{1}+Z-\tfrac12X\), with the eigenvalues \(E_{0,1}=(1\mp\sqrt5)/2=-0.618034\) and \(1.618034\). The controlled evolution is a controlled single-qubit rotation and the whole rodeo circuit has two qubits. Take the input \(\vert{+}\rangle\), whose weights on the two eigenstates are \(p=\vert c_0\vert^2=0.7236\) and \(0.2764\), and \(\sigma=3\). The gap is \(\sqrt5\), so \(e^{-5\sigma^2/2}\approx10^{-10}\) and \(f(E_1-E_0)=\tfrac12\) to all digits: every cycle at \(E=E_0\) halves the excited component on average. Equation (7.18) predicts the peak heights
that is \(0.862\) and \(0.638\) for \(M=1\), \(0.758\) and \(0.367\) for \(M=3\), \(0.728\) and \(0.288\) for \(M=6\), over a background of \(0.5\), \(0.125\) and \(0.016\). The left panel of Fig. 7.5 shows the scan, averaged over three hundred sets of random times, on top of the formula. With one cycle the “spectrum” is two bumps on a pedestal of one half; with six it is two clean peaks whose heights are the weights of the input state.

Figure 7.5: The rodeo algorithm on the one-qubit Hamiltonian \(\tfrac12\mathbb{1}+Z-\tfrac12X\) with the input \(\vert{+}\rangle\) and \(\sigma=3\). Left: the all-zero probability against the target energy for \(M=1,3,6\) cycles, averaged over \(300\) sets of Gaussian times (full lines), and Eq. (7.18) (dotted); the vertical lines are the exact eigenvalues. Right: the infidelity of the accepted runs at \(E=E_0\) against \(M\), from \(2000\) sampled time sets, from the exact average of Eq. (7.20), and the estimate of Eq. (7.21). Produced by rodeo.py.
It is instructive to run the algorithm as a device would, sampling each
ancilla outcome with its Born probability and carrying the collapsed
register to the next cycle. With \(E=E_0\) and \(M=6\), the first eight runs
of rodeo.py produce six records \(000000\), with fidelities
between \(0.991\) and \(1.000000\) with the ground state, and two records
containing a \(1\), which are discarded; over four thousand runs the
accepted fraction is \(0.730\), against the prediction \(0.728\). An accepted run is heralded: the record identifies the accepted
branch. It does not certify the fidelity of that individual state.
A time set containing only very small times can accept almost the
unfiltered input. The fidelity derived next is that of the
acceptance-weighted ensemble, with independently redrawn times;
it is not an unweighted average of normalized trajectories. Rejected
attempts consume the state-preparation cost and all gates executed before
rejection.
The program also verifies the two facts on which everything rests: that the circuit of Fig. 7.4, simulated gate by gate on the joint register, reproduces the filter of Eq. (7.13) to \(10^{-16}\) for a random sixteen-dimensional Hamiltonian, and that the sampled Gaussian average agrees with Eq. (7.17).
Eigenstate preparation and the convergence criterion#
Set \(E=E_0\). Equation (7.18) becomes the acceptance probability after \(M\) cycles,
in which the target weight is preserved at every cycle while all other weights decay geometrically. The accepted ensemble has the fidelity \(\mathcal{F}_M=p/P_M\) with the target. If \(\sigma\) is large compared with the inverse of the gap between \(E_0\) and the nearest level that carries weight, each unwanted \(f\) is approximately one half, giving the useful approximation
The rigorous bound uses \(f_{\max}=\tfrac12(1+e^{-\Delta^2\sigma^2/2})\), where \(\Delta>0\) is the distance to the nearest unwanted occupied energy:
At any finite \(\sigma\), \(f_{\max}>1/2\), so replacing it by \(1/2\) is an approximation, not a strict bound. For degeneracy, \(p\) is the weight in the entire target eigenspace. Filtering cannot select one vector within that space or prepare an absent component.
The right panel of Fig. 7.5 shows the three versions for the one-qubit example, where \(1-\mathcal{F}_M=0.160,\,0.046,\,5.9\times10^{-3},\,3.7\times10^{-4}\) for \(M=1,3,6,10\).
For \(0<p<1\), \(0<\delta<1\), a sufficient cycle count in the large-gap approximation is
cycles. For a rigorous sufficient count replace the logarithm by \(\ln[(1-p)/(p\delta)]/[-\ln f_{\max}]\), round up and clamp at zero. For \(p=1\) no filtering is needed; for \(p=0\) it cannot succeed. The acceptance probability tends to \(p\), so that the expected number of attempts is \(1/P_M\), approaching \(1/p\), and the total time of controlled evolution per accepted state is of the order of \(M\sigma/p\sim\vert\log\delta\vert/(p\,\epsilon)\) at an energy resolution \(\epsilon\) [Choi2021]. And the whole construction is efficient precisely when \(p\) is not small. With \(p=0.9988\) the algorithm succeeds on almost every attempt and starts from an infidelity that is already \(10^{-3}\); with \(p=10^{-6}\) it would need a million attempts and twenty additional cycles. The filter is only as good as the state it is given, which is why this chapter began with refinement.
Detuning and restart costs. If \(E=E_0+\eta\) is imperfectly known, define \(f_j=f(E_j-E)\). Then
The intended level must be closer to \(E\) than all unwanted occupied levels for their ratios to decay. Off resonance \(f_0<1\), so acceptance ultimately vanishes even if the conditional fidelity improves. An energy between two equally distant levels does not distinguish them. Low acceptance can reveal a problem, but high acceptance is not proof of the intended state or a correct implementation.
Let \(C_{\mathrm{prep}}\) be a preparation cost in evolution-time units and \(P_0=1\). If we restart immediately after the first rejected cycle, the expected cost per accepted output is
The \(k\)th survival probability is the probability of paying for cycle \(k+1\). This assumes fresh independent Gaussian times and counts absolute evolution duration, including negative times implemented by inverse evolution. A gate budget uses the corresponding mean gate cost per cycle and adds measurements, resets and synthesis. Energy scans are an additional task. The simpler full-attempt cost \((C_{\mathrm{prep}}+M\sigma\sqrt{2/\pi})/P_M\) is an upper estimate.
If an identity term \(h_I\mathbb{1}\) is removed from \(H\) in the controlled evolution, the ancilla phase must use \(E-h_I\). Otherwise a seemingly global system phase becomes an incorrect relative ancilla phase, exactly the issue discussed in Chapter 5.
The Gaussian distribution is a convenient choice rather than an optimal one. Equation (7.14) shows that a cycle of duration \(t=\pi/(E_j-E)\) removes the level \(E_j\) exactly, so that when the levels carrying weight are few and their energies are known, to sufficient accuracy, a handful of chosen times does better than many random ones. Deterministic and geometric sequences of times have been optimized for the general case [Cohen2023,Patkowski2026]. We shall see the effect in Section Filtering the refined state.
Using the class. RodeoFilter in rodeo.py takes a
Hermitian matrix and the width \(\sigma\); its methods are the circuit
(cycle_ancilla), the filter (cycle), the scan, the
preparation statistics and a sampled run:
import numpy as np
from rodeo import RodeoFilter
H = np.array([[1.5, -0.5], [-0.5, -0.5]]) # I/2 + Z - X/2
rf = RodeoFilter(H, sigma=3.0, rng=np.random.default_rng(8))
plus = np.array([1.0, 1.0]) / np.sqrt(2)
E0 = rf.w[0] # exact eigenvalues are kept in rf.w
print(rf.scan(plus, [E0, 0.5, rf.w[1]], M=6, n_sets=300))
infidelity, acceptance = rf.expected(plus, E0, M=10) # Eq. (8.PM)
record, state = rf.run(plus, E0, M=6) # one run with sampled outcomes
print(record, abs(rf.V[:, 0] @ state) ** 2)
[0.72870704 0.01865007 0.28974581]
[0, 0, 0, 0, 0, 0] 0.9669079068282486
Refinement and rodeo together: the pairing model end to end#
We now assemble the pipeline on the pairing Hamiltonian of Eq. (7.11) with \(N=4\) particles, \(g=1\) and the target resolution \(k=4\): eight system qubits in the Jordan–Wigner encoding with one qubit per spin orbital, Eq. (3.75), and a ground-state energy \(E_0=0.635548\). The stages are a coarse solver, the prolongation, the refinement and the filter. Each is validated against exact diagonalization in the four-particle sector, which has \(70\) states. The compact encoding of Eq. (3.78), one qubit per level, which Chapters 5 and 6 used for the same Hamiltonian, would halve the register; we keep the full encoding here because it is the one that generalizes to Hamiltonians without a seniority symmetry, and return to the compact one in Sections The pairing model three ways: rodeo, phase estimation and VQE and Circuits, depth and the bottlenecks of quantum computing, where the difference between the two turns out to be a factor of ten in gates.
The coarse solver#
Any method that prepares a low-resolution eigenstate will do for the first stage. We use the variational eigensolver of Chapter 6 with the unitary coupled-cluster ansatz of Eq. (6.9), restricted to single and double excitations of the Hartree–Fock determinant and written as a product,
with generators applied in the listed order, singles first (the first
applied exponential is the rightmost matrix factor). Every factor is a circuit of Pauli rotations,
Section A first variational circuit: unitary coupled cluster for the pairing model, and every generator
\(\hat{A}=\hat{\tau}-\hat{\tau}^\dagger\) obeys \(\hat{A}^3=-\hat{A}\), so
that \(e^{\theta\hat{A}}=\mathbb{1}+\sin\theta\,\hat{A}+(1-\cos\theta)\hat{A}^2\)
can be applied to a vector of the \(N\)-particle sector without forming a
matrix. The spectrum of \(i\hat{A}\) is \(\{-1,0,1\}\), which is the case in
which the two-term parameter-shift rule fails,
Section When two terms are not enough; uccsd_sector.py computes the
exact gradient from one forward and one backward sweep through the
product instead. This is a classical state-vector adjoint calculation,
not a two-circuit gradient measurement on quantum hardware; the more
general shift rules of Chapter 6 apply there. This lets one program run from \(k=2\) to \(k=8\), sixteen
qubits, in a few seconds.
\(k\) |
qubits |
dim |
FCI |
CCD |
UCCSD |
parameters |
CNOTs |
|---|---|---|---|---|---|---|---|
\(2\) |
\(4\) |
\(1\) |
\(1.000000\) |
\(1.000000\) |
\(1.000000\) |
\(0\) |
\(0\) |
\(3\) |
\(6\) |
\(15\) |
\(0.794697\) |
\(0.794697\) |
\(0.794697\) |
\(8\) |
\(272\) |
\(4\) |
\(8\) |
\(70\) |
\(0.635548\) |
\(0.630443\) |
\(0.636987\) |
\(26\) |
\(1312\) |
\(5\) |
\(10\) |
\(210\) |
\(0.497768\) |
\(0.484977\) |
\(0.501278\) |
\(54\) |
|
\(6\) |
\(12\) |
\(495\) |
\(0.372664\) |
\(0.350058\) |
\(0.378719\) |
\(92\) |
|
\(7\) |
\(14\) |
\(1001\) |
\(0.256052\) |
\(0.221608\) |
\(0.265052\) |
\(140\) |
|
\(8\) |
\(16\) |
\(1820\) |
\(0.145559\) |
\(0.097263\) |
\(0.157856\) |
\(198\) |
Table 7.1: Ground-state energies of the pairing model with \(N=4\), \(g=1\)
against the number of levels \(k\): exact diagonalization in the
\(N\)-particle sector (FCI), coupled-cluster doubles of
Section The CCD equations (CCD), and the product-form UCCSD of
Eq. (7.26) optimized from \(\vec{\theta}=0\), with its number
of parameters and the unpruned CNOT count of the state-preparation circuit in
the Jordan–Wigner encoding. Produced by uccsd_sector.py and
gate_budget.py.

Figure 7.6: The coarse solvers against the number of levels (\(N=4\), \(g=1\)). Left: ground-state energies. Right: deviations from exact diagonalization; the UCCSD energy lies above the exact one and the CCD energy below. Produced by uccsd_sector.py.
Table 7.1 and Fig. 7.6 show what the solver delivers. At \(k=3\) it is exact to machine precision: there are two pair configurations beyond the reference and the ansatz reaches both. From \(k=4\) on it is a variational upper bound whose error grows slowly, from \(1.4\times10^{-3}\) at \(k=4\) to \(1.2\times10^{-2}\) at \(k=8\), while the non-variational CCD of Chapter 3 overbinds by an amount three to four times larger. The singles amplitudes vanish to machine precision at every \(k\). The pairing force cannot change the seniority, so that a single excitation of the Hartree–Fock state has no matrix element with anything the Hamiltonian connects to the reference, and the solver is in effect a doubles theory, like its classical counterpart for this initialization and symmetry. The last column counts the full template before eliminating zero-angle rotations: \(272\) CNOT gates at \(k=3\) and \(1312\) at \(k=4\). Section Building blocks shows where these numbers come from. The point for now is that the cheap resolutions are the low ones, which is the premise of refinement.
Two chains to the same state#
With \(N=4\) the chain \(k=2\to4\) of Section A first example: the pairing model from two levels to four has a coarse stage that does no work. To exercise the pipeline properly we also start from \(k=3\): the \(272\)-CNOT variational state of Table 7.1 is prolonged into the \(k=4\) register and refined along the same path, with the shift of Eq. (7.5) referenced to the variational coarse energy. Figure 7.7 compares the two chains. The better coarse start raises the prolonged overlap from \(0.868\) to \(0.964\) and halves the refinement time, \(T^*=8\) instead of \(16\). This improves the sampled evolution time, but a complete cost comparison must also compile the \(k=3\) coarse-path Hamiltonian, whose embedded term is more complicated than the rank-one \(k=2\) projector. One cannot price both paths using the \(k=2\) step count. Coarse optimization, state loading and the remaining error budget also matter. The \(272\)-CNOT coarse template has only two active pair transfers here, costing \(96\) CNOTs after pruning.

Figure 7.7: Two refinement chains to the \(k=4\) ground state (\(N=4\), \(g=1\), \(\mu_{\mathrm{buf}}=0.6\)): from the gate-free \(k=2\) determinant and from the UCCSD state at \(k=3\). Left: overlap against the adiabatic time; right: the missing overlap on a logarithmic scale. The dotted line marks \(p=0.99\). Produced by pairing_pipeline.py.
Filtering the refined state#
The state handed to the rodeo algorithm is the output of the chain \(2\to4\) at \(T=30\), with \(p=0.9988\). For contrast we also filter the merely prolonged state, \(p=0.8676\). The spectral content of the latter is instructive: the seventy-dimensional sector has five occupied energies (with weights summed within degenerate eigenspaces), \(0.636\), \(2.935\), \(5.000\), \(7.209\) and \(9.220\) with the weights \(0.868\), \(0.106\), \(0.024\), \(0.0015\) and \(0.0007\). The occupied components are in the seniority-zero subspace: the input has no broken pairs and neither the refinement nor the filter can break one. The dynamics of the pairing pipeline takes place in the six-dimensional space of pair configurations, even though the register has \(2^8\) states.

Figure 7.8: Rodeo energy scans of the \(k=4\) pairing model with \(M=4\) cycles. Left: a coarse scan (\(\sigma=2\)) of the prolonged and of the refined state; the dotted lines are the exact eigenvalues that carry weight in the prolonged state and the dashed line is the background \(2^{-M}\). Right: a fine scan (\(\sigma=8\)) of the refined state around the ground-state peak. Produced by pairing_pipeline.py.
Figure 7.8 scans the target energy. With \(\sigma=2\) and four cycles the scan of the prolonged state is a spectrum: a peak of height approximately \(0.88\) at the ground state and smaller peaks at the excited pair energies. Their finite-cycle heights include leakage from other levels, over the background \(2^{-4}\). The scan of the refined state shows one peak; the rest is background, since the refinement has already removed the excited components to the level of \(10^{-3}\). A finer scan with \(\sigma=8\) locates the peak at \(E=0.6355\), against the exact \(0.635548\). The scan is how the algorithm would be used when \(E_0\) is not known: coarse first, to find the peak, then fine, to fix the energy at which the filter is run.
refined input |
prolonged input |
|||
|---|---|---|---|---|
\(M\) |
\(1-\mathcal{F}_M\) |
\(P_M\) |
\(1-\mathcal{F}_M\) |
\(P_M\) |
\(0\) |
\(1.2\times10^{-3}\) |
\(1\) |
\(1.3\times10^{-1}\) |
\(1\) |
\(1\) |
\(6.2\times10^{-4}\) |
\(0.9994\) |
\(7.1\times10^{-2}\) |
\(0.9338\) |
\(2\) |
\(3.1\times10^{-4}\) |
\(0.9991\) |
\(3.7\times10^{-2}\) |
\(0.9007\) |
\(4\) |
\(7.8\times10^{-5}\) |
\(0.9988\) |
\(9.4\times10^{-3}\) |
\(0.8759\) |
\(6\) |
\(1.9\times10^{-5}\) |
\(0.9988\) |
\(2.4\times10^{-3}\) |
\(0.8697\) |
\(8\) |
\(4.9\times10^{-6}\) |
\(0.9988\) |
\(6.0\times10^{-4}\) |
\(0.8682\) |
Table 7.2: Rodeo preparation of the \(k=4\) pairing ground state at
\(E=E_0\) with Gaussian times, \(\sigma=4\): infidelity of the accepted
runs and acceptance probability from Eq. (7.20), for the
refined input (\(p=0.9988\)) and the prolonged input (\(p=0.8676\)).
Produced by pairing_pipeline.py.

Figure 7.9: Rodeo preparation at \(E=E_0\), \(\sigma=4\). Left: infidelity of the accepted runs against the number of cycles for the two inputs; full lines are the exact Gaussian average of Eq. (7.20), points are \(300\) sampled sets of times, dotted lines the estimate \(\frac{1-p}{p}2^{-M}\) of Eq. (7.21). Right: the acceptance probability converges to the input overlap \(p\) (dotted). Produced by pairing_pipeline.py.
Table 7.2 and Fig. 7.9 fix \(E=E_0\) and count cycles. Both inputs lose a factor of two in infidelity per cycle approximately, as Eq. (7.21) predicts, and the acceptance settles at \(p\). The difference between them is where they start and what they cost. The refined input starts at \(1.2\times10^{-3}\), reaches \(4.9\times10^{-6}\) in eight cycles and is accepted \(999\) times in a thousand. The prolonged input reaches \(6.0\times10^{-4}\) in the same eight cycles, about twice as accurate as the refined input before filtering, and is rejected in one attempt out of seven. The long-time refinement calculation gives \(2.9\times10^{-5}\) at \(T=70\) and \(4.0\times10^{-6}\) at \(T=110\). The eight rodeo cycles add a mean duration \(8\sigma\sqrt{2/\pi}\simeq26\) to the refinement time \(T=30\), before repetition and scanning costs. Eight further cycles approximately divide the remaining infidelity by \(256\); they do not in general square it.
Random times are not the best one can do here. Only a few levels carry weight, the exact diagonalization supplies their energies for this benchmark. A cycle with \(t_j=\pi/(E_j-E_0)\) removes the level \(E_j\) exactly. Three such cycles, aimed at the levels \(2.935\), \(5.000\) and \(7.209\) with \(t=1.366\), \(0.720\) and \(0.478\), take the refined input to an infidelity of \(5.3\times10^{-6}\) and the prolonged one to \(1.4\times10^{-4}\), with the acceptances \(0.9988\) and \(0.868\): approximately the refined-input accuracy of eight Gaussian cycles in three, and in a tenth of the evolution time. The general lesson is that the time distribution is a resource to be optimized [Cohen2023,Patkowski2026], and that prior knowledge of the spectrum can be valuable. The chosen-time numbers use exact spectral information, whereas a finite-shot scan supplies only estimates; Exercise 7.5 tests the sensitivity to those errors.
The pairing model three ways: rodeo, phase estimation and VQE#
The pairing model with four levels and two pairs has now been treated by three quantum algorithms: phase estimation in Section Phase estimation on the models, the variational eigensolver in Section Ansätze that know the physics and in Table 7.1, and the refinement–rodeo pipeline. Section Phase estimation and VQE weighed against each other weighed the first two against each other as ways of obtaining an energy. Here we compare all three as ways of obtaining a state, which is what a calculation of any observable other than the energy needs.
Phase estimation as a filter#
Phase estimation with \(m\) control qubits also filters. When the control register is read and returns the integer \(y\), the component \(\vert E_j\rangle\) of the system register is multiplied by the amplitude of Eq. (5.27),
whose modulus squared is the Dirichlet kernel of Eq. (5.28). Accepting the runs that return the grid point nearest to \(\phi_0\) prepares the ground state with the fidelity
For fixed phase gaps bounded away from zero modulo one, the unwanted probabilities have an \(O(4^{-m})\) envelope, while the nearest target bin has probability at least \(4/\pi^2\) conditional on the target eigenstate. Thus the conditional infidelity has an \(O(T_{\mathrm{tot}}^{-2})\) envelope with \(T_{\mathrm{tot}}=t(2^m-1)\); exact zeros and oscillations prevent a universal equality or monotone law. Rodeo at fixed resolving \(\sigma\) instead suppresses unwanted weights geometrically in \(M\).
This comparison is between one uniform-window QPE measurement and the
specified Gaussian filter, not a lower bound on all phase-estimation
methods. Repeated QPE postselection or different clock windows can
sharpen the filter too. Both benchmarks use the exact target energy to
choose the accepted bin or resonant phase. The code centers the spectrum
at \(\bar E=(E_{\min}+E_{\max})/2\) and chooses
\(t=0.9\pi/\|H-\bar E\|=0.659\) using exact sector eigenvalues. This is
stronger prior information than the Pauli-norm spectral bound used in
Chapter 5. Tables and plots count evolution per full attempt;
filters_compared.py also prints costs including restarts,
excluding preparation and scanning.
phase estimation |
rodeo |
|||||||
|---|---|---|---|---|---|---|---|---|
\(m\) |
\(T_{\mathrm{tot}}\) |
\(1-\mathcal{F}\) |
accept. |
\(\vert\Delta E\vert\) |
\(M\) |
\(T_{\mathrm{tot}}\) |
\(1-\mathcal{F}\) |
accept. |
\(4\) |
\(9.9\) |
\(1.0\times10^{-3}\) |
\(0.760\) |
\(1.2\times10^{-1}\) |
\(3\) |
\(9.6\) |
\(1.9\times10^{-2}\) |
\(0.884\) |
\(5\) |
\(20.4\) |
\(3.7\times10^{-4}\) |
\(0.497\) |
\(1.2\times10^{-1}\) |
\(6\) |
\(19.1\) |
\(2.4\times10^{-3}\) |
\(0.870\) |
\(6\) |
\(41.5\) |
\(6.9\times10^{-5}\) |
\(0.759\) |
\(3.0\times10^{-2}\) |
\(12\) |
\(38.3\) |
\(3.7\times10^{-5}\) |
\(0.868\) |
\(8\) |
\(168\) |
\(4.6\times10^{-6}\) |
\(0.759\) |
\(7.5\times10^{-3}\) |
||||
\(10\) |
\(674\) |
\(4.6\times10^{-8}\) |
\(0.759\) |
\(1.9\times10^{-3}\) |
Table 7.3: Phase estimation and the rodeo algorithm as state preparation
for the \(k=4\) pairing ground state from the prolonged input
(\(p=0.8676\)): total evolution time, infidelity of the accepted runs and
acceptance probability. Phase estimation accepts the bin nearest the
known target phase in an
\(m\)-qubit control register; the rodeo algorithm uses Gaussian times with
\(\sigma=4\) and its evolution time is the mean. The last column is the
error of the phase-estimation energy. Produced by
filters_compared.py.

Figure 7.10: Infidelity of the prepared \(k=4\) pairing ground state against the time of controlled evolution per full attempt, for phase estimation (nearest target bin, \(m=2\) to \(10\) control qubits) and for the rodeo algorithm (Gaussian times, \(\sigma=4\), \(M=1\) to \(12\)), from the prolonged input (left) and the refined input (right). The power law of the Dirichlet kernel and the exponential of the rodeo filter cross at an evolution time of about \(40\) for both inputs. Produced by filters_compared.py.
The table corrects two impressions that the asymptotic statements might leave. The first is that the exponential wins from the start. It does not: at short times phase estimation is the better filter for this spectrum, by more than a factor of ten at \(T_{\mathrm{tot}}\approx10\), because the few levels that carry weight are far from the ground state and already sit in the tails of the kernel. The exponential overtakes the power law at \(T_{\mathrm{tot}}\approx40\) for the prolonged input, and from there the gap widens quickly: the infidelity \(4.6\times10^{-6}\) costs phase estimation an evolution time of \(168\) and the rodeo algorithm about \(50\). The hardware requirements also differ. Standard QPE uses \(m\) ancillas and an inverse Fourier transform, or an iterative variant with feedback. Rodeo reuses one ancilla without feedback to its phase settings, but the system must remain coherent across all accepted cycles. Random times are independently drawn; the system states are not independent, and the Gaussian has unbounded duration tails.
Finite-resolution QPE acceptance includes both target-bin weight and unwanted leakage. The factor in \([4/\pi^2,1]\) multiplies only the target contribution \(p\). The nearest-bin spacing bounds the rounding error conditional on the intended eigenphase; it is not an unconditional single-run confidence interval for an arbitrary input. These distinctions preserve the interpretation established in Chapter 5. The best method depends on prior spectral information, the requested output, input preparation, repetition costs and hardware.
The variational state#
The variational route prepares the \(k=4\) ground state directly with the
circuit of Eq. (7.26): \(26\) parameters, \(1312\) CNOT gates,
no ancilla and no post-selection. Table 7.1 gave its
energy error, \(1.4\times10^{-3}\). Its infidelity, which
filters_compared.py computes, is \(1.8\times10^{-4}\); the error
of a variational energy is of the order of the infidelity times the
excitation energy of the admixed states, which here is large. The
comparison with the pipeline is therefore more even than the energies
suggest, and it must be made like with like. The refined state at
\(T=30\) has the infidelity \(1.2\times10^{-3}\) and the energy error
\(4.1\times10^{-3}\): as it leaves the adiabatic stage it is a
worse state than the variational one, by a factor of seven in
infidelity. Two to three rodeo cycles with exact evolution bring it
level, and eight put it a factor of forty ahead.
The reported UCCSD result is an optimized value, not a proof of the global minimum over its parameters. Moreover, a residual for one ansatz is not a limit on VQE: Chapter 6 reaches the exact pairing benchmark with six pair-transfer parameters, and its ADAPT example uses five selected operators. In the same Jordan–Wigner construction, six pair transfers cost \(288\) CNOTs before further cancellations, compared with \(1312\) for the full, unpruned UCCSD template. The four nonzero reference-to-virtual pair transfers of the present optimized circuit cost only \(192\) CNOTs. Changing the encoding and changing the ansatz are separate improvements.
The refinement stage avoids full-resolution variational optimization, but it still requires choices of path, buffer, duration, step size, target energy and filtering times. The coarse solver may itself use optimization. Ideal filtering can reduce a residual beyond a fixed trial state’s accuracy; finite precision, detuning and noise must be included before claiming an attainable accuracy. These small examples establish neither a general VQE expressivity barrier nor a scalable advantage for the pipeline.
The two routes are also not exclusive, and the most economical state preparation for this problem uses both. The rodeo filter accepts any input. Fed with the \(k=4\) variational state, \(p=0.99982\), it returns the infidelities \(8.9\times10^{-5}\), \(4.4\times10^{-5}\) and \(2.8\times10^{-6}\) after one, two and six cycles, with acceptance tending to \(0.9998\), and the energy error of the filtered state falls from \(1.4\times10^{-3}\) to \(3.6\times10^{-4}\) after two cycles and \(2.2\times10^{-5}\) after six. The filter improves this particular optimized trial state. Seen this way the adiabatic refinement and the variational circuit are alternatives for the same job, producing the large overlap, and the filter is what follows either. Which of them is preferable depends on how their costs scale. The variational circuit and its optimization become expensive as the resolution grows; the refinement becomes expensive as the gap closes or the prolonged overlap falls. Table 7.4 collects the comparison.
VQE |
phase estimation |
refinement + rodeo |
|
|---|---|---|---|
input needed |
an ansatz |
a state with overlap \(p\) |
a coarse state and target energy |
state error |
ansatz and optimizer dependent |
uniform-window envelope \(O(T_{\mathrm{tot}}^{-2})\) |
ideal bound \(O(f_{\max}^M)\) |
acceptance |
no postselection |
target-bin weight plus leakage |
\(P_M\to p\) at resonance |
classical work |
optimization, shots |
calibration and inference |
coarse solver, scan and calibration |
ancilla qubits |
none |
\(m\), or one with feedback |
one, reset and reused |
coherence |
ansatz dependent |
through controlled powers |
through accepted cycles |
energy |
exact expectation is variational |
finite-resolution estimate |
scan or observable estimate |
validation |
convergence and state diagnostics |
input and phase statistics |
acceptance and state diagnostics |
Table 7.4: Three algorithms for the ground state of the same Hamiltonian, as state-preparation methods.
None of these methods certifies an arbitrary output from one measurement record alone. For example, a faulty identity evolution at target setting \(E=0\) accepts every input without improving it. Acceptance is a useful diagnostic only in conjunction with checks of the evolution, target energy and input spectral weight.
The other three Hamiltonians#
Nothing in Sections Resolution refinement and The rodeo algorithm is specific to pairing. The ideal rodeo filter needs controlled evolution, ancilla phases and measurement, an input with target weight and a sufficiently accurate target-energy setting. Refinement needs an answer to one question, what a coarser version of the problem is, and the answer depends on the model. This section gives it for the Lipkin model, the Heisenberg ring and the Hubbard ring, with the parameters of Table 5.6 as targets, so that the results can be set beside the phase-estimation energies of Table 5.7 and the variational energies of Tables 6.5 and 6.6.
A convenient energy-origin convention is useful first. For a basis refinement the prolonged state has the energy \(E_{\mathrm{low}}\) in the fine Hamiltonian and one shift serves both terms of Eq. (7.4). When the prolongation changes the energy scale, as it does on a lattice or when particles are added, we may give each term its own shift,
so that the tracked state starts at \(-\mu_{\mathrm{buf}}\) and the fine Hamiltonian is measured from the energy of the prolonged state, which a device can measure. For a basis refinement this is Eq. (7.4) again. Crucially, changing only the fine-space shift adds a scalar function times the full identity. It changes a global phase, but neither the gaps nor the evolved-state fidelity. This differs from shifting the embedded coarse Hamiltonian, which adds a multiple of \(PP^\dagger\). We use \(\mu_{\mathrm{buf}}=1\) throughout this section.
The Lipkin model: more particles. In the encoding of Eq. (3.73) every doublet of the Lipkin model is one qubit, \(\vert 0\rangle\) for the particle in the lower level, and the Hamiltonian couples the qubits in pairs. A coarser problem is the same Hamiltonian with fewer particles. We take \(N=2\), solve it on two qubits, where the ground state is a rotation in the space of \(\vert 00\rangle\) and \(\vert 11\rangle\), and prolong by adding two doublets in their lower level, \(\hat{P}\vert\psi\rangle=\vert\psi\rangle\otimes\vert 00\rangle\), again without gates. The coarse term of the path is the two-qubit Hamiltonian multiplied by the projector on \(\vert 00\rangle\) of the new qubits.
The Heisenberg ring: magnons on a lattice, and a sign. For spins, think of the down spins as particles, magnons, hopping on a lattice of up spins. The \(S^z=0\) sector of a ring with \(n\) sites has \(n/2\) magnons. A coarse ring with \(n/2\) sites and the same number of magnons is completely full, a single state, exactly as the four-particle pairing model at \(k=2\). The lattice prolongation spreads every magnon over the two fine sites of its block, and here something new enters. With the plus sign of Section The prolongation operator, each block becomes the triplet state \((\vert{\downarrow\uparrow}\rangle+\vert{\uparrow\downarrow}\rangle)/\sqrt2\) and the prolonged state has an overlap of \(0.083\) with the ground state of the four-site ring. With a minus sign each block becomes a singlet, the prolonged state is the singlet covering that Section Ansätze that know the physics used as a variational reference, and the overlap is \(0.750\). The sign is Marshall’s: the ground state of an antiferromagnet on a bipartite lattice has amplitudes whose signs alternate with the number of down spins on one sublattice, and ignoring it can greatly reduce the useful ground-state component. The plus-sign state here still has nonzero ground overlap, \(0.083\); it is not entirely confined to an orthogonal symmetry sector. The lesson generalizes. The prolongation must respect the symmetries and the sign structure of the fine ground state, because the adiabatic evolution conserves every symmetry that the path Hamiltonian has, and an input in the wrong sector stays there.
The Hubbard ring: bonding orbitals. For the half-filled ring with four sites, four particles and \(U=4t\), the coarse lattice has two sites and is again full. Every coarse orbital becomes the bonding combination of its two fine sites, \(W_{2c,c}=W_{2c+1,c}=1/\sqrt2\) for both spins, and Eq. (7.2) turns the coarse determinant into a product of two doubly occupied bond orbitals, a state of decoupled dimers with \(\langle\hat{H}_{\mathrm{high}}\rangle=0\) and an overlap of \(0.425\) with the correlated ground state at \(E_0=-2.102748\).
refinement |
dim |
\(E_0\) |
\(\langle\hat{H}_{\mathrm{high}}\rangle_{\Phi_0}\) |
\(p(0)\) |
gap |
\(T^*\) |
\(p(20)\) |
|---|---|---|---|---|---|---|---|
Lipkin, \(N=2\to4\) |
\(16\) |
\(-4.21288\) |
\(-4.02759\) |
\(0.9458\) |
\(1.000\) |
\(6\) |
\(0.9998\) |
Lipkin, \(N=2\to4\), \(V=-1\) |
\(16\) |
\(-5.53585\) |
\(-4.23607\) |
\(0.7506\) |
\(1.000\) |
\(14\) |
\(0.9981\) |
Heisenberg, \(2\to4\) sites |
\(6\) |
\(-2.00000\) |
\(-1.50000\) |
\(0.7500\) |
\(0.908\) |
\(10\) |
\(0.9999\) |
Heisenberg, \(4\to8\) sites |
\(70\) |
\(-3.65109\) |
\(-3.00000\) |
\(0.5043\) |
\(0.522\) |
\(14\) |
\(0.9981\) |
Hubbard, \(2\to4\) sites |
\(70\) |
\(-2.10275\) |
\(0.00000\) |
\(0.4249\) |
\(0.296\) |
\(18\) |
\(0.9955\) |
Table 7.5: Resolution refinement for the Lipkin, Heisenberg and Hubbard
models with \(\mu_{\mathrm{buf}}=1\) and the path of
Eq. (7.29): dimension of the fine space, exact energy,
energy and overlap of the prolonged state, minimum gap along the path,
the time \(T^*\) for an overlap of \(0.99\), and the overlap at \(T=20\). The
first, third and fifth rows are the Hamiltonians of
Table 5.6; “Lipkin, \(V=-1\)” is a stronger interaction,
beyond the mean-field transition of Section Stability and the Lipkin model.
Produced by other_models.py.

Figure 7.11: Left: the missing overlap against the adiabatic time for the five refinements of Table 7.5. Right: rodeo scan (\(\sigma=3\), \(M=5\)) of the Hubbard ring from the prolonged dimer state and from the state refined to \(T=20\); the dashed line is the background \(2^{-5}\). Produced by other_models.py.
Table 7.5 and the left panel of Fig. 7.11 show the refinements. The pattern of the pairing model repeats, with the models ordered by how much the prolonged state already knows. The weakly coupled Lipkin model starts at \(p=0.946\) and is refined to \(0.99\) by \(T=6\); with the stronger interaction \(V=-1\) the start drops to \(0.75\) and the time more than doubles at the same gap, the effect of the left panel of Fig. 7.3. The Heisenberg ring starts from the singlet covering at \(0.75\) for four sites and \(0.50\) for eight, where the covering breaks the translation symmetry that the ground state has, and both reach \(0.998\) or better by \(T=20\). The Hubbard ring is the hardest case in the table: the prolonged overlap is \(0.42\), and the gap of the fine Hamiltonian, \(0.296\) to the lowest triplet, is below the buffer and sets the minimum along the path. The triplet is not coupled to the tracked singlet by a spin-symmetric path, so the quoted gap is pessimistic, and the refinement reaches \(p=0.9955\) at \(T=20\). In no case does the gap close, the displayed curves decrease rapidly at first. Their finite ranges do not establish exponential long-time convergence.
model |
input |
\(p\) |
\(M=2\) |
\(M=4\) |
\(M=8\) |
\(P_8\) |
|---|---|---|---|---|---|---|
Lipkin |
prolonged |
\(0.9458\) |
\(1.4\times10^{-2}\) |
\(3.6\times10^{-3}\) |
\(2.2\times10^{-4}\) |
\(0.946\) |
refined |
\(0.9998\) |
\(4.4\times10^{-5}\) |
\(1.1\times10^{-5}\) |
\(6.9\times10^{-7}\) |
\(1.000\) |
|
Lipkin, \(V=-1\) |
prolonged |
\(0.7506\) |
\(7.7\times10^{-2}\) |
\(2.0\times10^{-2}\) |
\(1.3\times10^{-3}\) |
\(0.752\) |
refined |
\(0.9981\) |
\(4.8\times10^{-4}\) |
\(1.2\times10^{-4}\) |
\(7.5\times10^{-6}\) |
\(0.998\) |
|
Heisenberg, 4 sites |
prolonged |
\(0.7500\) |
\(7.7\times10^{-2}\) |
\(2.0\times10^{-2}\) |
\(1.3\times10^{-3}\) |
\(0.751\) |
refined |
\(0.9999\) |
\(2.0\times10^{-5}\) |
\(5.0\times10^{-6}\) |
\(3.1\times10^{-7}\) |
\(1.000\) |
|
Heisenberg, 8 sites |
prolonged |
\(0.5043\) |
\(2.0\times10^{-1}\) |
\(5.8\times10^{-2}\) |
\(3.8\times10^{-3}\) |
\(0.506\) |
refined |
\(0.9981\) |
\(4.7\times10^{-4}\) |
\(1.2\times10^{-4}\) |
\(7.4\times10^{-6}\) |
\(0.998\) |
|
Hubbard ring |
prolonged |
\(0.4249\) |
\(2.5\times10^{-1}\) |
\(7.8\times10^{-2}\) |
\(5.3\times10^{-3}\) |
\(0.427\) |
refined |
\(0.9955\) |
\(1.1\times10^{-3}\) |
\(2.8\times10^{-4}\) |
\(1.8\times10^{-5}\) |
\(0.996\) |
Table 7.6: The rodeo filter (\(\sigma=4\), Gaussian times, \(E=E_0\)) on the
prolonged states and on the states refined to \(T=20\) of
Table 7.5: overlap of the input, infidelity of the
accepted runs after \(M\) cycles from Eq. (7.20), and acceptance
after eight cycles. Produced by other_models.py.
Table 7.6 applies the filter, and its rows come in pairs that tell the story of the chapter in numbers. The filter works on every input; the infidelity falls by a factor of four for every two cycles in all ten rows. But the prolonged Hubbard state is accepted in \(43\) runs out of a hundred and is, after eight cycles, where the refined state was after one, while the refined state is accepted in \(996\) out of a thousand and reaches \(1.8\times10^{-5}\). The right panel of Fig. 7.11 shows the two scans. The prolonged dimer state is a broad spectrum: besides the ground state, with weight \(0.425\), it contains levels at \(-1.068\), \(2.965\), \(5.035\) and \(10.103\) with the weights \(0.276\), \(0.205\), \(0.071\) and \(0.018\), and the scan shows them all. The refined state is dominated by the ground-state line. Compare with the earlier chapters. Phase estimation with ten control qubits gave this energy to \(1.7\times10^{-2}\), Table 5.7, starting from the exact ground state; the hardware-efficient ansatz missed it by \(0.10\) and the Hamiltonian-variational ansatz found it exactly, Table 6.7, after an optimization. The pipeline prepares the state to \(10^{-5}\) from a product of dimers, without full-resolution variational optimization, but using the exact target energy for this benchmark, at the price, as always, of coherent evolution: \(T=20\) in units of \(1/t\), plus the cycles.
A chain with two stages. In all the lattice examples so far the
coarse space was a single state, because a half-filled lattice with half
as many sites is full. At low filling the coarse space is not trivial,
and this is the setting of the original proposal [Bogner2026]:
particles in a continuum, discretized on a lattice whose spacing \(a\) is
halved at every stage. other_models.py puts one spin-up and one
spin-down particle on an open chain of \(2\), then \(4\), then \(8\) sites,
sixteen qubits at the end, with the hopping \(t\propto1/a^2\) multiplied by
four and the contact interaction \(U\propto1/a\) by two at every stage,
and the on-site energy \(2t\) of the discretized kinetic energy. The
refined state of the first stage, not the exact one, is prolonged into
the second. With a buffer and an evolution time that follow the energy
scale, \(\mu_{\mathrm{buf}}=4\) and \(T=2\) in units of the coarse hopping,
the prolonged overlaps are \(0.909\) and \(0.942\), the refined overlaps
\(0.995\) and \(0.985\), and four rodeo cycles assessed separately on each stage
reduce the infidelity to \(3\times10^{-4}\) and \(1\times10^{-3}\). The code
passes the unfiltered refined state to the next stage, not a sampled
rodeo output. The second stage therefore starts from an approximate
coarse eigenstate, whose excited-state weight and residual are reported. These two prolongations have increasing overlap, but two stages do not
establish asymptotic scaling. A doubling hierarchy has logarithmically
many stages; the register size, stage simulation cost, coupling
renormalization and inherited preparation errors still grow or change.
For a continuum interpretation one must also specify physical box length
and boundary discretization. Here doubling the number of interior sites
with \(a\to a/2\) is a schematic hierarchy: with Dirichlet endpoints the
length \((n+1)a\) is not exactly constant.
Circuits, depth and the bottlenecks of quantum computing#
Up to this point the evolution operators were exact matrix exponentials, which is how one studies an algorithm. A device executes gates. This section gives a construction and count for each pairing stage using single-qubit rotations and CNOT gates, the product-formula error is put back, the gates are counted, and the count is compared with what hardware can run. We do this in detail for one example because the exercise is the most direct way we know to see, in one place and in numbers, what limits quantum computing for many-body problems. The currency throughout is the CNOT gate: two-qubit gates are slower than single-qubit gates and have error rates that are typically an order of magnitude larger, so that their count is a useful first resource estimate. It is not circuit depth or wall-clock runtime: parallel scheduling, routing, gate durations, resets and idle errors require separate accounting.
Building blocks#
Everything is built from the Pauli rotation \(e^{-i\phi P/2}\) of Eq. (3.81): rotate every qubit on which \(P\) acts into the \(Z\) basis, collect the parity on the last qubit with a ladder of CNOT gates, apply one \(R_z(\phi)\), and undo the ladder and the basis change. A string of weight \(w\) costs
CNOT gates and one parametrized rotation, Fig. 7.12;
gate_budget.py checks the circuit against the exact
exponential for the string \(XXXY\), to \(10^{-15}\). A rotation
controlled on an ancilla, which is what the rodeo cycle needs,
costs two CNOT gates more, whatever the weight, because only the central
\(R_z\) has to be controlled, Fig. 5.7.

Figure 7.12: The rotation \(e^{-i\phi\,X X X Y/2}\) on the four qubits of two pairing levels \(p\) and \(q\): basis changes (the product \(\mathrm{H}S^\dagger\) means \(S^\dagger\) first), a ladder of three CNOT gates, the rotation, and the reverse. Six CNOT gates. Eight such blocks make one pair-hopping term, and \(160\) rotations of this kind, of weights four to eight, make the UCCSD preparation at \(k=4\).
Excitation operators. In the Jordan–Wigner encoding a single excitation \(a^\dagger_aa_i-\mathrm{h.c.}\) is a sum of two strings, \(X\) and \(Y\) on the two qubits with a string of \(Z\) between them, and its cost grows with the distance: \(8\) CNOT gates between neighboring levels and \(16\) for the excitation from mode \(0\) to mode \(4\). A double excitation is a sum of eight strings, of weight four plus whatever \(Z\) strings lie between the two occupied and between the two empty modes; the double \((0,3)\to(4,5)\) has weight six and costs \(80\). The pair-hopping doubles that carry all the amplitude in the pairing problem are the fortunate case. A time-reversed pair occupies the adjacent modes \(2p\) and \(2p+1\), the \(Z\) strings of its two operators cancel, and all eight strings have weight four: \(48\) CNOT gates per pair-hopping term, whatever the distance between the levels. The full ansatz of Eq. (7.26) has \(8\) operators, \(40\) rotations and \(272\) CNOT gates at \(k=3\), and \(26\) operators, \(160\) rotations and \(1312\) CNOT gates at \(k=4\), the numbers of Table 7.1.
One Trotter step. The Hamiltonian is split the way its circuit is,
with the pair operators \(\hat{P}^{+}_p=a^\dagger_{p+}a^\dagger_{p-}\) of Eq. (3.30), which are not to be confused with the prolongation, and a diagonal part \(\hat{D}\) that contains the single-particle energies and the \(p=q\) term of the interaction: phases on single qubits and one \(ZZ\) rotation per level. Each \(\hat{h}_{pq}\) is eight weight-four strings, \(48\) CNOT gates, and a first-order step costs
which is \(296\) at \(k=4\) and \(1360\) at \(k=8\); the program obtains the
same numbers by mapping the Hamiltonian with the JordanWigner
class and adding up Eq. (7.30) over its \(60\) strings.
With the controls, two CNOT gates for each of the \(60\) rotations, the
step costs \(416\). A symmetric second-order step has each hopping term
twice, except the middle one, and merges adjacent diagonal half-steps: the bulk counts are \(536\)
CNOT gates plain and \(736\) controlled. A finite sequence also retains
two endpoint half-layers; together these add one full diagonal-layer
count beyond \(n\) times the bulk count.
Finally the coarse term of the path, the projector on the four new
qubits being empty, is a sum of \(15\) strings of \(Z\) operators, \(34\) CNOT
gates per step.
The encoding. The same counts in the compact encoding of Eq. (3.78), one qubit per level and \(\hat{h}_{pq}=-\tfrac{g}{4}(X_pX_q+Y_pY_q)\), are \(4\) CNOT gates per hopping term instead of \(48\), no two-qubit gates in \(\hat{D}\), and \(24\) per first-order step at \(k=4\) instead of \(296\), on half the qubits. The dynamics is the same, since, as we saw, it never leaves the seniority-zero space, and so are the splitting and its Trotter error. The factor of twelve is the price of carrying, through every gate, a part of Hilbert space that the calculation never visits, and using that exact symmetry reduces the cost without approximating the dynamics. We keep both columns in the budget below: the compact one is what one would run for this model, the Jordan–Wigner one is what a Hamiltonian without a conserved seniority, a nuclear shell-model interaction for instance, would require an independently derived count; the pairing count is not a prediction for such a general interaction.
The pipeline with product formulas#
The eight strings of one \(\hat{h}_{pq}\) commute, so that \(e^{-i\hat{h}_{pq}\delta t}\) is implemented exactly by its eight rotations, and the only error of the product formula is the non-commutativity between the terms of Eq. (7.31). At \(k=4\) and \(t=1\) the symmetric formula has a spectral-norm error of \(3.4\times10^{-2}\) with four steps and \(8.3\times10^{-3}\) with eight, falling by four when the number of steps doubles; the first-order formula has \(0.31\) and \(0.15\).

Figure 7.13: The pipeline with product formulas (\(k=4\), \(N=4\), \(g=1\)). Left: missing overlap of the Trotterized refinement \(k=2\to4\) with \(T=30\) against the number of steps, for the first- and second-order formulas; the dotted line is the result with exact slices. Right: infidelity of the rodeo filter against the number of cycles when the controlled evolution is a second-order product formula with a maximum step \(\delta t\), for the input refined with \(n_s=80\) steps (\(p=0.9977\)). A coarse step reduces acceptance in this example; \(\delta t=0.125\) is indistinguishable from the exact evolution. Produced by trotter_pipeline.py.
Refinement. The left panel of Fig. 7.13 replaces the exact slices of the path by product formulas. With the symmetric formula, \(n_s=80\) steps over \(T=30\) give \(p=0.9977\), against \(0.9988\) with exact slices, and \(160\) steps give \(0.9986\); with \(40\) steps the step is too long and the overlap drops to \(0.94\). The first-order formula needs more than \(640\) steps for the same quality. At these operating points refinement tolerates some product-formula error. This is empirical: an effective-Hamiltonian interpretation requires a sufficiently small step, a smooth logarithm branch and a stable isolated eigenspace. It is not a guarantee for arbitrary paths.
The filter. For the rodeo stage the honest prescription fixes a maximum step length \(\delta t\), so that a cycle of duration \(t_k\) uses \(\lceil\vert t_k\vert/\delta t\rceil\) steps of actual size \(t_k/n_k\), about \(13.27\) on average for \(\sigma=4\) and \(\delta t=0.25\). The right panel of Fig. 7.13 and Table 7.7 show three regimes. With \(\delta t=1\) the compiled evolution has little to do with \(e^{-i\hat{H}t}\), and the filter rejects it: the acceptance collapses to \(0.08\) and the accepted states are poor. With \(\delta t=0.5\) the six-cycle result is near \(2\times10^{-3}\). With \(\delta t=0.25\) it follows the exact curve down to \(1.4\times10^{-4}\) at six cycles, with an acceptance of \(0.986\), and with \(\delta t=0.125\) it is indistinguishable from the exact evolution. The final column is a separate fixed-step diagnostic, not a proved floor for these runs. The code chooses \(n_k=\lceil|t_k|/\delta t\rceil\) and uses \(S_2(t_k/n_k)^{n_k}\). Different times therefore use different step lengths; these unitaries need not commute and do not in general share one effective Hamiltonian.
For a genuinely fixed symmetric step \(S_2(h)\), a consistent logarithm defines \(H_{\mathrm{eff}}(h)=H+O(h^2)\). With a nonzero isolated gap, eigenvector perturbation is \(O(h^2)\) and its infidelity is \(O(h^4)\). That explains the scale of the fixed-step diagnostic in the small-step regime. The code selects the eigenvector with largest overlap with the true ground state; at large steps phase wrapping prevents automatically calling it the ground state of a principal-log Hamiltonian. The variable-step filter may approach a mixed conditional state, and neither a universal floor nor monotonic convergence follows from the diagnostic. This refines the Chapter 5 lesson: implemented unitaries, including their relative phases, determine what an interferometer tests.
\(\delta t\) |
\(1-\mathcal{F}_2\) |
\(1-\mathcal{F}_6\) |
\(P_6\) |
diagnostic |
|---|---|---|---|---|
\(1\) |
\(9.6\times10^{-2}\) |
\(1.4\times10^{-1}\) |
\(0.078\) |
\(3.1\times10^{-1}\) |
\(0.5\) |
\(2.1\times10^{-3}\) |
\(1.9\times10^{-3}\) |
\(0.814\) |
\(3.1\times10^{-3}\) |
\(0.25\) |
\(6.4\times10^{-4}\) |
\(1.4\times10^{-4}\) |
\(0.986\) |
\(1.5\times10^{-4}\) |
\(0.125\) |
\(5.5\times10^{-4}\) |
\(3.9\times10^{-5}\) |
\(0.997\) |
\(8.7\times10^{-6}\) |
exact |
\(5.7\times10^{-4}\) |
\(3.6\times10^{-5}\) |
\(0.998\) |
Table 7.7: The rodeo filter with a Trotterized controlled evolution
(second order, maximum step \(\delta t\), \(\sigma=4\)) on the circuit-level refined
state, \(p=0.9977\): infidelity of the accepted runs after two and six
cycles, acceptance after six, and the fixed-step eigenvector diagnostic (largest overlap with the
true ground state). Values for approximate evolution use \(300\) sampled
time sets, acceptance weighting and no measurement-shot sampling;
the last column is not a lower bound on them. Produced by trotter_pipeline.py.
The depth budget#
Table 7.8 adds everything up at the operating point of Fig. 7.13: \(80\) symmetric refinement steps, and rodeo cycles with \(\sigma=4\) and \(\delta t=0.25\), about \(13.27\) controlled steps each on average, with diagonal endpoint layers retained. The comparison is meant to be honest in both directions.
CNOT gates |
||||
|---|---|---|---|---|
circuit |
params |
JW |
compact |
infidelity |
UCCSD template, per run |
\(26\) |
\(1312\) |
\(1.8\times10^{-4}\) |
|
coarse state and prolongation |
\(0\) |
\(0\) |
\(0\) |
\(1.3\times10^{-1}\) |
refinement, \(80\) steps |
\(0\) |
\(45\,642\) |
\(3682\) |
\(2.3\times10^{-3}\) |
one rodeo cycle (mean) |
\(0\) |
\(9799\) |
\(1282\) |
|
pipeline with \(M=2\) |
\(0\) |
\(65\,240\) |
\(6246\) |
\(6.4\times10^{-4}\) |
pipeline with \(M=6\) |
\(0\) |
\(104\,436\) |
\(11\,374\) |
\(1.4\times10^{-4}\) |
Table 7.8: CNOT budget for preparing the \(k=4\) pairing ground state
(\(N=4\), \(g=1\)): the variational circuit of Table 7.1 and
the refinement–rodeo pipeline at the operating point of
Fig. 7.13, in the Jordan–Wigner encoding (\(8+1\) qubits)
and in the compact pair encoding (\(4+1\) qubits). Infidelities are those
of Table 7.7 and of Section The variational state;
they do not depend on the encoding. Produced by
gate_budget.py.
The table is a per-full-attempt construction, before compilation cancellations, connectivity routing and noise. It includes endpoint diagonal layers and uses
for the Gaussian mean step count. A postselected cost must also include failed attempts, as in Eq. (7.25); the high acceptance here makes that correction modest, but not zero. Optimizer shots and energy scans are excluded from both columns and must be budgeted before an end-to-end comparison.
The pipeline invests most of its gates in coherent refinement and filtering. Increasing the buffer helped the finite scan, starting from \(k=3\) halved the sampled threshold time, and compact encoding reduced per-step counts substantially. None of these observations is a universal cost law. Comparisons should use the same encoding and allow each method to remove zero-angle gates and exploit the same symmetries.
Shorter variational circuits#
The full \(1312\)-CNOT template is reducible in this benchmark. From the seniority-zero reference, all singles and pair-breaking doubles have zero gradients along the pair-preserving submanifold. Zero initialization keeps the present optimizer there, leaving four reference-to-virtual pair transfers and \(192\) Jordan–Wigner CNOTs. This is pruning of the present solution, not proof of a global optimum of every full-UCCSD parameterization.
The ADAPT pool of Chapter 6 is broader than these four reference excitations. Once correlations develop, transfers between other level pairs can acquire nonzero gradients. Its five selected operators reach the benchmark ground state; the six-transfer fixed ansatz does too. Individual Pauli-generator pools [Tang2021] can reduce individual gate blocks, but replacing a fermionic excitation by one string generally changes both the ansatz and its symmetries. Such changes must be validated. Variational preparation and filtering remain complementary: either a coarse or a full-resolution variational state can be the input to the filter.
The budget against the hardware#
The requirements of the pipeline on a device are now explicit: \(2k+1\) qubits, nine at \(k=4\) and seventeen at \(k=8\), or \(k+1\) in the compact encoding; mid-circuit measurement of one ancilla with reset and reuse; and a coherent sequence of \(10^4\) to \(10^5\) two-qubit gates. Published devices support small registers and mid-circuit readout; long coherent gate sequences remain a separate requirement. An independent-fault estimate illustrates the resource sensitivity. If every two-qubit gate fails independently with probability \(\varepsilon\), a circuit of \(N_2\) such gates runs without a fault with probability
and \(N_2\varepsilon\) is the expected number of faults. Table 7.9 evaluates it for the circuits of this chapter.
circuit |
\(N_2\) |
\(\varepsilon=10^{-2}\) |
\(10^{-3}\) |
\(10^{-4}\) |
\(10^{-6}\) |
|---|---|---|---|---|---|
UCCSD, \(k=3\) |
\(272\) |
\(0.066\) |
\(0.76\) |
\(0.97\) |
\(1.00\) |
UCCSD, \(k=4\) |
\(1312\) |
\(2\times10^{-6}\) |
\(0.27\) |
\(0.88\) |
\(1.00\) |
pipeline, compact, \(M=2\) |
\(6246\) |
\(7.5\times10^{-28}\) |
\(2\times10^{-3}\) |
\(0.54\) |
\(0.99\) |
pipeline, Jordan–Wigner, \(M=2\) |
\(65\,240\) |
\(4.6\times10^{-284}\) |
\(4.6\times10^{-29}\) |
\(1.5\times10^{-3}\) |
\(0.94\) |
Table 7.9: Illustrative no-fault diagnostic \(e^{-N_2\varepsilon}\) evaluated at
the mean CNOT count for random-duration circuits, for error rates per gate from
\(10^{-2}\) to \(10^{-6}\). Produced by gate_budget.py.
The columns in Table 7.9 are illustrative error-rate scenarios, not a survey of current devices. Under this independent-fault model the long circuits have very small no-fault probabilities at \(\varepsilon=10^{-3}\). That probability is not output-state fidelity, postselection acceptance, or a theorem about what error mitigation can recover. Some faults are harmless for an observable; others are coherent, correlated, or accepted by the filter. For random gate counts, \(e^{-\varepsilon\mathbb E[N_2]}\) is also different from \(\mathbb E[e^{-\varepsilon N_2}]\); the table uses the former diagnostic.
Published demonstrations provide context rather than a universal gate budget: superconducting error-mitigated computations [Kim2023], a trapped-ion QCCD processor [Moses2023], and small rodeo/eigenvalue experiments [Qian2024,BeeLindgren2022]. The constructions here omit routing SWAPs, idle noise, measurement/reset errors and the time required to preserve the system during ancilla readout. High acceptance cannot replace independent validation of these effects.
A logical error-rate scenario such as \(10^{-6}\) motivates quantum error correction [QCbook], which is outside the scope of these notes. Below-threshold memory and logical-processor demonstrations [Acharya2025,Bluvstein2024,Reichardt2024] do not by themselves establish a universal error rate for arbitrary logical gates. The \(k=4\) example needs nine logical qubits in the Jordan–Wigner encoding or five in the compact encoding, before ancillas for error correction, synthesis and routing. Arbitrary \(R_z\) rotations require accuracy-dependent fault-tolerant synthesis; their count and precision, logical measurement costs and physical-qubit overhead must accompany any CNOT budget. The present calculation is therefore a resource baseline for such an analysis, not a device feasibility forecast.
The bottlenecks, collected. The example has touched every limitation that the earlier chapters met one at a time, and it is worth listing them with the numbers attached.
Overlap and repetition. Independent postselected attempts cost \(1/P_M\), approaching \(1/p\) at exact resonance. Poor overlap can make preparation expensive, but it does not always decay exponentially.
Coherent evolution. The path gap, derivatives and schedule determine adiabatic requirements. Filter resolution depends on the time distribution and cycle count; coherence must survive accepted cycles.
Simulation error. Product-formula error changes the filter. Fixed-step effective-Hamiltonian diagnostics must be distinguished from the variable-step protocol actually simulated.
Encoding. The pairing first-order step costs \(296\) or \(24\) CNOTs in the two constructions because the compact encoding builds in seniority conservation. Other Hamiltonians require their own count.
Optimization and measurement. Variational costs include training, measurement and expressivity. Filtering costs include scans, calibration and repeated preparation. A residual for one ansatz is not a universal VQE accuracy floor.
Noise and certification. Acceptance, a no-fault estimate, fidelity and observable error are distinct quantities. Correctness requires diagnostics appropriate to the requested output.
The pairing model makes these costs measurable against exact solutions. Scaling beyond it requires controlling all of them together.
Summary#
Rodeo implements \([\mathbb{1}+e^{iEt}e^{-iHt}]/2\) using one measured ancilla. At a resolved, exactly resonant eigenvalue with input weight \(p>0\), unwanted ensemble weights decrease geometrically and the acceptance approaches \(p\). The finite-width bound, detuning formula and restart cost specify the conditions behind this statement. Heralding identifies an accepted branch; it is not individual-state certification.
Resolution refinement supplies a structured input by prolonging a coarse state and following a chosen path. The four model examples demonstrate useful overlaps and finite-time improvements, while the gap and the coarse-state error remain assumptions or diagnostics to check at each stage. Identical endpoint spectra alone do not guarantee a gapped path. The long-time refinement tail also cannot be inferred from a short semilogarithmic plot.
The QPE comparison concerns a specific uniform-window filter with known target information and evolution costs per attempt. VQE comparisons must include the more accurate pairing ansatz of Chapter 6 and symmetry-based pruning in the same encoding. The methods can be combined rather than assigned universal rankings.
Finally, the gate construction exposes costs beyond the ideal formulas: product-formula error, postselection, synthesis, routing and noise. The distinction between fixed-step and variable-step evolution prevents an incorrect interpretation of an effective-Hamiltonian diagnostic as a universal fidelity floor. These resource and validation questions connect the eigenstate algorithms to the methods of quantum error correction [QCbook].
Exercises#
The rodeo circuit. (a) Derive Eq. (7.12) by following the register through Fig. 7.4, and show that the two branches have the probabilities \(\cos^2\) and \(\sin^2\) of \((E_j-E)t/2\) for an eigenstate. (b) Show that the filters \(\hat{F}(t_k,E)\) commute, so that the order of the cycles is immaterial, and that \(\hat{F}(t,E)^\dagger\hat{F}(t,E)=\cos^2[(\hat{H}-E)t/2]\). (c) Derive Eq. (7.17) from the characteristic function of the Gaussian. What replaces it for times drawn uniformly from \([0,\tau]\), and what are the tradeoffs in side lobes, support and cost? (d) What state does the register hold after the outcome \(1\)? Show that a run with the record \(1,0,0,\dots\) at \(E=E_0\) has no weight on the ground state. Is it useful for anything?
Prolongation. (a) Prove Eq. (7.2). (b) Show that \(\hat{P}\) is an isometry if the columns of \(W\) are orthonormal, and that \(\hat{P}\hat{P}^\dagger\) is a projector. (c) For the basis refinement of the pairing model, show that \(\hat{P}^\dagger\hat{H}_{\mathrm{high}}\hat{P}=\hat{H}_{\mathrm{low}}\), and hence that the prolonged state has the energy \(E_{\mathrm{low}}\). Why does this fail for the lattice prolongation? (d) Write the circuit that prolongs one coarse site into two fine sites, \(\vert 1\rangle\to(\vert 10\rangle+\vert 01\rangle)/\sqrt2\) and \(\vert 0\rangle\to\vert 00\rangle\), with one controlled rotation and one CNOT gate, and its version with the minus sign of Section The other three Hamiltonians.
Paths compared. Using
refinement.py, compare the refinement \(k=2\to4\) of the pairing model with the coupling ramp from \(g=0\) at \(k=4\), for \(g=1\) and \(g=4\) and buffers \(0.6\) and \(1.5\). (a) Plot the gap along each path. (b) Explain why the ramp wins at \(g=1\). (c) Add a term \(-\xi'\sum_{p\sigma}p\,n_{p\sigma}\) that makes the single-particle levels degenerate, \(\xi'=\xi\), and repeat. Is the initial ground state still isolated? Distinguish degeneracy from failure of a chosen initial state, and verify any path claim numerically.The adiabatic estimate. Starting from Eq. (7.7), integrate by parts once and show that the boundary terms vanish when \(\partial_s\hat{H}=0\) at both ends. Test the consequence numerically by replacing the schedule of Eq. (7.4) by the linear one, \((1-s)\) and \(s\), in
ResolutionRefinement, and compare the overlap at \(T=30\).Choosing the times. (a) For the prolonged \(k=4\) pairing state, reproduce the three-cycle result of Section Filtering the refined state. (b) Suppose the excited energies are known only to \(\pm0.05\) from a coarse scan. How much of the advantage survives? (c) Implement the geometric sequence \(t_k=t_{\max}/2^{k-1}\) and compare with Gaussian times at equal total evolution time. (d) Relate the geometric sequence to the controlled powers \(U^{2^j}\) of phase estimation.
Excited states. The scan of Fig. 7.8 shows a peak at \(E=2.935\) with weight \(0.106\) in the prolonged state. (a) Use the filter at that energy to prepare the first excited seniority-zero state, and report the infidelity and the acceptance against \(M\). (b) Why is the refined state a poor input for this task? (c) Propose a refinement that tracks the excited state, and state the condition on \(\mu\) that it requires.
Phase estimation as a filter. (a) Derive the fidelity formula of Section Phase estimation as a filter and derive an \(O(4^{-m})\) envelope assuming fixed nonzero phase gaps modulo one. Explain why an equality and monotone decay need not hold. (b) Reproduce Table 7.3 and find the crossing point for the refined input. (c) Replace the uniform superposition of the control register by the sine window used for the HHL clock in Section The circuit. How do the tails, and the comparison, change?
Counting gates. (a) Derive Eq. (7.32). (b) Show that the \(Z\) strings of a pair-hopping double cancel, and find the CNOT count of the general double excitation \((i,j)\to(a,b)\) as a function of the four mode indices. (c) Derive the \(34\) CNOT gates of the projector on four empty qubits from its expansion in \(Z\) strings, and find a cheaper circuit using one ancilla and Toffoli gates. (d) Count the \(R_z\) rotations of the pipeline of Table 7.8.
The Trotter floor. (a) For the symmetric formula show that the effective Hamiltonian differs from \(\hat{H}\) at order \(\delta t^2\), that an isolated eigenvector differs at the same order, and hence that its infidelity is \(O(\delta t^4)\). Check the fixed-step diagnostic in Table 7.7 and explain why it is not a floor for the variable-step filter. (b) The filter was run at the exact \(E_0\) although the effective Hamiltonian has a shifted ground-state energy. Scan \(E\) with the Trotterized evolution at \(\delta t=0.5\) and find where the acceptance peaks. Does retuning improve acceptance or fidelity? Test separately a truly fixed-step filter and the variable-step implementation.
Another model. Carry the pipeline of Section The other three Hamiltonians through for the Hubbard ring with \(U=8t\). (a) How do the prolonged overlap and \(T^*\) change? (b) Replace the bonding-orbital prolongation by the antibonding one and explain the result. (c) Estimate the CNOT count of the refinement from the \(56\) CNOT gates per first-order step that
gate_budget.pyreports for this Hamiltonian, and place it in Table 7.9.
Programs for this chapter#
Every number and figure in this chapter comes from the programs in
LectureMaterial/BookPrograms/chapter7/, which build on the shared
modules of Chapters 2 and 3
(gates, circuit, fockspace, models,
pauli, jordanwigner, optimize), on
coupledcluster.py, mapped_models.py and
pauli_circuits.py of Chapter 3, and phase_estimation.py and
qpe_models.py of Chapter 5. All of them are
imported by the notebook
LectureMaterial/Notebooks/chapter7/chapter7.ipynb, and all
run on numpy and matplotlib alone.
refinement.pyThe classesProlongation(embedding and orbital prolongation, Eq. (7.2)) andResolutionRefinement(the paths of Eqs. (7.4) and (7.29), their spectrum and sampled minimum gap, evolution by exact slices or by a supplied product formula, \(T^*\)); the pairing refinements of Figs. 7.1 and 7.2 and the comparison with the coupling ramp. About ten seconds.rodeo.pyThe classRodeoFilter: the circuit of Fig. 7.4 on the joint register, the filter of Eq. (7.13), energy scans, the exact Gaussian averages of Eq. (7.20), sampled preparation statistics and sampled runs; the checks and the one-qubit example of Section One qubit, worked through, Fig. 7.5. About ten seconds.uccsd_sector.pyThe classUCCSDSector, the product-form UCCSD ansatz in a number sector with exact gradients, and Table 7.1 with Fig. 7.6 from \(k=2\) to \(k=8\). About five seconds.pairing_pipeline.pyThe two refinement chains of Fig. 7.7, the coupling and buffer scans of Fig. 7.3, the rodeo scans of Fig. 7.8, Table 7.2 with Fig. 7.9, and the three cycles with chosen times. About thirty seconds.filters_compared.pyPhase estimation as a filter, Eq. (7.27), against the rodeo algorithm as a function of evolution time per full attempt, plus restart costs, Table 7.3 and Fig. 7.10; the infidelity of the UCCSD state and the rodeo cycles applied to it, Section The variational state. About two seconds.other_models.pyThe hierarchies of Section The other three Hamiltonians for the Lipkin, Heisenberg and Hubbard models, Tables 7.5 and 7.6, Fig. 7.11, the role of the Marshall sign, and the two-stage lattice refinement of two particles on \(2\to4\to8\) sites. About ten seconds.trotter_pipeline.pyThe classPairingSplit(the splitting of Eq. (7.31) and its first- and second-order steps), the Trotterized refinement and the Trotterized rodeo filter of Fig. 7.13 and Table 7.7, and a fixed-step eigenvector diagnostic. About seventy seconds on the review machine.gate_budget.pyThe Pauli-rotation check, the Jordan–Wigner strings and CNOT counts of the excitation operators and of the UCCSD preparation, the Trotter-step counts of Eq. (7.32) in both encodings, plain and controlled, the projector of the path, Table 7.8, the step counts of the other models and Table 7.9. About one second.rodeo_checks.pyShared dimension, normalization and Hermiticity checks for these dense simulators.validate_rodeo.pyIndependent checks of conditioning, degeneracy, detuning, restart cost, fermionic signs, refinement convergence, complex-valued gradients and product-formula assumptions; no figures.
Running the programs of this chapter#
Each cell below runs one of the programs listed above as a script and shows the figures it writes to BookFigures/.
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/refinement.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
Prolongation k = 2 -> 4 (basis refinement), g = 1
N = 2: dim_low = 6, dim_high = 28, E_low = -0.618034, <H_high> = -0.618034, E_high = -0.779164, overlap = 0.9628
N = 4: dim_low = 1, dim_high = 70, E_low = 1.000000, <H_high> = 1.000000, E_high = 0.635548, overlap = 0.8676
Overlap of the refined state with the exact k = 4 ground state
T N = 2 N = 4
0 0.962761 0.867638
1 0.966618 0.875965
2 0.973851 0.895142
3 0.979660 0.915880
4 0.983444 0.933138
6 0.987624 0.954073
8 0.990865 0.967050
10 0.992913 0.976805
12 0.994574 0.982997
16 0.996661 0.990957
20 0.997886 0.995051
25 0.998770 0.997571
30 0.999271 0.998757
minimum gap along the path (N = 4): 0.6000
Four particles, k = 2 -> k_high: overlap and energy at selected T
k_high = 3: E_FCI = 0.794697, overlap(0) = 0.9171, overlap(30) = 0.9994, E(30) = 0.7964, T* = 12
k_high = 4: E_FCI = 0.635548, overlap(0) = 0.8676, overlap(30) = 0.9988, E(30) = 0.6397, T* = 16
The tail of the k = 2 -> 4 refinement (8 T slices): 1-p(50) = 1.4e-04, 1-p(70) = 2.9e-05, 1-p(100) = 6.0e-06, 1-p(110) = 4.0e-06
Refinement against a linear coupling ramp g: 0 -> 1 (k = 4, N = 4)
T refinement coupling ramp
5 0.945561 0.997513
10 0.976805 0.999438
20 0.995051 0.999853
30 0.998757 0.999992
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/rodeo.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
One-qubit Hamiltonian: E0 = -0.618034, E1 = 1.618034
excited state, t = 1.7, E = 0.3: P(0) = 0.189561307108, cos^2 = 0.189561307108
circuit against filter, 16 x 16 random H: |dpsi| = 1.9e-16, |dP| = 3.3e-16
Gaussian average of cos^2(x t/2), x = E1 - E0: sampled 0.5012, formula 0.5000
input |+>: weights 0.7236 (ground) and 0.2764; peak heights -> the weights as M grows
M = 1: P(E0) = 0.8618, P(E1) = 0.6382, background 2^-M = 0.5000
M = 3: P(E0) = 0.7582, P(E1) = 0.3668, background 2^-M = 0.1250
M = 6: P(E0) = 0.7279, P(E1) = 0.2877, background 2^-M = 0.0156
M = 10: P(E0) = 0.7239, P(E1) = 0.2771, background 2^-M = 0.0010
M infidelity (sampled, exact average, bound) acceptance (sampled, exact)
1 1.580e-01 1.604e-01 1.910e-01 0.8594 0.8618
2 8.705e-02 8.717e-02 9.549e-02 0.7926 0.7927
3 4.332e-02 4.557e-02 4.775e-02 0.7564 0.7582
4 2.186e-02 2.332e-02 2.387e-02 0.7398 0.7409
5 1.200e-02 1.180e-02 1.194e-02 0.7324 0.7322
6 6.724e-03 5.933e-03 5.968e-03 0.7285 0.7279
7 3.551e-03 2.975e-03 2.984e-03 0.7262 0.7258
8 1.733e-03 1.490e-03 1.492e-03 0.7249 0.7247
9 8.497e-04 7.455e-04 7.460e-04 0.7242 0.7241
10 4.594e-04 3.729e-04 3.730e-04 0.7239 0.7239
Sampled runs at E = E0 (M = 6): ancilla record, fidelity with the ground state
000000 accepted F = 0.991400
000000 accepted F = 0.999253
000000 accepted F = 1.000000
000000 accepted F = 0.999998
000000 accepted F = 0.995948
001000 rejected F = 0.000000
111010 rejected F = 0.000000
000000 accepted F = 0.997853
accepted fraction over 4000 runs: 0.730 (Eq. 7.PM: 0.728; p = 0.724)
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/uccsd_sector.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
k = 3: 8 operators (4 singles); analytic against numerical gradient: 2.3e-10
Ground-state energies, N = 4, g = 1
k qubits dim FCI CCD UCCSD UCCSD-FCI CCD-FCI #par max|singles| s
2 4 1 1.000000 1.000000 1.000000 +0.00e+00 +0.00e+00 0 0.0e+00 0.0
3 6 15 0.794697 0.794697 0.794697 -3.33e-16 +1.40e-13 8 0.0e+00 0.0
4 8 70 0.635548 0.630443 0.636987 +1.44e-03 -5.11e-03 26 0.0e+00 0.1
5 10 210 0.497768 0.484977 0.501278 +3.51e-03 -1.28e-02 54 0.0e+00 0.2
6 12 495 0.372664 0.350058 0.378719 +6.06e-03 -2.26e-02 92 0.0e+00 0.5
7 14 1001 0.256052 0.221608 0.265052 +9.00e-03 -3.44e-02 140 0.0e+00 1.3
8 16 1820 0.145559 0.097263 0.157856 +1.23e-02 -4.83e-02 198 0.0e+00 2.5
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/pairing_pipeline.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
Refinement chains to k = 4 (N = 4, g = 1)
2 -> 4: E_low = 1.000000, prolonged overlap = 0.8676, T* = 16, min gap = 0.600
3 -> 4: E_low = 0.794697 (UCCSD), prolonged overlap = 0.9637, T* = 8, min gap = 0.600
Coupling scan, k = 2 -> 4, buffer 0.6
g p(0) min gap T*(0.99)
0.3 0.9895 0.6000 1
0.5 0.9686 0.6000 6
1.0 0.8676 0.6000 16
1.5 0.7344 0.6000 23
2.0 0.6167 0.6000 29
3.0 0.4636 0.5884 41
4.0 0.3810 0.5678 51
Buffer scan at g = 1
buffer min gap T*(0.99)
0.30 0.3000 42
0.40 0.4000 28
0.60 0.6000 16
0.80 0.8000 11
1.00 1.0000 8
1.25 1.2500 6
1.50 1.4993 5
linear fit T* = 13.9 / gap -5.7
Rodeo inputs: refined p = 0.9988, prolonged p = 0.8676; E0 = 0.635548, first excited state with weight: see scan
eigenstates carrying weight in the prolonged state: 0.636 (0.8676), 2.935 (0.1063), 5.000 (0.0238), 7.209 (0.0015), 9.220 (0.0007)
fine scan (sigma = 8, M = 4): peak at E = 0.6355 (grid maximum 0.6350), exact 0.635548
Rodeo preparation at E = E0, sigma = 4: infidelity of the accepted runs and acceptance
M refined: infid. bound accept. prolonged: infid. bound accept.
1 6.22e-04 6.22e-04 0.9994 7.09e-02 7.63e-02 0.9338
2 3.11e-04 3.11e-04 0.9991 3.67e-02 3.81e-02 0.9007
3 1.56e-04 1.56e-04 0.9989 1.87e-02 1.91e-02 0.8842
4 7.78e-05 7.78e-05 0.9988 9.44e-03 9.53e-03 0.8759
5 3.89e-05 3.89e-05 0.9988 4.74e-03 4.77e-03 0.8718
6 1.94e-05 1.94e-05 0.9988 2.38e-03 2.38e-03 0.8697
7 9.72e-06 9.72e-06 0.9988 1.19e-03 1.19e-03 0.8687
8 4.86e-06 4.86e-06 0.9988 5.96e-04 5.96e-04 0.8682
Three cycles with t_j = pi/(E_j - E0) for the three excited levels that carry the most weight
refined E_j = 2.9354 weight 7.51e-04 t = 1.3660 infidelity 4.31e-04 acceptance 0.9992
refined E_j = 5.0000 weight 4.14e-04 t = 0.7198 infidelity 2.60e-05 acceptance 0.9988
refined E_j = 7.2089 weight 4.80e-05 t = 0.4779 infidelity 5.30e-06 acceptance 0.9988
prolonged E_j = 2.9354 weight 1.06e-01 t = 1.3660 infidelity 2.67e-02 acceptance 0.8915
prolonged E_j = 5.0000 weight 2.38e-02 t = 0.7198 infidelity 6.94e-04 acceptance 0.8682
prolonged E_j = 7.2089 weight 1.55e-03 t = 0.4779 infidelity 1.39e-04 acceptance 0.8678
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/filters_compared.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
Sector spectrum from 0.6355 to 9.2201; time step t = 0.6587
Input: prolonged state, p = 0.8676
phase estimation rodeo, sigma = 4
m total time infidelity acceptance E - E0 M total time infidelity acceptance
2 2.0 4.16e-03 0.7688 +9.1e+00 1 3.2 7.09e-02 0.9338
3 4.6 4.69e-03 0.5034 +9.1e+00 2 6.4 3.67e-02 0.9007
4 9.9 1.01e-03 0.7605 +1.2e-01 3 9.6 1.87e-02 0.8842
5 20.4 3.74e-04 0.4974 +1.2e-01 4 12.8 9.44e-03 0.8759
6 41.5 6.86e-05 0.7594 -3.0e-02 5 16.0 4.74e-03 0.8718
7 83.7 1.57e-05 0.4970 -3.0e-02 6 19.1 2.38e-03 0.8697
8 168.0 4.61e-06 0.7593 +7.5e-03 7 22.3 1.19e-03 0.8687
9 336.6 1.35e-07 0.4970 +7.5e-03 8 25.5 5.96e-04 0.8682
10 673.9 4.55e-08 0.7593 -1.9e-03 9 28.7 2.98e-04 0.8679
10 31.9 1.49e-04 0.8678
11 35.1 7.45e-05 0.8677
12 38.3 3.72e-05 0.8677
Input: refined state, p = 0.9988
phase estimation rodeo, sigma = 4
m total time infidelity acceptance E - E0 M total time infidelity acceptance
2 2.0 5.09e-05 0.8813 +9.1e+00 1 3.2 6.22e-04 0.9994
3 4.6 5.43e-05 0.5768 +9.1e+00 2 6.4 3.11e-04 0.9991
4 9.9 6.72e-06 0.8745 +1.2e-01 3 9.6 1.56e-04 0.9989
5 20.4 2.89e-06 0.5724 +1.2e-01 4 12.8 7.78e-05 0.9988
6 41.5 5.28e-07 0.8741 -3.0e-02 5 16.0 3.89e-05 0.9988
7 83.7 1.29e-07 0.5721 -3.0e-02 6 19.1 1.94e-05 0.9988
8 168.0 3.04e-08 0.8741 +7.5e-03 7 22.3 9.72e-06 0.9988
9 336.6 2.98e-09 0.5721 +7.5e-03 8 25.5 4.86e-06 0.9988
10 673.9 5.24e-10 0.8741 -1.9e-03 9 28.7 2.43e-06 0.9988
10 31.9 1.22e-06 0.9988
11 35.1 6.08e-07 0.9988
12 38.3 3.04e-07 0.9988
Cost comparison includes restart (known E0; scan and preparation costs excluded):
prolonged: QPE m=6 time/accepted=54.649; rodeo M=12 early-restart time/accepted=39.271
refined: QPE m=6 time/accepted=47.478; rodeo M=12 early-restart time/accepted=38.306
UCCSD at k = 4: E - E_FCI = 1.44e-03, infidelity 1 - p = 1.78e-04
rodeo cycles on the UCCSD state: M infidelity acceptance energy error of the filtered state
1 8.88e-05 0.9999 7.19e-04
2 4.44e-05 0.9999 3.60e-04
4 1.11e-05 0.9998 8.99e-05
6 2.78e-06 0.9998 2.25e-05
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/other_models.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
Refinement, buffer = 1.0
case dim E_high <H>_prol p(0) min gap T*(0.99) p(10) p(20)
Lipkin N=2->4 16 -4.21288 -4.02759 0.9458 1.0000 6 0.9978 0.9998
Lipkin, V=-1 16 -5.53585 -4.23607 0.7506 0.9995 14 0.9789 0.9981
Heisenberg 2->4 6 -2.00000 -1.50000 0.7500 0.9082 10 0.9932 0.9999
Heisenberg 4->8 70 -3.65109 -3.00000 0.5043 0.5223 14 0.9541 0.9981
Hubbard 2->4 70 -2.10275 -0.00000 0.4249 0.2963 18 0.9183 0.9955
Heisenberg 2 -> 4: overlap of the prolonged state with the ground state, Marshall sign 0.7500, plus sign 0.0833
Rodeo at E = E_0, sigma = 4: infidelity of the accepted runs (exact Gaussian average)
case input p M = 2 M = 4 M = 8 acceptance (M = 8)
Lipkin N=2->4 prolonged 0.9458 1.41e-02 3.57e-03 2.24e-04 0.9461
Lipkin N=2->4 refined 0.9998 4.43e-05 1.11e-05 6.92e-07 0.9998
Lipkin, V=-1 prolonged 0.7506 7.67e-02 2.03e-02 1.30e-03 0.7516
Lipkin, V=-1 refined 0.9981 4.79e-04 1.20e-04 7.49e-06 0.9981
Heisenberg 2->4 prolonged 0.7500 7.69e-02 2.04e-02 1.30e-03 0.7510
Heisenberg 2->4 refined 0.9999 2.00e-05 5.00e-06 3.13e-07 0.9999
Heisenberg 4->8 prolonged 0.5043 1.97e-01 5.80e-02 3.84e-03 0.5062
Heisenberg 4->8 refined 0.9981 4.73e-04 1.18e-04 7.42e-06 0.9981
Hubbard 2->4 prolonged 0.4249 2.53e-01 7.80e-02 5.26e-03 0.4272
Hubbard 2->4 refined 0.9955 1.12e-03 2.81e-04 1.76e-05 0.9955
Hubbard ring: levels carrying weight in the prolonged state: -2.103 (0.425), -1.068 (0.276), 2.965 (0.205), 5.035 (0.071), 10.103 (0.018)
Two particles on an open chain, t -> 4t, U -> 2U per stage, buffer 4 (scaled), T = 2 (scaled)
stage dim E_low <H>_prol E_high p(0) p(T) rodeo M = 4
Rodeo is assessed independently at each stage; the UNFILTERED refined state is passed onward.
2 -> 4 28 2.7639 4.9751 4.0506 0.9093 0.9949 3.2e-04
coarse-state residual norm: 4.441e-16; ground weight: 1.000000
4 -> 8 120 4.1081 7.3621 4.9946 0.9424 0.9849 9.6e-04
coarse-state residual norm: 8.654e-01; ground weight: 0.994892
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/trotter_pipeline.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
Spectral-norm error of the product formula for exp(-iH), t = 1 (k = 4, N = 4, g = 1)
steps first order second order
1 1.50e+00 9.63e-01
2 6.47e-01 1.49e-01
4 3.07e-01 3.40e-02
8 1.51e-01 8.32e-03
16 7.48e-02 2.07e-03
Trotterised refinement k = 2 -> 4, T = 30: exact slices give p = 0.9988
n_s first order second order
20 0.1672 0.0125
40 0.6435 0.9436
80 0.9386 0.9977
160 0.9815 0.9986
320 0.9931 0.9987
640 0.9967 0.9987
Rodeo on the n_s = 80 second-order refined state (p = 0.9977), sigma = 4.0, mean steps per cycle approximately sigma sqrt(2/pi)/dt + 1/2
dt steps/cycle infidelity M = 2 M = 6 acceptance M = 6
exact - 5.71e-04 3.57e-05 0.9978
1.000 3.7 9.60e-02 1.40e-01 0.0777
0.500 6.9 2.08e-03 1.90e-03 0.8140
0.250 13.3 6.39e-04 1.43e-04 0.9859
0.125 26.0 5.50e-04 3.88e-05 0.9971
Fixed-step eigenvector with largest overlap with the true ground state (diagnostic, not a filter floor)
dt = 1.000: 1 - |<E0|E0_eff>|^2 = 3.13e-01, E0_eff - E0 = +6.55e-01
dt = 0.500: 1 - |<E0|E0_eff>|^2 = 3.09e-03, E0_eff - E0 = +1.05e-01
dt = 0.250: 1 - |<E0|E0_eff>|^2 = 1.48e-04, E0_eff - E0 = +2.45e-02
dt = 0.125: 1 - |<E0|E0_eff>|^2 = 8.73e-06, E0_eff - E0 = +6.03e-03
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/gate_budget.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
exp(-i phi/2 XXXY): 17 gates, 6 CNOTs, depth 9, error 6.5e-16
Jordan-Wigner strings of tau - tau^dagger (k = 3, six qubits)
single 0 -> 4 2 strings, weights [(5, 2)], 16 CNOTs
single 1 -> 5 2 strings, weights [(5, 2)], 16 CNOTs
single 2 -> 4 2 strings, weights [(3, 2)], 8 CNOTs
pair (2,3) -> (4,5) 8 strings, weights [(4, 8)], 48 CNOTs
pair (0,1) -> (4,5) 8 strings, weights [(4, 8)], 48 CNOTs
double (0,3) -> (4,5) 8 strings, weights [(6, 8)], 80 CNOTs
UCCSD preparation, N = 4
k operators rotations CNOTs pair doubles only: operators CNOTs
3 8 40 272 2 96
4 26 160 1312 4 192
One first-order Trotter step of the pairing Hamiltonian: CNOTs plain / controlled
k Jordan-Wigner, 2k qubits formula 24k(k-1)+2k compact, k qubits
2 52 / 80 52 4 / 12 strings 14 / 4
3 150 / 216 150 12 / 30 strings 33 / 9
4 296 / 416 296 24 / 56 strings 60 / 16
6 732 (formula) 60 (formula)
8 1360 (formula) 112 (formula)
Projector on empty new levels, k = 2 -> 4: 15 Z strings, 34 CNOTs (Jordan-Wigner); 3 strings, 2 CNOTs (compact)
One Jordan-Wigner step as a circuit on the simulator: 932 gates, 296 CNOTs, depth 417 (without cancelling adjacent basis changes)
Budget at k = 4, N = 4: n_s = 80 second-order refinement steps, rodeo sigma = 4.0, dt = 0.25 (mean steps per cycle 13.3)
Jordan-Wigner (8+1 qubits) compact (4+1 qubits)
second-order step, plain 536 44
second-order step, controlled 736 96
refinement, 80 steps 45642 3682
one rodeo cycle (mean) 9799 1282
pipeline, M = 2 65240 6246
pipeline, M = 6 104436 11374
UCCSD preparation 1312
UCCSD k=4 with zero-angle gates removed: 4 pair transfers, 192 JW CNOTs
Chapter 6 six-transfer pairing ansatz: 288 JW / 24 compact CNOTs, numerical exactness
Counts are per full attempt, with diagonal endpoints; no routing, shots or rotation synthesis.
One first-order Trotter step of the four models of Table 5.models
model qubits strings CNOTs controlled
Lipkin, N=4 4 16 24 56
pairing, L=4 4 16 24 56
Hubbard ring 8 28 56 112
Heisenberg ring 4 12 24 48
Toy independent-fault diagnostic at the mean count: exp(-E[N] eps), NOT state fidelity or E[exp(-N eps)]
circuit CNOTs eps=1e-02 eps=1e-03 eps=1e-04 eps=1e-06
UCCSD, k = 3 272 6.59e-02 7.62e-01 9.73e-01 1.00e+00
UCCSD, k = 4 1312 2.00e-06 2.69e-01 8.77e-01 9.99e-01
pipeline, compact, M = 2 6246 7.49e-28 1.94e-03 5.35e-01 9.94e-01
pipeline, JW, M = 2 65240 4.64e-284 4.64e-29 1.47e-03 9.37e-01
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/rodeo_checks.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
import runpy, time
from IPython.display import Image, display
t0 = time.time()
runpy.run_path(str(root / 'BookPrograms' / 'chapter7/validate_rodeo.py'), run_name='__main__')
for png in sorted((root / 'BookFigures' / 'chapter7').glob('*.png')):
if png.stat().st_mtime >= t0:
display(Image(str(png)))
test_bound_and_restart_against_sampled_attempts (__main__.RodeoChecks.test_bound_and_restart_against_sampled_attempts) ...
ok
test_complex_circuit_and_completeness (__main__.RodeoChecks.test_complex_circuit_and_completeness) ...
ok
test_custom_evolution_and_impossible_branch (__main__.RodeoChecks.test_custom_evolution_and_impossible_branch) ...
ok
test_degenerate_eigenspace_not_one_eigenvector (__main__.RodeoChecks.test_degenerate_eigenspace_not_one_eigenvector) ...
ok
test_detuning_and_wrong_nearest_level (__main__.RodeoChecks.test_detuning_and_wrong_nearest_level) ...
ok
test_gaussian_accepted_ensemble_by_quadrature (__main__.RodeoChecks.test_gaussian_accepted_ensemble_by_quadrature) ...
ok
test_high_acceptance_is_not_certification (__main__.RodeoChecks.test_high_acceptance_is_not_certification) ...
ok
test_identity_shift_requires_ancilla_compensation (__main__.RodeoChecks.test_identity_shift_requires_ancilla_compensation) ...
ok
test_invalid_physical_inputs (__main__.RodeoChecks.test_invalid_physical_inputs) ...
ok
test_zero_width_no_overlap_zero_cycles (__main__.RodeoChecks.test_zero_width_no_overlap_zero_cycles) ...
ok
test_approximate_coarse_state_is_not_purified (__main__.RefinementChecks.test_approximate_coarse_state_is_not_purified) ...
ok
test_equal_endpoint_spectra_can_cross (__main__.RefinementChecks.test_equal_endpoint_spectra_can_cross) ...
ok
test_fermionic_swap_sign_and_complex_isometry (__main__.RefinementChecks.test_fermionic_swap_sign_and_complex_isometry) ...
ok
test_fine_identity_shift_changes_only_phase (__main__.RefinementChecks.test_fine_identity_shift_changes_only_phase) ...
ok
test_ground_space_and_truncated_confirmation (__main__.RefinementChecks.test_ground_space_and_truncated_confirmation) ...
ok
test_initial_gap_is_not_always_buffer (__main__.RefinementChecks.test_initial_gap_is_not_always_buffer) ...
ok
test_invalid_prolongation (__main__.RefinementChecks.test_invalid_prolongation) ...
ok
test_pairing_midpoint_convergence (__main__.RefinementChecks.test_pairing_midpoint_convergence) ...
ok
test_complex_hamiltonian_gradient (__main__.SolverAndCompilationChecks.test_complex_hamiltonian_gradient) ...
ok
test_gate_budget_endpoints_and_pruned_ansatz (__main__.SolverAndCompilationChecks.test_gate_budget_endpoints_and_pruned_ansatz) ...
ok
test_qpe_dirichlet_and_degenerate_filter (__main__.SolverAndCompilationChecks.test_qpe_dirichlet_and_degenerate_filter) ...
ok
test_symmetric_formula_unitarity_inverse_and_order (__main__.SolverAndCompilationChecks.test_symmetric_formula_unitarity_inverse_and_order) ...
ok
test_variable_steps_do_not_share_effective_hamiltonian (__main__.SolverAndCompilationChecks.test_variable_steps_do_not_share_effective_hamiltonian) ...
ok
----------------------------------------------------------------------
Ran 23 tests in 0.417s
OK
Pairing T=30 midpoint overlaps (160,320,640): [0.9987571885676829, 0.9987563639042027, 0.9987561573947719]
Variable-step evolution commutator norm: 0.006326363410197569