-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bloch Messiah decomposition from The Walrus #729
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #729 +/- ##
===========================================
- Coverage 98.33% 38.88% -59.46%
===========================================
Files 78 78
Lines 9603 9578 -25
===========================================
- Hits 9443 3724 -5719
- Misses 160 5854 +5694
Continue to review full report at Codecov.
|
strawberryfields/decompositions.py
Outdated
@@ -1021,53 +1011,7 @@ def bloch_messiah(S, tol=1e-10, rounding=9): | |||
if np.linalg.norm(np.transpose(S) @ omega @ S - omega) >= tol: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a is_symplectic
function in the walrus that you can use directly here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! comments on unmodified lines 🧐
(thanks for the suggestion, will do!)
NOTE: This PR is using thewalrus/main. DO NOT MERGE until there is a new release of The Walrus (don't forget to change the requirement files accordingly).
Context:
The current implementation of the Bloch-Messiah decomposition fails for degenerate symplectic matrices.
Description of the Change:
The Walrus included a new implementation of the Bloch-Messiah decomposition that solves the issue. This PR swaps the
SF implementation for the new improved implementation on TW.
Benefits:
Bloch-Messiah works for degenerate symplectic matrices.
Possible Drawbacks:
None.
Related GitHub Issues:
Closes #728