qiskit 1.2.2__cp38-abi3-win32.whl → 1.2.3__cp38-abi3-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
qiskit/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
qiskit/_accelerate.pyd CHANGED
Binary file
@@ -455,7 +455,7 @@ attempt to "close over" outer circuit registers, or use hidden parameters inside
455
455
  :class:`Instruction`\ s can be related to other circuits to provide a decompositions by using
456
456
  their :attr:`Instruction.definition` attribute, which provides a local, one-off decomposition. This
457
457
  can be in whatever basis set of operations is most convenient to you, as long as the definitions of
458
- all contained gates have some topological order; that is, you cannot use a gate in a definition it
458
+ all contained gates have some topological order; that is, you cannot use a gate in a definition if
459
459
  its own definition depends on the parent. If the :class:`Instruction` should be considered entirely
460
460
  opaque to optimizers, its :attr:`~Instruction.definition` can be ``None``. See
461
461
  :ref:`circuit-custom-gates` for more detail.
@@ -63,7 +63,7 @@ class RXXGate(Gate):
63
63
 
64
64
  .. math::
65
65
 
66
- R_{XX}(\theta = \pi) = i X \otimes X
66
+ R_{XX}(\theta = \pi) = -i X \otimes X
67
67
 
68
68
  .. math::
69
69
 
@@ -63,7 +63,7 @@ class RYYGate(Gate):
63
63
 
64
64
  .. math::
65
65
 
66
- R_{YY}(\theta = \pi) = i Y \otimes Y
66
+ R_{YY}(\theta = \pi) = -i Y \otimes Y
67
67
 
68
68
  .. math::
69
69
 
@@ -108,7 +108,7 @@ class RZXGate(Gate):
108
108
 
109
109
  .. math::
110
110
 
111
- R_{ZX}(\theta = \pi) = -i Z \otimes X
111
+ R_{ZX}(\theta = \pi) = -i X \otimes Z
112
112
 
113
113
  .. math::
114
114
 
qiskit/qpy/__init__.py CHANGED
@@ -116,6 +116,30 @@ and how the feature will be internally handled.
116
116
 
117
117
  .. autoexception:: QPYLoadingDeprecatedFeatureWarning
118
118
 
119
+ .. note::
120
+
121
+ With versions of Qiskit before 1.2.3, the ``use_symengine=True`` argument to :func:`.qpy.dump`
122
+ could cause problems with backwards compatibility if there were :class:`.ParameterExpression`
123
+ objects to serialize. In particular:
124
+
125
+ * When the loading version of Qiskit is 1.2.3 or greater, QPY files generated with any version
126
+ of Qiskit >= 0.46.0 can be loaded. If a version of Qiskit between 0.45.0 and 0.45.3 was used
127
+ to generate the files, and the non-default argument ``use_symengine=True`` was given to
128
+ :func:`.qpy.dump`, the file can only be read if the version of ``symengine`` used in the
129
+ generating environment was in the 0.11 or 0.13 series. However, if the environment was created
130
+ during the support window of Qiskit 0.45, it is likely that ``symengine==0.9.2`` was used.
131
+
132
+ * When the loading version of Qiskit is between 0.46.0 and 1.2.2 inclusive, the file can only be
133
+ read if the installed version of ``symengine`` in the loading environment matches the version
134
+ used in the generating environment.
135
+
136
+ To recover a QPY file that fails with ``symengine`` version-related errors during a call to
137
+ :func:`.qpy.load`, try first to use Qiskit >= 1.2.3 to load the file. If this still fails,
138
+ it is likely because Qiskit 0.45.x was used to generate the file with ``use_symengine=True``.
139
+ In this case, use Qiskit 0.45.3 with ``symengine==0.9.2`` to load the file, and then re-export
140
+ it to QPY setting ``use_symengine=False``. The resulting file can then be loaded by any later
141
+ version of Qiskit.
142
+
119
143
  QPY format version history
120
144
  --------------------------
121
145
 
@@ -20,9 +20,6 @@ from io import BytesIO
20
20
 
21
21
  import numpy as np
22
22
  import symengine as sym
23
- from symengine.lib.symengine_wrapper import ( # pylint: disable = no-name-in-module
24
- load_basic,
25
- )
26
23
 
27
24
  from qiskit.exceptions import QiskitError
28
25
  from qiskit.pulse import library, channels, instructions
@@ -106,7 +103,7 @@ def _loads_symbolic_expr(expr_bytes, use_symengine=False):
106
103
  return None
