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 the ability to tag circuit instructions #848

Merged
merged 13 commits into from
Nov 1, 2024
Merged

Add the ability to tag circuit instructions #848

merged 13 commits into from
Nov 1, 2024

Conversation

Strilanc
Copy link
Collaborator

@Strilanc Strilanc commented Oct 28, 2024

  • For example, TICK[100ns] instead of TICK or I[DYNAMICDECOUPLE] 2 3 5 instead of I 2 3 5
  • Stim ignores tags, except for propagating them through circuit transformations
  • Users can use tags for debugging or to communicate information from tools generating stim circuits to tools consuming them
import stim
circuit = stim.Circuit("""
    R[mlr] 0 1
    TICK[200ns]

    H 0
    TICK[10ns]

    REPEAT[unroll] 3 {
        CZ[adiabatic] 0 1
        TICK[20ns]
    }

    H 0
    TICK[20ns]

    I[DYNAMIC_DECOUPLE_NEW_LATEST_VERSION_5_FINAL_ACTUALLY_FINAL_YXY] 2 3 4 5
    M[include_two_state] 0 1
    DETECTOR[subgraph_2] rec[-1] rec[-2]
""")
assert circuit[0].tag == "mlr"
assert circuit[1].tag == "200ns"
assert circuit[2].tag == ""

Fixes #843

- Fix `SPP` not being classified as a unitary gate
- Fix `SPP_DAG` not being classified as a unitary gate

Fixes #846
- For example, `TICK[100ns]` instead of `TICK` or `I[DYNAMICDECOUPLE] 2 3 5` instead of `I 2 3 5`
- There are likely still places where tags are not flowing through as they should

TODO BEFORE MERGE: add unit tests, modify file format documentation

Fixes #843
…ableauspp

# Conflicts:
#	src/stim/simulators/error_analyzer.test.cc
# Conflicts:
#	src/stim/simulators/error_analyzer.test.cc
@Strilanc Strilanc merged commit 2581b90 into main Nov 1, 2024
57 checks passed
@Strilanc Strilanc deleted the terribletags branch November 1, 2024 22:40
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.

Add tags to stim circuit instructions
1 participant