Skip to content

Add SWEL (self-dual with equivalent logicals) support for CSS codes over arbitrary finite fields#536

Merged
perlinm merged 19 commits into
mainfrom
swel
Jul 17, 2026
Merged

Add SWEL (self-dual with equivalent logicals) support for CSS codes over arbitrary finite fields#536
perlinm merged 19 commits into
mainfrom
swel

Conversation

@perlinm

@perlinm perlinm commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

AI-assisted summary

A SWEL code is a self-dual CSS code admitting a logical-operator basis with Lx = Lz, which is what enables transversal logical Hadamard and S gates.

New:

  • CSSCode.is_swel: basis-independent test for whether such a basis exists. Supports qubits, qudits over GF(q), and subsystem codes, with cheap short-circuits from arXiv:2503.19790.
  • CSSCode.get_swel_logical_ops / CSSCode.set_swel_logical_ops: construct / install such a basis, or raise if none exists.
  • math.get_orthonormal_basis: generic routine returning an orthonormal basis (L @ L.T = I) for the row space of a matrix over any finite field, or None if none exists; handles rank-deficient input (with a promise_full_rank fast path).

Also in this PR:

  • In-place setters (set_logical_ops*, forget_distance, reduce_logical_ops, ...) return self.
  • Code transformations (maybe_to_css, canonicalized, conjugated, ...) preserve cached properties such as dimension and distance.
  • Use galois row_space() in place of row_reduce() + zero-row removal where a row-space basis is intended (common.py, rings.py, encoding.py).

@perlinm perlinm changed the title More support for SWEL codes Add SWEL (self-dual with equivalent logicals) support for CSS codes over arbitrary finite fields Jul 17, 2026
@perlinm
perlinm merged commit 4e9984e into main Jul 17, 2026
3 checks passed
@perlinm
perlinm deleted the swel branch July 17, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant