-
Notifications
You must be signed in to change notification settings - Fork 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
Sweeping repetition count of circuit fragment #3266
Comments
Related #3235 |
Discussed on Cirq Cynq, no objections - we just need to think through the design around this. |
Subcircuits + loops should help in this |
Actually sending circuits with this feature to hardware is another matter; that behavior is tracked by #3634. |
Prototyped a "CircuitOperation.repeat_until" option here: 968773a, to go in after #4997. It only works on "flattened" subcircuits. To make it work on non-flattened circuits we'd have to do #4888 first, which is prototyped at 8a5f71d. I started an attempt at parameterizing |
Since recursive parameter resolution is now working (#5033) we can do this now. The biggest caveat with this code is that params are floats, and repetitions must be an integer. I added a new type IntParam for the `repetitions` field itself, but it's still possible for the resolver to put a float value there. I added a runtime check for that. It may make sense to allow floats if they're really close to an integer, but I didn't do that here yet. Closes #3266
Since recursive parameter resolution is now working (quantumlib#5033) we can do this now. The biggest caveat with this code is that params are floats, and repetitions must be an integer. I added a new type IntParam for the `repetitions` field itself, but it's still possible for the resolver to put a float value there. I added a runtime check for that. It may make sense to allow floats if they're really close to an integer, but I didn't do that here yet. Closes quantumlib#3266
Since recursive parameter resolution is now working (quantumlib#5033) we can do this now. The biggest caveat with this code is that params are floats, and repetitions must be an integer. I added a new type IntParam for the `repetitions` field itself, but it's still possible for the resolver to put a float value there. I added a runtime check for that. It may make sense to allow floats if they're really close to an integer, but I didn't do that here yet. Closes quantumlib#3266
Is your feature request related to a use case or problem? Please describe.
Oftentimes one has a circuit whose portion is to be repeated a number of times and one would like to sweep the repetition count. Example and context for this issue: implementing CPMG pulse train in cirq, see #3255.
Describe the solution you'd like
Current workaround entails parametrizing each repeated instance with a boolean parameter, so we end up with a number of parameters equal to the maximum of the repetition count. Ideally, we'd only need one parameter for this - repetition count.
What is the urgency from your perspective for this issue? Is it blocking important work?
P2 - we should do it in the next couple of quarters
The text was updated successfully, but these errors were encountered: