5
$\begingroup$

I'm looking at this paper and try to implement the Quantum adders they define myself.

Suppose we have a number $b=b_{n-1}\dots b_1b_0$ and they want to add a constant number $a=a_{n-1}\dots a_1a_0$.

They define $$A_j = \Pi_{k=1}^{j+1} R_k^{a_{j+1-k}}, \quad R_k = \begin{pmatrix}1&0\\0&e^{i2\pi/2^k}\end{pmatrix}$$

The result can be obtained by first applying a QFT on all qubits, then apply $A_j$ on qubit $j$ and then apply an inverse QFT.

However, if I try to work this out for the simple case where $b=0$ and $a=1$, I end up with a quantum state $$0.5\left|01\right> + (0.5+0.5i)\left|10\right> - 0.5i \left|11\right>.$$ Note in this case, $A_0 = Z$ and $A_1 = S$.

Is there an error in my calculation, or is the definition in the article not correct?

$\endgroup$
  • $\begingroup$ I think that both times you only apply the QFT or its inverse to the register b, not to a. $\endgroup$ – DaftWullie Jun 29 '18 at 12:09
  • $\begingroup$ We only have a register $b$, as $a$ is a constant number and hence just an input. $\endgroup$ – nippon Jun 29 '18 at 13:08
  • $\begingroup$ Ah, sorry, so you're meaning $b=00$ and $a=01$? $\endgroup$ – DaftWullie Jun 29 '18 at 13:10
  • $\begingroup$ Yes. The $a$ is constant and is not related to the QFT $\endgroup$ – nippon Jun 29 '18 at 13:53
  • 4
    $\begingroup$ Here is the circuit in a simulator. Is that helpful? $\endgroup$ – Craig Gidney Jun 29 '18 at 18:13
2
$\begingroup$

I'm assuming an initial state of the form $|a\rangle|b\rangle = |1\rangle|0\rangle$ for your simple case. You first perform a QFT on the right qubit, obtaining $|1\rangle(\frac{|0\rangle+|1\rangle}{\sqrt{2}})$. Next, you apply $A_0 = R_1$ to the right qubit to obtain $|1\rangle(\frac{|0\rangle-|1\rangle}{\sqrt{2}})$. Finally, you apply an IQFT to the right qubit and obtain $|1\rangle|1\rangle$, thereby demonstrating that $1+0=1$. As @DaftWullie noted, all the action happens on the "$b$" qubit; the $a$ qubit (or cbit in this case) acts only as a control.

$\endgroup$
  • $\begingroup$ This is not what I wanted to do. See the comments. Interchanging the gates did solve it. $\endgroup$ – nippon Jul 1 '18 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.