# Understanding quantum teleportation algorithm from qiskit tutorials

I am very new to quantum computing and I have recently started to experiment with qiskit module in python, by following tutorials and implementing simple algorithms.

I constructed the quantum circuit described on this page: Qiskit teleportation And got same results that were expected:

my circuit:

my results:

Which are apparently expected results, since

"we will always measure 0 from Bob's qubit because we started off with |0⟩"

However, if I apply NOT Gate at the start of q0, I still get the exact same results. Is my understanding of algorithm wrong? Shouldnt I be getting q2 as 1 after applying the NOT gate at start?

code:

import qiskit as q
from qiskit.visualization import plot_histogram

circuit = q.QuantumCircuit(3, 3)

# entangle cubit 1 & 2

circuit.h(1)

circuit.cx(1, 2)

# apply CNOT to qubit we want to send
circuit.cx(0, 1)

circuit.h(0)

circuit.measure([0,1], [0,1])

circuit.cx(1, 2)

circuit.cz(0, 2)

print(circuit)

backend = q.Aer.get_backend('qasm_simulator')
job = q.execute(circuit, backend, shots=1024)
result = job.result()

counts = result.get_counts(circuit)
plot_histogram(counts)


Outcomes when NOT gate is inserted at the start of q0:

• Your circuit is good; could you insert the image of the alternative circuit? I am not sure what you did, and a picture is better than words. – kludg Dec 2 '19 at 12:04
• @kludg, you mean circuit in Ascii? I will post that as well along with code – Ach113 Dec 2 '19 at 12:06
• no, i meant the picture of alternative circuit like the picture of original circuit. – kludg Dec 2 '19 at 12:08
• @kludg I am not sure what you mean, the picture in post is generated by circuit.draw(output='mpl') so it is the description of what my code is doing – Ach113 Dec 2 '19 at 12:11
• shouldn't you measure q2 after teleportation? – kludg Dec 2 '19 at 12:28

Your circuit does not measure $$q_2$$ qubit after teleportation; I guess that is why teleportation of $$|1\rangle$$ qubit is shown incorrectly.