Skip to content

Add tapering QPE - #113

Draft
BrendanKKrueger wants to merge 12 commits into
mainfrom
bkk_taperingQPE
Draft

BrendanKKrueger wants to merge 12 commits into
mainfrom
bkk_taperingQPE

Conversation

@BrendanKKrueger

Copy link
Copy Markdown
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants