-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate simulator boilerplate by pushing iteration into base class (#…
…4035) Fixes #2178 Pushes iteration and run repetitions into simulator base class. Simulators only have to implement _create_act_on_args, and _create_step_result, and the base class handles the rest. After the migration to ActOnArgs, all simulators had nearly identical code for iteration and repetitions. The few places where they differed were either bugs (state vector had a bug where noise was not accounted for in terminal measurement gates), or missed optimization opportunities (MPS and Clifford did not split out unitary prefixes when running iterations). This PR consolidates and dedupes that logic. It also lays the foundation for future improvements, such as the ActOnArgs.join/split/move we've discussed separately, to be implemented once and inherited by all simulators.
- Loading branch information
Showing
12 changed files
with
550 additions
and
408 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
Oops, something went wrong.