-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix bug in JsonScalar::from_scalar (#74)
As @ColbyDeLisle mentioned in issue #63, `pow` refers to powers of two, whereas pyzx's `power2` refers to powers of sqrt(2). This was handled incorrectly in the Exact arm of `JsonScalar::from_scalar`. I have reworked that now so this fixes #63. I believe that `full_simplify` usually leads to scalars of the form `sqrt(2)^n * exp(m*i*pi/4)` for Clifford+T graphs. I refactored the match arm so that these values are always treated exactly. For other scalars, they are simply split up as `phase` and `floatfactor`.
- Loading branch information
Showing
2 changed files
with
91 additions
and
5 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