cirq-core 1.5.0.dev20250408055017__py3-none-any.whl → 1.5.0.dev20250408182640__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/circuits/circuit_operation.py +31 -34
- cirq/circuits/circuit_operation_test.py +31 -38
- cirq/ops/classically_controlled_operation_test.py +60 -70
- cirq/protocols/json_test_data/CircuitOperation.json +3 -6
- cirq/protocols/json_test_data/CircuitOperation.repr_inward +2 -4
- {cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/RECORD +12 -12
- {cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
|
@@ -22,6 +22,7 @@ component operations in order, including any nested CircuitOperations.
|
|
|
22
22
|
from __future__ import annotations
|
|
23
23
|
|
|
24
24
|
import math
|
|
25
|
+
import warnings
|
|
25
26
|
from functools import cached_property
|
|
26
27
|
from typing import (
|
|
27
28
|
Any,
|
|
@@ -48,7 +49,6 @@ from cirq._compat import proper_repr
|
|
|
48
49
|
if TYPE_CHECKING:
|
|
49
50
|
import cirq
|
|
50
51
|
|
|
51
|
-
|
|
52
52
|
INT_CLASSES = (int, np.integer)
|
|
53
53
|
INT_TYPE = Union[int, np.integer]
|
|
54
54
|
IntParam = Union[INT_TYPE, sympy.Expr]
|
|
@@ -123,8 +123,9 @@ class CircuitOperation(ops.Operation):
|
|
|
123
123
|
use_repetition_ids: When True, any measurement key in the subcircuit
|
|
124
124
|
will have its path prepended with the repetition id for each
|
|
125
125
|
repetition. When False, this will not happen and the measurement
|
|
126
|
-
key will be repeated.
|
|
127
|
-
|
|
126
|
+
key will be repeated. The default is True, but it will be changed
|
|
127
|
+
to False in the next release. Please pass an explicit argument
|
|
128
|
+
``use_repetition_ids=True`` to preserve the current behavior.
|
|
128
129
|
repeat_until: A condition that will be tested after each iteration of
|
|
129
130
|
the subcircuit. The subcircuit will repeat until condition returns
|
|
130
131
|
True, but will always run at least once, and the measurement key
|
|
@@ -161,8 +162,18 @@ class CircuitOperation(ops.Operation):
|
|
|
161
162
|
self._repetitions = repetitions
|
|
162
163
|
self._repetition_ids = None if repetition_ids is None else list(repetition_ids)
|
|
163
164
|
if use_repetition_ids is None:
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
if repetition_ids is None:
|
|
166
|
+
msg = (
|
|
167
|
+
"In cirq 1.6 the default value of `use_repetition_ids` will change to\n"
|
|
168
|
+
"`use_repetition_ids=False`. To make this warning go away, please pass\n"
|
|
169
|
+
"explicit `use_repetition_ids`, e.g., to preserve current behavior, use\n"
|
|
170
|
+
"\n"
|
|
171
|
+
" CircuitOperations(..., use_repetition_ids=True)"
|
|
172
|
+
)
|
|
173
|
+
warnings.warn(msg, FutureWarning)
|
|
174
|
+
self._use_repetition_ids = True
|
|
175
|
+
else:
|
|
176
|
+
self._use_repetition_ids = use_repetition_ids
|
|
166
177
|
if isinstance(self._repetitions, float):
|
|
167
178
|
if math.isclose(self._repetitions, round(self._repetitions)):
|
|
168
179
|
self._repetitions = round(self._repetitions)
|
|
@@ -270,9 +281,7 @@ class CircuitOperation(ops.Operation):
|
|
|
270
281
|
'repetition_ids': self.repetition_ids,
|
|
271
282
|
'parent_path': self.parent_path,
|
|
272
283
|
'extern_keys': self._extern_keys,
|
|
273
|
-
'use_repetition_ids':
|
|
274
|
-
True if changes.get('repetition_ids') is not None else self.use_repetition_ids
|
|
275
|
-
),
|
|
284
|
+
'use_repetition_ids': self.use_repetition_ids,
|
|
276
285
|
'repeat_until': self.repeat_until,
|
|
277
286
|
**changes,
|
|
278
287
|
}
|
|
@@ -476,9 +485,11 @@ class CircuitOperation(ops.Operation):
|
|
|
476
485
|
args += f'param_resolver={proper_repr(self.param_resolver)},\n'
|
|
477
486
|
if self.parent_path:
|
|
478
487
|
args += f'parent_path={proper_repr(self.parent_path)},\n'
|
|
479
|
-
if self.
|
|
488
|
+
if self.repetition_ids != self._default_repetition_ids():
|
|
480
489
|
# Default repetition_ids need not be specified.
|
|
481
490
|
args += f'repetition_ids={proper_repr(self.repetition_ids)},\n'
|
|
491
|
+
if not self.use_repetition_ids:
|
|
492
|
+
args += 'use_repetition_ids=False,\n'
|
|
482
493
|
if self.repeat_until:
|
|
483
494
|
args += f'repeat_until={self.repeat_until!r},\n'
|
|
484
495
|
indented_args = args.replace('\n', '\n ')
|
|
@@ -503,15 +514,14 @@ class CircuitOperation(ops.Operation):
|
|
|
503
514
|
args.append(f'params={self.param_resolver.param_dict}')
|
|
504
515
|
if self.parent_path:
|
|
505
516
|
args.append(f'parent_path={self.parent_path}')
|
|
506
|
-
if self.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
else:
|
|
510
|
-
# Default repetition_ids need not be specified.
|
|
511
|
-
args.append(f'loops={self.repetitions}, use_repetition_ids=True')
|
|
517
|
+
if self.repetition_ids != self._default_repetition_ids():
|
|
518
|
+
# Default repetition_ids need not be specified.
|
|
519
|
+
args.append(f'repetition_ids={self.repetition_ids}')
|
|
512
520
|
elif self.repetitions != 1:
|
|
513
|
-
#
|
|
521
|
+
# Only add loops if we haven't added repetition_ids.
|
|
514
522
|
args.append(f'loops={self.repetitions}')
|
|
523
|
+
if not self.use_repetition_ids:
|
|
524
|
+
args.append('no_rep_ids')
|
|
515
525
|
if self.repeat_until:
|
|
516
526
|
args.append(f'until={self.repeat_until}')
|
|
517
527
|
if not args:
|
|
@@ -556,9 +566,10 @@ class CircuitOperation(ops.Operation):
|
|
|
556
566
|
'measurement_key_map': self.measurement_key_map,
|
|
557
567
|
'param_resolver': self.param_resolver,
|
|
558
568
|
'repetition_ids': self.repetition_ids,
|
|
559
|
-
'use_repetition_ids': self.use_repetition_ids,
|
|
560
569
|
'parent_path': self.parent_path,
|
|
561
570
|
}
|
|
571
|
+
if not self.use_repetition_ids:
|
|
572
|
+
resp['use_repetition_ids'] = False
|
|
562
573
|
if self.repeat_until:
|
|
563
574
|
resp['repeat_until'] = self.repeat_until
|
|
564
575
|
return resp
|
|
@@ -592,10 +603,7 @@ class CircuitOperation(ops.Operation):
|
|
|
592
603
|
# Methods for constructing a similar object with one field modified.
|
|
593
604
|
|
|
594
605
|
def repeat(
|
|
595
|
-
self,
|
|
596
|
-
repetitions: Optional[IntParam] = None,
|
|
597
|
-
repetition_ids: Optional[Sequence[str]] = None,
|
|
598
|
-
use_repetition_ids: Optional[bool] = None,
|
|
606
|
+
self, repetitions: Optional[IntParam] = None, repetition_ids: Optional[Sequence[str]] = None
|
|
599
607
|
) -> CircuitOperation:
|
|
600
608
|
"""Returns a copy of this operation repeated 'repetitions' times.
|
|
601
609
|
Each repetition instance will be identified by a single repetition_id.
|
|
@@ -606,10 +614,6 @@ class CircuitOperation(ops.Operation):
|
|
|
606
614
|
defaults to the length of `repetition_ids`.
|
|
607
615
|
repetition_ids: List of IDs, one for each repetition. If unset,
|
|
608
616
|
defaults to `default_repetition_ids(repetitions)`.
|
|
609
|
-
use_repetition_ids: If given, this specifies the value for `use_repetition_ids`
|
|
610
|
-
of the resulting circuit operation. If not given, we enable ids if
|
|
611
|
-
`repetition_ids` is not None, and otherwise fall back to
|
|
612
|
-
`self.use_repetition_ids`.
|
|
613
617
|
|
|
614
618
|
Returns:
|
|
615
619
|
A copy of this operation repeated `repetitions` times with the
|
|
@@ -624,9 +628,6 @@ class CircuitOperation(ops.Operation):
|
|
|
624
628
|
ValueError: Unexpected length of `repetition_ids`.
|
|
625
629
|
ValueError: Both `repetitions` and `repetition_ids` are None.
|
|
626
630
|
"""
|
|
627
|
-
if use_repetition_ids is None:
|
|
628
|
-
use_repetition_ids = True if repetition_ids is not None else self.use_repetition_ids
|
|
629
|
-
|
|
630
631
|
if repetitions is None:
|
|
631
632
|
if repetition_ids is None:
|
|
632
633
|
raise ValueError('At least one of repetitions and repetition_ids must be set')
|
|
@@ -640,7 +641,7 @@ class CircuitOperation(ops.Operation):
|
|
|
640
641
|
expected_repetition_id_length: int = np.abs(repetitions)
|
|
641
642
|
|
|
642
643
|
if repetition_ids is None:
|
|
643
|
-
if use_repetition_ids:
|
|
644
|
+
if self.use_repetition_ids:
|
|
644
645
|
repetition_ids = default_repetition_ids(expected_repetition_id_length)
|
|
645
646
|
elif len(repetition_ids) != expected_repetition_id_length:
|
|
646
647
|
raise ValueError(
|
|
@@ -653,11 +654,7 @@ class CircuitOperation(ops.Operation):
|
|
|
653
654
|
|
|
654
655
|
# The eventual number of repetitions of the returned CircuitOperation.
|
|
655
656
|
final_repetitions = protocols.mul(self.repetitions, repetitions)
|
|
656
|
-
return self.replace(
|
|
657
|
-
repetitions=final_repetitions,
|
|
658
|
-
repetition_ids=repetition_ids,
|
|
659
|
-
use_repetition_ids=use_repetition_ids,
|
|
660
|
-
)
|
|
657
|
+
return self.replace(repetitions=final_repetitions, repetition_ids=repetition_ids)
|
|
661
658
|
|
|
662
659
|
def __pow__(self, power: IntParam) -> cirq.CircuitOperation:
|
|
663
660
|
return self.repeat(power)
|
|
@@ -294,15 +294,15 @@ def test_repeat(add_measurements: bool, use_default_ids_for_initial_rep: bool) -
|
|
|
294
294
|
op_with_reps: Optional[cirq.CircuitOperation] = None
|
|
295
295
|
rep_ids = []
|
|
296
296
|
if use_default_ids_for_initial_rep:
|
|
297
|
+
op_with_reps = op_base.repeat(initial_repetitions)
|
|
297
298
|
rep_ids = ['0', '1', '2']
|
|
298
|
-
|
|
299
|
+
assert op_base**initial_repetitions == op_with_reps
|
|
299
300
|
else:
|
|
300
301
|
rep_ids = ['a', 'b', 'c']
|
|
301
302
|
op_with_reps = op_base.repeat(initial_repetitions, rep_ids)
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
assert op_base**initial_repetitions != op_with_reps
|
|
304
|
+
assert (op_base**initial_repetitions).replace(repetition_ids=rep_ids) == op_with_reps
|
|
304
305
|
assert op_with_reps.repetitions == initial_repetitions
|
|
305
|
-
assert op_with_reps.use_repetition_ids
|
|
306
306
|
assert op_with_reps.repetition_ids == rep_ids
|
|
307
307
|
assert op_with_reps.repeat(1) is op_with_reps
|
|
308
308
|
|
|
@@ -332,6 +332,8 @@ 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
|
+
# TODO: #7232 - enable and fix immediately after the 1.5.0 release
|
|
336
|
+
@pytest.mark.xfail(reason='broken by rollback of use_repetition_ids for #7232')
|
|
335
337
|
def test_replace_repetition_ids() -> None:
|
|
336
338
|
a, b = cirq.LineQubit.range(2)
|
|
337
339
|
circuit = cirq.Circuit(cirq.H(a), cirq.CX(a, b), cirq.M(b, key='mb'), cirq.M(a, key='ma'))
|
|
@@ -458,7 +460,6 @@ def test_parameterized_repeat_side_effects():
|
|
|
458
460
|
op = cirq.CircuitOperation(
|
|
459
461
|
cirq.FrozenCircuit(cirq.X(q).with_classical_controls('c'), cirq.measure(q, key='m')),
|
|
460
462
|
repetitions=sympy.Symbol('a'),
|
|
461
|
-
use_repetition_ids=True,
|
|
462
463
|
)
|
|
463
464
|
|
|
464
465
|
# Control keys can be calculated because they only "lift" if there's a matching
|
|
@@ -712,6 +713,7 @@ cirq.CircuitOperation(
|
|
|
712
713
|
),
|
|
713
714
|
),
|
|
714
715
|
]),
|
|
716
|
+
use_repetition_ids=False,
|
|
715
717
|
)"""
|
|
716
718
|
)
|
|
717
719
|
op7 = cirq.CircuitOperation(
|
|
@@ -728,6 +730,7 @@ cirq.CircuitOperation(
|
|
|
728
730
|
cirq.measure(cirq.LineQubit(0), key=cirq.MeasurementKey(name='a')),
|
|
729
731
|
),
|
|
730
732
|
]),
|
|
733
|
+
use_repetition_ids=False,
|
|
731
734
|
repeat_until=cirq.KeyCondition(cirq.MeasurementKey(name='a')),
|
|
732
735
|
)"""
|
|
733
736
|
)
|
|
@@ -758,7 +761,6 @@ def test_json_dict():
|
|
|
758
761
|
'param_resolver': op.param_resolver,
|
|
759
762
|
'parent_path': op.parent_path,
|
|
760
763
|
'repetition_ids': None,
|
|
761
|
-
'use_repetition_ids': False,
|
|
762
764
|
}
|
|
763
765
|
|
|
764
766
|
|
|
@@ -865,26 +867,6 @@ def test_decompose_loops_with_measurements():
|
|
|
865
867
|
circuit = cirq.FrozenCircuit(cirq.H(a), cirq.CX(a, b), cirq.measure(a, b, key='m'))
|
|
866
868
|
base_op = cirq.CircuitOperation(circuit)
|
|
867
869
|
|
|
868
|
-
op = base_op.with_qubits(b, a).repeat(3)
|
|
869
|
-
expected_circuit = cirq.Circuit(
|
|
870
|
-
cirq.H(b),
|
|
871
|
-
cirq.CX(b, a),
|
|
872
|
-
cirq.measure(b, a, key=cirq.MeasurementKey.parse_serialized('m')),
|
|
873
|
-
cirq.H(b),
|
|
874
|
-
cirq.CX(b, a),
|
|
875
|
-
cirq.measure(b, a, key=cirq.MeasurementKey.parse_serialized('m')),
|
|
876
|
-
cirq.H(b),
|
|
877
|
-
cirq.CX(b, a),
|
|
878
|
-
cirq.measure(b, a, key=cirq.MeasurementKey.parse_serialized('m')),
|
|
879
|
-
)
|
|
880
|
-
assert cirq.Circuit(cirq.decompose_once(op)) == expected_circuit
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
def test_decompose_loops_with_measurements_use_rep_ids():
|
|
884
|
-
a, b = cirq.LineQubit.range(2)
|
|
885
|
-
circuit = cirq.FrozenCircuit(cirq.H(a), cirq.CX(a, b), cirq.measure(a, b, key='m'))
|
|
886
|
-
base_op = cirq.CircuitOperation(circuit, use_repetition_ids=True)
|
|
887
|
-
|
|
888
870
|
op = base_op.with_qubits(b, a).repeat(3)
|
|
889
871
|
expected_circuit = cirq.Circuit(
|
|
890
872
|
cirq.H(b),
|
|
@@ -1041,9 +1023,7 @@ def test_keys_under_parent_path():
|
|
|
1041
1023
|
op3 = cirq.with_key_path_prefix(op2, ('C',))
|
|
1042
1024
|
assert cirq.measurement_key_names(op3) == {'C:B:A'}
|
|
1043
1025
|
op4 = op3.repeat(2)
|
|
1044
|
-
assert cirq.measurement_key_names(op4) == {'C:B:A'}
|
|
1045
|
-
op4_rep = op3.repeat(2).replace(use_repetition_ids=True)
|
|
1046
|
-
assert cirq.measurement_key_names(op4_rep) == {'C:B:0:A', 'C:B:1:A'}
|
|
1026
|
+
assert cirq.measurement_key_names(op4) == {'C:B:0:A', 'C:B:1:A'}
|
|
1047
1027
|
|
|
1048
1028
|
|
|
1049
1029
|
def test_mapped_circuit_preserves_moments():
|
|
@@ -1121,8 +1101,12 @@ def test_mapped_circuit_allows_repeated_keys():
|
|
|
1121
1101
|
def test_simulate_no_repetition_ids_both_levels(sim):
|
|
1122
1102
|
q = cirq.LineQubit(0)
|
|
1123
1103
|
inner = cirq.Circuit(cirq.measure(q, key='a'))
|
|
1124
|
-
middle = cirq.Circuit(
|
|
1125
|
-
|
|
1104
|
+
middle = cirq.Circuit(
|
|
1105
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2, use_repetition_ids=False)
|
|
1106
|
+
)
|
|
1107
|
+
outer_subcircuit = cirq.CircuitOperation(
|
|
1108
|
+
middle.freeze(), repetitions=2, use_repetition_ids=False
|
|
1109
|
+
)
|
|
1126
1110
|
circuit = cirq.Circuit(outer_subcircuit)
|
|
1127
1111
|
result = sim.run(circuit)
|
|
1128
1112
|
assert result.records['a'].shape == (1, 4, 1)
|
|
@@ -1132,10 +1116,10 @@ def test_simulate_no_repetition_ids_both_levels(sim):
|
|
|
1132
1116
|
def test_simulate_no_repetition_ids_outer(sim):
|
|
1133
1117
|
q = cirq.LineQubit(0)
|
|
1134
1118
|
inner = cirq.Circuit(cirq.measure(q, key='a'))
|
|
1135
|
-
middle = cirq.Circuit(
|
|
1136
|
-
|
|
1119
|
+
middle = cirq.Circuit(cirq.CircuitOperation(inner.freeze(), repetitions=2))
|
|
1120
|
+
outer_subcircuit = cirq.CircuitOperation(
|
|
1121
|
+
middle.freeze(), repetitions=2, use_repetition_ids=False
|
|
1137
1122
|
)
|
|
1138
|
-
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
1139
1123
|
circuit = cirq.Circuit(outer_subcircuit)
|
|
1140
1124
|
result = sim.run(circuit)
|
|
1141
1125
|
assert result.records['0:a'].shape == (1, 2, 1)
|
|
@@ -1146,10 +1130,10 @@ def test_simulate_no_repetition_ids_outer(sim):
|
|
|
1146
1130
|
def test_simulate_no_repetition_ids_inner(sim):
|
|
1147
1131
|
q = cirq.LineQubit(0)
|
|
1148
1132
|
inner = cirq.Circuit(cirq.measure(q, key='a'))
|
|
1149
|
-
middle = cirq.Circuit(
|
|
1150
|
-
|
|
1151
|
-
middle.freeze(), repetitions=2, use_repetition_ids=True
|
|
1133
|
+
middle = cirq.Circuit(
|
|
1134
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2, use_repetition_ids=False)
|
|
1152
1135
|
)
|
|
1136
|
+
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
1153
1137
|
circuit = cirq.Circuit(outer_subcircuit)
|
|
1154
1138
|
result = sim.run(circuit)
|
|
1155
1139
|
assert result.records['0:a'].shape == (1, 2, 1)
|
|
@@ -1164,6 +1148,7 @@ def test_repeat_until(sim):
|
|
|
1164
1148
|
cirq.X(q),
|
|
1165
1149
|
cirq.CircuitOperation(
|
|
1166
1150
|
cirq.FrozenCircuit(cirq.X(q), cirq.measure(q, key=key)),
|
|
1151
|
+
use_repetition_ids=False,
|
|
1167
1152
|
repeat_until=cirq.KeyCondition(key),
|
|
1168
1153
|
),
|
|
1169
1154
|
)
|
|
@@ -1178,6 +1163,7 @@ def test_repeat_until_sympy(sim):
|
|
|
1178
1163
|
q1, q2 = cirq.LineQubit.range(2)
|
|
1179
1164
|
circuitop = cirq.CircuitOperation(
|
|
1180
1165
|
cirq.FrozenCircuit(cirq.X(q2), cirq.measure(q2, key='b')),
|
|
1166
|
+
use_repetition_ids=False,
|
|
1181
1167
|
repeat_until=cirq.SympyCondition(sympy.Eq(sympy.Symbol('a'), sympy.Symbol('b'))),
|
|
1182
1168
|
)
|
|
1183
1169
|
c = cirq.Circuit(cirq.measure(q1, key='a'), circuitop)
|
|
@@ -1197,6 +1183,7 @@ def test_post_selection(sim):
|
|
|
1197
1183
|
c = cirq.Circuit(
|
|
1198
1184
|
cirq.CircuitOperation(
|
|
1199
1185
|
cirq.FrozenCircuit(cirq.X(q) ** 0.2, cirq.measure(q, key=key)),
|
|
1186
|
+
use_repetition_ids=False,
|
|
1200
1187
|
repeat_until=cirq.KeyCondition(key),
|
|
1201
1188
|
)
|
|
1202
1189
|
)
|
|
@@ -1212,13 +1199,14 @@ def test_repeat_until_diagram():
|
|
|
1212
1199
|
c = cirq.Circuit(
|
|
1213
1200
|
cirq.CircuitOperation(
|
|
1214
1201
|
cirq.FrozenCircuit(cirq.X(q) ** 0.2, cirq.measure(q, key=key)),
|
|
1202
|
+
use_repetition_ids=False,
|
|
1215
1203
|
repeat_until=cirq.KeyCondition(key),
|
|
1216
1204
|
)
|
|
1217
1205
|
)
|
|
1218
1206
|
cirq.testing.assert_has_diagram(
|
|
1219
1207
|
c,
|
|
1220
1208
|
"""
|
|
1221
|
-
0: ───[ 0: ───X^0.2───M('m')─── ](until=m)───
|
|
1209
|
+
0: ───[ 0: ───X^0.2───M('m')─── ](no_rep_ids, until=m)───
|
|
1222
1210
|
""",
|
|
1223
1211
|
use_unicode_characters=True,
|
|
1224
1212
|
)
|
|
@@ -1235,6 +1223,7 @@ def test_repeat_until_error():
|
|
|
1235
1223
|
with pytest.raises(ValueError, match='Infinite loop'):
|
|
1236
1224
|
cirq.CircuitOperation(
|
|
1237
1225
|
cirq.FrozenCircuit(cirq.measure(q, key='m')),
|
|
1226
|
+
use_repetition_ids=False,
|
|
1238
1227
|
repeat_until=cirq.KeyCondition(cirq.MeasurementKey('a')),
|
|
1239
1228
|
)
|
|
1240
1229
|
|
|
@@ -1244,6 +1233,8 @@ def test_repeat_until_protocols():
|
|
|
1244
1233
|
op = cirq.CircuitOperation(
|
|
1245
1234
|
cirq.FrozenCircuit(cirq.H(q) ** sympy.Symbol('p'), cirq.measure(q, key='a')),
|
|
1246
1235
|
repeat_until=cirq.SympyCondition(sympy.Eq(sympy.Symbol('a'), 0)),
|
|
1236
|
+
# TODO: #7232 - remove immediately after the 1.5.0 release
|
|
1237
|
+
use_repetition_ids=False,
|
|
1247
1238
|
)
|
|
1248
1239
|
scoped = cirq.with_rescoped_keys(op, ('0',))
|
|
1249
1240
|
# Ensure the _repeat_until has been mapped, the measurement has been mapped to the same key,
|
|
@@ -1276,6 +1267,8 @@ def test_inner_repeat_until_simulate():
|
|
|
1276
1267
|
inner_loop = cirq.CircuitOperation(
|
|
1277
1268
|
cirq.FrozenCircuit(cirq.H(q), cirq.measure(q, key="inner_loop")),
|
|
1278
1269
|
repeat_until=cirq.SympyCondition(sympy.Eq(sympy.Symbol("inner_loop"), 0)),
|
|
1270
|
+
# TODO: #7232 - remove immediately after the 1.5.0 release
|
|
1271
|
+
use_repetition_ids=False,
|
|
1279
1272
|
)
|
|
1280
1273
|
outer_loop = cirq.Circuit(inner_loop, cirq.X(q), cirq.measure(q, key="outer_loop"))
|
|
1281
1274
|
circuit = cirq.Circuit(
|
|
@@ -358,9 +358,7 @@ def test_subcircuit_key_unset(sim):
|
|
|
358
358
|
cirq.measure(q1, key='b'),
|
|
359
359
|
)
|
|
360
360
|
circuit = cirq.Circuit(
|
|
361
|
-
cirq.CircuitOperation(
|
|
362
|
-
inner.freeze(), repetitions=2, use_repetition_ids=True, measurement_key_map={'c': 'a'}
|
|
363
|
-
)
|
|
361
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2, measurement_key_map={'c': 'a'})
|
|
364
362
|
)
|
|
365
363
|
result = sim.run(circuit)
|
|
366
364
|
assert result.measurements['0:a'] == 0
|
|
@@ -379,9 +377,7 @@ def test_subcircuit_key_set(sim):
|
|
|
379
377
|
cirq.measure(q1, key='b'),
|
|
380
378
|
)
|
|
381
379
|
circuit = cirq.Circuit(
|
|
382
|
-
cirq.CircuitOperation(
|
|
383
|
-
inner.freeze(), repetitions=4, use_repetition_ids=True, measurement_key_map={'c': 'a'}
|
|
384
|
-
)
|
|
380
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=4, measurement_key_map={'c': 'a'})
|
|
385
381
|
)
|
|
386
382
|
result = sim.run(circuit)
|
|
387
383
|
assert result.measurements['0:a'] == 1
|
|
@@ -490,12 +486,8 @@ def test_str():
|
|
|
490
486
|
def test_scope_local():
|
|
491
487
|
q = cirq.LineQubit(0)
|
|
492
488
|
inner = cirq.Circuit(cirq.measure(q, key='a'), cirq.X(q).with_classical_controls('a'))
|
|
493
|
-
middle = cirq.Circuit(
|
|
494
|
-
|
|
495
|
-
)
|
|
496
|
-
outer_subcircuit = cirq.CircuitOperation(
|
|
497
|
-
middle.freeze(), repetitions=2, use_repetition_ids=True
|
|
498
|
-
)
|
|
489
|
+
middle = cirq.Circuit(cirq.CircuitOperation(inner.freeze(), repetitions=2))
|
|
490
|
+
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
499
491
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
500
492
|
internal_control_keys = [
|
|
501
493
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -503,17 +495,15 @@ def test_scope_local():
|
|
|
503
495
|
assert internal_control_keys == ['0:0:a', '0:1:a', '1:0:a', '1:1:a']
|
|
504
496
|
assert not cirq.control_keys(outer_subcircuit)
|
|
505
497
|
assert not cirq.control_keys(circuit)
|
|
506
|
-
# pylint: disable=line-too-long
|
|
507
498
|
cirq.testing.assert_has_diagram(
|
|
508
499
|
cirq.Circuit(outer_subcircuit),
|
|
509
500
|
"""
|
|
510
|
-
[ [ 0: ───M───X─── ]
|
|
511
|
-
0: ───[ 0: ───[ ║ ║ ]
|
|
512
|
-
[ [ a: ═══@═══^═══ ](loops=2
|
|
501
|
+
[ [ 0: ───M───X─── ] ]
|
|
502
|
+
0: ───[ 0: ───[ ║ ║ ]──────────── ]────────────
|
|
503
|
+
[ [ a: ═══@═══^═══ ](loops=2) ](loops=2)
|
|
513
504
|
""",
|
|
514
505
|
use_unicode_characters=True,
|
|
515
506
|
)
|
|
516
|
-
# pylint: enable=line-too-long
|
|
517
507
|
cirq.testing.assert_has_diagram(
|
|
518
508
|
circuit,
|
|
519
509
|
"""
|
|
@@ -551,9 +541,9 @@ def test_scope_flatten_both():
|
|
|
551
541
|
cirq.testing.assert_has_diagram(
|
|
552
542
|
cirq.Circuit(outer_subcircuit),
|
|
553
543
|
"""
|
|
554
|
-
[ [ 0: ───M───X─── ]
|
|
555
|
-
0: ───[ 0: ───[ ║ ║ ]
|
|
556
|
-
[ [ a: ═══@═══^═══ ](loops=2) ](loops=2)
|
|
544
|
+
[ [ 0: ───M───X─── ] ]
|
|
545
|
+
0: ───[ 0: ───[ ║ ║ ]──────────────────────── ]────────────────────────
|
|
546
|
+
[ [ a: ═══@═══^═══ ](loops=2, no_rep_ids) ](loops=2, no_rep_ids)
|
|
557
547
|
""",
|
|
558
548
|
use_unicode_characters=True,
|
|
559
549
|
)
|
|
@@ -571,10 +561,10 @@ a: ═══@═══^═══@═══^═══@═══^═══@══
|
|
|
571
561
|
def test_scope_flatten_inner():
|
|
572
562
|
q = cirq.LineQubit(0)
|
|
573
563
|
inner = cirq.Circuit(cirq.measure(q, key='a'), cirq.X(q).with_classical_controls('a'))
|
|
574
|
-
middle = cirq.Circuit(
|
|
575
|
-
|
|
576
|
-
middle.freeze(), repetitions=2, use_repetition_ids=True
|
|
564
|
+
middle = cirq.Circuit(
|
|
565
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2, use_repetition_ids=False)
|
|
577
566
|
)
|
|
567
|
+
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
578
568
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
579
569
|
internal_control_keys = [
|
|
580
570
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -585,9 +575,9 @@ def test_scope_flatten_inner():
|
|
|
585
575
|
cirq.testing.assert_has_diagram(
|
|
586
576
|
cirq.Circuit(outer_subcircuit),
|
|
587
577
|
"""
|
|
588
|
-
[ [ 0: ───M───X─── ]
|
|
589
|
-
0: ───[ 0: ───[ ║ ║ ]
|
|
590
|
-
[ [ a: ═══@═══^═══ ](loops=2) ](loops=2
|
|
578
|
+
[ [ 0: ───M───X─── ] ]
|
|
579
|
+
0: ───[ 0: ───[ ║ ║ ]──────────────────────── ]────────────
|
|
580
|
+
[ [ a: ═══@═══^═══ ](loops=2, no_rep_ids) ](loops=2)
|
|
591
581
|
""",
|
|
592
582
|
use_unicode_characters=True,
|
|
593
583
|
)
|
|
@@ -607,10 +597,10 @@ def test_scope_flatten_inner():
|
|
|
607
597
|
def test_scope_flatten_outer():
|
|
608
598
|
q = cirq.LineQubit(0)
|
|
609
599
|
inner = cirq.Circuit(cirq.measure(q, key='a'), cirq.X(q).with_classical_controls('a'))
|
|
610
|
-
middle = cirq.Circuit(
|
|
611
|
-
|
|
600
|
+
middle = cirq.Circuit(cirq.CircuitOperation(inner.freeze(), repetitions=2))
|
|
601
|
+
outer_subcircuit = cirq.CircuitOperation(
|
|
602
|
+
middle.freeze(), repetitions=2, use_repetition_ids=False
|
|
612
603
|
)
|
|
613
|
-
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
614
604
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
615
605
|
internal_control_keys = [
|
|
616
606
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -621,9 +611,9 @@ def test_scope_flatten_outer():
|
|
|
621
611
|
cirq.testing.assert_has_diagram(
|
|
622
612
|
cirq.Circuit(outer_subcircuit),
|
|
623
613
|
"""
|
|
624
|
-
[ [ 0: ───M───X─── ]
|
|
625
|
-
0: ───[ 0: ───[ ║ ║ ]
|
|
626
|
-
[ [ a: ═══@═══^═══ ](loops=2
|
|
614
|
+
[ [ 0: ───M───X─── ] ]
|
|
615
|
+
0: ───[ 0: ───[ ║ ║ ]──────────── ]────────────────────────
|
|
616
|
+
[ [ a: ═══@═══^═══ ](loops=2) ](loops=2, no_rep_ids)
|
|
627
617
|
""",
|
|
628
618
|
use_unicode_characters=True,
|
|
629
619
|
)
|
|
@@ -645,11 +635,9 @@ def test_scope_extern():
|
|
|
645
635
|
inner = cirq.Circuit(cirq.measure(q, key='a'), cirq.X(q).with_classical_controls('b'))
|
|
646
636
|
middle = cirq.Circuit(
|
|
647
637
|
cirq.measure(q, key=cirq.MeasurementKey('b')),
|
|
648
|
-
cirq.CircuitOperation(inner.freeze(), repetitions=2
|
|
649
|
-
)
|
|
650
|
-
outer_subcircuit = cirq.CircuitOperation(
|
|
651
|
-
middle.freeze(), repetitions=2, use_repetition_ids=True
|
|
638
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2),
|
|
652
639
|
)
|
|
640
|
+
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
653
641
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
654
642
|
internal_control_keys = [
|
|
655
643
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -657,19 +645,17 @@ def test_scope_extern():
|
|
|
657
645
|
assert internal_control_keys == ['0:b', '0:b', '1:b', '1:b']
|
|
658
646
|
assert not cirq.control_keys(outer_subcircuit)
|
|
659
647
|
assert not cirq.control_keys(circuit)
|
|
660
|
-
# pylint: disable=line-too-long
|
|
661
648
|
cirq.testing.assert_has_diagram(
|
|
662
649
|
cirq.Circuit(outer_subcircuit),
|
|
663
650
|
"""
|
|
664
|
-
[ [ 0: ───M('a')───X─── ]
|
|
665
|
-
[ 0: ───M───[ ║ ]
|
|
666
|
-
0: ───[ ║ [ b: ════════════^═══ ](loops=2
|
|
667
|
-
[ ║ ║
|
|
668
|
-
[ b:
|
|
651
|
+
[ [ 0: ───M('a')───X─── ] ]
|
|
652
|
+
[ 0: ───M───[ ║ ]──────────── ]
|
|
653
|
+
0: ───[ ║ [ b: ════════════^═══ ](loops=2) ]────────────
|
|
654
|
+
[ ║ ║ ]
|
|
655
|
+
[ b: ═══@═══╩══════════════════════════════════ ](loops=2)
|
|
669
656
|
""",
|
|
670
657
|
use_unicode_characters=True,
|
|
671
658
|
)
|
|
672
|
-
# pylint: enable=line-too-long
|
|
673
659
|
cirq.testing.assert_has_diagram(
|
|
674
660
|
circuit,
|
|
675
661
|
"""
|
|
@@ -697,9 +683,9 @@ def test_scope_extern_wrapping_with_non_repeating_subcircuits():
|
|
|
697
683
|
)
|
|
698
684
|
middle = wrap_frozen(
|
|
699
685
|
wrap(cirq.measure(q, key=cirq.MeasurementKey('b'))),
|
|
700
|
-
wrap(cirq.CircuitOperation(inner, repetitions=2
|
|
686
|
+
wrap(cirq.CircuitOperation(inner, repetitions=2)),
|
|
701
687
|
)
|
|
702
|
-
outer_subcircuit = cirq.CircuitOperation(middle, repetitions=2
|
|
688
|
+
outer_subcircuit = cirq.CircuitOperation(middle, repetitions=2)
|
|
703
689
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
704
690
|
internal_control_keys = [
|
|
705
691
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -752,9 +738,9 @@ b: ═══╩═════════════════════
|
|
|
752
738
|
cirq.testing.assert_has_diagram(
|
|
753
739
|
circuit,
|
|
754
740
|
"""
|
|
755
|
-
0: ───M('c')───M('a')───X───M('a')───X───M('c')───M('a')───X───M('a')───X───
|
|
756
|
-
|
|
757
|
-
b:
|
|
741
|
+
0: ───M('0:c')───M('0:0:a')───X───M('0:1:a')───X───M('1:c')───M('1:0:a')───X───M('1:1:a')───X───
|
|
742
|
+
║ ║ ║ ║
|
|
743
|
+
b: ═══════════════════════════^════════════════^═══════════════════════════^════════════════^═══
|
|
758
744
|
""",
|
|
759
745
|
use_unicode_characters=True,
|
|
760
746
|
)
|
|
@@ -766,11 +752,9 @@ def test_scope_extern_mismatch():
|
|
|
766
752
|
inner = cirq.Circuit(cirq.measure(q, key='a'), cirq.X(q).with_classical_controls('b'))
|
|
767
753
|
middle = cirq.Circuit(
|
|
768
754
|
cirq.measure(q, key=cirq.MeasurementKey('b', ('0',))),
|
|
769
|
-
cirq.CircuitOperation(inner.freeze(), repetitions=2
|
|
770
|
-
)
|
|
771
|
-
outer_subcircuit = cirq.CircuitOperation(
|
|
772
|
-
middle.freeze(), repetitions=2, use_repetition_ids=True
|
|
755
|
+
cirq.CircuitOperation(inner.freeze(), repetitions=2),
|
|
773
756
|
)
|
|
757
|
+
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
774
758
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
775
759
|
internal_control_keys = [
|
|
776
760
|
str(condition) for op in circuit.all_operations() for condition in cirq.control_keys(op)
|
|
@@ -778,21 +762,19 @@ def test_scope_extern_mismatch():
|
|
|
778
762
|
assert internal_control_keys == ['b', 'b', 'b', 'b']
|
|
779
763
|
assert cirq.control_keys(outer_subcircuit) == {cirq.MeasurementKey('b')}
|
|
780
764
|
assert cirq.control_keys(circuit) == {cirq.MeasurementKey('b')}
|
|
781
|
-
# pylint: disable=line-too-long
|
|
782
765
|
cirq.testing.assert_has_diagram(
|
|
783
766
|
cirq.Circuit(outer_subcircuit),
|
|
784
767
|
"""
|
|
785
|
-
[ [ 0: ───M('a')───X─── ]
|
|
786
|
-
[ 0: ───M('0:b')───[ ║ ]
|
|
787
|
-
0: ───[ [ b: ════════════^═══ ](loops=2
|
|
788
|
-
[ ║
|
|
789
|
-
[ b:
|
|
768
|
+
[ [ 0: ───M('a')───X─── ] ]
|
|
769
|
+
[ 0: ───M('0:b')───[ ║ ]──────────── ]
|
|
770
|
+
0: ───[ [ b: ════════════^═══ ](loops=2) ]────────────
|
|
771
|
+
[ ║ ]
|
|
772
|
+
[ b: ══════════════╩══════════════════════════════════ ](loops=2)
|
|
790
773
|
║
|
|
791
|
-
b:
|
|
774
|
+
b: ═══╩═══════════════════════════════════════════════════════════════════
|
|
792
775
|
""",
|
|
793
776
|
use_unicode_characters=True,
|
|
794
777
|
)
|
|
795
|
-
# pylint: enable=line-too-long
|
|
796
778
|
cirq.testing.assert_has_diagram(
|
|
797
779
|
circuit,
|
|
798
780
|
"""
|
|
@@ -952,7 +934,7 @@ def test_sympy_scope():
|
|
|
952
934
|
outer_subcircuit = cirq.CircuitOperation(middle.freeze(), repetitions=2)
|
|
953
935
|
circuit = outer_subcircuit.mapped_circuit(deep=True)
|
|
954
936
|
internal_controls = [str(k) for op in circuit.all_operations() for k in cirq.control_keys(op)]
|
|
955
|
-
assert set(internal_controls) == {'a', 'b', 'c', 'd'}
|
|
937
|
+
assert set(internal_controls) == {'0:0:a', '0:1:a', '1:0:a', '1:1:a', '0:b', '1:b', 'c', 'd'}
|
|
956
938
|
assert cirq.control_keys(outer_subcircuit) == {'c', 'd'}
|
|
957
939
|
assert cirq.control_keys(circuit) == {'c', 'd'}
|
|
958
940
|
assert circuit == cirq.Circuit(cirq.decompose(outer_subcircuit))
|
|
@@ -986,15 +968,23 @@ d: ═══╩═════════════════════
|
|
|
986
968
|
cirq.testing.assert_has_diagram(
|
|
987
969
|
circuit,
|
|
988
970
|
"""
|
|
989
|
-
0:
|
|
990
|
-
|
|
991
|
-
a:
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
971
|
+
0: ───────M───M('0:0:c')───M───X(conditions=[c | d, 0:0:a & 0:b])───M───X(conditions=[c | d, 0:1:a & 0:b])───M───M('1:0:c')───M───X(conditions=[c | d, 1:0:a & 1:b])───M───X(conditions=[c | d, 1:1:a & 1:b])───
|
|
972
|
+
║ ║ ║ ║ ║ ║ ║ ║ ║ ║
|
|
973
|
+
0:0:a: ═══╬════════════════@═══^════════════════════════════════════╬═══╬════════════════════════════════════╬════════════════╬═══╬════════════════════════════════════╬═══╬════════════════════════════════════
|
|
974
|
+
║ ║ ║ ║ ║ ║ ║ ║ ║
|
|
975
|
+
0:1:a: ═══╬════════════════════╬════════════════════════════════════@═══^════════════════════════════════════╬════════════════╬═══╬════════════════════════════════════╬═══╬════════════════════════════════════
|
|
976
|
+
║ ║ ║ ║ ║ ║ ║ ║
|
|
977
|
+
0:b: ═════@════════════════════^════════════════════════════════════════^════════════════════════════════════╬════════════════╬═══╬════════════════════════════════════╬═══╬════════════════════════════════════
|
|
978
|
+
║ ║ ║ ║ ║ ║ ║
|
|
979
|
+
1:0:a: ════════════════════════╬════════════════════════════════════════╬════════════════════════════════════╬════════════════@═══^════════════════════════════════════╬═══╬════════════════════════════════════
|
|
980
|
+
║ ║ ║ ║ ║ ║
|
|
981
|
+
1:1:a: ════════════════════════╬════════════════════════════════════════╬════════════════════════════════════╬════════════════════╬════════════════════════════════════@═══^════════════════════════════════════
|
|
982
|
+
║ ║ ║ ║ ║
|
|
983
|
+
1:b: ══════════════════════════╬════════════════════════════════════════╬════════════════════════════════════@════════════════════^════════════════════════════════════════^════════════════════════════════════
|
|
984
|
+
║ ║ ║ ║
|
|
985
|
+
c: ════════════════════════════^════════════════════════════════════════^═════════════════════════════════════════════════════════^════════════════════════════════════════^════════════════════════════════════
|
|
986
|
+
║ ║ ║ ║
|
|
987
|
+
d: ════════════════════════════^════════════════════════════════════════^═════════════════════════════════════════════════════════^════════════════════════════════════════^════════════════════════════════════
|
|
998
988
|
""",
|
|
999
989
|
use_unicode_characters=True,
|
|
1000
990
|
)
|
|
@@ -133,8 +133,7 @@
|
|
|
133
133
|
"parent_path": [],
|
|
134
134
|
"repetition_ids": [
|
|
135
135
|
"0"
|
|
136
|
-
]
|
|
137
|
-
"use_repetition_ids": true
|
|
136
|
+
]
|
|
138
137
|
},
|
|
139
138
|
{
|
|
140
139
|
"cirq_type": "CircuitOperation",
|
|
@@ -188,8 +187,7 @@
|
|
|
188
187
|
"repetition_ids": [
|
|
189
188
|
"a",
|
|
190
189
|
"b"
|
|
191
|
-
]
|
|
192
|
-
"use_repetition_ids": true
|
|
190
|
+
]
|
|
193
191
|
},
|
|
194
192
|
{
|
|
195
193
|
"cirq_type": "CircuitOperation",
|
|
@@ -219,8 +217,7 @@
|
|
|
219
217
|
"repetition_ids": [
|
|
220
218
|
"a",
|
|
221
219
|
"b"
|
|
222
|
-
]
|
|
223
|
-
"use_repetition_ids": true
|
|
220
|
+
]
|
|
224
221
|
},
|
|
225
222
|
{
|
|
226
223
|
"cirq_type": "CircuitOperation",
|
|
@@ -25,12 +25,10 @@ cirq.CircuitOperation(circuit=cirq.FrozenCircuit([
|
|
|
25
25
|
(cirq.X**sympy.Symbol('theta')).on(cirq.LineQubit(0)),
|
|
26
26
|
),
|
|
27
27
|
]),
|
|
28
|
-
param_resolver={sympy.Symbol('theta'): 1.5},
|
|
29
|
-
use_repetition_ids=True),
|
|
28
|
+
param_resolver={sympy.Symbol('theta'): 1.5}),
|
|
30
29
|
cirq.CircuitOperation(circuit=cirq.FrozenCircuit([
|
|
31
30
|
cirq.Moment(
|
|
32
31
|
(cirq.X**sympy.Symbol('theta')).on(cirq.LineQubit(0)),
|
|
33
32
|
),
|
|
34
33
|
]),
|
|
35
|
-
param_resolver={sympy.Symbol('theta'): 1.5}
|
|
36
|
-
use_repetition_ids=True)]
|
|
34
|
+
param_resolver={sympy.Symbol('theta'): 1.5})]
|
{cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.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.dev20250408182640
|
|
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.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=0m3sYIyxRNv9jvAo6rzJ-cnbpny3KGnAByrbU7bApgQ,34720
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=cfocxtT1BJ4HkfZ-VO8YyIhPP-xfqHDkLrzz6eeO5U0,8421
|
|
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=5yd-ek4HQ9b075iNRZj8JAOjZGhxL5d52fKbt24cZIQ,1206
|
|
8
|
+
cirq/_version_test.py,sha256=WtaISJ1hqUNyf0LPcEHwlrqyi7bwYme9rGQ4s3plbsI,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=YVamU72nCUT5dG0bhAvRKVX5lXcZMNTwP3H36v-cYag,13615
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -17,8 +17,8 @@ cirq/circuits/_box_drawing_character_data_test.py,sha256=b3BN-iVUkQENi2Ja-RYQ_-_
|
|
|
17
17
|
cirq/circuits/_bucket_priority_queue.py,sha256=ml98_VAwGXzASUS0hE7lT7PeA0Hugz-qAZtjtAdBsvw,6744
|
|
18
18
|
cirq/circuits/_bucket_priority_queue_test.py,sha256=1FnB39rJKODvXP3SpSD6B8Tu02yQWCWOUQSPmR-22Pw,5288
|
|
19
19
|
cirq/circuits/circuit.py,sha256=reDLqLMj3SZM-z-7vLZhvy4XRTnmkK0HigbknFtMDLA,119141
|
|
20
|
-
cirq/circuits/circuit_operation.py,sha256=
|
|
21
|
-
cirq/circuits/circuit_operation_test.py,sha256=
|
|
20
|
+
cirq/circuits/circuit_operation.py,sha256=yOB9cWP2H8c8AyDrSj9FMZWsfvv_oa4z1MeaZzi_5Ws,36452
|
|
21
|
+
cirq/circuits/circuit_operation_test.py,sha256=i_NZ5R9PhxjNK17DUY21rL_7O2JgVtkpn9YnWI-Ax3M,48598
|
|
22
22
|
cirq/circuits/circuit_test.py,sha256=KjRYRwUgC65vxf_3hdZLgid7sNm5Fn_lcIp15Q4yWyk,162757
|
|
23
23
|
cirq/circuits/frozen_circuit.py,sha256=TLjw_UmbnV-Lhtn63RqTnCBbQiZPvsJdS-s99-aMRGI,9232
|
|
24
24
|
cirq/circuits/frozen_circuit_test.py,sha256=rHyii8hLhOQ6jdA8dC1OcYPGnyeBC4uY5Q53XspkkCk,4133
|
|
@@ -273,7 +273,7 @@ cirq/ops/arithmetic_operation_test.py,sha256=iKjnwOvd1wCWk-byeUC14aGwYuHXOlkrtlO
|
|
|
273
273
|
cirq/ops/boolean_hamiltonian.py,sha256=li003lNq6zS8pNPTobqzfzYJvyvaIpCVo3wkliI6Hzk,14930
|
|
274
274
|
cirq/ops/boolean_hamiltonian_test.py,sha256=1ey5yfYZPKZDsfM3jpCPAOpbPs_y8i4K_WvDK2d5_4Y,8518
|
|
275
275
|
cirq/ops/classically_controlled_operation.py,sha256=ePhBPrHymodrsztJFk_g2IGI3QSbFnpQ54d-6AH9CN4,10374
|
|
276
|
-
cirq/ops/classically_controlled_operation_test.py,sha256=
|
|
276
|
+
cirq/ops/classically_controlled_operation_test.py,sha256=qS9yzhZeWmsDzg-MM-g3njvGMRWPK1muoG19A6mIcTQ,52468
|
|
277
277
|
cirq/ops/clifford_gate.py,sha256=5mE97WQG6kW9ntRcn20hoFip71TFofnNKMx01RHETO4,39488
|
|
278
278
|
cirq/ops/clifford_gate_test.py,sha256=dqghYb7_afYxCLceBarX56Tn9y_dSWCKF75W-Qrzvcw,40341
|
|
279
279
|
cirq/ops/common_channels.py,sha256=lGDOSdstoK57DingL-lo2n49-a51MshhJOl4LOcpQfg,37126
|
|
@@ -491,10 +491,10 @@ cirq/protocols/json_test_data/Circuit.json,sha256=pQNIcjuIYBfXnGkqQnn4xuSLoHysFE
|
|
|
491
491
|
cirq/protocols/json_test_data/Circuit.json_inward,sha256=z62hEHwGtkVXrZNfxHX71_lDQ43wk12qtPO0Q0i5qwc,4574
|
|
492
492
|
cirq/protocols/json_test_data/Circuit.repr,sha256=i5fwYWIi64pmupNvqEEjUn_mHKp_vVGH2ozw65_EOuw,689
|
|
493
493
|
cirq/protocols/json_test_data/Circuit.repr_inward,sha256=i5fwYWIi64pmupNvqEEjUn_mHKp_vVGH2ozw65_EOuw,689
|
|
494
|
-
cirq/protocols/json_test_data/CircuitOperation.json,sha256=
|
|
494
|
+
cirq/protocols/json_test_data/CircuitOperation.json,sha256=s7jp0RDf_dz4eIvYMNDgpkoERfDBvqPWDrjWZ1Jxdck,6949
|
|
495
495
|
cirq/protocols/json_test_data/CircuitOperation.json_inward,sha256=EP3fiuDhxStcshrJC_Uot1hzYxEmlKk4dW66DMK9ALg,7951
|
|
496
496
|
cirq/protocols/json_test_data/CircuitOperation.repr,sha256=zjkjsVG9m3jedRYhKVJG_gqhwYycaqRRCcOuk1EKWvE,1711
|
|
497
|
-
cirq/protocols/json_test_data/CircuitOperation.repr_inward,sha256=
|
|
497
|
+
cirq/protocols/json_test_data/CircuitOperation.repr_inward,sha256=rsVxASnsKEPxfJFZhXw-PPjBV_7RYTrLCglxUTXjcLY,1083
|
|
498
498
|
cirq/protocols/json_test_data/ClassicalDataDictionaryStore.json,sha256=G09lSA5vshMhiXz_jgFw0STHjc08pJ0UczVCz8SGYLE,1185
|
|
499
499
|
cirq/protocols/json_test_data/ClassicalDataDictionaryStore.repr,sha256=bOLOBw-nLRvdkd7oYcLzkh5r-cBZAxwo7H6xdDgtOHw,404
|
|
500
500
|
cirq/protocols/json_test_data/ClassicallyControlledOperation.json,sha256=7t_Yyjhk8Ig-XyfOboE92K149csQbwvLoEwIsuDVHDw,669
|
|
@@ -1209,8 +1209,8 @@ cirq/work/sampler.py,sha256=sW0RhIelGABAKbqTM58shwyyCPgf86JIv9IGdJe__js,19186
|
|
|
1209
1209
|
cirq/work/sampler_test.py,sha256=mdk1J-WrvbPUYhY41VhWf9_te4DnXr_XMPcugWwc4-I,13281
|
|
1210
1210
|
cirq/work/zeros_sampler.py,sha256=8_Ne6dBkDANtTZuql7Eb0Qg_E_P3-_gu-ybFzxTbKAQ,2356
|
|
1211
1211
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1212
|
-
cirq_core-1.5.0.
|
|
1213
|
-
cirq_core-1.5.0.
|
|
1214
|
-
cirq_core-1.5.0.
|
|
1215
|
-
cirq_core-1.5.0.
|
|
1216
|
-
cirq_core-1.5.0.
|
|
1212
|
+
cirq_core-1.5.0.dev20250408182640.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1213
|
+
cirq_core-1.5.0.dev20250408182640.dist-info/METADATA,sha256=P_9_zmDcOWGAbzLjqykOJXGd2ZfaI7WtzpuxhzEsI-E,4584
|
|
1214
|
+
cirq_core-1.5.0.dev20250408182640.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1215
|
+
cirq_core-1.5.0.dev20250408182640.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1216
|
+
cirq_core-1.5.0.dev20250408182640.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20250408055017.dist-info → cirq_core-1.5.0.dev20250408182640.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|