clifford_cnot_count
def
The CNOT count of a k-qubit Clifford circuit, defined as the number of cnot gates in the list circ : List (CliffordGate k).
Statement
def clifford_cnot_count {k : ℕ} (circ : List (CliffordGate k)) : ℕ- Defined in
- scout/2610-04621-exact-clifford-optimality-for-two-sided-locally-randomized.md:1658
- Verified
- 30 Oct 2026
- Axioms
- none listed
- Built on 1
- CliffordGateAn inductive type representing a quantum gate in a k-qubit Clifford circuit: Hadamard h on qubit i : Fin k, phase gate s on qubit i : Fin…
- Used by 3
- op_757_cnot_two_existsFor k = 2, there exists a Clifford circuit circ : List (CliffordGate 2) satisfying is_1d_chain_circuit circ and clifford_circuit_score…
- op_757_all_to_all_cnot_three_existsFor k = 3 with all-to-all connectivity, there exists a Clifford circuit circ : List (CliffordGate 3) achieving clifford_circuit_score circ…
- op_757_1d_chain_cnot_three_le_fiveFor k = 3 with 1D nearest-neighbor chain connectivity, there exists a Clifford circuit circ : List (CliffordGate 3) satisfying…
Read back from the Lean
Given an implicit natural number k and a list circ of Clifford gates on k qubits (CliffordGate k), clifford_cnot_count circ is the number of CNOT gates in circ, computed as the length of the sublist of circ containing only those elements matching the CliffordGate.cnot constructor.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The CNOT count of a k-qubit Clifford circuit. -/ def clifford_cnot_count {k : ℕ} (circ : List (CliffordGate k)) : ℕ := (circ.filter fun g => match g with | .cnot _ _ _ => true | _ => false).length