Rename the two-qubit replacement-branch label prefix from *XX to ~XX or :replace:XX - #679
Open
ciaranra wants to merge 1 commit into
Open
Rename the two-qubit replacement-branch label prefix from *XX to ~XX or :replace:XX#679ciaranra wants to merge 1 commit into
ciaranra wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
p2_weightsdictionaries for DEM building accept two-qubit Pauli labels such asXXas post-gate Pauli branches. A replacement branch, which omits the ideal two-qubit gate before applying the Pauli, was spelled with a*prefix (*XX,*II). The*symbol is being reserved for a different meaning in upcoming noise APIs, so replacement branches are now spelled~XXor:replace:XX(and~II/:replace:IIfor omission only).Behavior change (breaking for configurations)
~XXand:replace:XXare accepted, equivalent, case-insensitive, and whitespace-trimmed.*XXis rejected with aValueErrorthat names both new spellings.IIremains rejected, and its message now points at~II/:replace:II. That message was unreachable before, because plainIIfailed the label check first; it is reachable now.PauliWeights::replacement_entries, approximation modes) is unchanged. Docs, diagnostics, and test messages in the DEM builder, the bindings, and the PythonNoiseParametersdocstrings use the new vocabulary.Existing user configurations that use
*XXwill fail at construction with the migration message.Tests
Rust, in the bindings parser: both spellings parse, case-insensitively;
~IIparses as omission-only;*XXis rejected with a hint containing~XXand:replace:XX; duplicate aliases are rejected; plainIInames the new spellings. Python, in the surface-code noise-parameter tests: a~XXreplacement branch builds a DEM and samples;*XXraisesValueErrormentioning~XX.Verification
cargo test -p pecos-qeccargo test -p pecos-rslib p2_weight_parser_testscargo clippy -p pecos-qec -p pecos-rslib --all-targets -- -D warningscargo fmt -p pecos-qec -p pecos-rslib -- --checkjust python-ci-build-test, then pytest on the QEC surface and DEM test files: 338 passed, 18 xfailedjust lint checkContext
Second of the separable changes ahead of the state-transition noise channel work.