You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each simulation is executed on a TaskManager. However, after completing each simulation, the TaskManager did not reset the iterator to the beginning of quantum operations so that the next simulation could be executed normally.
Therefore, the iterator remains at the end of quantum operations and nothing is executed for the next simulation. Consequently, the result from the second simulation is always equivalent.
Expected behavior
After completing each simulation, the TaskManager has to reset the iterator to the beginning of quantum operations.
How to Reproduce
See the situation by simply checking the equivalence of the following two circuits with simulations
qc1.x(0);
qc2.x(0);
// add a global phase of -1
qc2.z(0);
qc2.x(0);
qc2.z(0);
qc2.x(0);
The text was updated successfully, but these errors were encountered:
Thanks for raising this issue! I can confirm the underlying problem and have absolutely no idea how that has not surfaced earlier in the tests or during actual use. #348 should fix this.
## Description
This PR fixes an issue that `TaskManager` class was only ever being
reliably usable once due to its internal iterator and permutation not
being reset in further invocations.
Fixes#347
## Checklist:
<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->
- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
---------
Signed-off-by: burgholzer <[email protected]>
Environment information
Description
Each simulation is executed on a TaskManager. However, after completing each simulation, the TaskManager did not reset the iterator to the beginning of quantum operations so that the next simulation could be executed normally.
Therefore, the iterator remains at the end of quantum operations and nothing is executed for the next simulation. Consequently, the result from the second simulation is always equivalent.
Expected behavior
After completing each simulation, the TaskManager has to reset the iterator to the beginning of quantum operations.
How to Reproduce
See the situation by simply checking the equivalence of the following two circuits with simulations
qc1.x(0);
qc2.x(0);
// add a global phase of -1
qc2.z(0);
qc2.x(0);
qc2.z(0);
qc2.x(0);
The text was updated successfully, but these errors were encountered: