Algorithm guide · protocol
Gate teleportation
Teleport a T gate instead of a state. The trick that makes T gates affordable under error correction.
Circuit size: 3 qubits, 2 classical bits
State teleportation · T and S phase gates · Gate byproducts
Review quantum fundamentals →Notation used in this lesson
- |ψ⟩ and ⟨ψ|
- A state vector (ket) and its conjugate transpose (bra). ⟨a|b⟩ is their inner product.
- α, β and i
- α and β are complex amplitudes; i²=−1. A probability is the squared magnitude |α|².
- XOR, · and ⊗
- XOR adds bits modulo two. In s·x, multiply corresponding bits and XOR them. ⊗ combines registers or operations on different wires.
- U†, Σ and Tr
- U† is the adjoint (inverse for a unitary). Σ sums terms. Tr is the matrix trace, the sum of diagonal entries.
- Probability, shots and angles
- Ideal probabilities describe the model; measured shot frequencies fluctuate. Angles inside trigonometric expressions are in radians unless explicitly labeled turns.
1. The problem
Apply T to an input through a specially prepared entangled resource, rather than by placing T directly on the input wire. Learn why the ordinary X/Z teleportation corrections are no longer sufficient.
2. How it works
Move the difficult gate into resource preparation. Bell measurement teleports the input through that resource. T does not commute with every Pauli byproduct, so an additional conditional S repairs the result.
Prepare the resource
Create a Bell pair on q1,q2 and apply T to q2 before it meets the input q0.
Bell-measure input
CX q0→q1, H q0, then measure q0→c0 and q1→c1.
Feed-forward
On q2 apply X on c1, Z on c0 and S on c1, in the circuit’s order.
Inspect output
The unmeasured q2 contains T|ψ⟩ in every corrected branch, up to global phase.
3. The mathematics, one idea at a time
T rotates relative phase by π/4, while S rotates it by π/2.
The gate is stored in the relative phase of this entangled state.
Conjugating an X by T creates an extra phase correction. The implemented X, Z and conditional S remove the byproducts.
Work this through by hand
4. Teleport T onto |+⟩
Three fixed qubits. A |0⟩ input is a simpler basis check but hides T’s relative phase, so |+⟩ is the first informative example.
Choose |+⟩ · T corrected.
| Stage | Calculation or state | What it means |
|---|---|---|
| Input | |+⟩=(|0⟩+|1⟩)/√2 | Both amplitudes initially have the same phase. |
| Corrected target | T|+⟩=(|0⟩+exp(iπ/4)|1⟩)/√2 | The output is not |+⟩ even though both Z probabilities remain 1/2. |
| If conditional S is omitted | Branches with c1=1 give T†|+⟩ instead | The π/4 phase changes sign on those branches. |
Expected outcomes for this example
These are ideal predictions for the stated configuration, not a result already measured by your browser. Rows describing alternative modes or combined events are labeled explicitly.
| Outcome or event | Ideal probability | Interpretation |
|---|---|---|
| 00,01,10,11 | 25% each ideally | Bell record only; all corrected branches have the same target state. |
5. Load the worked example in Composer
The worked example can use smaller or simpler inputs than the gallery defaults. The button below loads the exact circuit used in this lesson.
Selected variant: Gate teleportation · |+⟩ · T corrected
- Save any current circuit you want to keep, then open the worked example. Loading it does not execute a paid hardware job.
- Trace the preparation, main operations and measurements against the worked table. Check the gate editor for controls, targets and angles.
- Start with an ideal noiseless simulator compatible with the circuit. Mid-circuit measurement, reset and feed-forward require support from the chosen backend.
- Inspect the live preview. For a recorded experiment, open Execute, set the available backend options and shots, and Run. Sign in when prompted to retain it in My Jobs.
- Read the output as described below before changing one setting and repeating. The guide describes the original example; edits can change the answer.
6. Read the output correctly
Read Bob’s q2 state amplitudes or Bloch direction to inspect the T phase. The two-bit Bell histogram cannot establish that phase.
The “S correction omitted” variant is a controlled failure comparison, not a second correct implementation.
For verification, appending T† then H to corrected q2 would give 0 ideally.
A bit label is a register value; its bar height is a probability or count. For S shots and observed count k, the sampled frequency is k/S. A typical sampling scale for probability p is √[p(1−p)/S]; this is not a strict error bound. Finite samples do not have to match the ideal percentages exactly.
7. Common mistakes & limits
- This three-physical-qubit demo does not distill magic states or implement a complete fault-tolerant logical T gate.
- An unchanged Z-basis histogram does not mean T had no effect.
8. Check your understanding
Why does input |0⟩ make the phase effect harder to see?
Reveal the reasoning
T|0⟩=|0⟩. There is no relative phase between two occupied basis amplitudes to inspect.
9. Further study
The lesson’s register mappings, supported inputs and loadable example follow Quantket’s implemented circuit. A reference may use different wire names, bit order or resource conventions.
Gallery reference: defaults, definitions & implementation notes
Available example inputs
Choose a named circuit variant in Algorithms. Each variant fixes its preparation, operations and measurement mapping; the worked variant above is one of them.
- Gate teleportation · |+⟩ · T corrected
- Gate teleportation · |0⟩ · T corrected
- Gate teleportation · |1⟩ · T corrected
- Gate teleportation · |−⟩ · T corrected
- Gate teleportation · |+i⟩ · T corrected
- Gate teleportation · complex input · T corrected
- Gate teleportation · |+⟩ · S correction omitted
Implementation notes
T is applied only while preparing the entangled resource, before it meets the input. The rest uses Clifford gates, Bell measurements and classical feed-forward. Preparing magic resources separately is useful under error correction; this ideal three-physical-qubit example performs neither distillation nor a fault-tolerant logical T gate.
Read your saved result
Check the submitted circuit, measured register and execution settings in Run details. Exact results give computed probabilities; sampled results show frequencies from the recorded shots. Edited circuits and noise can change the expected outcome. The algorithm label records the circuit's origin; it does not certify an edited circuit or a measured result.