Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to detector error models #896

Merged
merged 3 commits into from
Mar 4, 2025
Merged

Add tags to detector error models #896

merged 3 commits into from
Mar 4, 2025

Conversation

Strilanc
Copy link
Collaborator

@Strilanc Strilanc commented Mar 4, 2025

Adds the ability to tag instructions in detector error models (like error[crosstalk](0.1) D1 D2). Tags have no semantic effect, other than to be propagated. Outside systems can read the tags for custom behavior, or to help with debugging.

stim.Circuit.detector_error_model also now flows tags from the circuit into the dem. Tags on noise instructions end up as tags on error instructions, tags on detectors are kept, and so forth.

For example:

print(stim.Circuit("""
    R 0
    X_ERROR[hello-world](0.25) 0
    M 0
    DETECTOR[alarm] rec[-1]
""").detector_error_model())

prints:

error[hello-world](0.25) D0
detector[alarm] D0

Fixes #872

@Strilanc Strilanc enabled auto-merge (squash) March 4, 2025 22:40
@Strilanc Strilanc merged commit bd60b73 into main Mar 4, 2025
56 checks passed
@Strilanc Strilanc deleted the demtagging branch March 4, 2025 22:54
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.

tags don't appear in the printout of explain_detector_error_model_errors
1 participant