Skip to content

Commit

Permalink
Cap upper version of symengine in requirements list
Browse files Browse the repository at this point in the history
Out of an abundance of caution this commit places a cap on the allowed
version of symengine users can install to be compatible with Qiskit.
Due to the symengine version dependence discovered in QPY around
serializing ParameterExpressions, we'll likely have a similar issue
when symengine 0.14.0 releases. Pre-emptively capping this means we
aren't going to be in this situation until we can confirm compatibility
with QPY serialization. The real solution for this will come in #13252,
although as this behavior is embedded in QPY formats 10, 11, and 12 at
this point we'll have to handle this edge case moving forward regardless
of whether we introduce a better solution in 1.3.0 or not. Although
realistically in that case we will likely need to just document this as
a limitation when exporting QPY payloads with Qiskit 0.45.0 through
1.2.3 (and with the ``version`` flag set to >= 10 and < 13) and have
explicit error checking around the symengine version (which this PR
adds) when in that code path.
  • Loading branch information
mtreinish committed Oct 1, 2024
1 parent e089d5c commit 7aae984
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions releasenotes/notes/fix-qpy-symengine-compat-858970a9a1d6bc14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ issues:
``use_symengine`` flag was set to ``True`` your only option is to load
the QPY file using Qiskit 0.46.3 and regenerate it using
``use_symengine=False``.
upgrade_other:
- |
The requirement on the support versions of `symengine <https://pypi.org/project/symengine/>`__
has been pre-emptively capped at < 0.14.0 (which is the next minor version as of this release).
This has been done to protect against a potential incompatibility in :mod:`.qpy` when serializing
:class:`.ParameterExpression` objects. The serialization used in
:ref:`qpy_format` versions 10, 11, and 12 for :class:`.ParameterExpression`
objects is tied to the symengine version used to generate it and there is the potential
for a future symengine release to not be compatible. This upper version cap is to prevent
a future release of symengine causing incompatibilities when trying to load QPY files
using :class:`.qpy.load`.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dill>=0.3
python-dateutil>=2.8.0
stevedore>=3.0.0
typing-extensions
symengine>=0.11
symengine>=0.11,<0.14

0 comments on commit 7aae984

Please sign in to comment.