Stim
Stim copied to clipboard
Add tick slicing to circuits
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?
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 https://github.com/quantumlib/Stim/issues/739 as well (although actually whatever we decide for tick_slice should probably be the same convention se use for both diagrams)