qiskit-community / qiskit-dynamics

Tools for building and solving models of quantum systems in Qiskit
https://qiskit-community.github.io/qiskit-dynamics/
Apache License 2.0
106 stars 60 forks source link

Fixing errors introduced by recent JAX release #69

Closed DanPuzzuoli closed 2 years ago

DanPuzzuoli commented 2 years ago

Summary

Needed to add additional Array wrapping in one spot in rotating_wave_approximation in which a raw JAX array was controlling a binary operation.

Also, in final_state_converter, JAX arrays were being fed into quantum info types, e.g. DensityMatrix, raising an error. I've changed this function to always convert the array to a numpy.array before wrapping in cls, as cls will always be a quantum info type, which can only accept numpy.arrays in any case. The doc string for this function has been updated to explain this.

DanPuzzuoli commented 2 years ago

Updates: