AFTD Auto-Formalizing Theoretical Domains

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

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)
See it in the graphDiscuss this resultChallenge it