Custom
Memories from arbitrary Pauli stabiliser groups
6/6 passed in 124276ms
| Test | What it does | Result |
|---|---|---|
test_derived_logicals | The derived logicals number k and are the protected pure-Z representatives: k=1 for repetition, 2 for [[4,2,2]], 1 for the non-CSS [[5,1,3]]. | ✅ pass |
test_every_check_detected | Every stabiliser, X type included, declares a detector each round, and the final data readout closes the Z ones again: len(stabs) * rounds + Z count. | ✅ pass |
test_input_forms | "ZZI", the letter list ["Z", "Z", "I"], and lower case with a +/- sign ("-izz" is a qubit-0 identity, not a phase) build the identical circuit. | ✅ pass |
test_invalid_rejected | ValueError for a ragged string, a bad letter, an all-identity check, anticommuting stabilisers, an observable that anticommutes with a check, is a check product, or anticommutes with another observable, and an unknown memory. | ✅ pass |
test_memories_protect | Repetition, rotated surface (derived and explicit logical) and the non-CSS [[5,1,3]] memories decode far below the always-zero predictor, and the derived surface logical decodes like the explicit one. | ✅ pass |
test_memory_bases | The algebraic builders read each logical by its own ancilla, so both bases are silent at p=0 and mirrored: a Z memory takes no logical flip under Z noise and one under X noise, and the X memory the reverse. | ✅ pass |