Qiskit-Extensions / qiskit-dynamics

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

Fix a bug where y0 of type np.ndarray throws an exception in DynamicsBackend.solve #351

Closed donsano33 closed 3 months ago

donsano33 commented 3 months ago

Summary

Using a np.ndarray as parameter value for y0 in DynamicsBackend.solve(...) threw an exception. This was solved by adding a check if the parameter is of type str before checking the equality with ==

fixes #350

Details and comments

Straightforward implementation. Added the case to the unitest for DynamicsBackend.solve(..)