-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shots.bins() generator method (#5476)
**Context:** The current approach for sampling multiple shots involves handling shot vectors by sampling multiple times and processing each shot independently. However, a more efficient strategy would be to sample all shots at once and then process each bin separately. The `shots.bins()` method facilitates this by providing the lower and upper bounds for each bin. **Description of the Change:** - The `shots.bins()` method generates a sequence of tuples, where each tuple represents the lower and upper bounds of a bin. - In `_measure_with_samples_diagonalizing_gates` sample once with total number of shots and use `shots.bins()` to process each bin separately **Benefits:** This method is particularly useful for processing shot quantities in a partitioned manner, as it allows for the separate handling of each bin's range **Possible Drawbacks:** **Related GitHub Issues:** Fixes #5433 --------- Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Nathan Killoran <[email protected]>
- Loading branch information
1 parent
ca9637a
commit 016d2cc
Showing
5 changed files
with
51 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters