ThisCalculator

Everyday

Quantum Teleportation Circuit: Build It in a Simulator

Updated · Standard formula, shown below

Quantum Teleportation Circuit: Build It in a Simulator

A quantum teleportation circuit transfers an unknown qubit state to another qubit using shared entanglement and two classical measurement results. You can build and test the protocol in a circuit simulator; the original qubit is measured, so this does not copy the state or send information faster than light.

What You’ll Need

  • A quantum circuit simulator that supports at least three qubits, single-qubit gates, controlled-NOT (CNOT), measurements, and classical bits. A graphical or code-based simulator will work.
  • Three qubits: one for the state to teleport (Q), one for Alice’s entangled pair qubit (A), and one for Bob’s qubit (B).
  • Two classical bits to record Alice’s measurement results. Some simulators attach these to measurements automatically.
  • A test input state. For a first run, use a known state such as |+> = (|0> + |1>)/√2. Later, try a state made with rotations.

Step-by-Step

  1. Create the register. Start a circuit with three qubits and two classical bits. Label the qubits Q, A, and B so it is clear which state is being transferred and which qubits form the shared pair. Simulator wire numbering varies, so use the labels or check its qubit-index convention before adding gates.
  2. Prepare the input state on Q. To use |+>, apply a Hadamard gate (H) to Q, which starts in |0>. To test a less symmetric example, apply a rotation such as Ry(θ) to Q. If using a rotation, note the angle and simulator convention; the state is cos(θ/2)|0> + sin(θ/2)|1> for the usual Y-rotation definition. Do not use a measurement to inspect Q before teleportation, since that would destroy the unknown state.
  3. Make an entangled pair for Alice and Bob. Apply H to A, then CNOT with A as the control and B as the target. A and B are now in the Bell state (|00> + |11>)/√2. Ensure the CNOT control and target are not reversed.
  4. Entangle the input with Alice’s qubit. Apply CNOT with Q as control and A as target, then apply H to Q. These two gates are Alice’s Bell-basis measurement preparation. Keep B untouched; it is the destination qubit.
  5. Measure Alice’s qubits. Measure Q into classical bit mQ and A into mA. Record which classical bit corresponds to which wire. The outcomes are random, but their values determine the correction Bob needs. A circuit that measures before the two preparation gates is not implementing this protocol.
  6. Apply Bob’s corrections using the results. Use a classically controlled X gate on B if mA = 1, and a classically controlled Z gate on B if mQ = 1. In pseudocode: if mA: X(B); if mQ: Z(B). The order of X and Z can be swapped here because the two corrections differ only by an overall phase when both apply. Do not interchange which measurement bit controls which correction.
  7. Run the circuit and inspect B. Execute one shot to see one valid measurement branch, then run many shots to view the four possible result pairs. With corrections active, B should match the original input state in every branch, apart from simulator conventions and numerical precision. The two classical results are each 0 or 1; they are not themselves the teleported state.
  8. Verify the output state. For a clear test, prepare |+> on Q and check that B is also |+>. A measurement of B in the computational (Z) basis gives 0 and 1 about equally often for both Q and B, so those counts alone do not establish that the states match. Compare a simulator statevector or density matrix when available, or measure B in the X basis by applying H to B immediately before measurement; the expected result is 0 every time in an ideal simulation.
  9. Test that the corrections matter. Temporarily remove the conditional X and Z gates and rerun. B will generally not reproduce the input state. Restore the corrections after the comparison. If the simulator only supports circuit diagrams, use its classical-control or feed-forward feature; a circuit with fixed X and Z gates is not equivalent, because the required gates depend on the measurement outcomes.

Common Mistakes

  • Confusing the wires: The input is Q, Alice’s half of the pair is A, and Bob’s is B. The CNOT that creates the pair has A as control and B as target; the next one has Q as control and A as target.
  • Using the wrong correction bit: For the steps above, apply X when Alice’s A measurement is 1, and Z when her Q measurement is 1. If the simulator maps displayed bits in reverse order, map by wire rather than by the printed bit string.
  • Assuming a single output measurement proves equality: A computational-basis test cannot distinguish every pair of states. Choose a measurement basis suited to the input, or compare statevectors when possible.
  • Trying to read the input mid-circuit: Measuring Q before the protocol collapses its state. Use simulator state inspection only when it does not add a physical measurement to the circuit.
  • Expecting teleportation to copy a qubit: The original is consumed by measurement, and Bob’s state is recovered only after classical results guide the corrections.

Tips

Build the circuit in stages and check the entangled pair before adding the teleportation steps. If supported, inspect the pair’s statevector: it should have equal amplitudes for |00> and |11>, with no |01> or |10> component. Keep a written map of qubit labels, classical bits, and control conditions; this prevents most wiring and bit-order errors.

Use at least two different inputs to validate the circuit. The states |0> and |1> are useful wiring checks but are not enough to test phase handling. Include |+> or another state with a relative phase. A statevector simulator can show exact amplitudes; a shot-based simulator estimates measurement frequencies and may show small sampling variation. The ideal protocol works for any single-qubit state, including states not known to the sender.

Troubleshooting

Bob gets the wrong state for some measurement outcomes: Check that both correction conditions are enabled and that they refer to the intended classical bits. Confirm that X is tied to A’s result and Z to Q’s result for the gate order in this guide. Some tools display classical bits in an order that differs from the wire order.

Bob’s result changes when you change the input: First confirm the input-preparation gate is only on Q, and that B is not included in that gate. Then inspect the CNOT directions and ensure the correction gates act on B. If using a custom rotation, check whether the simulator expects radians or degrees.

The simulator rejects conditional gates: Look for a classical condition, feed-forward, or dynamic-circuit option. If unavailable, run separate circuits for each of the four possible measurement outcomes and apply the corresponding fixed correction to B in each branch. Do not claim that an unconditioned circuit performs the full protocol.

Shot counts do not look exact: Increase the number of shots and check that the final measurement basis is appropriate. For |+>, measuring B directly in Z should remain roughly balanced even when teleportation succeeds; apply H before measurement to test it in the X basis. For exact checks, use statevector or density-matrix output rather than finite shots.

Frequently Asked Questions

Does quantum teleportation move a physical qubit?
No. It transfers a quantum state to a qubit already held at the destination. The protocol uses entanglement and two classical bits, and it consumes the original state during measurement.

Can I teleport an unknown state in a simulator?
Yes. The circuit can operate on a state without measuring or otherwise learning its amplitudes. A simulator can track the state mathematically, but a real experiment still requires preparing the input and performing the protocol.

Why are two classical bits required?
Alice’s two measurements produce four possible outcomes. The two bits identify which of four correction cases applies to Bob’s qubit.

Why does the protocol not send information faster than light?
Bob needs Alice’s classical measurement results before he can choose the correction. Classical communication cannot travel faster than light, and without it his qubit alone does not reveal the input state.

Will every simulator use the same qubit numbering?
No. Wire order, displayed bit-string order, and control syntax vary. Follow labeled wires and explicitly map each measurement to its classical bit.

What does an ideal successful run look like?
After the conditional corrections, Bob’s qubit has the same state as the original input, while Alice’s measurements can be any of the four pairs. Small differences can occur in shot-based results, but not in an ideal statevector calculation.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.