Open BoxiLi opened 4 months ago
What I don't understand is, dag
seems to work fine for this case
@jax.jit
def tmp(a):
m = qutip.Qobj(np.array([[1., a], [np.conjugate(a), 1.]]))
m.dag()
return 0.
tmp(1.-1.j)
where _isherm
is used instead of isherm
.
def dag(self):
"""Get the Hermitian adjoint of the quantum object."""
if self._isherm:
return self.copy()
tr
checks first if the matrix is Hermitian and changes the type of the output.However, when determining the
isherm
property,jnp.allclose
is used to check if the matrix is close to hermitian.In principle, following the philosophy of
jit
, anything related to the property of a matrix and will be used in branching the computation should not evaluate the matrix. Maybe for JaxArray we should just leave it as false if it can not be derived explicitly?Example: