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
105 stars 61 forks source link

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

Closed donsano33 closed 7 months ago

donsano33 commented 7 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(..)