cirq-core 1.5.0.dev20250129044210__py3-none-any.whl → 1.5.0.dev20250129233125__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, 10, 0): # pragma: no cover
28
28
  'of cirq (e.g. "python -m pip install cirq==1.1.*")'
29
29
  )
30
30
 
31
- __version__ = "1.5.0.dev20250129044210"
31
+ __version__ = "1.5.0.dev20250129233125"
cirq/_version_test.py CHANGED
@@ -3,4 +3,4 @@ import cirq
3
3
 
4
4
 
5
5
  def test_version():
6
- assert cirq.__version__ == "1.5.0.dev20250129044210"
6
+ assert cirq.__version__ == "1.5.0.dev20250129233125"
@@ -266,7 +266,9 @@ class CircuitOperation(ops.Operation):
266
266
  'repetition_ids': self.repetition_ids,
267
267
  'parent_path': self.parent_path,
268
268
  'extern_keys': self._extern_keys,
269
- 'use_repetition_ids': True if 'repetition_ids' in changes else self.use_repetition_ids,
269
+ 'use_repetition_ids': (
270
+ True if changes.get('repetition_ids') is not None else self.use_repetition_ids
271
+ ),
270
272
  'repeat_until': self.repeat_until,
271
273
  **changes,
272
274
  }
@@ -332,6 +332,28 @@ def test_repeat(add_measurements: bool, use_default_ids_for_initial_rep: bool) -
332
332
  assert op_base.repeat(2.99999999999).repetitions == 3
333
333
 
334
334
 
335
+ def test_replace_repetition_ids() -> None:
336
+ a, b = cirq.LineQubit.range(2)
337
+ circuit = cirq.Circuit(cirq.H(a), cirq.CX(a, b), cirq.M(b, key='mb'), cirq.M(a, key='ma'))
338
+ op = cirq.CircuitOperation(circuit.freeze())
339
+ assert op.repetitions == 1
340
+ assert not op.use_repetition_ids
341
+
342
+ op2 = op.replace(repetitions=2)
343
+ assert op2.repetitions == 2
344
+ assert not op2.use_repetition_ids
345
+
346
+ op3 = op.replace(repetitions=3, repetition_ids=None)
347
+ assert op3.repetitions == 3
348
+ assert not op3.use_repetition_ids
349
+
350
+ # Passing `repetition_ids` will also enable `use_repetition_ids`
351
+ op4 = op.replace(repetitions=4, repetition_ids=['a', 'b', 'c', 'd'])
352
+ assert op4.repetitions == 4
353
+ assert op4.use_repetition_ids
354
+ assert op4.repetition_ids == ['a', 'b', 'c', 'd']
355
+
356
+
335
357
  @pytest.mark.parametrize('add_measurements', [True, False])
336
358
  @pytest.mark.parametrize('use_repetition_ids', [True, False])
337
359
  @pytest.mark.parametrize('initial_reps', [0, 1, 2, 3])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20250129044210
3
+ Version: 1.5.0.dev20250129233125
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=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=KSvpIMRn4c5QraZ3ulDZUP284bkFK1COIUyEguh1N_o,1206
8
- cirq/_version_test.py,sha256=rBBRKNwwVf-J07nm_yE4XT3mFFNnY7NxUpSZJx5Xj1U,147
7
+ cirq/_version.py,sha256=6YpY2zK2ghe5RAHRY3czxCjjBix7fuKLJuYwX1etpoA,1206
8
+ cirq/_version_test.py,sha256=nH3Bb2p0jFQCLGRSQ-OXdVE6c3kBNCNKd-NA4XQ9CNk,147
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=p-vEOa-8GQ2cFIAdze-kd6C1un1uRvtujVPljVKaHBg,13557
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -17,8 +17,8 @@ cirq/circuits/_box_drawing_character_data_test.py,sha256=XO94z0piwZRHaNZHTf-5tKH
17
17
  cirq/circuits/_bucket_priority_queue.py,sha256=hxFuii2fKD8G6EKT_aVLEsA7FmSfqFXPwIbA0KsoSC4,6745
18
18
  cirq/circuits/_bucket_priority_queue_test.py,sha256=t6u_hG7K2e2WKWrgCsKxNRtp4ghKwiCrp0_WSY0W25k,5288
19
19
  cirq/circuits/circuit.py,sha256=nbWC95tzQlm69JmvFJdJMwzDOia_s0pah8tH4i9u1Ug,118173
20
- cirq/circuits/circuit_operation.py,sha256=MaQ6fPt1HctEE31fVaUDtl9MqOmoTyt3m2HYeGCdIaM,35440
21
- cirq/circuits/circuit_operation_test.py,sha256=7ezTwTY2RaAchjfXOJythVrxs6Rom317gC0AUBe0GVM,45259
20
+ cirq/circuits/circuit_operation.py,sha256=e-ePLg-Nrw6WM0pc6hucR3pMpP5Bn7Klq1RRwXXZoWw,35486
21
+ cirq/circuits/circuit_operation_test.py,sha256=os3_XQYW5neotlsPBdaNZmP2H25CMMYTarboO1pLT4I,46049
22
22
  cirq/circuits/circuit_test.py,sha256=BZjwavIekWR2hgG1yV0Acgt7-Q05cOjugozrLgYdx7k,161268
23
23
  cirq/circuits/frozen_circuit.py,sha256=qSbLHqIszCbVipNZQy4N829v_mWf8N2926cYRzpxGqE,9243
24
24
  cirq/circuits/frozen_circuit_test.py,sha256=rHyii8hLhOQ6jdA8dC1OcYPGnyeBC4uY5Q53XspkkCk,4133
@@ -1202,8 +1202,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
1202
1202
  cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
1203
1203
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1204
1204
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1205
- cirq_core-1.5.0.dev20250129044210.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1206
- cirq_core-1.5.0.dev20250129044210.dist-info/METADATA,sha256=v06JgmjGZYCU9zLy60oU3NgYaZ5qWM6yMrAmREwsM2I,3239
1207
- cirq_core-1.5.0.dev20250129044210.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1208
- cirq_core-1.5.0.dev20250129044210.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1209
- cirq_core-1.5.0.dev20250129044210.dist-info/RECORD,,
1205
+ cirq_core-1.5.0.dev20250129233125.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1206
+ cirq_core-1.5.0.dev20250129233125.dist-info/METADATA,sha256=DOddX-RASYXXcIqQG0M6OtbP2SGhZ2C7uUqfoNw3oRA,3239
1207
+ cirq_core-1.5.0.dev20250129233125.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1208
+ cirq_core-1.5.0.dev20250129233125.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1209
+ cirq_core-1.5.0.dev20250129233125.dist-info/RECORD,,