-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace convert_to_target
with the Qiskit version
#1600
Conversation
Pull Request Test Coverage Report for Build 8974814830Details
💛 - Coveralls |
@t-imamichi we recently had an issue that the from qiskit_ibm_runtime.utils.backend_converter import convert_to_target as qr_c2t
from qiskit.providers.backend_compat import convert_to_target as qk_c2t
qr_target = qr_c2t(backend.configuration(), backend.properties(), backend.defaults())
qk_target = qk_c2t(backend.configuration(), backend.properties(), backend.defaults())
# then qr_target.operation_names gives:
dict_keys(['id', 'rz', 'sx', 'x', 'cx', 'reset', 'measure', 'switch_case', 'if_else', 'for_loop', 'delay'])
# but qk_target.operation_names gives:
dict_keys(['id', 'rz', 'switch_case', 'if_else', 'cx', 'x', 'measure', 'for_loop', 'delay', 'sx']) Presumably there was a reason for qiskit-ibm-runtime to have its own |
We can look at fixing the issue in Qiskit's converter function; is there an issue open about it already? I assume Besides that the other consideration is that we're planning to deprecate the |
I copied Qiskit
|
@mtreinish I'm guessing no if you're not aware. Somehow I thought you were added to the thread where this was discussed. Is it worth opening an issue in Qiskit at this point if it's going to be deprecated in 1.2?
Sounds like we'll need to copy those over to qiskit-ibm-runtime, since that's still how we get data from the server. |
@t-imamichi can you also add more tests? Like maybe copy the ones on faulty qubits from Qiskit (we already have one on control flow). They can just be unit tests using fake backends. |
I vaguely remember the issue, but I don't remember the specifics. But yeah we still support the converter function for > 1 year so it's good to ensure we get this fixed.
Yeah, I would think so. There's no rush until ~August 2025 (that's when the 1.x series goes EoL) but planning for that and taking ownership of the container objects for the api payloads in the medium term is probably prudent. |
I copied unit tests on faulty qubits from https://github.com/Qiskit/qiskit/blob/main/test/python/providers/test_faulty_backend.py |
I noticed some error occurs due to random seed issue. Need to merge #1616 |
Puala suggested replacing |
No objections, after that, this PR LGTM |
Use local convert_to_target
This is labeled as new feature. Can it not be backported to 0.23.1 if there will be one? Besides fixing #1570 and #1590, it also fixes another issue I am running into (where a backend defines pulse calibrations for a qubit pair that does not have an entry in the gate properties; the old code in 0.23.0 raises a KeyError while the version here skips the missing keys without an exception). |
Summary
This PR copies
qiskit.providers.backend_compat.convert_to_target
toutils.backend_converter.convert_to_target
with some modifications for mypy and lint. Particularly, I addedreset
torequired
to ensurereset
is included in target.Fixes #1590
Details and comments
The script #1590 works fine as follows
main
this PR