Repository navigation
Add tapering QPE - #113
Draft
BrendanKKrueger wants to merge 12 commits into
Draft
Add tapering QPE#113BrendanKKrueger wants to merge 12 commits into
BrendanKKrueger wants to merge 12 commits into
Conversation
BrendanKKrueger
commented
Oct 13, 2026
Collaborator
- Fix ancilla qubit counts
scipy is imported directly in several modules but was only installed transitively.
Prepares any 2^n-amplitude state with uniformly controlled Ry/Rz trees. Gate counts depend only on n and on whether the amplitudes are real, so costs are available without the angles.
Window states can now be built from any two of num_phase_qubits, num_precision_qubits and num_confidence_qubits (or num_phase_qubits alone), with informative errors otherwise. The default uses only the total; windows whose shape depends on the split can override it.
DPSSWindowState prepares the exact DPSS taper of arXiv:2403.18927 on l precision plus m confidence qubits. from_requirements picks the smallest m whose Theorem 1 bound meets the probability of failure; tests check the worst case over phases meets it too.
TruncatedDPSSWindowState keeps only the 2K + 1 lowest frequencies of the DPSS (arXiv:2403.18927 eq. 92) and prepares them with the paper's App. A circuit: an m-qubit state preparation, a phase ramp, sign-extending CNOTs and a QFT. Its failure probability is at most 4x that of the DPSS (eq. 107), for far fewer rotations when l is large.
BandwidthOptimizedWindowState is the taper on the same 2K + 1 frequencies as the truncated DPSS with the smallest average failure probability (arXiv:2403.18927 Sec. VII B), using the same circuit. It is found with an SVD of the out-of-band energy, which stays accurate below the 1e-16 floor of an eigensolver.
qpe_from_pauli_file now passes any algorithm settings through to the config, so other end-to-end tests can reuse it with different window states.
"QPE: QHAT flexible" now accepts ancilla_prep = "dpss", "truncated dpss" or "bandwidth-optimized", sized from energy_error and probability_of_failure or from explicit num_precision_qubits and num_confidence_qubits (either may be replaced by num_phase_qubits). Invalid combinations raise errors that name the config settings. An end-to-end test through a Pauli file checks that the tapered QPE meets its requirements where a rectangular window of the same size does not.
For amplitudes (0.6, 0, 0, 0.8) the second-level angle for prefix 1 is pi (sending |0> to |1>), not 0.
…m, P The tapering paper's symbols for the precision, confidence and total phase qubit counts are specific to that paper. Code, docstrings, the README and tests now say num_precision_qubits, num_confidence_qubits and num_phase_qubits (or N and K where those suffice).
1 - (probability of the 2K + 1 closest estimates) rounded to -2e-16 for the 4-point DPSS at theta = 0 on CI (Python 3.14, Linux), and its square root in test_truncation_bound_pointwise was NaN. Summing the other estimates' probabilities is never negative.
BrendanKKrueger
force-pushed
the
bkk_taperingQPE
branch
from
October 21, 2026 14:25
11d90ce to
dc69e78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.