Controlled gates on a set of control qubits #
Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #83, the reachable core of the
re-split row #72 (R-005; specs/magic-plan.md, "The split").
One definition covers the whole gate vocabulary of the Clifford+T chain. For a control set S, a
target j ∉ S and a control pattern pat, ctrlSet S j pat a b c d applies the 2 × 2 block
!![a, b; c, d] to qubit j of those basis labels that match pat on S, and the identity on the
rest:
S = ∅is a single-qubit gate (singleGate, andxGatefor the bit flip);S = {a}with the flip block isCNOT(cnotGate');S = univ.erase jis the multiply-controlled gate of #71 — ★ctrlSet_erase_eq_ctrlGateidentifies them, so the two-level theory of #70 and #71 applies verbatim.
The algebra is blockwise, and that is the point: ★★ ctrlSet_mul says controlled gates on a fixed
(S, j, pat) multiply by multiplying their 2 × 2 blocks, so they are a copy of the 2 × 2
matrices inside the big matrix algebra; ★ ctrlSet_conjTranspose transposes the block,
ctrlSet_one is the identity, and hence ★ ctrlSet_mem_unitaryGroup — such a gate is unitary
exactly when its block is.
agree_off_iff,sum_collapse_update— the two-element collapse every computation here uses;ctrlSet, its three entry lemmas,ctrlSet_one, ★★ctrlSet_mul, ★ctrlSet_conjTranspose, ★ctrlSet_mem_unitaryGroup;singleGate,xGate,cnotGate'and their unitarity,xGate_mul_self; ★ctrlSet_erase_eq_ctrlGate.
Honest scope #
⚠️ This is the vocabulary, not yet the decomposition. Writing a multiply-controlled gate as a
product of CNOTs and single-qubit gates needs three further pieces, and they are numbered: the
control pattern must be freed by conjugating with X gates on the control qubits, so that only the
number of controls matters (BACKLOG #83's companion, also #85); the z-y-z Euler decomposition
of a 2 × 2 unitary with the ABC identity for one control (#84, shared with #81); and the
control-count recursion through square roots (#85). The work-qubit ladder is not a substitute:
it reproduces a multiply-controlled gate only on the sector where the work qubits are 0, not as a
matrix identity, which is what #73 consumes.
References: M. A. Nielsen, I. L. Chuang, Quantum Computation and Quantum Information §4.3;
A. Barenco et al., PRA 52 (1995) 3457 §V–VII; specs/magic-plan.md; specs/BACKLOG.md #83, #84,
#85; specs/future-work.md.
The two-element collapse #
A label agrees with k away from j exactly when it is one of the two labels obtained by
setting the j-th qubit.
The controlled gate #
The gate controlled on the qubits of S with pattern pat, acting by the 2 × 2 block
!![a, b; c, d] on the target qubit j.
Equations
- One or more equations did not get rendered due to their size.
Instances For
★ A controlled gate is unitary exactly when its block is.
The gate vocabulary #
The single-qubit bit flip on qubit j.