-
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
Remove complex amp support for ScalableSymbolicPulse
#11403
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 7480324698
💛 - 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.
Thanks @TsafrirA for taking care of this :)
ref_obj = pulse.Constant(duration=160, amp=1j * 0.1) | ||
|
||
self.assertEqual(assigned, ref_obj) | ||
self.assertEqual(assigned.amp, 0.1j) |
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.
Seems like this is confusing because we can still use complex valued amplitude through parameterization (because this bypasses validation in the constructor). We can probably drop validation in the constructor and let user use valid amplitude value on their responsibility. Note that this pulse will fail in execution anyways because QPY doesn't take complex value, right? I think this test doesn't really make sense.
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.
With Qiskit's main branch you can save a ScheduleBlock
with complex amp
.
In #9897 we added a PendingDeprecationWarning
for the assignment of complex values. We can promote to deprecation in 0.46 and remove in 1.0 if you want.
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. Just minor fix. Qiskit 1.0 should not contain deprecation warning and I think we need to drop support for parameter assignment of complex values.
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Thanks @nkanazawa1989 ! |
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, thanks!
* Remove complex amp support * QPY compatibility fix * lint * Yet another QPY compatibility fix * Yet another QPY compatibility fix * Yet another QPY compatibility fix * Update qiskit/qpy/binary_io/schedules.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Update qiskit/qpy/binary_io/schedules.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * lynt --------- Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Summary
Support for complex
amp
in the instantiation ofScalableSymbolicPulse
is removed.Details and comments
Complex
amp
support was deprecated in #10357 (with some parts awaiting deprecation with #11257 in the 0.46 branch). This PR removes the support.Pulses with complex
amp
loaded from old QPY files are automatically converted to (amp
,angle
) representation (with a user warning). Note that there are three eras with regard to this - complex amp (Terra <0.23), amp,angle with complex amp support (Qiskit < 1.0) and now amp,angle with no complex amp support (Qiskit >= 1.0). QPY version was not bumped, so the "complexity" ofamp
is tested even for QPY files of Qiskit >=1.0. With the next version of QPY,amp
could be assumed to be real.The QPY compatibility test was updated to reflect the difference in the API, but backwards compatibility is maintained.