 at any stage in the circuit in Fig. 20.1. In each gate, the control qubit is H|0) = |0) + |1), within the factor 1/2. The tensor-product output is CUP[(|0) + 11)) @ |u)] or, identically, |0) x /u) + |1) x UP|U) = |0) x |u) + |1) 2 = (|0) x Clearly, the first and second terms in this tensor product belong to the first and second registers, respectively. This is established by developing the tensor product in the left-hand side, starting from the last two terms (or considering K = 2): 2it0ie33 noting that the tensor products |ij), with i, j = 0, 1, are noted li X 2° +jx21. It is clear that the full product yields the summation shown in the right-hand side in Eq. (20.1). Shor's factorization algorithm U2K-1 Figure 20.1 Quantum circuit for phase estimation (front-end module). where Qi = 0, 1 are bits. In particular, we have 2x1p2x (20.3) 2<2422 (20.4) Noting that the terms within braces { } in the right-hand side in Eqs. (20.3) and (20.4) are integers, we have for the imaginary exponentials: e2i2k1i( 2i2-21+ (20.5) Introduce the definition (20.6) and substitute it into Eq. (20.5) to obtain (20.7) We then consider the specific case where Q is exactly defined by K bits, meaning that all bits QK+1,QK+2, are identically zero. Substituting the results in Eq. (20.7) into 20.1 Phase estimation Eq. (20.1) under this assumption, and overlooking the output qubit lu), yields the first register output: x (20.8) As based on Eqs. (19.29) and (19.30), the result in Eq. (20.8), together with the definition in Eq. (20.6), is immediately identified as being the quantum Fourier transform of the "phase" qubit 10) = 16142 QK). We can, thus, recover 16), by performing the inverse Fourier transform of the output register, followed by a measurement in the computational basis, which yields the K classical bits Q1Q2 OK defining the phase. The "back-end" module of the PE circuit, thus, consists first of an inverse Fourier transform circuit, noted FT+. This circuit is shown in Fig. 19.4, while conceived as being traversed from right to left. T