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 tick slicing to circuits #765

Open
Strilanc opened this issue May 6, 2024 · 1 comment
Open

Add tick slicing to circuits #765

Strilanc opened this issue May 6, 2024 · 1 comment

Comments

@Strilanc
Copy link
Collaborator

Strilanc commented May 6, 2024

Something like circuit.tick_slice(3, 20) which returns everything starting from tick 3 ending at tick 20.

Need to decide on the inclusion/exclusion semantics carefully. Is there an implicit tick at the start of the circuit?

@mmcewen-g
Copy link
Collaborator

only-mostly-tongue-in-cheek: tick means fence post, so tock should mean fence stringer. after that just use python inclusion semantics

c = stim.Circuit("""
R 0     # TOCK 0
TICK    # TICK 0
H 0     # TOCK 1
TICK    # TICK 1
H 0     # TOCK 2
S 0     # ^
TICK    # TICK 2
M 0     # TOCK 3
""")

c.tick_slice(0, 2) -> stim.Circuit("""
TICK    # TICK 0
H 0     # TOCK 1
TICK    # TICK 1
H 0     # TOCK 2
S 0     # ^
""")

c.tock_slice(1,3) -> stim.Circuit("""
R 0     # TOCK 0
TICK    # TICK 0
H 0     # TOCK 1
TICK    # TICK 1
H 0     # TOCK 2
S 0     # ^
TICK    # TICK 2
""")

This has the other advantage of letting us complicate #739 as well
(although actually whatever we decide for tick_slice should probably be the same convention se use for both diagrams)

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

No branches or pull requests

2 participants