One control: C¹(U) from two CNOTs and single-qubit gates #
Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #84, part (e2) of R-005
(specs/magic-plan.md, "The split"), the circuit half; the 2 × 2 half is
EulerDecomposition.lean.
Nielsen–Chuang Figure 4.6: a gate with one control is a product of two CNOTs and four
single-qubit gates — ★★ ctrlOf_eq_circuit. The mechanism is the ABC identity of
EulerDecomposition.lean: on the control bit 0 the two CNOTs act trivially and the target sees
A B C = 1, on the control bit 1 they each insert an X and it sees e^{iα} A X B X C = U.
The proof needs one piece of gate algebra, and that piece is the content of this file. ctrlChoice
is the family of gates that apply the 2 × 2 block M b to the target when the control carries
the bit b. It is closed under products, blockwise in each branch separately (★★
ctrlChoice_mul), and it contains every gate the circuit uses:
- a single-qubit gate on the target is
ctrlChoicewith a constant family (gateOf_eq_ctrlChoice); - a diagonal single-qubit gate on the control is
ctrlChoicewith scalar branches (★diagGate_eq_ctrlChoice) — the one place the control qubit is addressed; CNOTisctrlChoicewith branches1andX(cnotGate'_eq_ctrlChoice);- the one-control gate itself is
ctrlChoicewith branches1andU(ctrlOf_eq_ctrlChoice).
So the whole circuit collapses to one ctrlChoice, and the identity is checked one control bit at
a time. gateOf and ctrlOf are #83's singleGate and ctrlSet {a} j addressed by a 2 × 2
matrix instead of four scalars (blockEntry_eq_apply is the bridge).
ctrlChoice,ctrlChoice_apply_of_agree,ctrlChoice_apply_of_not_agree,ctrlChoice_one, ★★ctrlChoice_mul;blockEntry_eq_apply,gateOf,ctrlOf,unitary_entries,gateOf_mem_unitaryGroup,ctrlOf_mem_unitaryGroup;gateOf_eq_ctrlChoice,diagGate_apply,ctrlChoice_diag_apply, ★diagGate_eq_ctrlChoice,cnotGate'_eq_ctrlChoice, ★ctrlOf_eq_ctrlChoice;- ★★
ctrlOf_eq_circuit.
Honest scope #
⚠️ One control. The control-count recursion (C^k(U) from C^{k-1}(√U)) and the pattern
normalisation that frees the control values are BACKLOG #85; ctrlChoice_mul is the algebra they
will be stated in.
References: M. A. Nielsen, I. L. Chuang, Quantum Computation and Quantum Information §4.3
(Figure 4.6 and Corollary 4.2); CsdLean4/Mathlib/QuantumInfo/ControlledGate.lean for the gate
vocabulary; specs/magic-plan.md; specs/BACKLOG.md #84, #85; specs/future-work.md.
The one-control gate family #
★★ One-control gates multiply blockwise, in each branch separately. The control bit is untouched by both factors, so the two branches never mix: this is the algebra every circuit identity with one control is checked in.
The vocabulary of #83, addressed by a 2 × 2 matrix #
The single-qubit gate on j given by a 2 × 2 matrix.
Equations
- QuantumInfo.Controlled.gateOf j M = QuantumInfo.Controlled.singleGate j (M 0 0) (M 0 1) (M 1 0) (M 1 1)
Instances For
The gate M on qubit j controlled by qubit a.
Equations
- QuantumInfo.Controlled.ctrlOf a j M = QuantumInfo.Controlled.ctrlSet {a} j (fun (x : Fin m) => 1) (M 0 0) (M 0 1) (M 1 0) (M 1 1)
Instances For
Unitarity of a 2 × 2 matrix, entry by entry — the form #83's gates ask for.
Every gate of the circuit is a ctrlChoice #
★ A diagonal single-qubit gate on the control qubit is a one-control gate with scalar
branches. This is the only place the control qubit is addressed directly, and it is how the global
phase of the ABC identity enters the circuit.
The circuit #
★★ A gate with one control is a product of two CNOTs and four single-qubit gates
(Nielsen–Chuang Figure 4.6). The phase of the ABC identity rides on the control line as the
diagonal gate diag (1, e^{iα}); the control bit 0 leaves the target A B C = 1, and the control
bit 1 inserts the two Xs, leaving it e^{iα} A X B X C = U.