Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.28k stars 2.37k forks source link

Extended the `from_backend` method of `InstructionDurations` to support both `BackendV1` and `BackendV2` (backport #12941) #13009

Closed mergify[bot] closed 3 months ago

mergify[bot] commented 3 months ago

Summary

This PR fixes #12760

I have extended the from_backend method of InstructionDurations so that it supports both BackendV1 and BackendV2 (also GenericBackendV2). To get the instruction durations from the BackendV2, I have used the attribute target. Also, in GenericBackendV2, the (duration, error) for delay and reset is set to (None, None) and this None value raises an error in the update() method of InstructionDurations. So, I am skipping the instructions which have None as the duration (let me know if this is not what we want).

@1ucian0, please review this and let me know if this is acceptable. If you want I can also add tests and/or new release notes for the changes I have made.

Thanks

Details and comments


This is an automatic backport of pull request #12941 done by Mergify.

qiskit-bot commented 3 months ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 10487878456

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 6 91.73%
crates/qasm2/src/parse.rs 12 96.23%
<!-- Total: 19 -->
Totals Coverage Status
Change from base Build 10475958824: -0.02%
Covered Lines: 66802
Relevant Lines: 74385

💛 - Coveralls