stabrank

Tools for stabilizer-rank bounds on magic states.

stabrank is an open-source Python library for the simulated-annealing search, exhaustive certification, and Lean 4 formal verification of stabilizer-rank decompositions of quantum magic states.

Install

git clone https://github.com/unitaryfoundation/stabrank.git
cd stabrank
uv venv
uv pip install -e .

Quickstart

A two-term decomposition of |𝕊⟩⊗2 via the simulated-annealing engine.

import numpy as np
from stabrank.target_functions import qutrit_strange_state
from stabrank.stabrank_core import run_sa_pauli_expansion

target = qutrit_strange_state(2)              # 9-dim |S>^2
n, p, chi = 2, 3, 2

initial_basis = [
    np.ones(p**n, dtype=complex) / np.sqrt(p**n)
    for _ in range(chi)
]

_, basis, coeffs, residual, *_ = run_sa_pauli_expansion(
    target=target,
    n_orig=n,
    p_prime=p,
    k_subset_size=chi,
    initial_basis=initial_basis,
    num_chains=16,
    early_exit_threshold=1e-12,
)

print(f"|S>^2 ≈ sum of {chi} stabilizer states, residual = {residual:.2e}")

State of the art

Best known exact-rank upper bounds on χR(|M⟩⊗m). Bold cells are tight (equality); other cells are upper bounds.

Qubit H-type orbit

Phase-state representative |T⟩ = (|0⟩ + eiπ/4|1⟩)/√2, Clifford-equivalent to cos(π/8)|0⟩ + sin(π/8)|1⟩ (edge center of the stabilizer octahedron). The cells below are the standard literature values for the “qubit T-state” in the magic-state-distillation sense.

m 12345 678 asymptotic
χR(T⊗m) ≤ 2 2 [1] 3 [1] 4 [6] 6 [1] 6 [2] 12 [2] 12 [2] 2αm, α = log2(3)/4 ≈ 0.3963 [2][8]
χR(T⊗m) ≥ 2 2 [2] 3 [2] 4 [6] m / 100 [7]

Qubit Bravyi–Kitaev T-type orbit

BK T-type representative |T⟩ = cosβ |0⟩ + eiπ/4 sinβ |1⟩, cos(2β) = 1/√3 (face center of the stabilizer octahedron, Bloch vector (1,1,1)/√3). Distinct from the H-type orbit above.

m 1234 asymptotic γ ≤
χR(T⊗m) ≤ 2 2 [6] 3 [6] ≤3 [6] log2(3)/4 ≈ 0.3963 [6]
χR(T⊗m) ≥ 2 2 [6] 3 [6]

Qutrits

orbit m = 1 2 3 4 asymptotic γ ≤
Strange 2 2 [6] 4 [6] ≤4 [6] log3(2)/2 ≈ 0.316 [6]
H3 2 3 [6] 4 [6] ≤8 [6] log3(4)/3 ≈ 0.421 [6]
Norrell 2 3 [6] 4 [6] ≤7 [6] log3(4)/3 ≈ 0.421 [6]
T3 3 3 [3] ≤8 [3] ≤9 1/2 [3]

References

  1. Bravyi, S., Smith, G., Smolin, J. A. Trading classical and quantum computational resources. Phys. Rev. X 6, 021043 (2016). arXiv:1506.01396 · DOI
  2. Qassim, H., Pashayan, H., Gosset, D. Improved upper bounds on the stabilizer rank of magic states. Quantum 5, 606 (2021). arXiv:2106.07740 · DOI
  3. Kocia, L., Sarovar, M. Improved simulation of quantum circuits by fewer Gaussian eliminations. Phys. Rev. A 103, 022603 (2021). arXiv:2003.01130 · DOI
  4. Labib, F. Stabilizer rank and higher-order Fourier analysis. Quantum 6, 645 (2022). arXiv:2107.10551 · DOI
  5. Jain, A., Prakash, S. Qutrit and ququint magic states. Phys. Rev. A 102, 042409 (2020). arXiv:2003.07164 · DOI
  6. Labib, F., Russo, V. Stabilizer-rank bounds for qutrit magic-state orbits. (2026). arXiv preprint, eprint TBA.
  7. Peleg, S., Shpilka, A., Volk, B. L. Lower bounds on stabilizer rank. Quantum 6, 652 (2022). arXiv:2106.03214 · DOI
  8. Kissinger, A., van de Wetering, J., Vilmart, R. Classical simulation of quantum circuits with partial and graphical stabiliser decompositions. TQC 2022, LIPIcs 232, 5:1–5:13. arXiv:2202.09202 · DOI. Sharpens the H-type bound to a finite-rate χR(H⊗t) ≤ (4/3)·20.3963 t via a partial-decomposition technique (|H⟩⊗5 → 3 terms, each retaining a single |H⟩; iterated to remove four |H⟩s at the cost of tripling terms).

Cite the tool


  @misc{labib2026stabilizer,
      title={Stabilizer rank bounds for magic-state orbits}, 
      author={Farrokh Labib and Vincent Russo},
      year={2026},
      eprint={2605.28586},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2605.28586}, 
}