0

I was reading this page about Quantum Teleportation :-
https://qiskit.org/textbook/ch-algorithms/defining-quantum-circuits.html
Following this quantum circuit diagram, I calculated the quantum states (from left to right as it process thru the diagram) but for the case of classical bits result of 11, I find that if I perform Z gate before X gate (as the diagram is drawn), Bob's get the wrong qubit by a factor of -1.
The matrix for performing Z before X is this :-
( 0,-1)
( 1, 0)
The matrix for performing X before Z is this :-
( 0, 1)
(-1, 0)
I get the right qubit for Bob if I do X before Z. So I need someone to double-check the calculations again. Is the diagram on QisKit web-site correct? Thanks.

Hum YW
  • 1
  • 2
  • 1
    just so you know, gates don't generally commute, order always matter, as you may already know quantum gates can be represented as matrices, right? Matrices simply do not commute and so are the quantum gates (there are some few exceptions that commute tho). – user206904 Oct 20 '20 at 15:58

1 Answers1

2

The diagram in that specific section of the textbook is incorrect, and if you go to the Quantum Teleportation Chapter of the Qiskit Textbook, you will see that X comes before Z. The reason that the diagram you referenced is incorrect is because, as you just showed, XZ (performing Z before X) is not equal to ZX (performing X before Z), and ZX gives the correct result, meaning the order matters and X should be applied before Z. I've brought up this issue on Github which you can view at the following link: https://github.com/qiskit-community/qiskit-textbook/issues/714

Winona
  • 166
  • 1
  • 5
  • Thanks for confirming that the first diagram is incorrect. Hope the authors will fix it for future readers and avoid the confusion I had. Thanks again. – Hum YW Sep 02 '20 at 02:38
  • This is a late update, but the authors have fixed the issue! If you find errors like that in the future, you can always write an issue at https://github.com/qiskit-community/qiskit-textbook – Winona Oct 20 '20 at 18:38