Curriculum / Noise & Error Correction / Magic State Distillation

Lesson 12 of 14ReadingPro+75 XP

Magic State Distillation

Why T gates are expensive and how magic states enable universal fault-tolerant computation.

Magic State Distillation

Magic state distillation is the protocol by which high-fidelity T gates are implemented fault-tolerantly. It is one of the most resource-intensive subroutines in fault-tolerant quantum computing, consuming most of the physical qubit overhead in realistic FT architectures.

The T gate problem:

The T gate (π/8 gate) is . It is a non-Clifford gate: it cannot be simulated efficiently classically and is needed for universal quantum computing. Unlike H, S, CNOT (Clifford gates), T cannot be implemented transversally on most error correcting codes.

The solution: prepare a "magic state" and consume it to implement T via gate teleportation:

T|ψ⟩ can be implemented as:
1. Prepare |T⟩ = T|+⟩
2. Apply CNOT between |ψ⟩ and |T⟩
3. Measure |T⟩ in the computational (Z) basis
4. Apply S gate to |ψ⟩ conditionally

Distillation protocol:

Physical T gates are noisy. Magic state distillation takes many noisy copies of |T⟩ and "distills" them into fewer, higher-fidelity copies:

Input statesProtocolOutput statesError suppression
15 noisy |T⟩ (error ε)15-to-1 Bravyi-Kitaev1 high-fidelity |T⟩ (error 35ε³)Cubic in ε
10 noisy |T⟩ (error ε)Some protocols2 |T⟩ (error ~O(ε³))Cubic in ε

The factor of 35ε³ means: if ε = 0.01 (1% T gate error), the output has error 35 × (0.01)³ = 3.5 × 10⁻⁵, dramatically better.

The 15-to-1 distillation protocol

The Bravyi-Kitaev 15-to-1 protocol encodes 15 noisy magic states in a [[15,1,3]] Reed-Muller code. If 1 or fewer of the 15 input states are faulty, the encoding checks detect all errors. If the check passes, the output state has error reduced from ε to 35ε³. This protocol can be nested: feed 15² = 225 level-0 states to get 15 level-1 states, then distill those to 1 level-2 state with error 35(35ε³)³ ≈ 10⁶ε⁹. Distillation factories can produce T gates with error < 10⁻¹⁵ from physical gates with error 10⁻³.

This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.

How this lesson works

A guided reading lesson with interactive knowledge checks. Concepts are explained step by step with circuit diagrams and runnable examples, and you confirm understanding before moving on.

Part of: Noise & Error Correction

Understand quantum noise and build error correction codes to protect quantum information.

This lesson is part of Pro

Unlock Noise & Error Correction and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.