I understand that CNOT and Toffoli (CCNOT) gates are not universal for quantum computation since they (alone) cannot create superposition. Moreover, it is totally possible to perform a CNOT operation where the control qubit is in superposition, $\alpha\vert 0 \rangle + \beta\vert 1 \rangle$, and target qubit to be $\vert 0 \rangle$.

My question is can we have a control qubit to be in superposition while using CCNOT, something like the following?

Toffoli Gate containing superposition

If yes, what will be the values for $p, q, $ and $r$? If not, why not?

The related material I found are universality of the toffoli gate and CNOT in superposition.

Thank you in advance!


1 Answer 1


Control qubit can be in superposition, why not? This is how entangled qubits are created. But the circuit you have drawn does not entangle qubits, it actually does not change qubit states at all, and $|p\rangle = \alpha| 0 \rangle + \beta| 1 \rangle$, $|q\rangle=|0\rangle$, $|r\rangle=|0\rangle$.

It would be more interesting if the input value of the 2nd qubit was $|1\rangle$; then the 2nd output value $|q\rangle=|1\rangle$, but there is no separated $|p\rangle$ and $|r\rangle$ output values, instead you have 2-qubit entangled state

$$|pr\rangle=\alpha|00\rangle + \beta|1 1 \rangle$$

  • $\begingroup$ So if the 2nd qubit is $\vert 1 \rangle$, then $\vert q \rangle = \vert 1 \rangle$, $ \vert p \rangle = \alpha\vert 0 \rangle + \beta\vert 1 \rangle$ and $ \vert r \rangle= \vert pr \rangle = \alpha \vert 00 \rangle + \beta \vert 11 \rangle$? $\endgroup$ Commented Dec 18, 2019 at 19:01
  • $\begingroup$ No. $\vert pr \rangle$ is entangled 2-qubit state which cannot be factored into separate $\vert p \rangle$ and $\vert r \rangle$ states. In other words, there is $\vert pr \rangle$ but no $\vert p \rangle$ and $\vert r \rangle$ $\endgroup$
    – kludg
    Commented Dec 18, 2019 at 19:05
  • $\begingroup$ So I can say that the input is three separate qubits and the output is a one separate qubit and one entangled 2-qubit state? $\endgroup$ Commented Dec 18, 2019 at 19:13
  • $\begingroup$ Yes, this is OK; or simply "one separate qubit and two entangled qubits". $\endgroup$
    – kludg
    Commented Dec 18, 2019 at 19:18
  • $\begingroup$ One last thing, I had $\vert q \rangle = \vert 0 \rangle$ and you said it would be more interesting if $\vert q \rangle = \vert 1 \rangle$. Can $\vert q \rangle = \alpha_2 \vert 0 \rangle + \beta_2 \vert 1 \rangle$? How about all three qubits to be in superposition? is that allowed? $\endgroup$ Commented Dec 18, 2019 at 19:24

Your Answer

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

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