0
$\begingroup$

I can't get my head around this. I'm trying to implement a simple CNOT-Gate. I have to qubits:
c = $|0\rangle$ = [1, 0]
t = $|1\rangle$ = [0, 1]
For all combinations of states $|00\rangle$, $|10\rangle$, $|01\rangle$ and $|11\rangle$ we would now be in $|01\rangle$.
So CNOT should have no effect because qubit c (control) is in state $|0\rangle$. Let's create the tensor product:
$c \otimes t$ = [1 * 0, 1 * 1, 0 * 0, 0 * 1] = [0, 1, 0, 0]

Now we apply CNOT:

$$\operatorname{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix} $$

to the tensor product [0, 1, 0, 0]:
The result is: [0, 1, 0, 0]
So we have 0 * $|00\rangle$, 1 * $|10\rangle$, 0 * $|01\rangle$ and 0 * $|11\rangle$ . So we are actually in state c = $|1\rangle$ and t = $|0\rangle$ now. That is a contradiction to the state we were in at the beginning $|01\rangle$ .
What am I missing here?

$\endgroup$
2
  • $\begingroup$ please see quantumcomputing.meta.stackexchange.com/questions/49/… to see how to format math on the site $\endgroup$
    – glS
    Nov 7, 2022 at 7:17
  • $\begingroup$ your initial and final state are indeed identical, you probably just made a typo converting the output back in bra-ket form $\endgroup$
    – glS
    Nov 7, 2022 at 7:19

3 Answers 3

1
$\begingroup$

This tensor product decomposition is not correct:

0 * |00>, 1 * |10>, 0 * |01> and 0 * |11>

If we use the following notation $$c=(c(0), c(1))$$ $$t=(t(0), t(1))$$ The tensor product can be written: $$ \begin{bmatrix} 0\\ 1\\ 0\\ 0\\ \end{bmatrix} = \begin{bmatrix} c(0)t(0)\\ c(0)t(1)\\ c(1)t(0)\\ c(1)t(1)\\ \end{bmatrix} $$ We now have a system of equations and from $1=c(0)t(1)$ we obtain $c(0)=1$ and $t(1)=1$. From the rest of equations it is straightforward:

$$ \begin{bmatrix} 1\\ 0\\ \end{bmatrix} \otimes \begin{bmatrix} 0\\ 1\\ \end{bmatrix} = \begin{bmatrix} 0\\ 1\\ 0\\ 0\\ \end{bmatrix} $$

I hope this may help you.

$\endgroup$
2
  • $\begingroup$ So in a combined state |xy>, c is x and t is y, right? For example |01> means that c is in state 0 = [1, 0] and y is in state 1 [0, 1]. $\endgroup$
    – Oli
    Nov 7, 2022 at 21:03
  • $\begingroup$ Yes, that's it! $\endgroup$
    – Paul
    Nov 9, 2022 at 8:15
0
$\begingroup$

The technical term is "phase kickback". Googling that term may give you more insight. But yes, in quantum circuits, sometimes things that look like they're one way aren't.

Hand waving: What actually is happening is that CNOT is the a controlled-X operator. There are two fixed-points for the X operator, |+> and |->. Mathematically, there are the two eigenvectors of the X operator. But if you look carefully, you'll see that |+> has an eigenvalue of 1, but |-> has had eigenvalue of -1. So when you apply X to |->, you're more or less flipping the rest of the world upside down.

Less handwavingly, you have to just thing of the operators in terms of their respective matrices. While classically, CNOT is a one-way operator, with qubits it isn't.

$\endgroup$
0
$\begingroup$

I think you're in a jumble with your basis labelling. If you start with $$ |01\rangle\equiv(0,1,0,0)^T, $$ then yes, when you apply cnot, the output is $$ (0,1,0,0)^T $$ Note, however, that this is exactly the same as the input, so it is $|01\rangle$. I'm not sure why you've decided it's $|10\rangle$.

Here's a handy way to get your basis ordering right - just write out the binary numbers in order: 00 (0), 01 (1), 10 (2), 11 (3). This is the order of your basis elements in the vector. So if you've got a 1 in the second element and 0 everywhere else, that means you have $|01\rangle$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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