You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tr checks first if the matrix is Hermitian and changes the type of the output.
...
out=_data.trace(self._data)
# This ensures that trace can return something that is not a number such# as a `tensorflow.Tensor` in qutip-tensorflow.returnout.realif (self.ishermandhasattr(out, "real")
) elseout
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?
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:
The text was updated successfully, but these errors were encountered: