qutip / qutip-jax

JAX backend for QuTiP
BSD 3-Clause "New" or "Revised" License
17 stars 7 forks source link

`AttributeError` when importing `qutip_jax` with M2 chip #61

Closed ofw24 closed 1 month ago

ofw24 commented 1 month ago

When importing qutip_jax, I'm seeing an AttributeError within qutip.core.data when referencing sqrtm within qutip-jax/src/qutip-jax/unary. Looking through the source code it seems like the implementation lies within qutip/core/data/expm, but this isn't referenced correctly and causes the ImportError.

To recreate: import qutip-jax

Output: AttributeError: module 'qutip.core.data' has no attribute 'sqrtm'

Ericgig commented 1 month ago

To use the development version of qutip-jax, you will need the development version of qutip. If you install qutip from source, it should work. The branch dev.major have a few extra addition to support jit and grad with some functions. See https://qutip-jax.readthedocs.io/en/latest/metrics.html

ofw24 commented 1 month ago

Great, this seems to have fixed the issue. Thanks!