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

Fix time_reversed_for_flows handling feedback incorrectly #764

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

Fix time_reversed_for_flows handling feedback incorrectly #764

Strilanc opened this issue May 4, 2024 · 1 comment

Comments

@Strilanc
Copy link
Collaborator

Strilanc commented May 4, 2024

import stim
c = stim.Circuit("""
    R 1
    M 1
    CX rec[-1] 0
""")
p = stim.PauliString("Z")
f = stim.Flow(input=p, output=p)
assert c.has_flow(f)
c_inv, (f_inv,) = c.time_reversed_for_flows([f])
assert c_inv.has_flow(f_inv)

Currently raises an exception instead of succeeding.

@Strilanc
Copy link
Collaborator Author

Strilanc commented May 6, 2024

This ends up being pretty complicated to solve. Because the time reversal flips the order of the feedback and the measurement, it's necessary to push the reversed feedback forward in time so that it occurs after the measurement again. It might be easiest to add flow support to "with_inlined_feedback" and then use that to remove any feedback before time reversing.

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

1 participant