Skip to content

Add CSS.get_destabilizer_ops - #544

Merged
perlinm merged 2 commits into
mainfrom
destab
Jul 22, 2026
Merged

Add CSS.get_destabilizer_ops#544
perlinm merged 2 commits into
mainfrom
destab

Conversation

@perlinm

@perlinm perlinm commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Cleanup of #543. The example (copy-pasted and modified) is now:

Example usage: I have a syndrome vector syndrome_bits = (s_0, s_1, ...) from stabilizer measurements. I want the destabilizer that zeros out that syndrome and commutes with all logical operators. Say the code is self-dual and defined by a minimal set of stabilizer generators. I can construct the desired stabilizer with some thing like:

from qldpc import codes
from qldpc.objects import Pauli

code = codes.SteaneCode()
syndrome_bits = (0, 1, 0)

# X-type stabilizers and their Z-type duals
stabs = code.get_stabilizer_ops(Pauli.X)
destab_ops = code.get_destabilizer_ops(Pauli.Z)

syndrome_vec = code.field(syndrome_bits)  # convert to a galois.FieldArray
print(syndrome_vec)

net_destabilizer = syndrome_vec @ destab_ops
print(net_destabilizer)

@perlinm
perlinm merged commit 27ade63 into main Jul 22, 2026
3 checks passed
@perlinm
perlinm deleted the destab branch July 22, 2026 23:24
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