Skip to content

Commit

Permalink
Even better Williamson
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Quesada committed Jul 17, 2023
1 parent 1579a7d commit 9544ff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thewalrus/decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def symplectic_eigenvals(cov):
(array): symplectic eigenvalues
"""
M = int(len(cov) / 2)
D, _ = williamson(cov)
return np.diag(D)[:M]
Omega = sympmat(M)
return np.real_if_close(-1j * np.linalg.eigvals(Omega @ cov))[::2]


def blochmessiah(S):
Expand Down

0 comments on commit 9544ff9

Please sign in to comment.