-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 repeat-until functionality to subcircuits #5018
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool. I think I'd like @mpharrigan's input on this as a potential user of this feature (e.g. would this work for measurement-based QC?), but overall I'm quite happy with how well Condition
s work here.
Should we say this closes #461? |
It's good to mention this on that issue, but I don't think it fully closes it. There are simulator-based optimizations for explicit post-selection (e.g. forcing measurements to a specific result) that this doesn't support. |
Also tagging #3234 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted to merge #5033 first since it's smaller - this will need conflict resolution after that finishes.
@95-martin-orion no conflicts |
* Allow flattening of subcircuits * format * Add serialization logic and tests * Change flatten_repetitions (default False) to use_repetition_ids (default True) * Add shape tests for simulation results from flattened subcircuits * docs * add repeat_until * repr/json/etc * format * chagne do_while to repeat_until * merge fix * make mapped_single_loop private * Address code review comments. * Fix test * simplify branch * simplify branch * simplify branch * add unbound controls in repeat_until to control_keys
* Allow flattening of subcircuits * format * Add serialization logic and tests * Change flatten_repetitions (default False) to use_repetition_ids (default True) * Add shape tests for simulation results from flattened subcircuits * docs * add repeat_until * repr/json/etc * format * chagne do_while to repeat_until * merge fix * make mapped_single_loop private * Address code review comments. * Fix test * simplify branch * simplify branch * simplify branch * add unbound controls in repeat_until to control_keys
* Allow flattening of subcircuits * format * Add serialization logic and tests * Change flatten_repetitions (default False) to use_repetition_ids (default True) * Add shape tests for simulation results from flattened subcircuits * docs * add repeat_until * repr/json/etc * format * chagne do_while to repeat_until * merge fix * make mapped_single_loop private * Address code review comments. * Fix test * simplify branch * simplify branch * simplify branch * add unbound controls in repeat_until to control_keys
Adds repeat-until functionality to subcircuits. It's only valid on subcircuits that do not use repetition ids, as otherwise there wouldn't be any mutating measurement value to repeat until.
@95-martin-orion no urgency here, and if we want a different approach for this I'm fine with closing it.