1
$\begingroup$

What would be the outcome of this circuit?

enter image description here

New contributor
toaster_fan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
4
$\begingroup$

The outcome is $-i\left| 11 \right\rangle $. Here is how I obtained it.

$$ \left| 01 \right\rangle \xrightarrow{\text{X}} \left| 11 \right\rangle \xrightarrow{\text{Y}} -i\left| 10 \right\rangle \xrightarrow{\text{CNOT}} -i\left| 11 \right\rangle \xrightarrow{\text{SWAP}} -i\left| 11 \right\rangle $$

$X$ gate changes 0 to 1, and 1 to 0:

$$ X \left| 0 \right\rangle = \left| 1 \right\rangle \qquad X \left| 1 \right\rangle = \left| 0 \right\rangle $$

$Y$ gate also changes 0 to 1, and 1 to 0, but also changes the phase of the qubit:

$$ Y \left| 0 \right\rangle = i\left| 1 \right\rangle \qquad Y \left| 1 \right\rangle = -i\left| 0 \right\rangle $$

CNOT changes the second qubit if the first qubit is in $\left| 1 \right\rangle$ state and does nothing if the first qubit is in $\left| 0 \right\rangle$ state:

$$ CNOT \left| 00 \right\rangle = \left| 00 \right\rangle \qquad CNOT \left| 01 \right\rangle = \left| 01 \right\rangle $$

$$ CNOT \left| 10 \right\rangle = \left| 11 \right\rangle \qquad CNOT \left| 11 \right\rangle = \left| 10 \right\rangle $$

SWAP gate changes the qubits, first qubit's state becomes the state of the second qubit and vice versa:

$$ SWAP \left| 00 \right\rangle = \left| 00 \right\rangle \qquad SWAP \left| 01 \right\rangle = \left| 10 \right\rangle $$

$$ SWAP \left| 10 \right\rangle = \left| 01 \right\rangle \qquad SWAP \left| 11 \right\rangle = \left| 11 \right\rangle $$

$\endgroup$
  • $\begingroup$ what would be the input of this circuit and why? $\endgroup$ – toaster_fan Jan 13 at 17:37
  • 2
    $\begingroup$ The input is given in your example: in the picture after q[0] it is written | 0> and after q[1] it is written |1>. So, the input state is |0>|1> = |01> $\endgroup$ – Davit Khachatryan Jan 13 at 17:41
  • $\begingroup$ and for that particular input state (|01>) the circuit produces -i|11> state $\endgroup$ – Davit Khachatryan Jan 13 at 17:45
  • $\begingroup$ I just applied the gates to the input state by taking into account that X|0> = |1>, Y|1> = -i|0>, CNOT |1> |0> = |1> |1> and SWAP |11> = |11> $\endgroup$ – Davit Khachatryan Jan 13 at 17:51
  • $\begingroup$ I have edited the answer, hope now it is more clear how I obtained the result :) $\endgroup$ – Davit Khachatryan Jan 13 at 18:08

Your Answer

toaster_fan is a new contributor. Be nice, and check out our Code of Conduct.

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.