-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing complex values support from Calibrations (#1067)
### Summary This PR aims to remove the use of complex amplitude for `SymbolicPulse` in calibration experiments. Most notable changes are to the `HalfAngleCal` experiment and the `FixedFrquencyTransmon` library. With these changes, support of complex values in general raises a `PendingDeprecationWarning`. ### Details and comments Qiskit Terra recently changed the representation of `SymbolicPulse` from complex amplitude to (`amp`,`angle`). Once the deprecation is completed, some calibration experiments will fail. Additionally, assignment of complex parameters in general has caused problems recently (See Qiskit-Terra issue [9187](Qiskit/qiskit#9187)), and is also being phased out (See Qiskit-Terra PR [9735](Qiskit/qiskit#9735)). Most calibration experiments are oblivious to these changes, with the exception of `HalfAngleCal` and `RoughAmplitudeCal`. The library `FixedFrequencyTransmon` also has to conform with the new representation. To create as little breaking changes as possible, the following were changed: - `FixedFrequencyTransmon` library was converted to the new representation. All experiments will work as they have been with it. - `RoughAmplitudeCal` was changed such that it will work for both real or complex `amp`, without changing the type of the value. - `HalfAngleCal` was changed to calibrate 'angle' instead of the complex amplitude. A user which uses the `FixedFrequencyTransmon` library will experience no change (except for the added parameters). A user which uses custom built schedules will experience an error. To simplify the transition, most likely scenarios (schedule with no `angle` parameter, `cal_parameter_name="amp"`) will raise an informative error with explanation about the needed changes. A `PendingDeprecationWarning` is raised with every initialization of `ParameterValue` with complex type value (which also covers addition of parameter value to a calibration). Note that Qiskit-Terra PR [9897](Qiskit/qiskit#9897) will also raise a warning from the Terra side, for all assignment of complex parameters. Handling of loaded calibrations which do not conform to the new representation will be sorted out once PR #1120 is merged, as it introduces a major change in calibration loading. --------- Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net> Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com>
- Loading branch information
1 parent
e19e45c
commit 5459cc1
Showing
9 changed files
with
224 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
releasenotes/notes/adjust-symbolic-pulses-amp-angle-representation-f5c40007416cf938.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
other: | ||
- | | ||
Qiskit Terra 0.23.0 began phasing out support of complex parameters | ||
in the Pulse module. Mainly, all library symbolic pulses were converted | ||
from complex amplitude representation to a duo of real (float) parameters | ||
(``amp``, ``angle``). To avoid problems, Qiskit Experiments adopted this convention. | ||
Changes were made to :class:`.FixedFrequencyTransmon` and :class:`.HalfAngleCal` | ||
(see upgrade section). With the exception of :class:`.HalfAngleCal`, all | ||
library experiments should continue to function as they did before (even with | ||
complex ``amp``). When used with the :class:`.FixedFrequencyTransmon` library, | ||
:class:`.HalfAngleCal` will also continue working as before. | ||
Eventually, support for complex parameters will be dropped altogether, and it is | ||
thus pending deprecation - including for saving and loading calibration data with | ||
complex values. | ||
upgrade: | ||
- | | ||
The minimal required Qiskit-Terra version was bumped to 0.23 in order to use | ||
the (``amp``, ``angle``) representation of library pulses in Qiskit Pulse. | ||
- | | ||
The representation of pulses in the :class:`.FixedFrequencyTransmon` library | ||
was changed from complex amplitude to (``amp``,``angle``) representation. All pulses | ||
now include an ``angle`` parameter, and the default values of ``amp`` are set | ||
as type ``float`` instead of ``complex``. | ||
- | | ||
:class:`.HalfAngleCal` was changed from updating the complex amplitude of | ||
the pulse, to updating the angle in the (``amp``, ``angle``) representation. When used with | ||
the :class:`.FixedFrequencyTransmon` library, it will continue to work seamlessly | ||
in the new representation. However, when the experiment is used with custom | ||
built pulses, which rely on the old convention of complex ``amp`` (with no | ||
angle parameter) - the experiment will fail. Most reasonable cases will raise | ||
a detailed ``CalibrationError`` explaining the change and the way to adjust | ||
to it. Some edge cases - like a custom built pulse with an ``angle`` parameter | ||
which doesn't conform to the naming convention of Qiskit Terra's | ||
``ScalableSymbolicPulse`` class, or using a loaded calibration with ``complex`` | ||
``amp`` - will result in updating the wrong parameter. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.