cirq-core 1.7.0.dev20250806132447__py3-none-any.whl → 1.7.0.dev20250807224154__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 CHANGED
@@ -28,4 +28,4 @@ if sys.version_info < (3, 11, 0): # pragma: no cover
28
28
  'of Cirq (e.g. "python -m pip install cirq==1.5.0")'
29
29
  )
30
30
 
31
- __version__ = "1.7.0.dev20250806132447"
31
+ __version__ = "1.7.0.dev20250807224154"
cirq/_version_test.py CHANGED
@@ -3,4 +3,4 @@ import cirq
3
3
 
4
4
 
5
5
  def test_version() -> None:
6
- assert cirq.__version__ == "1.7.0.dev20250806132447"
6
+ assert cirq.__version__ == "1.7.0.dev20250807224154"
@@ -40,9 +40,8 @@ def eject_phased_paulis(
40
40
  """Transformer pass to push X, Y, PhasedX & (certain) PhasedXZ gates to the end of the circuit.
41
41
 
42
42
  As the gates get pushed, they may absorb Z gates, cancel against other
43
- X, Y, or PhasedX gates with exponent=1, get merged into measurements (as
44
- output bit flips), and cause phase kickback operations across CZs (which can
45
- then be removed by the `cirq.eject_z` transformation).
43
+ X, Y, or PhasedX gates with exponent=1, and cause phase kickback operations
44
+ across CZs (which can then be removed by the `cirq.eject_z` transformation).
46
45
 
47
46
  `cirq.PhasedXZGate` with `z_exponent=0` (i.e. equivalent to PhasedXPow) or with `x_exponent=0`
48
47
  and `axis_phase_exponent=0` (i.e. equivalent to ZPowGate) are also supported.
@@ -85,10 +84,6 @@ def eject_phased_paulis(
85
84
  if t is not None:
86
85
  return _absorb_z_into_w(op, held_w_phases)
87
86
 
88
- # Dump coherent flips into measurement bit flips.
89
- if isinstance(op.gate, ops.MeasurementGate):
90
- return _dump_into_measurement(op, held_w_phases)
91
-
92
87
  # Cross CZs using kickback.
93
88
  if _try_get_known_cz_half_turns(op, no_symbolic=not eject_parameterized) is not None:
94
89
  return (
@@ -140,18 +135,6 @@ def _dump_held(
140
135
  held_w_phases.pop(q, None)
141
136
 
142
137
 
143
- def _dump_into_measurement(
144
- op: ops.Operation, held_w_phases: dict[ops.Qid, value.TParamVal]
145
- ) -> cirq.OP_TREE:
146
- measurement = cast(ops.MeasurementGate, cast(ops.GateOperation, op).gate)
147
- new_measurement = measurement.with_bits_flipped(
148
- *[i for i, q in enumerate(op.qubits) if q in held_w_phases]
149
- ).on(*op.qubits)
150
- for q in op.qubits:
151
- held_w_phases.pop(q, None)
152
- return new_measurement
153
-
154
-
155
138
  def _potential_cross_whole_w(
156
139
  op: ops.Operation, atol: float, held_w_phases: dict[ops.Qid, value.TParamVal]
157
140
  ) -> cirq.OP_TREE:
@@ -235,60 +235,12 @@ def test_crosses_czs() -> None:
235
235
  )
236
236
 
237
237
 
238
- def test_toggles_measurements() -> None:
238
+ def test_doesnt_change_measurements() -> None:
239
239
  a = cirq.NamedQubit('a')
240
- b = cirq.NamedQubit('b')
241
- x = sympy.Symbol('x')
242
240
 
243
- # Single.
244
- assert_optimizes(
245
- before=quick_circuit(
246
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(a)], [cirq.measure(a, b)]
247
- ),
248
- expected=quick_circuit([cirq.measure(a, b, invert_mask=(True,))]),
249
- )
250
241
  assert_optimizes(
251
- before=quick_circuit(
252
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(b)], [cirq.measure(a, b)]
253
- ),
254
- expected=quick_circuit([cirq.measure(a, b, invert_mask=(False, True))]),
255
- )
256
- assert_optimizes(
257
- before=quick_circuit([cirq.PhasedXPowGate(phase_exponent=x).on(b)], [cirq.measure(a, b)]),
258
- expected=quick_circuit([cirq.measure(a, b, invert_mask=(False, True))]),
259
- eject_parameterized=True,
260
- )
261
-
262
- # Multiple.
263
- assert_optimizes(
264
- before=quick_circuit(
265
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(a)],
266
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(b)],
267
- [cirq.measure(a, b)],
268
- ),
269
- expected=quick_circuit([cirq.measure(a, b, invert_mask=(True, True))]),
270
- )
271
-
272
- # Xmon.
273
- assert_optimizes(
274
- before=quick_circuit(
275
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(a)], [cirq.measure(a, b, key='t')]
276
- ),
277
- expected=quick_circuit([cirq.measure(a, b, invert_mask=(True,), key='t')]),
278
- )
279
-
280
- # CCOs
281
- assert_optimizes(
282
- before=quick_circuit(
283
- [cirq.PhasedXPowGate(phase_exponent=0.25).on(a)],
284
- [cirq.measure(a, key="m")],
285
- [cirq.X(b).with_classical_controls("m")],
286
- ),
287
- expected=quick_circuit(
288
- [cirq.measure(a, invert_mask=(True,), key="m")],
289
- [cirq.X(b).with_classical_controls("m")],
290
- ),
291
- compare_unitaries=False,
242
+ before=quick_circuit([cirq.PhasedXPowGate(phase_exponent=0.25).on(a)], [cirq.measure(a)]),
243
+ expected=quick_circuit([cirq.PhasedXPowGate(phase_exponent=0.25).on(a)], [cirq.measure(a)]),
292
244
  )
293
245
 
294
246
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cirq-core
3
- Version: 1.7.0.dev20250806132447
3
+ Version: 1.7.0.dev20250807224154
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
@@ -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=joRvIgtKiLcU0hNAAHXE7bSTfe0fjbWik6eHIROt1UQ,1206
8
- cirq/_version_test.py,sha256=DY4lOo-RICf3TmJpyOZxiE8fFidTDPMoVKzsxhwXbE0,155
7
+ cirq/_version.py,sha256=P5YAvfjPnif5jntwzbwusRIWDRHV_4TeXwkGNk6ekA0,1206
8
+ cirq/_version_test.py,sha256=GGaSfPXWJBJgqgRIAVliLKF4FKGuJZNj_ImG_mGeWyY,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
@@ -1073,8 +1073,8 @@ cirq/transformers/drop_negligible_operations.py,sha256=eP2dP_n0BYlr8aZ1wnD8YWsqC
1073
1073
  cirq/transformers/drop_negligible_operations_test.py,sha256=32mS4QQ8tiH3wBAAgbUU8LgwWDmvreRVEDZML_kgxyo,3859
1074
1074
  cirq/transformers/dynamical_decoupling.py,sha256=LP0Hrp7XqfVRmSy_wQX85GKPgK1Vy2_HCt8OyySFL2s,13484
1075
1075
  cirq/transformers/dynamical_decoupling_test.py,sha256=wQUCw99ODghLmluox9-3rg-w_A1vEVa96dFmKXWC2m0,45171
1076
- cirq/transformers/eject_phased_paulis.py,sha256=ZeVEh614OihWZtHyaBBtgpWj_dUxQGXDzf4NmBlzbeM,14725
1077
- cirq/transformers/eject_phased_paulis_test.py,sha256=AOMmOq3fWFGm2_qDyocjtF9fK7GAhC0kF550mkjtPx4,15791
1076
+ cirq/transformers/eject_phased_paulis.py,sha256=gK1XIslsBPFcppUFacbhvzfhcnK5ZSVcyLN1SM5wTEE,14072
1077
+ cirq/transformers/eject_phased_paulis_test.py,sha256=o5cK5zvcOMflFGQiXDiVBx-Cz_eA0EzTBXnujJ23O3s,14244
1078
1078
  cirq/transformers/eject_z.py,sha256=3u0Q0WGGAxmZuPnyiU4q04gJMnY--0nvhF4eotnSl9k,5803
1079
1079
  cirq/transformers/eject_z_test.py,sha256=mKa-xViF9ZyuJpHWeqmYfPHL-3AGNTTfe0yHaXYHRZ8,13226
1080
1080
  cirq/transformers/expand_composite.py,sha256=jDuipLc-9uYKGogQ7HAH0NLg5qb1uhdxh1nFWBYWkPk,2402
@@ -1234,8 +1234,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
1234
1234
  cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
1235
1235
  cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
1236
1236
  cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
1237
- cirq_core-1.7.0.dev20250806132447.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1238
- cirq_core-1.7.0.dev20250806132447.dist-info/METADATA,sha256=YYvHmc-1T9b5Ezrbcf_MYMEunIl4JsPlF8loRON7-HA,4857
1239
- cirq_core-1.7.0.dev20250806132447.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1240
- cirq_core-1.7.0.dev20250806132447.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1241
- cirq_core-1.7.0.dev20250806132447.dist-info/RECORD,,
1237
+ cirq_core-1.7.0.dev20250807224154.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1238
+ cirq_core-1.7.0.dev20250807224154.dist-info/METADATA,sha256=0e8gaieVOCv57evNnnXZD1_0NTOFWb-CXOzsi-HQBI0,4857
1239
+ cirq_core-1.7.0.dev20250807224154.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1240
+ cirq_core-1.7.0.dev20250807224154.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1241
+ cirq_core-1.7.0.dev20250807224154.dist-info/RECORD,,