pauli_size
def
The weight (support size) of a k-qubit Pauli operator: the number of qubits on which the operator is not the identity.
Statement
def pauli_size {k : ℕ} (p : PauliLabel k) : ℕ- Defined in
- scout/2610-04621-exact-clifford-optimality-for-two-sided-locally-randomized.md:456
- Verified
- 30 Oct 2026
- Axioms
- none listed
- Built on 1
- PauliLabelA binary symplectic Pauli label on k qubits, given as a pair of binary vectors (x, z) in (ZMod 2)^k x (ZMod 2)^k.
- Used by 6
- sum_pow_pauli_sizeWeight enumerator of Pauli labels: summed over all 4^k labels, x^(k - pauli_size p) equals (x+3)^k. Per qubit the four Pauli choices…
- full_support_paulisThe set of full-support Pauli operators on k qubits, acting non-trivially on every qubit.
- pauli_size_apply_clifford_gate_cnot_leApplying a CNOT gate increases the Pauli size by at most 1.
- pauli_size_apply_clifford_gate_hSingle-qubit Hadamard gate preserves the Pauli size of any Pauli label.
- pauli_size_apply_clifford_gate_sSingle-qubit Phase gate preserves the Pauli size of any Pauli label.
- clifford_circuit_scoreThe integer score S_k(U) of a k-qubit Clifford circuit circ : List (CliffordGate k), defined as the sum over all p in full_support_paulis…
Read back from the Lean
For a natural number k and a Pauli label p : PauliLabel k, pauli_size p is defined as the number of indices i : Fin k such that p.1 i ≠ 0 or p.2 i ≠ 0 (that is, the cardinality of the set of indices i ∈ Fin k where at least one of the two components of p is non-zero).
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 support size (Pauli weight) of a k-qubit Pauli label. -/ def pauli_size {k : ℕ} (p : PauliLabel k) : ℕ := Finset.card (Finset.filter (fun i => p.1 i ≠ 0 ∨ p.2 i ≠ 0) Finset.univ)