diff --git a/docs/changelog.rst b/docs/changelog.rst index 83be035e..e3b57ccf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,12 @@ Changelog ~~~~~~~~~ +Unreleased +---------- + +* Fix conversion of symbols into qiskit. +* Require qiskit >= 1.2.0. + 0.55.0 (July 2024) ------------------ diff --git a/pytket/extensions/qiskit/qiskit_convert.py b/pytket/extensions/qiskit/qiskit_convert.py index 69edbc53..116997aa 100644 --- a/pytket/extensions/qiskit/qiskit_convert.py +++ b/pytket/extensions/qiskit/qiskit_convert.py @@ -35,6 +35,7 @@ import numpy as np from symengine import sympify # type: ignore +from symengine.lib import symengine_wrapper # type: ignore import sympy import qiskit.circuit.library.standard_gates as qiskit_gates # type: ignore @@ -846,7 +847,9 @@ def tk_to_qiskit( # See Parameter.__init__() in qiskit/circuit/parameter.py. new_p = Parameter(p_name) new_p._uuid = uuid - new_p._parameter_keys = frozenset(((p_name, uuid),)) + new_p._parameter_keys = frozenset( + ((symengine_wrapper.Symbol(p_name), uuid),) + ) new_p._hash = hash((new_p._parameter_keys, new_p._symbol_expr)) updates[p] = new_p qcirc.assign_parameters(updates, inplace=True) diff --git a/setup.py b/setup.py index 85e001e0..864aa2f9 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ include_package_data=True, install_requires=[ "pytket >= 1.30.0", - "qiskit >= 1.1", + "qiskit >= 1.2.0", "qiskit-algorithms >= 0.3.0", "qiskit-ibm-runtime >= 0.24.1", "qiskit-aer >= 0.14.2",