-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix the output macros.measure with backendV2 #10135
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5173873465
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks almost good to go. Please also add a release note with fix section. @mtreinish do we have plan for 0.24.2?
qiskit/pulse/macros.py
Outdated
|
||
return _measure_v2( | ||
qubits=qubits, | ||
target=backend.target, | ||
meas_map=meas_map, | ||
meas_map=meas_map or getattr(backend, "meas_map", [list(range(backend.num_qubits))]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This attribute is defined in the base class of V2 backend, so it's fair to assume backend has meas_map. On the other hand, it is not implemented and raises NotImplementedError
by default, so
try:
meas_map = backend.meas_map
except NotImplementedError:
meas_map = [list(range(backend.num_qubits))]
is more appropriate. Do you have any reason to use getattr
?
https://github.com/Qiskit/qiskit-terra/blob/02502b5d98796dcc2c8b80ac5d0f2af85e978e5c/qiskit/providers/backend.py#L452-L466
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed at 4ae58e7.
We don't have any date set for a 0.24.2 release, but if we've got patches to go into one then we'll make one. While we won't hold up the 0.24.1 release planned for tomorrow on this, if it merges before then, we could just fold it in. |
Thanks Jake. I don't think we can add this to 0.24.1 because of the tight deadline. 0.24.2 sounds good to me :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor fix for the release note.
releasenotes/notes/fix-outputs-of-measure_v2-8959ebbbf5f87294.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @to24toro for the bugfix.
* fix measure_v2 * modify measure_all * fix meas_map input in measure_v2 * add reno * fix reno * Update reno. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * fix reno again --------- Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> (cherry picked from commit f911366)
* fix measure_v2 * modify measure_all * fix meas_map input in measure_v2 * add reno * fix reno * Update reno. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * fix reno again --------- Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> (cherry picked from commit f911366) Co-authored-by: Kento Ueda <38037695+to24toro@users.noreply.github.com>
Summary
In the process of working on #9501, the output of measure_v1 and measure_v2 don't match.
This is the PR for this fix.
Details and comments