On a positive eigenvalue label and a clean quantum ancilla, the HHL algorithm applies a quantum variable rotation with angle , where :
Uncomputation of the eigenvalue register followed by conditioning on flag one multiplies each input eigenvector amplitude by . If is normalized, the success probability is . Choosing from a valid condition number bound gives success probability at least .
Let denote the coherent exact quantum phase estimation unitary operator from the preceding part, with the data quantum register written first. For every eigenvector of ,
because and lies in , with no phase-aliasing ambiguity. Apply coherently to the input quantum state and a clean quantum register; do not measure the eigenvalue label. By linearity it produces .
Append a quantum ancilla in , and use the provided quantum variable rotation with , choosing the nonnegative cosine. The resulting normalized quantum state is
The sum covers both terms; this fixes the potentially ambiguous sum placement in the abbreviated display. The orthonormal basis of eigenvectors and the unit length of each rotated quantum ancilla show that its norm is one. This is quantum spectral filtering by multiplication, not the reciprocal rotation used in the HHL algorithm.
Write the normalized input as , where and . Use a data register, an -qubit eigenvalue register, and a flag quantum ancilla. Begin with .
Apply exact quantum phase estimation to . Its controlled evolutions and inverse quantum Fourier transform produce
Apply the HHL controlled reciprocal rotation, with :
The function of is computed by quantum arithmetic; the rotation is a quantum variable rotation. On a zero eigenvalue label with no input amplitude, define any unitary action, for example no rotation.
Run the inverse phase-estimation circuit. Because each amplitude multiplier depends only on , the eigenvalue register is reset to on both flag branches. Measuring the flag and conditioning on outcome one leaves
The successful unnormalized branch is , giving the probability in the preceding part. The operations independent of are the Hadamard gates preparing the phase register, the inverse quantum Fourier transform, the reversible reciprocal/angle arithmetic, the controlled fixed-angle rotations, and the final flag measurement. Uncomputation removes all arithmetic workspace; the -dependent controlled evolutions and the -dependent state-preparation circuit supply the input-specific operations.
Suppose the angle register stores a fixed-point expansion . Append a target qubit in . For each angle bit , apply to the target a controlled . Rotations about the same axis commute, so their product is and
With retained bits, each controlled rotation decomposes into one- and two-qubit gates and the complete quantum variable rotation has polylogarithmic size. Thus the required branchwise map is implemented coherently for every .
Let a Hermitian operator have dyadic eigenvalues in for known , with controlled access to the unitary operator . This interval ensures that different eigenvalues have different eigenphases; exact representability alone would not exclude phase aliasing, as and both give phase zero. Let a real function obey , and assume the required quantum variable rotations are available. Coherent exact quantum phase estimation, a quantum variable rotation and uncomputation implement
Postselection on flag one gives normalized, with probability , provided this vector is nonzero. Erasing the eigenvalue label by uncomputation is essential to preserve coherence between different eigenvectors. On this dyadic spectrum, gives , so reversing the phase-estimation gates is possible using forward controlled- calls. The choice multiplies by ; a scaled reciprocal gives the different filter used in the HHL algorithm.