Currently, a program may be designated to execute with a shot count via program.wrap_in_numshots_loop(shots). This value is then sent as a request parameter alongside the program in the translation request.
There are use cases, though, where the user may prefer to directly control that shot-count loop within their own program, with a pattern like:
(this may be better suited for implementation in https://github.com/rigetti/pyquil and then use here)
Currently, a program may be designated to execute with a shot count via
program.wrap_in_numshots_loop(shots)
. This value is then sent as a request parameter alongside the program in the translation request.There are use cases, though, where the user may prefer to directly control that shot-count loop within their own program, with a pattern like:
The user's program could be wrapped with this loop using a function roughly like: