Controlled single-qubit gates, Z and T phase gates, and the Clifford + T decomposition #
This module defines the controlled-V two-qubit gate (Gate.controlled), the single-qubit register
phase gates Gate.pauliZ (diag(1, -1), obtained by reindexing Cslib.Quantum.pauliZ) and
Gate.phaseT (diag(1, e^{i π / 4})), and proves the exact 2-term Clifford decomposition
T = e^{i π / 8} cos (π / 8) · I - i e^{i π / 8} sin (π / 8) · Z (Gate.phaseT_eq_comb_pauliZ)
together with its magic ℓ₁ weight cos (π / 8) + sin (π / 8) = √(1 + 1 / √2)
(Gate.cos_add_sin_pi_div_eight).
Main definitions #
Cslib.Quantum.Gate.controlled: the two-qubit controlled-Vgate (|0, b⟩ ↦ |0, b⟩,|1, b⟩ ↦ |1⟩ ⊗ V |b⟩) for anyV : Gate 1.Cslib.Quantum.Gate.pauliZ: the single-qubit Pauli-Zgate (diag(1, -1)), reindexingCslib.Quantum.pauliZalongFin 1 → Bool ≃ Bool.Cslib.Quantum.Gate.phaseT: the single-qubitπ / 4phase (T) gate (diag(1, e^{i π / 4})).
Main results #
Cslib.Quantum.Gate.controlled_apply,Cslib.Quantum.Gate.pauliZ_apply,Cslib.Quantum.Gate.phaseT_apply: matrix-entry characterizations of the three register gates.Cslib.Quantum.Gate.cos_add_sin_pi_div_eight:cos (π / 8) + sin (π / 8) = √(1 + 1 / √2).Cslib.Quantum.Gate.phaseT_eq_comb_pauliZ: exact2-term Clifford linear combination forGate.phaseTin{1, Gate.pauliZ}.
References #
The controlled-V two-qubit gate (|0, b⟩ ↦ |0, b⟩, |1, b⟩ ↦ |1⟩ ⊗ V |b⟩) for any
single-qubit gate V : Gate 1.
Single-qubit Pauli-Z register gate (diag(1, -1)), reindexing Cslib.Quantum.pauliZ along
Fin 1 → Bool ≃ Bool.
Single-qubit T (π / 4 phase) gate (diag(1, e^{i π / 4})).
Exact 2-term Clifford decomposition of Gate.phaseT:
T = e^{i π / 8} cos (π / 8) · I - i e^{i π / 8} sin (π / 8) · Z, whose absolute coefficients
sum to cos (π / 8) + sin (π / 8) = √(1 + 1 / √2).