cirq-core 1.6.0.dev20250627024936__py3-none-any.whl → 1.6.0.dev20250627201540__py3-none-any.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.
Potentially problematic release.
This version of cirq-core might be problematic. Click here for more details.
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/transformers/analytical_decompositions/two_qubit_to_cz.py +7 -2
- cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py +9 -0
- {cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/METADATA +1 -1
- {cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/RECORD +9 -9
- {cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/WHEEL +0 -0
- {cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/licenses/LICENSE +0 -0
- {cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
|
@@ -226,12 +226,15 @@ def _merge_single_qubit_gates(
|
|
|
226
226
|
transformation.
|
|
227
227
|
Returns:
|
|
228
228
|
new sequence of operations after merging gates
|
|
229
|
+
|
|
230
|
+
Raises:
|
|
231
|
+
ValueError: if one of the operations is not on 1 or 2 qubits
|
|
229
232
|
"""
|
|
230
233
|
merged_ops: list[ops.Operation] = []
|
|
231
234
|
pending_ops: dict[tuple[cirq.Qid, ...], list[ops.Operation]] = dict()
|
|
232
235
|
for op in operations:
|
|
233
236
|
if protocols.num_qubits(op) == 2:
|
|
234
|
-
for
|
|
237
|
+
for qubit_ops in pending_ops.values():
|
|
235
238
|
merged_ops.extend(
|
|
236
239
|
_transform_single_qubit_operations_to_phased_x_and_z(qubit_ops, atol=atol)
|
|
237
240
|
)
|
|
@@ -242,8 +245,10 @@ def _merge_single_qubit_gates(
|
|
|
242
245
|
if op.qubits not in pending_ops:
|
|
243
246
|
pending_ops[op.qubits] = []
|
|
244
247
|
pending_ops[op.qubits].append(op)
|
|
248
|
+
else:
|
|
249
|
+
raise ValueError(f'operation is on {protocols.num_qubits(op)} qubits, expected 1 or 2')
|
|
245
250
|
# Merge remaining pending operations
|
|
246
|
-
for
|
|
251
|
+
for qubit_ops in pending_ops.values():
|
|
247
252
|
merged_ops.extend(
|
|
248
253
|
_transform_single_qubit_operations_to_phased_x_and_z(qubit_ops, atol=atol)
|
|
249
254
|
)
|
|
@@ -26,6 +26,7 @@ from cirq.testing import random_two_qubit_circuit_with_czs
|
|
|
26
26
|
from cirq.transformers.analytical_decompositions.two_qubit_to_cz import (
|
|
27
27
|
_is_trivial_angle,
|
|
28
28
|
_parity_interaction,
|
|
29
|
+
cleanup_operations,
|
|
29
30
|
two_qubit_matrix_to_diagonal_and_cz_operations,
|
|
30
31
|
)
|
|
31
32
|
|
|
@@ -294,3 +295,11 @@ def test_remove_partial_czs_or_fail() -> None:
|
|
|
294
295
|
_ = cirq.transformers.analytical_decompositions.two_qubit_to_cz._remove_partial_czs_or_fail(
|
|
295
296
|
[CZ**-0.5], atol=1e-9
|
|
296
297
|
)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
@pytest.mark.parametrize("gate", [cirq.CCZ, cirq.GlobalPhaseGate(1.0)])
|
|
301
|
+
def test_cleanup_operations_raises_if_op_not_on_1_or_2_qubits(gate: cirq.Gate) -> None:
|
|
302
|
+
qubits = cirq.LineQubit.range(gate.num_qubits())
|
|
303
|
+
op = gate.on(*qubits)
|
|
304
|
+
with pytest.raises(ValueError, match="expected 1 or 2"):
|
|
305
|
+
cleanup_operations([op], atol=1e-8)
|
{cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.6.0.
|
|
3
|
+
Version: 1.6.0.dev20250627201540
|
|
4
4
|
Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
{cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=emXpdD5ZvwLRlFAoQB8YatmZyU3b4e9jg6FppMTUhkU,33900
|
|
|
4
4
|
cirq/_doc.py,sha256=BrnoABo1hk5RgB3Cgww4zLHUfiyFny0F1V-tOMCbdaU,2909
|
|
5
5
|
cirq/_import.py,sha256=ixBu4EyGl46Ram2cP3p5eZVEFDW5L2DS-VyTjz4N9iw,8429
|
|
6
6
|
cirq/_import_test.py,sha256=oF4izzOVZLc7NZ0aZHFcGv-r01eiFFt_JORx_x7_D4s,1089
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=1CwcE50eY4ghLp9EN8ksWqG5TMakfgfzQXyoLVekSAg,1206
|
|
8
|
+
cirq/_version_test.py,sha256=eleiwTQXJCb-Q6cWLOThwZo4OeEoB74mQqLc_Tl3Vh8,155
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=hYyG53VJeV61X0oukK5ndZYega8lkL2FyaL1m0j6h5M,13556
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -1112,8 +1112,8 @@ cirq/transformers/analytical_decompositions/three_qubit_decomposition.py,sha256=
|
|
|
1112
1112
|
cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py,sha256=a21HU4BE82AG2UJU4hUVqymUU7Lw4CLw4-NChX4OpLI,6808
|
|
1113
1113
|
cirq/transformers/analytical_decompositions/two_qubit_state_preparation.py,sha256=2bIpZOHBHxH2mdbJfDpo6nQgpitOI0ZmoH_5l_nA1nU,6167
|
|
1114
1114
|
cirq/transformers/analytical_decompositions/two_qubit_state_preparation_test.py,sha256=c-vFBZnybd-Ez4rcs13THGGthzEZ0qw9Iw9sAKbE6yc,4494
|
|
1115
|
-
cirq/transformers/analytical_decompositions/two_qubit_to_cz.py,sha256=
|
|
1116
|
-
cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py,sha256=
|
|
1115
|
+
cirq/transformers/analytical_decompositions/two_qubit_to_cz.py,sha256=bBA8RP-lzv8fKRiHT6M5NEBbl0l_ml5carekhGD5gnU,11705
|
|
1116
|
+
cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py,sha256=eDpkbJqVnSLuqXNJkU1BsaUYSIFRWrUXgQO35xrQHXE,11074
|
|
1117
1117
|
cirq/transformers/analytical_decompositions/two_qubit_to_fsim.py,sha256=8tYGV41gQBRzJSNUB3bsTMI8vil0TNE4TgqWlEw8BhE,9656
|
|
1118
1118
|
cirq/transformers/analytical_decompositions/two_qubit_to_fsim_test.py,sha256=bX8ap8VskN-gKxn3F4A8_vhgWO0AErOpP1QVVEtBjmY,7073
|
|
1119
1119
|
cirq/transformers/analytical_decompositions/two_qubit_to_ms.py,sha256=dP9umZJBgNJ8FbDFFZVgMSyO-NjWJqXmoWyQuTo--0g,3751
|
|
@@ -1220,8 +1220,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
|
|
|
1220
1220
|
cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
|
|
1221
1221
|
cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
|
|
1222
1222
|
cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
|
|
1223
|
-
cirq_core-1.6.0.
|
|
1224
|
-
cirq_core-1.6.0.
|
|
1225
|
-
cirq_core-1.6.0.
|
|
1226
|
-
cirq_core-1.6.0.
|
|
1227
|
-
cirq_core-1.6.0.
|
|
1223
|
+
cirq_core-1.6.0.dev20250627201540.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1224
|
+
cirq_core-1.6.0.dev20250627201540.dist-info/METADATA,sha256=qBxAsTgISyFiWKb-RSeARa5-fCVOkqR2K8QEZfgDP2g,4857
|
|
1225
|
+
cirq_core-1.6.0.dev20250627201540.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1226
|
+
cirq_core-1.6.0.dev20250627201540.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1227
|
+
cirq_core-1.6.0.dev20250627201540.dist-info/RECORD,,
|
{cirq_core-1.6.0.dev20250627024936.dist-info → cirq_core-1.6.0.dev20250627201540.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|