cirq-core 1.7.0.dev20250925212546__py3-none-any.whl → 1.7.0.dev20250926000855__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/contrib/paulistring/clifford_optimize.py +20 -2
- cirq/transformers/gauge_compiling/idle_moments_gauge.py +3 -1
- {cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/METADATA +1 -1
- {cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/RECORD +9 -9
- {cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/WHEEL +0 -0
- {cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/licenses/LICENSE +0 -0
- {cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
|
@@ -21,8 +21,26 @@ from cirq.contrib.paulistring.clifford_target_gateset import CliffordTargetGates
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def clifford_optimized_circuit(circuit: circuits.Circuit, atol: float = 1e-8) -> circuits.Circuit:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
"""Optimizes a circuit composed of Clifford and CZ gates.
|
|
25
|
+
|
|
26
|
+
This function attempts to simplify a circuit by finding local optimizations.
|
|
27
|
+
It works in two stages:
|
|
28
|
+
1. It converts the circuit to a target gateset consisting of
|
|
29
|
+
`cirq.SingleQubitCliffordGate` and `cirq.CZPowGate` gates.
|
|
30
|
+
2. It then iterates through the circuit, applying the following rules:
|
|
31
|
+
- Merges adjacent single-qubit Clifford gates.
|
|
32
|
+
- Commutes single-qubit Clifford gates past CZ gates, attempting to
|
|
33
|
+
merge them with other single-qubit Clifford gates.
|
|
34
|
+
- Cancels pairs of identical CZ gates.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
circuit: The circuit to optimize.
|
|
38
|
+
atol: A limit on the amount of absolute error introduced by the decomposition.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
The optimized circuit.
|
|
42
|
+
"""
|
|
43
|
+
# Convert to a circuit with SingleQubitCliffordGates, CZs and other ignored gates.
|
|
26
44
|
c_cliff = transformers.optimize_for_target_gateset(
|
|
27
45
|
circuit, gateset=CliffordTargetGateset(atol=atol)
|
|
28
46
|
)
|
|
@@ -187,7 +187,9 @@ class IdleMomentsGauge:
|
|
|
187
187
|
for q in op.qubits:
|
|
188
188
|
active_moments[q].append((m_id, is_mergable))
|
|
189
189
|
|
|
190
|
-
single_qubit_moments = [
|
|
190
|
+
single_qubit_moments = [
|
|
191
|
+
{op.qubits[0]: op for op in m if len(op.qubits) == 1} for m in circuit
|
|
192
|
+
]
|
|
191
193
|
non_single_qubit_moments = [[op for op in m if len(op.qubits) != 1] for m in circuit]
|
|
192
194
|
|
|
193
195
|
for q, active in active_moments.items():
|
{cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.7.0.
|
|
3
|
+
Version: 1.7.0.dev20250926000855
|
|
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.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.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=e0hRNDzWL1dC5broxpqJmLUmXKOfY7sXG0fKBLlKHsQ,1206
|
|
8
|
+
cirq/_version_test.py,sha256=TlhFCdORMWJpq5Go53KjFXL5wzkTx851AY9NHqwUFu0,155
|
|
9
9
|
cirq/conftest.py,sha256=wSDKNdIQRDfLnXvOCWD3erheOw8JHRhdfQ53EyTUIXg,1239
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=A5DIgFAY1hUNt9vai_C3-gGBv24116CJMzQxMcXOax4,13726
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -100,7 +100,7 @@ cirq/contrib/noise_models/__init__.py,sha256=O3wvaQ6kyNZzwsCnMMZvr2EyS76LpO9xnVZ
|
|
|
100
100
|
cirq/contrib/noise_models/noise_models.py,sha256=CJcvVQTaah5t6AC2nFTbaiSL-nTR1jtYV3ftO7nTbyo,11404
|
|
101
101
|
cirq/contrib/noise_models/noise_models_test.py,sha256=htDTYcWeMtgtLIo_4DaTIidoHCxPMVIAKtS80R4OmDs,11472
|
|
102
102
|
cirq/contrib/paulistring/__init__.py,sha256=1k2_MYLTMPn8AFoJvSgpN-F-6xgmDjKXRhb-FdDsFoQ,1761
|
|
103
|
-
cirq/contrib/paulistring/clifford_optimize.py,sha256=
|
|
103
|
+
cirq/contrib/paulistring/clifford_optimize.py,sha256=UDJ9aIJ-iFBFM5MV8n6ec7wsGluC6diC4UFXYSfep1g,8675
|
|
104
104
|
cirq/contrib/paulistring/clifford_optimize_test.py,sha256=8FFLg9gb1HmHHMdXPa-vCr1zyxvgdlciRH8qyfTWQRw,3964
|
|
105
105
|
cirq/contrib/paulistring/clifford_target_gateset.py,sha256=5QP4A1gC1rsTbWXB0L00ZuSGy2VZvYer63UyydCj1W0,6311
|
|
106
106
|
cirq/contrib/paulistring/clifford_target_gateset_test.py,sha256=LUkfj_cahaclu2iByO3YsX-db-DLEWrAxZfxeKuJPdI,8792
|
|
@@ -1143,7 +1143,7 @@ cirq/transformers/gauge_compiling/gauge_compiling.py,sha256=bXqAEVBXHplnxRMwNA0G
|
|
|
1143
1143
|
cirq/transformers/gauge_compiling/gauge_compiling_test.py,sha256=JFG7aCe-PxPGZDPCAx82ILu6PX_laFvCDlaabwvL0Kc,5272
|
|
1144
1144
|
cirq/transformers/gauge_compiling/gauge_compiling_test_utils.py,sha256=NUbcz-tGS58QPohpsmMx0RbB4d79GMSoyVxdL3CPiZc,5060
|
|
1145
1145
|
cirq/transformers/gauge_compiling/gauge_compiling_test_utils_test.py,sha256=qPcs2BWU-1gOEz0NCLixBLO9I1PVIOLShB7wkprcQZY,1896
|
|
1146
|
-
cirq/transformers/gauge_compiling/idle_moments_gauge.py,sha256=
|
|
1146
|
+
cirq/transformers/gauge_compiling/idle_moments_gauge.py,sha256=9NVZMXTgcEQN-AmT_eqfYIsSKVi_dC1UaSQav6B2t0k,8491
|
|
1147
1147
|
cirq/transformers/gauge_compiling/idle_moments_gauge_test.py,sha256=OSb0840o0M8Qpde_Dp3-sRCGrJCO4rBgArDLnnT8D-g,6903
|
|
1148
1148
|
cirq/transformers/gauge_compiling/iswap_gauge.py,sha256=CfW3hgO6AgUB7D6tC8J2XZQw2Ge77LT44BygCzMW4Xc,3536
|
|
1149
1149
|
cirq/transformers/gauge_compiling/iswap_gauge_test.py,sha256=V6g-jyGujMKEzGtOi_OhMxX5oTznGXJi9tCNKI9Qrb8,901
|
|
@@ -1236,8 +1236,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
|
|
|
1236
1236
|
cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
|
|
1237
1237
|
cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
|
|
1238
1238
|
cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
|
|
1239
|
-
cirq_core-1.7.0.
|
|
1240
|
-
cirq_core-1.7.0.
|
|
1241
|
-
cirq_core-1.7.0.
|
|
1242
|
-
cirq_core-1.7.0.
|
|
1243
|
-
cirq_core-1.7.0.
|
|
1239
|
+
cirq_core-1.7.0.dev20250926000855.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1240
|
+
cirq_core-1.7.0.dev20250926000855.dist-info/METADATA,sha256=9GnjUvTv5yNU9J0VwDGrtjMZRvbsY80VSKwQNStczc8,4758
|
|
1241
|
+
cirq_core-1.7.0.dev20250926000855.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1242
|
+
cirq_core-1.7.0.dev20250926000855.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1243
|
+
cirq_core-1.7.0.dev20250926000855.dist-info/RECORD,,
|
{cirq_core-1.7.0.dev20250925212546.dist-info → cirq_core-1.7.0.dev20250926000855.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|