cirq-core 1.5.0.dev20250115165326__py3-none-any.whl → 1.5.0.dev20250115173001__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/align.py +11 -1
- cirq/transformers/align_test.py +13 -0
- {cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/RECORD +9 -9
- {cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
cirq/transformers/align.py
CHANGED
|
@@ -73,4 +73,14 @@ def align_right(
|
|
|
73
73
|
"""
|
|
74
74
|
if context is not None and context.deep is True:
|
|
75
75
|
context = dataclasses.replace(context, deep=False)
|
|
76
|
-
|
|
76
|
+
# Reverse the circuit, align left, and reverse again. Note each moment also has to have its ops
|
|
77
|
+
# reversed internally, to avoid edge conditions where non-commuting but can-be-in-same-moment
|
|
78
|
+
# ops (measurements and classical controls, particularly) could end up getting swapped.
|
|
79
|
+
backwards = []
|
|
80
|
+
for moment in circuit[::-1]:
|
|
81
|
+
backwards.append(circuits.Moment(reversed(moment.operations)))
|
|
82
|
+
aligned_backwards = align_left(circuits.Circuit(backwards), context=context)
|
|
83
|
+
forwards = []
|
|
84
|
+
for moment in aligned_backwards[::-1]:
|
|
85
|
+
forwards.append(circuits.Moment(reversed(moment.operations)))
|
|
86
|
+
return circuits.Circuit(forwards)
|
cirq/transformers/align_test.py
CHANGED
|
@@ -208,3 +208,16 @@ def test_classical_control():
|
|
|
208
208
|
)
|
|
209
209
|
cirq.testing.assert_same_circuits(cirq.align_left(circuit), circuit)
|
|
210
210
|
cirq.testing.assert_same_circuits(cirq.align_right(circuit), circuit)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def test_measurement_and_classical_control_same_moment_preserve_order():
|
|
214
|
+
q0, q1 = cirq.LineQubit.range(2)
|
|
215
|
+
circuit = cirq.Circuit()
|
|
216
|
+
op_measure = cirq.measure(q0, key='m')
|
|
217
|
+
op_controlled = cirq.X(q1).with_classical_controls('m')
|
|
218
|
+
circuit.append(op_measure)
|
|
219
|
+
circuit.append(op_controlled, cirq.InsertStrategy.INLINE)
|
|
220
|
+
circuit = cirq.align_right(circuit)
|
|
221
|
+
ops_in_order = list(circuit.all_operations())
|
|
222
|
+
assert ops_in_order[0] == op_measure
|
|
223
|
+
assert ops_in_order[1] == op_controlled
|
{cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev20250115173001
|
|
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.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=Qq3ZcfgD-Nb81cEppQdJqhAyrVqXKtfXZYGXT0p-Wh0,34718
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=p9gMHJscbtDDkfHOaulvd3Aer0pwUF5AXpL89XR8dNw,8402
|
|
6
6
|
cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=_WdhS8j0znfMx6r9XlD0gsh7QkhJv6_--hrzaX1NwDY,1206
|
|
8
|
+
cirq/_version_test.py,sha256=HJi0piVqH8nTw5uqgy8onx-uWbPObXcxZpIuWHcl5xs,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=cpbvJMNIh0U-l1mEVb-TqhJUEXfm2vpuR3v432ORSmg,13702
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -1040,8 +1040,8 @@ cirq/testing/test_data/test_module_missing_json_test_data/__init__.py,sha256=47D
|
|
|
1040
1040
|
cirq/testing/test_data/test_module_missing_testspec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1041
1041
|
cirq/testing/test_data/test_module_missing_testspec/json_test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1042
1042
|
cirq/transformers/__init__.py,sha256=QjYovkmQHRi7D6nPHkWrszVBM_1__thvOXG4wcYvX_E,6905
|
|
1043
|
-
cirq/transformers/align.py,sha256=
|
|
1044
|
-
cirq/transformers/align_test.py,sha256=
|
|
1043
|
+
cirq/transformers/align.py,sha256=5BCC61Vi__RaLkmX2Z9kQ8WpPGopcWnBPR7-yHz91zA,3330
|
|
1044
|
+
cirq/transformers/align_test.py,sha256=AI26PxERbtJDfjKtoz17xVAKn6TSr-9pyImqfr5LJWc,7686
|
|
1045
1045
|
cirq/transformers/drop_empty_moments.py,sha256=Rtn_BrpwkLXyZBdLzwdnsnEGWTdYuf1xOPakzbpv7-w,1517
|
|
1046
1046
|
cirq/transformers/drop_empty_moments_test.py,sha256=G8pZmTfi8NG2NpGz_K3LZu5NQoqa-xPMCuZjwEu07xk,1907
|
|
1047
1047
|
cirq/transformers/drop_negligible_operations.py,sha256=8eyOMy7bra2wJAjORbk6QjwHiLdL5SfwRaz8D2Dazbw,2083
|
|
@@ -1203,8 +1203,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
|
|
|
1203
1203
|
cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
|
|
1204
1204
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1205
1205
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1206
|
-
cirq_core-1.5.0.
|
|
1207
|
-
cirq_core-1.5.0.
|
|
1208
|
-
cirq_core-1.5.0.
|
|
1209
|
-
cirq_core-1.5.0.
|
|
1210
|
-
cirq_core-1.5.0.
|
|
1206
|
+
cirq_core-1.5.0.dev20250115173001.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1207
|
+
cirq_core-1.5.0.dev20250115173001.dist-info/METADATA,sha256=Uh02EbtQq89sDAEXNjBbQ4tv7qYpcSECWgTFklLPTDk,2105
|
|
1208
|
+
cirq_core-1.5.0.dev20250115173001.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1209
|
+
cirq_core-1.5.0.dev20250115173001.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1210
|
+
cirq_core-1.5.0.dev20250115173001.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20250115165326.dist-info → cirq_core-1.5.0.dev20250115173001.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|