|
| 1 | +--- |
| 2 | +fixes: |
| 3 | + - | |
| 4 | + Fixed an issue with :func:`.qpy.load` when loading a QPY file containing |
| 5 | + a :class:`.ParameterExpression`, if the versions of ``symengine`` installed |
| 6 | + in the generating and loading environments were not the same. For example, |
| 7 | + if a QPY file containing :class:`.ParameterExpression`\ s was generated |
| 8 | + using Qiskit 1.2.2 with ``symengine==0.11.0`` installed, Qiskit 1.2.2 with |
| 9 | + ``syengine==0.13.0`` installed would be unable to load it. |
| 10 | +
|
| 11 | + Previously, an error would have been raised by ``symengine`` around this |
| 12 | + version mismatch. This has been worked around for ``symengine`` 0.11 and |
| 13 | + 0.13 (there was no 0.12), but if you're trying to use different versions of |
| 14 | + ``symengine`` and there is a mismatch, this version of Qiskit still might not |
| 15 | + work. |
| 16 | +issues: |
| 17 | + - | |
| 18 | + Versions of Qiskit before 1.2.3 will not be able to load QPY files dumped |
| 19 | + using :func:`.qpy.dump`, even with ``version`` set appropriately, if: |
| 20 | +
|
| 21 | + * there are unbound :class:`.ParameterExpression`\ s in the QPY file, |
| 22 | + * the ``use_symengine=True`` flag was set (which is the default in Qiskit >= |
| 23 | + 1.0.0) in :func:`.qpy.dump`, |
| 24 | + * the version of ``symengine`` installed in the generating and loading |
| 25 | + environments are not within the same minor version. |
| 26 | +
|
| 27 | + This applies regardless of the version of Qiskit used in the generation (at |
| 28 | + least up to Qiskit 1.2.3 inclusive). |
| 29 | +
|
| 30 | + If you want to maximize compatibility with older versions of Qiskit, you |
| 31 | + should set ``use_symengine=False``. Newer versions of Qiskit should not |
| 32 | + require this. |
| 33 | + - | |
| 34 | + QPY files from the Qiskit 0.45 series can, under a very specific and unlikely |
| 35 | + set of circumstances, fail to load with any newer version of Qiskit, |
| 36 | + including Qiskit 1.2.3. The criteria are: |
| 37 | +
|
| 38 | + * the :class:`.QuantumCircuit` or :class:`.ScheduleBlock` to be dumped |
| 39 | + contained unbound :class:`.ParameterExpression` objects, |
| 40 | + * the installed version of ``symengine`` was in the 0.9 series (which was the |
| 41 | + most recent release during the support window of Qiskit 0.45), |
| 42 | + * the ``use_symengine=True`` flag was set (which was *not* the default). |
| 43 | +
|
| 44 | + Later versions of Qiskit used during generation are not affected, because |
| 45 | + they required newer versions than ``symengine`` 0.9. |
| 46 | +
|
| 47 | + In this case, you can recover the QPY file by reloading it with an environment |
| 48 | + with Qiskit 0.45.3 and ``symengine`` 0.9.2 installed. Then, use |
| 49 | + :func:`.qpy.dump` with ``use_symengine=False`` to re-export the file. This |
| 50 | + will then be readable by any newer version of Qiskit. |
| 51 | +upgrade: |
| 52 | + - | |
| 53 | + The supported versions of `symengine <https://pypi.org/project/symengine/>`__ |
| 54 | + have been pre-emptively capped at < 0.14.0 (which is expected to be the next |
| 55 | + minor version, as of this release of Qiskit). This has been done to protect |
| 56 | + against a potential incompatibility in :mod:`.qpy` when serializing |
| 57 | + :class:`.ParameterExpression` objects. The serialization used in |
| 58 | + :ref:`qpy_format` versions 10, 11, and 12 for :class:`.ParameterExpression` |
| 59 | + objects is tied to the symengine version used to generate it, and there is the potential |
| 60 | + for a future symengine release to not be compatible. This upper version cap is to prevent |
| 61 | + a future release of symengine causing incompatibilities when trying to load QPY files |
| 62 | + using :class:`.qpy.load`. |
0 commit comments