-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 a bug of missing pulse library entry in PulseQobj parsing #11397
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -959,8 +959,12 @@ def _convert_generic( | |
|
||
yield instructions.Play(waveform, channel) | ||
else: | ||
if qubits := getattr(instruction, "qubits", None): | ||
msg = f"qubits {qubits}" | ||
else: | ||
msg = f"channel {instruction.ch}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah both |
||
raise QiskitError( | ||
f"Instruction {instruction.name} on qubit {instruction.qubits} is not found " | ||
f"Instruction {instruction.name} on {msg} is not found " | ||
"in Qiskit namespace. This instruction cannot be deserialized." | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed a bug that results in an error when a user tries to load .calibration | ||
data of a gate in :class:`.Target` in a particular situation. | ||
This occurs when the backend doesn't support pulse waveform payload, while | ||
Qiskit doesn't have corresponding parametric pulse definition. | ||
In this situation, Qiskit pulse object cannot be built, resulting in the failure in | ||
parsing PulseQobj and the user encounters a meaningless error. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the situation where the error is meaningless? This changes the code so that the case where a calibration schedule was unloadable behaves like no calibration was reported by the backend rather than raising an exception. If the user wanted to use the calibration, the user's code will still have a problem. Maybe there is some code that eagerly handles calibrations and can work okay when they are not available? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Qobj is parsed when they are called for the first time (i.e. when a user call I expect the user implements the code that checks if calibration is available on their side. |
||
This error was suppressed, and the .calibration now returns None value instead, | ||
which implies the calibration data is not properly supplied. | ||
nkanazawa1989 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Could we emit a warning (UserWarning?) here with the message from the
QiskitError
? Here we are treating a calibration loading error as equivalent to no calibration being provided and the user might want to know when there is a loading error.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.
Fair enough. Added an error and test in bf723eb