mitiq
mitiq copied to clipboard
Address executor and observable incompatibility
Description
Fixes #2449
This PR address code changes in the Executor
and Pauli
classes to account for when an Observable
is passed to an executor along with a circuit that already has a measurement on a qubit effected by the Observable
.
Also, I removed a check in the Executor
class, with the assumption the user is passing a valid executor
if an observable
is used.
Furthermore, the docs for the Executor
and Observable
have been updated with the annotation/typehinting requirement.
Finally, additional unit testing has been added to ensure that incompatible Executor
s and Observable
s are caught and an appropriate message is given to the user.
License
- [X] I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.
Before opening the PR, please ensure you have completed the following where appropriate.
- [ ] I added unit tests for new code.
- [X] I used type hints in function signatures.
- [X] I used Google-style docstrings for functions.
- [X] I updated the documentation where relevant.