[X] I have searched exisisting GitHub issues to make sure the issue does not already exist.
Expected behavior
from thewalrus.random import random_covariance
from thewalrus.quantum import Qmat
def rmat(l, hbar=2):
"""
This is the R matrix in https://the-walrus.readthedocs.io/en/latest/gbs.html
"""
idl = np.identity(l)/np.sqrt(2*hbar)
return np.block([[idl, 1j*idl],[idl, -1j*idl]])
cov = random_covariance(m)
Q = Qmat(cov)
rr = rmat(m)
Qp = rr @ cov @ (rr.T.conj()) + np.identity(len(cov))*0.5
print(np.allclose(Q, Qp)) # Comes out to be False
Actual behavior
from thewalrus.random import random_covariance
from thewalrus.quantum import Qmat
def rmat(l, hbar=2):
"""
This is the R matrix in https://the-walrus.readthedocs.io/en/latest/gbs.html
"""
idl = np.identity(l)/np.sqrt(2*hbar)
return np.block([[idl, 1j*idl],[idl, -1j*idl]])
cov = random_covariance(m)
Q = Qmat(cov)
rr = rmat(m)
Qp = rr @ cov @ (rr.T.conj()) + np.identity(len(cov))*0.5
print(np.allclose(Q, Qp.conj())) # Comes out to be True
Before posting a bug report
Expected behavior
Actual behavior
Reproduces how often
Always
System information
Source code
No response
Tracebacks
No response
Additional information
No response