Quantum computing · Theory
Quantum State Preparation for Complex-Valued Amplitudes
arXiv:2610.36680v1 ↗PDF ↗Submitted 27 October 2026
- Question
- Quantum algorithms often compute numbers into binary registers with reversible arithmetic, but then need those numbers as amplitudes. For a complex \(z=x+iy\), the usual route encodes \(x\) and \(y\) separately and adds them with a linear combination of unitaries, which fixes the normalisation by the ranges of \(x\) and \(y\). How can \(z/\alpha\) be loaded coherently, for inputs in superposition, with a normalisation set by \(|z|\) itself?
- Result
- The procedure computes the magnitude \(r'\) and argument \(\phi'\) of \(z\) reversibly with CORDIC, which uses only shifts and additions. It then encodes \(r'/\alpha\) with an exact binary-to-amplitude routine, applies one phase gate per bit of \(\phi'\) to obtain \(e^{i\phi'}\), and uncomputes the arithmetic. The cost is \(O(n^2)\) Toffoli and \(T\) gates and \(O(n)\) ancillas, with error \(|r'e^{i\phi'}-z|=O(2^{-(n-l)})\) for \(n\)-bit inputs with \(l\) integer bits. A reversible in-place multiplication by \(1+2^{-2j}\), exactly invertible despite rounding, lets each CORDIC step run without storing an extra copy of a coordinate.
The paper in detail
The target map is \(\ket x\ket y\ket0\ket0_a\mapsto\ket x\ket y\bigl(\tfrac{z'}{\alpha}\ket0+\ket\perp\bigr)\ket0_a\), with \(z'\approx z\), the inputs preserved and all work registers returned to zero, so it acts correctly on superpositions of inputs. Inputs are \(n\)-bit two’s-complement numbers, and \(\alpha\) is the smallest power of two exceeding every possible \(r'\), so dividing by \(\alpha\) is a shift.
CORDIC copies \((x,y)\), flips it into the right half-plane (recording \(\pm\pi\) in the angle register), and then rotates the vector toward the positive \(x\)-axis by angles \(\alpha_j=\arctan2^{-j}\), clockwise when \(y_j\ge0\): \(x_{j+1}=x_j-d_j2^{-j}y_j\), \(y_{j+1}=y_j+d_j2^{-j}x_j\), \(\phi_{j+1}=\phi_j-d_j\alpha_j\). Each step lengthens the vector by \(\sqrt{1+2^{-2j}}\), so after \(n\) steps \(y_n\approx0\), \(\phi_n\approx\phi\) and \(K_nx_n\approx r\) with \(K_n=\prod_j(1+2^{-2j})^{-1/2}\). A direction qubit copies the sign of \(y_j\) in each step and is cleared only when the whole computation is reversed.
Doing both coordinate updates in place would seem to need the old \(x_j\). The paper instead multiplies \(y_j\) by \(1+2^{-2j}\) in place and then adds \(d_j2^{-j}x_{j+1}\): since \(d_j^2=1\), \((1+2^{-2j})y_j+d_j2^{-j}(x_j-d_j2^{-j}y_j)=y_j+d_j2^{-j}x_j\). The in-place multiplication is reversible because the rounded map \(u\mapsto u+\lfloor u/M\rfloor\), with \(M=2^{2j}\), has the exact inverse \(v\mapsto v-\lfloor v/(M+1)\rfloor\), computed by block long division. Theorem II.1 bounds the result by induction: each step adds at most \(3\delta\) of rounding error, so \(|y_n|=O(2^{-n}x_n+n\delta)\), and with \(O(\log n)\) extra fractional bits the total error is \(O(2^{-(n-l)})\).
Encoding then writes \(r'/\alpha=\sum_jb_j2^{-j}\) into an amplitude exactly with \(O(n)\) Toffolis, and applies \(\mathrm{diag}(1,e^{i2^j})\) on each bit of \(\phi'\) (with \(-2^2\) on its sign bit), which multiplies the amplitude by \(e^{i\phi'}\). Synthesising these \(O(n)\) phase gates to precision \(O(2^{-n}/n)\) costs \(O(n^2)\) \(T\) gates, and the total amplitude error is \(O(2^{-(n-l)}/\alpha+2^{-n})\). Reversing the gain multiplication, the CORDIC steps and the quadrant correction clears every ancilla.
Transferable methods
CORDIC: rotation by shifts and additions
Rotating by \(\arctan2^{-j}\) needs only a shift and an addition, at the price of a known stretch factor. A sequence of such micro-rotations with signs chosen from the sign of \(y\) drives the vector onto the \(x\)-axis, accumulating the argument in one register and leaving the stretched magnitude in another.
The matrix \(\bigl(\begin{smallmatrix}1&-d2^{-j}\\d2^{-j}&1\end{smallmatrix}\bigr)=\sqrt{1+2^{-2j}}\,R(d\,\alpha_j)\), with \(R\) a rotation, so each step rotates by \(\pm\alpha_j\) and stretches by \(\sqrt{1+2^{-2j}}\), independent of the sign. The angles satisfy \(\alpha_j\le\sum_{k>j}\alpha_k+\alpha_{n-1}\), so a greedy choice of signs can reach any angle within \(\sum_j\alpha_j\approx1.7433\) rad of zero, which covers the right half-plane \(|\phi|\le\pi/2\) left after the quadrant flip. The residual angle after \(n\) steps is at most about \(\alpha_{n-1}\approx2^{-(n-1)}\), so \(|y_n|/x_n=O(2^{-n})\) in exact arithmetic.
Editorial check: a fixed-point simulation following the paper’s rounding (arithmetic right shifts toward \(-\infty\), the in-place multiply, \(\lceil\log_2n\rceil+2\) guard bits) on 3000 random inputs in \([-1,1)^2\) gives a worst error \(|r'e^{i\phi'}-z|\) of \(1.0\times10^{-2}\), \(6.3\times10^{-4}\), \(4.0\times10^{-5}\) and \(2.5\times10^{-6}\) for \(n=8,12,16,20\). The error times \(2^n\) stays near 2.6, consistent with \(O(2^{-(n-l)})\) at \(l=0\).
How to reuse it
CORDIC replaces square roots, arctangents, sines and cosines by \(O(n)\) adder calls, which suits reversible circuits where multipliers are costly. The same iteration in rotation mode (driving \(\phi\) to zero) computes \(\cos\) and \(\sin\) of a stored angle, and the hyperbolic variant computes logarithms and exponentials. Because the stretch factor is input-independent, it costs one constant multiplication at the end.
Exact inversion of a rounded in-place product
Rounded arithmetic usually destroys information, which blocks in-place updates in reversible circuits. Multiplication by \(1+1/M\) with floor rounding is an exception: the input is recoverable from the output alone, so the old register can be cleared.
Write \(u=Mq+r\) with \(0\le r<M\). Then \(v=u+\lfloor u/M\rfloor=(M+1)q+r\), and since \(0\le r<M+1\), \(\lfloor v/(M+1)\rfloor=q\), so \(u=v-\lfloor v/(M+1)\rfloor\). Floor division handles negative \(u\) the same way. The division is done by long division in blocks of \(2j\) bits: bringing down block \(a\) onto remainder \(R\in[0,M]\) gives \(MR+a=(M+1)R+(a-R)\), and when \(a<R\), the quotient digit becomes \(R-1\) and \(M+1\) is added to the remainder. Every quotient digit stays in \([0,M-1]\), so digits do not overlap. One comparison bit per block controls the correction.
After the product is formed and swapped into place, the circuit reconstructs \(u\) from \(v\) in fresh workspace, XORs it into the old input register (clearing it), and runs the reconstruction backwards. This works because the reconstruction never read the register it cleared. The cost is \(O(n)\) Toffolis and ancillas. Editorial check: the identity holds for every integer \(u\in[-5000,5000)\) and \(M=4,16,64,256\).
How to reuse it
Any reversible update of the form \(u\mapsto u+\lfloor u/M\rfloor\) (a multiplication by \(1+1/M\) in fixed point) can be done in place without garbage, which is useful for gain corrections, Newton iterations or exponentials built from \(\prod(1+2^{-k})\). More generally, before keeping a copy of an operand for later uncomputation, check whether a rounded map is still injective with a cheap inverse.
Context & limitations
Why it matters. A smaller normalisation raises the success amplitude, so fewer rounds of amplitude amplification are needed. That matters when each round recomputes expensive inputs, as in Hamiltonian simulation. The polar form is also left in registers for further arithmetic before encoding; for instance, a reciprocal needs only \(r^{-1}\) and \(-\phi\).
Limitations. Costs are asymptotic; there are no concrete gate counts and no comparison on a specific application, which the paper names as the next step. The LCU route uses asymptotically fewer Toffoli gates, so the trade-off depends on the application. The gain needs a bound on \(|z|\) tighter than the box bound: if only \(|x|,|y|<2^l\) is known, both routes give normalisation \(2^{l+1}\) (editorial). The error-propagation constant relies on a cited CORDIC analysis, and \(\alpha\) is restricted to powers of two.