Appendix: The Phase Kick-Back Formation
We have the following formula by the phase kick-back formation [18]:
$$ \begin{array}{@{}rcl@{}} U_{f}|x\rangle|\phi_{d}\rangle =\omega^{f(x)}|x\rangle|\phi_{d}\rangle. \end{array} $$
(1)
In what follows, we discuss the rationale behind the above relation (1). Consider the action of the Uf gate on the state |x〉|ϕd〉. Each summand in |ϕd〉 is of the form ωd−j|j〉. We observe that
$$ \begin{array}{@{}rcl@{}} U_{f}\omega^{d-j}|x\rangle|j\rangle =\omega^{d-j} |x\rangle|(j+f(x))\ \text{mod}\ d\rangle. \end{array} $$
(2)
A variable k is introduced such that f(x) + j = k, from which it follows that d − j = d + f(x) − k. Thus, (2) becomes
$$ \begin{array}{@{}rcl@{}} U_{f}\omega^{d-j}|x\rangle|j\rangle =\omega^{f(x)} \omega^{d-k}|x\rangle|k\ \text{mod}\ d\rangle. \end{array} $$
(3)
If k < d we have that |k mod d〉 = |k〉 and thus the summands in |ϕd〉 for which k < d are transformed as follows:
$$ \begin{array}{@{}rcl@{}} U_{f}\omega^{d-j}|x\rangle|j\rangle =\omega^{f(x)}\omega^{d-k}|x\rangle|k\rangle. \end{array} $$
(4)
On the other hand, as both f(x) and j are bounded from above by d, k is strictly less than 2d. Thus, when d ≤ k < 2d, we have |k mod d〉 = |k − d〉. Let k − d = m. We have
$$ \begin{array}{@{}rcl@{}} &&\omega^{f(x)}\omega^{d-k}|x\rangle|k\ \text{mod}\ d\rangle =\omega^{f(x)}\omega^{-m}|x\rangle|m\rangle\\ &&=\omega^{f(x)}\omega^{d-m}|x\rangle|m\rangle. \end{array} $$
(5)
Hence, the summands in |ϕd〉 for which k ≥ d are transformed as follows:
$$ \begin{array}{@{}rcl@{}} U_{f}\omega^{d-j}|x\rangle|j\rangle =\omega^{f(x)}\omega^{d-m}|x\rangle|m\rangle. \end{array} $$
(6)
Finally, regarding (4) and (6), we have
$$ \begin{array}{@{}rcl@{}} U_{f}|x\rangle|\phi_{d}\rangle=\omega^{f(x)}|x\rangle|\phi_{d}\rangle. \end{array} $$
(7)
Therefore, the relation (1) holds.