Skip to content

QPE vs TSVF-QPE Phase Estimation (IBM Fez)

Patent notice: The underlying methods are covered by pending patent applications.

Objective

Test whether TSVF trajectory filtering can "anchor" the phase estimate in Quantum Phase Estimation, keeping a sharp probability spike on the correct phase binary fraction despite hardware noise as precision qubits increase.

Setup

Parameter Value
Backend IBM Fez (156 qubits)
Algorithm QPE for \(U = R_z(2\pi\phi)\) with eigenphase \(\phi = 1/3\)
Precision qubits t = 3–7
Total qubits t + 1 (eigenstate) + 1 (ancilla) = 5–9
Shots 8,192 per configuration
TSVF variant Mild perturbation + phase probe ancilla
Date March 2026

Why φ = 1/3?

The eigenphase \(\phi = 1/3 = 0.\overline{01}\) in binary is irrational — it cannot be exactly represented in any finite binary fraction. This makes it a good stress test: even a perfect QPE circuit will have inherent approximation error that shrinks as \(2^{-t}\), and hardware noise compounds on top of that.

TSVF Approach

  1. Standard QPE: Hadamard on precision register → controlled-\(U^{2^k}\) kicks → inverse QFT → measure precision qubits
  2. TSVF-QPE: Same + mild chaotic perturbation (Rz/Ry with scale \(\pi/(6\sqrt{t})\), sparse CZ ring) + ancilla phase probe (2-controlled-Ry gates rewarding correct binary fraction bits)
  3. Post-selection: Accept only shots where ancilla measures \(\lvert1\rangle\)

Key Results

t Fid(std) Fid(TSVF) Err(std) Err(TSVF) Ent(std) Ent(TSVF) Accept%
3 0.582 0.064 0.105 0.326 1.97 2.48 35.8%
4 0.551 0.015 0.095 0.267 2.49 3.71 32.0%
5 0.369 0.035 0.148 0.284 3.68 4.76 50.5%
6 0.343 0.012 0.110 0.261 4.05 5.87 60.1%
7 0.157 0.008 0.157 0.245 5.65 6.83 49.6%

Phase Identification

t Correct bits Std best TSVF best
3 011 011 110
4 0101 0101 0010
5 01011 01011 11010
6 010101 010101 000010
7 0101011 0101011 0001110

Result: TSVF does NOT help QPE

Standard QPE correctly identifies φ ≈ 1/3 at all precision levels on IBM Fez — the hardware is good enough to preserve the phase structure even at depth 411 (t=7). The TSVF perturbation, even at the mild scale of \(\pi/(6\sqrt{t})\), destroys the delicate phase coherence that the inverse QFT relies on, producing near-uniform random output.

QPE fidelity versus precision qubits comparing standard and TSVF on IBM Fez
Phase fidelity versus precision qubits (t) on IBM Fez. Standard QPE (blue) maintains high fidelity across all precision levels, correctly identifying φ ≈ 1/3. TSVF-QPE (orange) collapses to near-zero fidelity — the chaotic perturbation destroys the phase coherence that the inverse QFT requires.
QPE phase error versus precision comparing standard and TSVF variants
Phase estimation error versus precision qubits. Standard QPE error decreases with precision (as expected for an irrational eigenphase), while TSVF-QPE error remains high — consistent with random output from destroyed phase structure.
QPE histogram entropy comparison showing TSVF produces near-uniform output
Histogram entropy versus precision. Higher entropy indicates a more uniform (random) distribution. TSVF-QPE entropy approaches the maximum, confirming the inverse QFT produces diffuse rather than peaked output when phase coherence is disrupted.

Why TSVF Fails for QPE

QPE encodes its answer in the phase coherence of the precision register after the inverse QFT. The controlled-\(U^{2^k}\) gates establish precise phase relationships between qubits, and the inverse QFT converts these into a probability peak at the correct binary fraction.

Any unitary perturbation on the precision register — even small rotations — disrupts these phase relationships. The inverse QFT then produces a diffuse distribution instead of a sharp peak. Post-selection on the ancilla cannot recover the destroyed phase information because it was lost before measurement.

Lesson Learned

TSVF trajectory filtering is effective for amplitude-encoded algorithms but fundamentally incompatible with phase-coherence-encoded algorithms. This is not a failure of the implementation but an intrinsic limitation of the perturbation-based approach.

Reproduction

python simulations/qpe_tsvf/run_qpe_tsvf_experiment.py \
    --mode ibm --max-precision 7 --shots 8192
python simulations/qpe_tsvf/run_qpe_tsvf_experiment.py \
    --mode aer --max-precision 7 --shots 8192

Requirements

Requires .secrets.json with ibmq_token for IBM hardware runs.

Using the qgate Adapter

from qgate.adapters.qpe_adapter import QPETSVFAdapter
from qgate.config import GateConfig, ConditioningVariant
from qgate.filter import TrajectoryFilter

# Initialize the QPE TSVF adapter
adapter = QPETSVFAdapter(
    backend=backend,          # AerSimulator() or IBM Runtime backend
    algorithm_mode="standard",  # Use "standard" — TSVF is NOT recommended for QPE
    eigenphase=1 / 3,
    seed=42,
)

# Build and run at t=7 precision qubits
circuit = adapter.build_circuit(n_precision=7, n_cycles=1)
raw_results = adapter.run(circuit, shots=8192)

# Parse results
outcomes = adapter.parse_results(raw_results, n_subsystems=8, n_cycles=1)

# Extract best phase estimate
best_bs, best_phase, best_count = adapter.extract_best_phase(
    raw_results, n_precision=7, postselect=False,
)
correct_bits = adapter.get_correct_phase_bits(7)
print(f"Best phase: {best_phase:.6f} (exact: {1/3:.6f})")
print(f"Best bitstring: {best_bs} (correct: {correct_bits})")

TSVF is not recommended for QPE

Use algorithm_mode="standard" for QPE. The TSVF perturbation destroys phase coherence, which is fundamental to QPE's operation. This is an intrinsic limitation, not an implementation issue. See Why TSVF Works for Some Algorithms for the theoretical explanation.