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

Drop support for backendV2 in from_backend and _to_schedule_list #249

Closed to24toro closed 1 year ago

to24toro commented 1 year ago

Summary

closes https://github.com/Qiskit-Extensions/qiskit-dynamics/issues/236.

Details and comments

The type hint of an argument backend in from_backend supports both backendV1 and backendV2. However, we found it confuses people because almost all backendV2 cannot be used for dynamics backend in reality.

In addition, I changed the type hint of an argument backend from BackendV2 to BackendV1 in _to_schedule_list. In _to_schedule_list, build_schedule is used. Scheduling with backendV2 fails because of some bugs in terra. I am assigned to work on it but cannot solve it yet.

In the future, supporting BackendV2 again in these functions is essential for users.

DanPuzzuoli commented 1 year ago

The only other thing I'm wondering with this PR is, now that we are removing BackendV2 from the type hints, should add a line to the from_backend doc string that this will work for BackendV2 if it has a configuration and defaults. Just as we don't want users to think this will work for all BackendV2, causing confusion, we also want them to be aware that it will work with the ones that have configuration and defaults for backwards compatibility.