Computing Library › Worked Examples
Worked Examples

Iterative Quantum Phase Estimation Numbers

Extract the phase of an eigenvalue one bit at a time using a single ancilla qubit, and reconstruct the value from the measured bits.

Problem

Iterative phase estimation (IPE) determines the eigenphase phi of a unitary U with eigenvalue e^{2 pi i phi}, using just one ancilla qubit reused across rounds instead of the large register of textbook phase estimation. Each round extracts one binary digit of phi, from least to most significant.

Target

Suppose phi = 0.101 in binary = 0.625. We estimate three bits. Round k applies controlled-U to the power 2^{n-k}, corrects the ancilla phase using bits already found, then measures in the X basis to read the next bit.

python

phi=0.625  # = 0.101 binary
bits=[]
for k in range(3):        # bit index from least significant
    # feedback phase from previously found bits
    feedback=sum(b*2**-(j+2) for j,b in enumerate(reversed(bits)))
    val=(2**(2-k))*phi - feedback
    bit=int(round(val))%2
    bits.append(bit)
bits=bits[::-1]
est=sum(b*2**-(i+1) for i,b in enumerate(bits))
print('bits',bits,'estimate',est)  # [1,0,1] -> 0.625

Result

The three measured bits are 1, 0, 1, reconstructing phi = 0.625 exactly because the phase is a clean three-bit fraction. When phi is not a dyadic fraction the bits give the nearest 3-bit approximation, and more rounds add precision. The feedback step is essential: it removes the contribution of already-known lower bits so each measurement is deterministic in the noiseless case.