cirq-core 1.7.0.dev20250819195403__py3-none-any.whl → 1.7.0.dev20250821232720__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.py +1 -1
- cirq/circuits/moment.py +1 -1
- cirq/devices/grid_qubit.py +1 -2
- cirq/devices/line_qubit.py +1 -3
- cirq/experiments/z_phase_calibration_test.py +8 -7
- cirq/interop/quirk/cells/arithmetic_cells.py +1 -1
- cirq/interop/quirk/cells/cell_test.py +5 -5
- cirq/interop/quirk/cells/composite_cell_test.py +5 -3
- cirq/interop/quirk/cells/control_cells.py +2 -2
- cirq/interop/quirk/cells/input_cells.py +3 -3
- cirq/interop/quirk/cells/input_rotation_cells.py +2 -2
- cirq/interop/quirk/cells/swap_cell.py +2 -2
- cirq/interop/quirk/cells/testing.py +1 -1
- cirq/interop/quirk/url_to_circuit.py +2 -2
- cirq/interop/quirk/url_to_circuit_test.py +11 -11
- cirq/linalg/decompositions.py +1 -1
- cirq/linalg/decompositions_test.py +52 -50
- cirq/linalg/diagonalize_test.py +2 -2
- cirq/linalg/predicates.py +1 -1
- cirq/linalg/predicates_test.py +24 -24
- cirq/linalg/transformations.py +6 -4
- cirq/neutral_atoms/neutral_atom_devices.py +1 -1
- cirq/ops/arithmetic_operation.py +1 -2
- cirq/ops/classically_controlled_operation.py +2 -2
- cirq/ops/clifford_gate.py +1 -1
- cirq/ops/common_channels_test.py +1 -1
- cirq/ops/common_gates.py +2 -2
- cirq/ops/controlled_operation.py +2 -2
- cirq/ops/controlled_operation_test.py +17 -16
- cirq/ops/dense_pauli_string.py +1 -1
- cirq/ops/dense_pauli_string_test.py +41 -37
- cirq/ops/eigen_gate_test.py +0 -7
- cirq/ops/gate_operation.py +11 -3
- cirq/ops/gateset.py +3 -3
- cirq/ops/gateset_test.py +23 -23
- cirq/ops/linear_combinations.py +1 -1
- cirq/ops/linear_combinations_test.py +103 -89
- cirq/ops/matrix_gates_test.py +31 -31
- cirq/ops/measure_util_test.py +11 -10
- cirq/ops/measurement_gate_test.py +23 -22
- cirq/ops/parity_gates.py +1 -2
- cirq/ops/pauli_gates.py +1 -1
- cirq/ops/pauli_measurement_gate_test.py +12 -12
- cirq/ops/pauli_string_phasor_test.py +45 -40
- cirq/ops/pauli_string_raw_types.py +1 -3
- cirq/ops/pauli_string_raw_types_test.py +5 -4
- cirq/ops/pauli_string_test.py +190 -118
- cirq/ops/permutation_gate.py +1 -1
- cirq/ops/raw_types.py +3 -4
- cirq/ops/raw_types_test.py +1 -1
- cirq/ops/three_qubit_gates.py +3 -3
- cirq/protocols/act_on_protocol.py +2 -4
- cirq/protocols/act_on_protocol_test.py +5 -6
- cirq/protocols/apply_channel_protocol.py +1 -2
- cirq/protocols/apply_channel_protocol_test.py +19 -18
- cirq/protocols/apply_mixture_protocol.py +1 -2
- cirq/protocols/apply_mixture_protocol_test.py +20 -19
- cirq/protocols/apply_unitary_protocol.py +1 -2
- cirq/protocols/apply_unitary_protocol_test.py +31 -23
- cirq/protocols/approximate_equality_protocol.py +1 -2
- cirq/protocols/approximate_equality_protocol_test.py +22 -16
- cirq/protocols/circuit_diagram_info_protocol.py +4 -5
- cirq/protocols/commutes_protocol.py +1 -2
- cirq/protocols/commutes_protocol_test.py +4 -4
- cirq/protocols/control_key_protocol.py +1 -3
- cirq/protocols/decompose_protocol.py +1 -2
- cirq/protocols/equal_up_to_global_phase_protocol.py +1 -2
- cirq/protocols/has_unitary_protocol.py +1 -2
- cirq/protocols/json_serialization.py +1 -2
- cirq/protocols/kraus_protocol.py +1 -2
- cirq/protocols/measurement_key_protocol.py +1 -3
- cirq/protocols/mixture_protocol.py +1 -2
- cirq/protocols/pauli_expansion_protocol.py +1 -3
- cirq/protocols/phase_protocol.py +1 -3
- cirq/protocols/qasm.py +1 -3
- cirq/protocols/qid_shape_protocol.py +1 -3
- cirq/protocols/resolve_parameters.py +1 -2
- cirq/protocols/trace_distance_bound.py +1 -2
- cirq/protocols/unitary_protocol.py +1 -2
- cirq/qis/quantum_state_representation.py +1 -2
- cirq/sim/simulation_state.py +1 -2
- cirq/sim/simulation_state_base.py +1 -3
- cirq/study/sweepable.py +1 -3
- cirq/transformers/transformer_api.py +1 -3
- cirq/value/classical_data.py +1 -3
- cirq/value/linear_dict.py +1 -1
- cirq/value/value_equality_attr.py +1 -3
- cirq/work/collector.py +1 -2
- {cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.dist-info}/METADATA +1 -2
- {cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.dist-info}/RECORD +95 -95
- {cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.dist-info}/WHEEL +0 -0
- {cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.dist-info}/licenses/LICENSE +0 -0
- {cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.dist-info}/top_level.txt +0 -0
|
@@ -17,11 +17,10 @@ from __future__ import annotations
|
|
|
17
17
|
import numbers
|
|
18
18
|
from decimal import Decimal
|
|
19
19
|
from fractions import Fraction
|
|
20
|
-
from typing import Any, Iterable
|
|
20
|
+
from typing import Any, Iterable, Protocol
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
23
|
import sympy
|
|
24
|
-
from typing_extensions import Protocol
|
|
25
24
|
|
|
26
25
|
from cirq._doc import doc_private
|
|
27
26
|
|
|
@@ -25,7 +25,7 @@ import sympy
|
|
|
25
25
|
import cirq
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_approx_eq_primitives():
|
|
28
|
+
def test_approx_eq_primitives() -> None:
|
|
29
29
|
assert not cirq.approx_eq(1, 2, atol=1e-01)
|
|
30
30
|
assert cirq.approx_eq(1.0, 1.0 + 1e-10, atol=1e-09)
|
|
31
31
|
assert not cirq.approx_eq(1.0, 1.0 + 1e-10, atol=1e-11)
|
|
@@ -40,7 +40,7 @@ def test_approx_eq_primitives():
|
|
|
40
40
|
assert not cirq.approx_eq('1', 1, atol=1e-3)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def test_approx_eq_mixed_primitives():
|
|
43
|
+
def test_approx_eq_mixed_primitives() -> None:
|
|
44
44
|
assert cirq.approx_eq(complex(1, 1e-10), 1, atol=1e-09)
|
|
45
45
|
assert not cirq.approx_eq(complex(1, 1e-4), 1, atol=1e-09)
|
|
46
46
|
assert cirq.approx_eq(complex(1, 1e-10), 1.0, atol=1e-09)
|
|
@@ -49,7 +49,7 @@ def test_approx_eq_mixed_primitives():
|
|
|
49
49
|
assert not cirq.approx_eq(1, 1.0 + 1e-10, atol=1e-11)
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
def test_numpy_dtype_compatibility():
|
|
52
|
+
def test_numpy_dtype_compatibility() -> None:
|
|
53
53
|
i_a, i_b, i_c = 0, 1, 2
|
|
54
54
|
i_types = [np.intc, np.intp, np.int8, np.int16, np.int32, np.int64]
|
|
55
55
|
for i_type in i_types:
|
|
@@ -77,18 +77,18 @@ def test_numpy_dtype_compatibility():
|
|
|
77
77
|
assert not cirq.approx_eq(c_type(c_a), c_type(c_c), atol=1e-8)
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
def test_fractions_compatibility():
|
|
80
|
+
def test_fractions_compatibility() -> None:
|
|
81
81
|
assert cirq.approx_eq(Fraction(0), Fraction(1, int(1e10)), atol=1e-9)
|
|
82
82
|
assert not cirq.approx_eq(Fraction(0), Fraction(1, int(1e7)), atol=1e-9)
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
def test_decimal_compatibility():
|
|
85
|
+
def test_decimal_compatibility() -> None:
|
|
86
86
|
assert cirq.approx_eq(Decimal('0'), Decimal('0.0000000001'), atol=1e-9)
|
|
87
87
|
assert not cirq.approx_eq(Decimal('0'), Decimal('0.00000001'), atol=1e-9)
|
|
88
88
|
assert not cirq.approx_eq(Decimal('NaN'), Decimal('-Infinity'), atol=1e-9)
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
def test_approx_eq_mixed_types():
|
|
91
|
+
def test_approx_eq_mixed_types() -> None:
|
|
92
92
|
assert cirq.approx_eq(np.float32(1), 1.0 + 1e-10, atol=1e-9)
|
|
93
93
|
assert cirq.approx_eq(np.float64(1), np.complex64(1 + 1e-8j), atol=1e-4)
|
|
94
94
|
assert cirq.approx_eq(np.uint8(1), np.complex64(1 + 1e-8j), atol=1e-4)
|
|
@@ -103,7 +103,7 @@ def test_approx_eq_mixed_types():
|
|
|
103
103
|
assert not cirq.approx_eq(np.complex64(1e-5j), Decimal('0.001'), atol=1e-4)
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
def test_approx_eq_special_numerics():
|
|
106
|
+
def test_approx_eq_special_numerics() -> None:
|
|
107
107
|
assert not cirq.approx_eq(float('nan'), 0, atol=0.0)
|
|
108
108
|
assert not cirq.approx_eq(float('nan'), float('nan'), atol=0.0)
|
|
109
109
|
assert not cirq.approx_eq(float('inf'), float('-inf'), atol=0.0)
|
|
@@ -123,6 +123,9 @@ class X(Number):
|
|
|
123
123
|
return NotImplemented
|
|
124
124
|
return self.val == other.val
|
|
125
125
|
|
|
126
|
+
def __hash__(self):
|
|
127
|
+
return hash(self.val) # pragma: no cover
|
|
128
|
+
|
|
126
129
|
|
|
127
130
|
class Y(Number):
|
|
128
131
|
"""Subtype of Number that cannot fallback to __eq__"""
|
|
@@ -130,15 +133,18 @@ class Y(Number):
|
|
|
130
133
|
def __init__(self):
|
|
131
134
|
pass
|
|
132
135
|
|
|
136
|
+
def __hash__(self):
|
|
137
|
+
return hash(complex(self)) # pragma: no cover
|
|
138
|
+
|
|
133
139
|
|
|
134
|
-
def test_approx_eq_number_uses__eq__():
|
|
140
|
+
def test_approx_eq_number_uses__eq__() -> None:
|
|
135
141
|
assert cirq.approx_eq(C(0), C(0), atol=0.0)
|
|
136
142
|
assert not cirq.approx_eq(X(0), X(1), atol=0.0)
|
|
137
143
|
assert not cirq.approx_eq(X(0), 0, atol=0.0)
|
|
138
144
|
assert not cirq.approx_eq(Y(), 1, atol=0.0)
|
|
139
145
|
|
|
140
146
|
|
|
141
|
-
def test_approx_eq_tuple():
|
|
147
|
+
def test_approx_eq_tuple() -> None:
|
|
142
148
|
assert cirq.approx_eq((1, 1), (1, 1), atol=0.0)
|
|
143
149
|
assert not cirq.approx_eq((1, 1), (1, 1, 1), atol=0.0)
|
|
144
150
|
assert not cirq.approx_eq((1, 1), (1,), atol=0.0)
|
|
@@ -146,7 +152,7 @@ def test_approx_eq_tuple():
|
|
|
146
152
|
assert not cirq.approx_eq((1.1, 1.2, 1.3), (1, 1, 1), atol=0.2)
|
|
147
153
|
|
|
148
154
|
|
|
149
|
-
def test_approx_eq_list():
|
|
155
|
+
def test_approx_eq_list() -> None:
|
|
150
156
|
assert cirq.approx_eq([], [], atol=0.0)
|
|
151
157
|
assert not cirq.approx_eq([], [[]], atol=0.0)
|
|
152
158
|
assert cirq.approx_eq([1, 1], [1, 1], atol=0.0)
|
|
@@ -156,7 +162,7 @@ def test_approx_eq_list():
|
|
|
156
162
|
assert not cirq.approx_eq([1.1, 1.2, 1.3], [1, 1, 1], atol=0.2)
|
|
157
163
|
|
|
158
164
|
|
|
159
|
-
def test_approx_eq_symbol():
|
|
165
|
+
def test_approx_eq_symbol() -> None:
|
|
160
166
|
q = cirq.GridQubit(0, 0)
|
|
161
167
|
s = sympy.Symbol("s")
|
|
162
168
|
t = sympy.Symbol("t")
|
|
@@ -184,14 +190,14 @@ def test_approx_eq_symbol():
|
|
|
184
190
|
cirq.approx_eq(symbol_1, symbol_3, atol=0.2)
|
|
185
191
|
|
|
186
192
|
|
|
187
|
-
def test_approx_eq_default():
|
|
193
|
+
def test_approx_eq_default() -> None:
|
|
188
194
|
assert cirq.approx_eq(1.0, 1.0 + 1e-9)
|
|
189
195
|
assert cirq.approx_eq(1.0, 1.0 - 1e-9)
|
|
190
196
|
assert not cirq.approx_eq(1.0, 1.0 + 1e-7)
|
|
191
197
|
assert not cirq.approx_eq(1.0, 1.0 - 1e-7)
|
|
192
198
|
|
|
193
199
|
|
|
194
|
-
def test_approx_eq_iterables():
|
|
200
|
+
def test_approx_eq_iterables() -> None:
|
|
195
201
|
def gen_1_1():
|
|
196
202
|
yield 1
|
|
197
203
|
yield 1
|
|
@@ -221,7 +227,7 @@ class B:
|
|
|
221
227
|
return cirq.approx_eq(self.val, other, atol=atol)
|
|
222
228
|
|
|
223
229
|
|
|
224
|
-
def test_approx_eq_supported():
|
|
230
|
+
def test_approx_eq_supported() -> None:
|
|
225
231
|
assert cirq.approx_eq(A(0.0), A(0.1), atol=0.1)
|
|
226
232
|
assert not cirq.approx_eq(A(0.0), A(0.1), atol=0.0)
|
|
227
233
|
assert cirq.approx_eq(B(0.0), 0.1, atol=0.1)
|
|
@@ -238,7 +244,7 @@ class C:
|
|
|
238
244
|
return self.val == other.val
|
|
239
245
|
|
|
240
246
|
|
|
241
|
-
def test_approx_eq_uses__eq__():
|
|
247
|
+
def test_approx_eq_uses__eq__() -> None:
|
|
242
248
|
assert cirq.approx_eq(C(0), C(0), atol=0.0)
|
|
243
249
|
assert not cirq.approx_eq(C(1), C(2), atol=0.0)
|
|
244
250
|
assert cirq.approx_eq([C(0)], [C(0)], atol=0.0)
|
|
@@ -247,7 +253,7 @@ def test_approx_eq_uses__eq__():
|
|
|
247
253
|
assert cirq.approx_eq(0, complex(0, 0), atol=0.0)
|
|
248
254
|
|
|
249
255
|
|
|
250
|
-
def test_approx_eq_types_mismatch():
|
|
256
|
+
def test_approx_eq_types_mismatch() -> None:
|
|
251
257
|
assert not cirq.approx_eq(0, A(0), atol=0.0)
|
|
252
258
|
assert not cirq.approx_eq(A(0), 0, atol=0.0)
|
|
253
259
|
assert not cirq.approx_eq(B(0), A(0), atol=0.0)
|
|
@@ -16,11 +16,10 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import re
|
|
18
18
|
from fractions import Fraction
|
|
19
|
-
from typing import Any, Iterable, overload, Sequence, TYPE_CHECKING, TypeVar, Union
|
|
19
|
+
from typing import Any, Iterable, overload, Protocol, Self, Sequence, TYPE_CHECKING, TypeVar, Union
|
|
20
20
|
|
|
21
21
|
import numpy as np
|
|
22
22
|
import sympy
|
|
23
|
-
from typing_extensions import Protocol
|
|
24
23
|
|
|
25
24
|
from cirq import protocols, value
|
|
26
25
|
from cirq._doc import doc_private
|
|
@@ -76,7 +75,7 @@ class CircuitDiagramInfo:
|
|
|
76
75
|
self.exponent_qubit_index = exponent_qubit_index
|
|
77
76
|
self.auto_exponent_parens = auto_exponent_parens
|
|
78
77
|
|
|
79
|
-
def with_wire_symbols(self, new_wire_symbols: Iterable[str]):
|
|
78
|
+
def with_wire_symbols(self, new_wire_symbols: Iterable[str]) -> CircuitDiagramInfo:
|
|
80
79
|
return CircuitDiagramInfo(
|
|
81
80
|
wire_symbols=new_wire_symbols,
|
|
82
81
|
exponent=self.exponent,
|
|
@@ -300,7 +299,7 @@ class CircuitDiagramInfoArgs:
|
|
|
300
299
|
return str(radians)
|
|
301
300
|
return repr(radians)
|
|
302
301
|
|
|
303
|
-
def copy(self):
|
|
302
|
+
def copy(self) -> Self:
|
|
304
303
|
return self.__class__(
|
|
305
304
|
known_qubits=self.known_qubits,
|
|
306
305
|
known_qubit_count=self.known_qubit_count,
|
|
@@ -311,7 +310,7 @@ class CircuitDiagramInfoArgs:
|
|
|
311
310
|
transpose=self.transpose,
|
|
312
311
|
)
|
|
313
312
|
|
|
314
|
-
def with_args(self, **kwargs):
|
|
313
|
+
def with_args(self, **kwargs) -> Self:
|
|
315
314
|
args = self.copy()
|
|
316
315
|
for arg_name, val in kwargs.items():
|
|
317
316
|
setattr(args, arg_name, val)
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
from types import NotImplementedType
|
|
20
|
-
from typing import Any, overload, TypeVar
|
|
20
|
+
from typing import Any, overload, Protocol, TypeVar
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
|
-
from typing_extensions import Protocol
|
|
24
23
|
|
|
25
24
|
from cirq import linalg
|
|
26
25
|
from cirq._doc import doc_private
|
|
@@ -21,7 +21,7 @@ import sympy
|
|
|
21
21
|
import cirq
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def test_commutes_on_matrices():
|
|
24
|
+
def test_commutes_on_matrices() -> None:
|
|
25
25
|
I, X, Y, Z = (cirq.unitary(A) for A in (cirq.I, cirq.X, cirq.Y, cirq.Z))
|
|
26
26
|
IX, IY = (np.kron(I, A) for A in (X, Y))
|
|
27
27
|
XI, YI, ZI = (np.kron(A, I) for A in (X, Y, Z))
|
|
@@ -38,14 +38,14 @@ def test_commutes_on_matrices():
|
|
|
38
38
|
assert cirq.commutes(A, B)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def test_commutes_on_gates_and_gate_operations():
|
|
41
|
+
def test_commutes_on_gates_and_gate_operations() -> None:
|
|
42
42
|
X, Y, Z = tuple(cirq.unitary(A) for A in (cirq.X, cirq.Y, cirq.Z))
|
|
43
43
|
XGate, YGate, ZGate = (cirq.MatrixGate(A) for A in (X, Y, Z))
|
|
44
44
|
XXGate, YYGate, ZZGate = (cirq.MatrixGate(cirq.kron(A, A)) for A in (X, Y, Z))
|
|
45
45
|
a, b = cirq.LineQubit.range(2)
|
|
46
46
|
for A in (XGate, YGate, ZGate):
|
|
47
47
|
assert cirq.commutes(A, A)
|
|
48
|
-
assert A._commutes_on_qids_(a, A, atol=1e-8) is NotImplemented
|
|
48
|
+
assert A._commutes_on_qids_([a], A, atol=1e-8) is NotImplemented
|
|
49
49
|
with pytest.raises(TypeError):
|
|
50
50
|
cirq.commutes(A(a), A)
|
|
51
51
|
with pytest.raises(TypeError):
|
|
@@ -91,7 +91,7 @@ def test_commutes_on_gates_and_gate_operations():
|
|
|
91
91
|
assert cirq.commutes(XGate(a), 'Gate', default='default') == 'default'
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
def test_operation_commutes_using_overlap_and_unitary():
|
|
94
|
+
def test_operation_commutes_using_overlap_and_unitary() -> None:
|
|
95
95
|
class CustomCnotGate(cirq.Gate):
|
|
96
96
|
def num_qubits(self) -> int:
|
|
97
97
|
return 2
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
18
|
from types import NotImplementedType
|
|
19
|
-
from typing import Any, TYPE_CHECKING
|
|
20
|
-
|
|
21
|
-
from typing_extensions import Protocol
|
|
19
|
+
from typing import Any, Protocol, TYPE_CHECKING
|
|
22
20
|
|
|
23
21
|
from cirq._doc import doc_private
|
|
24
22
|
from cirq.protocols import measurement_key_protocol
|
|
@@ -25,14 +25,13 @@ from typing import (
|
|
|
25
25
|
Iterable,
|
|
26
26
|
Iterator,
|
|
27
27
|
overload,
|
|
28
|
+
Protocol,
|
|
28
29
|
Sequence,
|
|
29
30
|
TYPE_CHECKING,
|
|
30
31
|
TypeVar,
|
|
31
32
|
Union,
|
|
32
33
|
)
|
|
33
34
|
|
|
34
|
-
from typing_extensions import Protocol
|
|
35
|
-
|
|
36
35
|
from cirq import devices, ops
|
|
37
36
|
from cirq._doc import doc_private
|
|
38
37
|
from cirq.protocols import qid_shape_protocol
|
|
@@ -16,10 +16,9 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import numbers
|
|
18
18
|
from collections.abc import Iterable
|
|
19
|
-
from typing import Any
|
|
19
|
+
from typing import Any, Protocol
|
|
20
20
|
|
|
21
21
|
import numpy as np
|
|
22
|
-
from typing_extensions import Protocol
|
|
23
22
|
|
|
24
23
|
from cirq import linalg
|
|
25
24
|
from cirq._doc import doc_private
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
|
-
from typing import Any, TypeVar
|
|
17
|
+
from typing import Any, Protocol, TypeVar
|
|
18
18
|
|
|
19
19
|
import numpy as np
|
|
20
|
-
from typing_extensions import Protocol
|
|
21
20
|
|
|
22
21
|
from cirq import linalg, qis
|
|
23
22
|
from cirq._doc import doc_private
|
|
@@ -21,13 +21,12 @@ import json
|
|
|
21
21
|
import numbers
|
|
22
22
|
import pathlib
|
|
23
23
|
from types import NotImplementedType
|
|
24
|
-
from typing import Any, Callable, cast, IO, Iterable, overload, Sequence
|
|
24
|
+
from typing import Any, Callable, cast, IO, Iterable, overload, Protocol, Sequence
|
|
25
25
|
|
|
26
26
|
import attrs
|
|
27
27
|
import numpy as np
|
|
28
28
|
import pandas as pd
|
|
29
29
|
import sympy
|
|
30
|
-
from typing_extensions import Protocol
|
|
31
30
|
|
|
32
31
|
from cirq._doc import doc_private
|
|
33
32
|
|
cirq/protocols/kraus_protocol.py
CHANGED
|
@@ -18,10 +18,9 @@ from __future__ import annotations
|
|
|
18
18
|
|
|
19
19
|
import warnings
|
|
20
20
|
from types import NotImplementedType
|
|
21
|
-
from typing import Any, Sequence, TypeVar
|
|
21
|
+
from typing import Any, Protocol, Sequence, TypeVar
|
|
22
22
|
|
|
23
23
|
import numpy as np
|
|
24
|
-
from typing_extensions import Protocol
|
|
25
24
|
|
|
26
25
|
from cirq import protocols, qis
|
|
27
26
|
from cirq._doc import doc_private
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
from types import NotImplementedType
|
|
20
|
-
from typing import Any, Mapping, TYPE_CHECKING
|
|
21
|
-
|
|
22
|
-
from typing_extensions import Protocol
|
|
20
|
+
from typing import Any, Mapping, Protocol, TYPE_CHECKING
|
|
23
21
|
|
|
24
22
|
from cirq import value
|
|
25
23
|
from cirq._doc import doc_private
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
from types import NotImplementedType
|
|
20
|
-
from typing import Any, Sequence
|
|
20
|
+
from typing import Any, Protocol, Sequence
|
|
21
21
|
|
|
22
22
|
import numpy as np
|
|
23
|
-
from typing_extensions import Protocol
|
|
24
23
|
|
|
25
24
|
from cirq._doc import doc_private
|
|
26
25
|
from cirq.protocols.decompose_protocol import _try_decompose_into_operations_and_qubits
|
cirq/protocols/phase_protocol.py
CHANGED
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
|
-
from typing import Any, TypeVar
|
|
18
|
-
|
|
19
|
-
from typing_extensions import Protocol
|
|
17
|
+
from typing import Any, Protocol, TypeVar
|
|
20
18
|
|
|
21
19
|
# This is a special value to indicate that a type error should be returned.
|
|
22
20
|
# This is used within phase_by to raise an error if no underlying
|
cirq/protocols/qasm.py
CHANGED
|
@@ -16,9 +16,7 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import string
|
|
18
18
|
from types import NotImplementedType
|
|
19
|
-
from typing import Any, Iterable, Mapping, TYPE_CHECKING, TypeVar
|
|
20
|
-
|
|
21
|
-
from typing_extensions import Protocol
|
|
19
|
+
from typing import Any, Iterable, Mapping, Protocol, TYPE_CHECKING, TypeVar
|
|
22
20
|
|
|
23
21
|
from cirq import ops
|
|
24
22
|
from cirq._doc import doc_private
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
from types import NotImplementedType
|
|
18
|
-
from typing import Any, Sequence, TypeVar
|
|
19
|
-
|
|
20
|
-
from typing_extensions import Protocol
|
|
18
|
+
from typing import Any, Protocol, Sequence, TypeVar
|
|
21
19
|
|
|
22
20
|
from cirq import ops
|
|
23
21
|
from cirq._doc import doc_private, document
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import numbers
|
|
18
|
-
from typing import AbstractSet, Any, cast, TYPE_CHECKING, TypeVar
|
|
18
|
+
from typing import AbstractSet, Any, cast, Protocol, Self, TYPE_CHECKING, TypeVar
|
|
19
19
|
|
|
20
20
|
import sympy
|
|
21
|
-
from typing_extensions import Protocol, Self
|
|
22
21
|
|
|
23
22
|
from cirq import study
|
|
24
23
|
from cirq._doc import doc_private
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
|
-
from typing import Any, Sequence, TypeVar
|
|
17
|
+
from typing import Any, Protocol, Sequence, TypeVar
|
|
18
18
|
|
|
19
19
|
import numpy as np
|
|
20
|
-
from typing_extensions import Protocol
|
|
21
20
|
|
|
22
21
|
from cirq._doc import doc_private
|
|
23
22
|
from cirq.protocols import unitary_protocol
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
from types import NotImplementedType
|
|
18
|
-
from typing import Any, TypeVar
|
|
18
|
+
from typing import Any, Protocol, TypeVar
|
|
19
19
|
|
|
20
20
|
import numpy as np
|
|
21
|
-
from typing_extensions import Protocol
|
|
22
21
|
|
|
23
22
|
from cirq import linalg
|
|
24
23
|
from cirq._doc import doc_private
|
cirq/sim/simulation_state.py
CHANGED
|
@@ -18,10 +18,9 @@ from __future__ import annotations
|
|
|
18
18
|
|
|
19
19
|
import abc
|
|
20
20
|
import copy
|
|
21
|
-
from typing import Any, cast, Generic, Iterator, Sequence, TYPE_CHECKING, TypeVar
|
|
21
|
+
from typing import Any, cast, Generic, Iterator, Self, Sequence, TYPE_CHECKING, TypeVar
|
|
22
22
|
|
|
23
23
|
import numpy as np
|
|
24
|
-
from typing_extensions import Self
|
|
25
24
|
|
|
26
25
|
from cirq import ops, protocols, value
|
|
27
26
|
from cirq.sim.simulation_state_base import SimulationStateBase
|
|
@@ -18,9 +18,7 @@ from __future__ import annotations
|
|
|
18
18
|
|
|
19
19
|
import abc
|
|
20
20
|
from types import NotImplementedType
|
|
21
|
-
from typing import Any, Generic, Iterator, Mapping, Sequence, TYPE_CHECKING, TypeVar
|
|
22
|
-
|
|
23
|
-
from typing_extensions import Self
|
|
21
|
+
from typing import Any, Generic, Iterator, Mapping, Self, Sequence, TYPE_CHECKING, TypeVar
|
|
24
22
|
|
|
25
23
|
from cirq import protocols, value
|
|
26
24
|
|
cirq/study/sweepable.py
CHANGED
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
import warnings
|
|
20
|
-
from typing import cast, Iterable, Iterator, Sequence
|
|
21
|
-
|
|
22
|
-
from typing_extensions import Protocol
|
|
20
|
+
from typing import cast, Iterable, Iterator, Protocol, Sequence
|
|
23
21
|
|
|
24
22
|
from cirq._doc import document
|
|
25
23
|
from cirq.study.resolver import ParamResolver, ParamResolverOrSimilarType
|
|
@@ -21,9 +21,7 @@ import enum
|
|
|
21
21
|
import functools
|
|
22
22
|
import inspect
|
|
23
23
|
import textwrap
|
|
24
|
-
from typing import Any, Callable, cast, Hashable, overload, TYPE_CHECKING, TypeVar
|
|
25
|
-
|
|
26
|
-
from typing_extensions import Protocol
|
|
24
|
+
from typing import Any, Callable, cast, Hashable, overload, Protocol, TYPE_CHECKING, TypeVar
|
|
27
25
|
|
|
28
26
|
from cirq import circuits
|
|
29
27
|
|
cirq/value/classical_data.py
CHANGED
|
@@ -16,9 +16,7 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import abc
|
|
18
18
|
import enum
|
|
19
|
-
from typing import Mapping, Sequence, TYPE_CHECKING
|
|
20
|
-
|
|
21
|
-
from typing_extensions import Self
|
|
19
|
+
from typing import Mapping, Self, Sequence, TYPE_CHECKING
|
|
22
20
|
|
|
23
21
|
from cirq.value import digits, value_equality_attr
|
|
24
22
|
|
cirq/value/linear_dict.py
CHANGED
|
@@ -28,6 +28,7 @@ from typing import (
|
|
|
28
28
|
Mapping,
|
|
29
29
|
MutableMapping,
|
|
30
30
|
overload,
|
|
31
|
+
Self,
|
|
31
32
|
TYPE_CHECKING,
|
|
32
33
|
TypeVar,
|
|
33
34
|
ValuesView,
|
|
@@ -35,7 +36,6 @@ from typing import (
|
|
|
35
36
|
|
|
36
37
|
import numpy as np
|
|
37
38
|
import sympy
|
|
38
|
-
from typing_extensions import Self
|
|
39
39
|
|
|
40
40
|
from cirq import protocols
|
|
41
41
|
|
cirq/work/collector.py
CHANGED
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import abc
|
|
18
|
-
from typing import Any, Iterator, TYPE_CHECKING
|
|
18
|
+
from typing import Any, Iterator, Protocol, TYPE_CHECKING
|
|
19
19
|
|
|
20
20
|
import duet
|
|
21
21
|
import numpy as np
|
|
22
|
-
from typing_extensions import Protocol
|
|
23
22
|
|
|
24
23
|
from cirq import study, value
|
|
25
24
|
|
{cirq_core-1.7.0.dev20250819195403.dist-info → cirq_core-1.7.0.dev20250821232720.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.dev20250821232720
|
|
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
|
|
@@ -36,7 +36,6 @@ Requires-Dist: pandas~=2.1
|
|
|
36
36
|
Requires-Dist: sortedcontainers~=2.0
|
|
37
37
|
Requires-Dist: scipy~=1.12
|
|
38
38
|
Requires-Dist: sympy
|
|
39
|
-
Requires-Dist: typing_extensions>=4.2
|
|
40
39
|
Requires-Dist: tqdm>=4.12
|
|
41
40
|
Provides-Extra: contrib
|
|
42
41
|
Requires-Dist: ply>=3.6; extra == "contrib"
|