107
104
  expr_bytes = zlib.decompress(expr_bytes)
108
105
  if use_symengine:
109
- return load_basic(expr_bytes)
106
+ return common.load_symengine_payload(expr_bytes)
110
107
  else:
111
108
  from sympy import parse_expr
112
109
 
@@ -20,9 +20,6 @@ import uuid
20
20
 
21
21
  import numpy as np
22
22
  import symengine
23
- from symengine.lib.symengine_wrapper import ( # pylint: disable = no-name-in-module
24
- load_basic,
25
- )
26
23
 
27
24
 
28
25
  from qiskit.circuit import CASE_DEFAULT, Clbit, ClassicalRegister
@@ -290,7 +287,7 @@ def _read_parameter_expression_v3(file_obj, vectors, use_symengine):
290
287
 
291
288
  payload = file_obj.read(data.expr_size)
292
289
  if use_symengine:
293
- expr_ = load_basic(payload)
290
+ expr_ = common.load_symengine_payload(payload)
294
291
  else:
295
292
  from sympy.parsing.sympy_parser import parse_expr
296
293
 
qiskit/qpy/common.py CHANGED
@@ -18,7 +18,12 @@ Common functions across several serialization and deserialization modules.
18
18
  import io
19
19
  import struct
20
20
 
21
- from qiskit.qpy import formats
21
+ import symengine
22
+ from symengine.lib.symengine_wrapper import ( # pylint: disable = no-name-in-module
23
+ load_basic,
24
+ )
25
+
26
+ from qiskit.qpy import formats, exceptions
22
27
 
23
28
  QPY_VERSION = 12
24
29
  QPY_COMPATIBILITY_VERSION = 10
@@ -304,3 +309,42 @@ def mapping_from_binary(binary_data, deserializer, **kwargs):
304
309
  mapping = read_mapping(container, deserializer, **kwargs)
305
310
 
306
311
  return mapping
