T-gate injection: the magic state enacts T through Clifford gates and a measurement #
Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #66 and #67, the two rows of
R-006 (specs/magic-plan.md, "The split").
The gate-teleportation circuit: data qubit ψ on wire 0, the magic state |A⟩ = (|0⟩ + e^{iπ/4}|1⟩)/√2
(magicState) on wire 1; CNOT with control 0 and target 1; measure the ancilla in the
computational basis with outcome m; apply S^m to the data. The data qubit is then T ψ — up to
the normalisation 1/√2 of the outcome and, for m = 1, the global phase e^{iπ/4}:
(S^m ⊗ ⟨m|) · CNOT · (ψ ⊗ |A⟩) = (1/√2) · e^{imπ/4} · T ψ.
dataAnc ψ φ : QReg 2— the product state (data, ancilla);sCorr m— the correctionS^mon the data wire;injectSlice φ m ψ : QReg 1— the unnormalised data state after the circuit with resourceφand outcomem;- ★★
injectSlice_magicState— the injection identity (row #66): with the resourcemagicState,injectSlice magicState m ψ = (1/√2) e^{imπ/4} • T ψ, for both outcomes;norm_sq_injectSlice_magicState— each outcome has probability½; - ★
injectSlice_zMagicState— the error transfers: with the resourceZ|A⟩the circuit yields(1/√2)(−e^{iπ/4})^m • Z T ψ; injectionKraus φ m— the Kraus operator(S^m ⊗ ⟨m|) · CNOT · (1 ⊗ |φ⟩)as a matrix on the data qubit;injectionKraus_magicState,injectionKraus_zMagicState— their closed formsc_m • Tandc'_m • Z T;injectionChannel : Channel— the circuit as a quantum channel on the data qubit; ★★injectionChannel_apply—Tenacted (row #67, closesR-006):Φ(ρ) = T ρ T†for everyρ, consuming one magic state;noisyInjectionChannel p— the same with the resource(1 − p)|A⟩⟨A| + p Z|A⟩⟨A|Z; ★noisyInjectionChannel_apply—Φ_p(ρ) = (1 − p) T ρ T† + p Z T ρ T† Z: aZ-error on the resource becomes aZ-error on the output, the error model that distillation (#75–#78) consumes.
Honest scope #
⚠️ One data qubit; the two-qubit circuit is written in the coordinate-operator model of
Clifford.lean/Magic.lean (wires 0 and 1 of QReg 2). The channel is the outcome-averaged
one with the classical correction applied; the measurement statistics are the ‖·‖² of the slices.
Distillation of noisy magic states is BACKLOG #75–#79, Clifford+T density #68–#74.
References: D. Gottesman, I. Chuang, Nature 402 (1999) 390; S. Bravyi, A. Kitaev, PRA 71 (2005)
022316 §II; Nielsen–Chuang §10.6.2; specs/magic-plan.md; specs/BACKLOG.md #66, #67;
specs/future-work.md.
The circuit #
The two-qubit label (x, m): data x on wire 0, ancilla m on wire 1.
Equations
- QuantumInfo.pair x m = ![x, m]
Instances For
The product state ψ ⊗ φ on two qubits: data ψ on wire 0, ancilla φ on wire 1.
Equations
Instances For
The correction S^m on the data wire.
Equations
- QuantumInfo.sCorr m Φ = if m = 0 then Φ else QuantumInfo.sGate 0 Φ
Instances For
The injection identity #
★★ The injection identity (BACKLOG #66): with the magic state as resource, the data qubit
after outcome m and the correction S^m is (1/√2) e^{imπ/4} · T ψ.
Each outcome of the injection has probability ½: ‖slice‖² = ‖ψ‖²/2.
The error transfers #
Z|A⟩, the magic state with a phase-flip error.
Equations
Instances For
The Kraus operators and the channel #
The T gate as a matrix on one qubit.
Equations
- QuantumInfo.tMat = Matrix.diagonal fun (z : Fin 1 → Fin 2) => QuantumInfo.tPhase ^ ↑(z 0)
Instances For
The Z gate as a matrix on one qubit.
Equations
- QuantumInfo.zMat = Matrix.diagonal fun (z : Fin 1 → Fin 2) => QuantumInfo.signChar (z 0)
Instances For
The Kraus operator of outcome m with resource φ: the matrix of ψ ↦ injectSlice φ m ψ,
i.e. (S^m ⊗ ⟨m|) · CNOT · (1 ⊗ |φ⟩).
Equations
- QuantumInfo.injectionKraus φ m = Matrix.of fun (x y : Fin 1 → Fin 2) => (QuantumInfo.injectSlice φ m (QuantumInfo.basisState y)).ofLp x
Instances For
The two Kraus operators of the magic-state circuit are trace-preserving.
The injection channel on the data qubit: Kraus operators (S^m ⊗ ⟨m|) · CNOT · (1 ⊗ |A⟩),
m = 0, 1.
Equations
Instances For
The noisy injection channel: the resource is (1 − p)|A⟩⟨A| + p Z|A⟩⟨A|Z, so the Kraus
operators are √(1 − p) times those of |A⟩ and √p times those of Z|A⟩.
Equations
- One or more equations did not get rendered due to their size.