forked from quantumlib/Cirq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ignore_measurement_results=True for subcircuits (quantumlib#4760)
Density matrix simulator has a bug that if `ignore_measurement_results` is set, that setting is overlooked within subcircuits. The reason is that this setting check is done in `SimulatorBase.core_iterator`, but that only iterates the outermost circuit. The fix is to move the check into `ActOnArgs.measure`, to ensure that any measurement is replaced with a dephase operation. Surprisingly we did not even have a test for the non-subcircuit case. This PR adds a test for that and the subcircuit case.
- Loading branch information
Showing
5 changed files
with
51 additions
and
8 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