312
+
313
+
314
+ def load_symengine_payload(payload: bytes) -> symengine.Expr:
315
+ """Load a symengine expression from its serialized cereal payload."""
316
+ # This is a horrible hack to workaround the symengine version checking
317
+ # it's deserialization does. There were no changes to the serialization
318
+ # format between 0.11 and 0.13 but the deserializer checks that it can't
319
+ # load across a major or minor version boundary. This works around it
320
+ # by just lying about the generating version.
321
+ symengine_version = symengine.__version__.split(".")
322
+ major = payload[2]
323
+ minor = payload[3]
324
+ if int(symengine_version[1]) != minor:
325
+ if major != "0":
326
+ raise exceptions.QpyError(
327
+ "Qiskit doesn't support loading a symengine payload generated with symengine >= 1.0"
328
+ )
329
+ if minor == 9:
330
+ raise exceptions.QpyError(
331
+ "Qiskit doesn't support loading a historical QPY file with `use_symengine=True` "
332
+ "generated in an environment using symengine 0.9.0. If you need to load this file "
333
+ "you can do so with Qiskit 0.45.x or 0.46.x and re-export the QPY file using "
334
+ "`use_symengine=False`."
335
+ )
336
+ if minor not in (11, 13):
337
+ raise exceptions.QpyError(
338
+ f"Incompatible symengine version {major}.{minor} used to generate the QPY "
339
+ "payload"
340
+ )
341
+ minor_version = int(symengine_version[1])
342
+ if minor_version not in (11, 13):
343
+ raise exceptions.QpyError(
344
+ f"Incompatible installed symengine version {symengine.__version__} to load "
345
+ "this QPY payload"
346
+ )
347
+ payload = bytearray(payload)
348
+ payload[3] = minor_version
349
+ payload = bytes(payload)
350
+ return load_basic(payload)
qiskit/qpy/interface.py CHANGED
@@ -144,6 +144,17 @@ def dump(
144
144
  from the QPY format at that version will persist. This should only be used if
145
145
  compatibility with loading the payload with an older version of Qiskit is necessary.
146
146
 
147
+ .. note::
148
+
149
+ If serializing a :class:`.QuantumCircuit` or :class:`.ScheduleBlock` that contain
150
+ :class:`.ParameterExpression` objects with ``version`` set low with the intent to
151
+ load the payload using a historical release of Qiskit, it is safest to set the
152
+ ``use_symengine`` flag to ``False``. Versions of Qiskit prior to 1.2.3 cannot load
153
+ QPY files containing ``symengine``-serialized :class:`.ParameterExpression` objects
154
+ unless the version of ``symengine`` used between the loading and generating
155
+ environments matches.
156
+
157
+
147
158
  Raises:
148
159
  QpyError: When multiple data format is mixed in the output.
149
160
  TypeError: When invalid data type is input.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qiskit
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
5
5
  Author-email: Qiskit Development Team <qiskit@us.ibm.com>
6
6
  License: Apache 2.0
@@ -36,7 +36,7 @@ Requires-Dist: dill>=0.3
36
36
  Requires-Dist: python-dateutil>=2.8.0
37
37
  Requires-Dist: stevedore>=3.0.0
38
38
  Requires-Dist: typing-extensions
39
- Requires-Dist: symengine>=0.11
39
+ Requires-Dist: symengine<0.14,>=0.11
40
40
  Provides-Extra: all
41
41
  Requires-Dist: qiskit[crosstalk-pass,csp-layout-pass,qasm3-import,visualization]; extra == "all"
42
42
  Provides-Extra: crosstalk-pass
@@ -1,6 +1,6 @@
1
- qiskit/VERSION.txt,sha256=a_J0R6S5pfUF4WcOTkr-tN2RHmMFNU1kkD7OMXZdgrk,7
1
+ qiskit/VERSION.txt,sha256=dfKOEQOPs4e4CEZ-F1mkLcmqaZRpfotn6cGyLo9GbmE,7
2
2
  qiskit/__init__.py,sha256=bxCfTQyH6qfT6E-R4FTfP2ovP3F3qz0fVid6TeRHT5A,5540
3
- qiskit/_accelerate.pyd,sha256=sfUr0bJM7h1QpIul2PVSjLARH-9RulGrTAZ_0x6s09U,4727808
3
+ qiskit/_accelerate.pyd,sha256=YYVcV9OsEyutnsQh5Z5VuJQUZog70NuDONws0rRDPVc,4727296
4
4
  qiskit/_numpy_compat.py,sha256=EV1RihNRJnvWzjb57z8sjMbv9EeRPzk8Mnegzw7ItR0,2888
5
5
  qiskit/exceptions.py,sha256=UamBNQmDJTx6ruzmj7iXgcsrBcvkfE-bZ4TH2-K_ngw,5772
6
6
  qiskit/user_config.py,sha256=IKxY7cK1EX-GqkvPE4Lsss1NMoEcYie6Qq8hkNOtLJA,10371
@@ -10,7 +10,7 @@ qiskit/assembler/assemble_circuits.py,sha256=slVUA-BKYYI1pfDzqIZIJyfbgi9FDqaL92B
10
10
  qiskit/assembler/assemble_schedules.py,sha256=tQ2FytodUcNPA-WeJltCpcnhmDODLNOAWKRK2nYUuCE,15802
11
11
  qiskit/assembler/disassemble.py,sha256=2OJSlfQolQHSLtteyg7CAibkFZH6BKx6Wy6c8J6ku9E,12940
12
12
  qiskit/assembler/run_config.py,sha256=xVw70UASYS5jGtac6mSK6iKCkAzn3Nux6rksbZ2eC6E,2538
13
- qiskit/circuit/__init__.py,sha256=xfqfyqWJpfYczjKUK9PukGFXo226Y6_ymiYk376PMGg,60222
13
+ qiskit/circuit/__init__.py,sha256=vJkdYdxtb3EDGNLrJre3RTOpJs30RGN0NRvZVxRUe1Q,60222
14
14
  qiskit/circuit/_classical_resource_map.py,sha256=HhScd6Mjs74JEOXstQUTDicY9o74RM_B6EjnbrZeho8,7130
15
15
  qiskit/circuit/_standard_gates_commutations.py,sha256=Y9S2xI_SNSJ3OMiZQl7qRe5HsFeNK0M28coATKJ4-UQ,89014
16
16
  qiskit/circuit/_utils.py,sha256=MxIpuBs6ZsdfMDxT6ZCFgskp_32FbK7zVHp7sxmzoCQ,6614
@@ -154,11 +154,11 @@ qiskit/circuit/library/standard_gates/multi_control_rotation_gates.py,sha256=veK
154
154
  qiskit/circuit/library/standard_gates/p.py,sha256=xZ4Zeu7rnI71EoIxyXzTveG1fGerVB1wD0-GL7oIGio,15017
155
155
  qiskit/circuit/library/standard_gates/r.py,sha256=Lq79642r-_AxEZjFFN_q3sXyGxjZsBCpdX8pQUMxkh0,4119
156
156
  qiskit/circuit/library/standard_gates/rx.py,sha256=SR1i_lJZBS0keNlqgw3LjHSJl4LLlT_J2NksmgOsuaw,11328
157
- qiskit/circuit/library/standard_gates/rxx.py,sha256=UoYCoLxC-J4ljeC5CmqF84BVidyvM3Myj7OTNxeFEr4,6868
157
+ qiskit/circuit/library/standard_gates/rxx.py,sha256=_B5y-VJihUwmBrL4LRy8LECIrbvmyLUhM_uznDgBtNQ,6869
158
158
  qiskit/circuit/library/standard_gates/ry.py,sha256=Gj_zSvxT_OI9lUgn-N5CDDWwit95WqrKklae-O_bRU0,10966
159
- qiskit/circuit/library/standard_gates/ryy.py,sha256=l6-gUXAUh9OOsaNknaPGCR47VKYqHb7DAYQl1uOtE74,7047
159
+ qiskit/circuit/library/standard_gates/ryy.py,sha256=LXO8vjrNFO3X_pSQVcxLZPBGxDpSShK-l710K90WeOQ,7048
160
160
  qiskit/circuit/library/standard_gates/rz.py,sha256=PVbYw6dWErlYN-Ij35fKCQt6El6IBIKhG2Cd3Kbkc3E,11429
161
- qiskit/circuit/library/standard_gates/rzx.py,sha256=NjLDEFmG-TYcJlCTfBTNKoF9okxcVRouQDSWO7Wi5Lo,8527
161
+ qiskit/circuit/library/standard_gates/rzx.py,sha256=PJ6eNcob-IdZZX0FBE6Kg3tZvSxbCI2-vfnK_6Kfi2A,8527
162
162
  qiskit/circuit/library/standard_gates/rzz.py,sha256=dlQIzTX1vqhGFoMdlBgHkErOmfarYNYjXTl6BimNoe4,6714
163
163
  qiskit/circuit/library/standard_gates/s.py,sha256=3R4czczMCtxIozPNYwxGcMe9ExRmLEWRn9Z1oGKe8EM,13246
164
164
  qiskit/circuit/library/standard_gates/swap.py,sha256=GKJNlaiAcxSePnQaxn5NFYcQjcHibO83-k8kz5KEE3M,9276
@@ -428,16 +428,16 @@ qiskit/qobj/utils.py,sha256=lcn2b4gvt5j6xw_Gb0LEwzROzFJA9nka2n0O5DWhiUY,1355
428
428
  qiskit/qobj/converters/__init__.py,sha256=eouPijW91tEX8ptE86TbAOYw53VWNC8lqZpxe4O8LKY,709
429
429
  qiskit/qobj/converters/lo_config.py,sha256=Au6xQJpTzsnzWrQfcG0AeQQhfjGmOoFbnjK6QEqeoRU,7089
430
430
  qiskit/qobj/converters/pulse_instruction.py,sha256=_oQYd3VrfJxmeT2buDmHQK_M8mkfvXjfegK32c3Y6W0,31362
431
- qiskit/qpy/__init__.py,sha256=r2jV7e6u8FhOqxQ_gxMMeYiyJx2AKO47SzDdp68NnvQ,58102
432
- qiskit/qpy/common.py,sha256=kKc8VZQP2wzezcYOG0aReyi_HupTFr99z_sNXqIGQOk,10593
431
+ qiskit/qpy/__init__.py,sha256=4gtPAU--xrpG4zp36CwdHVYVdM_-nXY1giJU8M021fM,59720
432
+ qiskit/qpy/common.py,sha256=zZksatVxnfiH7OsTknVmIfkimhFe1gjt9kH03OEgPew,12609
433
433
  qiskit/qpy/exceptions.py,sha256=BX1ILW35oUPDmotmttybw2bY1IvUwziOVpsf7z_mIkY,1900
434
434
  qiskit/qpy/formats.py,sha256=kxItULKeSVP70rjUjzERSmA1bq19mMJijOwRVOdJEq8,11663
435
- qiskit/qpy/interface.py,sha256=k5d6EK943XhRtOuDnBPQbc57SnHy5MdwltQUvgO1CvY,12715
435
+ qiskit/qpy/interface.py,sha256=VBLaCd_dRFkOC-KiWHs8rICP5ob1kC_jbyHcyrk2nX4,13372
436
436
  qiskit/qpy/type_keys.py,sha256=gRuzYEeXhrSHUE6uNXe3oTCP8g5Q1I_DfB1wiY0ARhM,16333
437
437
  qiskit/qpy/binary_io/__init__.py,sha256=kBTRGy5cJdiDk-X1CSjSEpgLV-i_xT0IqcmI1a_AhOY,1109
438
438
  qiskit/qpy/binary_io/circuits.py,sha256=mDngUS8eIr_Ona4ABzAoaO9aQzkLDoXb4sorns_GXvo,58575
439
- qiskit/qpy/binary_io/schedules.py,sha256=gV9bPIivGEIFJGavCqkjf_FOmMpdfL9izKooRHHmX2Q,24550
440
- qiskit/qpy/binary_io/value.py,sha256=nqpi5ce4t3EJGWx9v6RGtGIj8LXzqU7EKp6b3X_UU-g,29295
439
+ qiskit/qpy/binary_io/schedules.py,sha256=yLY7-LIQSkff_emHXpuVxBmAGTGI-IA7OqreK6_gbss,24463
440
+ qiskit/qpy/binary_io/value.py,sha256=blE5v2Qrck7-WATOpwYbtGzKbF-miZactnR-0DF4Cus,29208
441
441
  qiskit/quantum_info/__init__.py,sha256=n8hLJIMlnYnxOAGHxF1bkd4q_CRGphhYIqhic1FYjMo,3497
442
442
  qiskit/quantum_info/quaternion.py,sha256=qlB8jMmWBmYzBgzDwiLjINGD9KlfllfS5D5yCr2DML4,5040
443
443
  qiskit/quantum_info/random.py,sha256=N9f6Vgo_oWf03xbV3drM6Pmi0jWw7w2SC6hpO5BQiaE,941
@@ -812,9 +812,9 @@ qiskit/visualization/timeline/types.py,sha256=jtpipQWUpahayNPQYKUst4GG6BqauovO0q
812
812
  qiskit/visualization/timeline/plotters/__init__.py,sha256=Klg9a1cSUIQhc815g8OpnD5vO1hcI51L9KlFfKzcuRg,588
813
813
  qiskit/visualization/timeline/plotters/base_plotter.py,sha256=taRkL2ZbyorRUEf6nJS8egdzKW2eznQ3w5oBLtMG_U8,1805
814
814
  qiskit/visualization/timeline/plotters/matplotlib.py,sha256=lqqNH3-bdf1F1cS2mDla9dLr5qEOeIFuqVl9Rhdg-Dw,7086
815
- qiskit-1.2.2.dist-info/LICENSE.txt,sha256=pUbmRuPr1gJTTTWZu2c8UmNSntz-pDdKfGR-86NRkok,11619
816
- qiskit-1.2.2.dist-info/METADATA,sha256=u34nR1C3P7RuyykO2nNCxxJv9w8YhmtHrsHmvAIS_0s,13089
817
- qiskit-1.2.2.dist-info/WHEEL,sha256=wbeAP3FaEg2XPA1YvjyV0o9Zyj-L4W4y8U1O-4kQUaw,96
818
- qiskit-1.2.2.dist-info/entry_points.txt,sha256=dCqiF7i6g_s6cYnXX7UUO1MM63xFFb5DCHYEYyGAeCc,3556
819
- qiskit-1.2.2.dist-info/top_level.txt,sha256=_vjFXLv7qrHyJJOC2-JXfG54o4XQygW9GuQPxgtSt9Q,7
820
- qiskit-1.2.2.dist-info/RECORD,,
815
+ qiskit-1.2.3.dist-info/LICENSE.txt,sha256=pUbmRuPr1gJTTTWZu2c8UmNSntz-pDdKfGR-86NRkok,11619
816
+ qiskit-1.2.3.dist-info/METADATA,sha256=lH2cStvwYHKxAgX72q2RHjDD2-Alo6FL0373mxCJFcE,13095
817
+ qiskit-1.2.3.dist-info/WHEEL,sha256=xRIth8mHpORGBo0u7ZcMbA24uht4e0efYstShPPKdtg,95
818
+ qiskit-1.2.3.dist-info/entry_points.txt,sha256=dCqiF7i6g_s6cYnXX7UUO1MM63xFFb5DCHYEYyGAeCc,3556
819
+ qiskit-1.2.3.dist-info/top_level.txt,sha256=_vjFXLv7qrHyJJOC2-JXfG54o4XQygW9GuQPxgtSt9Q,7
820
+ qiskit-1.2.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-abi3-win32
5
5