forked from TeamGraphix/graphix
-
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.
This commit introduces a new method `is_pauli` on `M` commands, which returns a pair `(axis, sign)` if the measure is Pauli, and `None` otherwise. This method takes an optional parameter `precision` ($\rho$, default: `1e-6`): a measure is considered to be Pauli if the angle is in an interval $[- \rho + k \cdot \frac \pi 2; \rho + k \cdot \frac \pi 2]$, addressing the precision problem raised in TeamGraphix#181. `axis` is computed by using the `cos` and `sin` definitions of `pauli.py`, solving the inconsistency bug reported in TeamGraphix#188. This commit introduces a new `Sign` class to make code manipulating `Plus` and `Minus` to be more readable than when using `bool`.
- Loading branch information
1 parent
364be19
commit b19ab05
Showing
5 changed files
with
105 additions
and
71 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