cirq-core 1.6.0.dev20250519212157__py3-none-any.whl → 1.6.0.dev20250520002718__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/frozen_circuit.py +2 -2
- cirq/contrib/acquaintance/topological_sort.py +2 -2
- cirq/contrib/custom_simulators/custom_state_simulator.py +2 -2
- cirq/contrib/paulistring/clifford_target_gateset.py +2 -2
- cirq/contrib/quantum_volume/quantum_volume.py +5 -3
- cirq/contrib/quimb/grid_circuits.py +4 -3
- cirq/contrib/quimb/state_vector.py +4 -2
- cirq/contrib/routing/router.py +2 -2
- cirq/experiments/qubit_characterizations.py +2 -1
- cirq/experiments/random_quantum_circuit_generation.py +2 -1
- cirq/experiments/two_qubit_xeb.py +2 -1
- cirq/linalg/predicates.py +1 -1
- cirq/ops/gate_operation.py +2 -1
- cirq/ops/linear_combinations.py +5 -5
- cirq/ops/pauli_string_phasor.py +2 -2
- cirq/ops/raw_types.py +2 -1
- cirq/sim/clifford/clifford_tableau_simulation_state.py +2 -2
- cirq/sim/clifford/stabilizer_ch_form_simulation_state.py +2 -2
- cirq/sim/clifford/stabilizer_simulation_state.py +2 -1
- cirq/sim/simulation_state_base.py +2 -1
- cirq/testing/consistent_protocols.py +2 -0
- cirq/testing/consistent_protocols_test.py +4 -2
- cirq/testing/consistent_qasm.py +2 -0
- cirq/testing/consistent_qasm_test.py +2 -0
- cirq/testing/consistent_resolve_parameters.py +2 -0
- cirq/testing/consistent_specified_has_unitary.py +2 -0
- cirq/testing/consistent_specified_has_unitary_test.py +2 -0
- cirq/testing/consistent_unitary.py +2 -0
- cirq/testing/consistent_unitary_test.py +2 -0
- cirq/testing/deprecation.py +3 -0
- cirq/testing/deprecation_test.py +3 -0
- cirq/testing/devices.py +4 -0
- cirq/testing/devices_test.py +3 -0
- cirq/testing/equals_tester.py +2 -0
- cirq/testing/equals_tester_test.py +2 -0
- cirq/testing/equivalent_basis_map.py +2 -0
- cirq/testing/equivalent_basis_map_test.py +3 -0
- cirq/testing/equivalent_repr_eval.py +2 -0
- cirq/testing/equivalent_repr_eval_test.py +2 -0
- cirq/testing/gate_features.py +2 -0
- cirq/testing/gate_features_test.py +2 -0
- cirq/testing/json.py +6 -2
- cirq/testing/json_test.py +2 -0
- cirq/testing/lin_alg_utils_test.py +2 -0
- cirq/testing/logs.py +4 -0
- cirq/testing/logs_test.py +2 -0
- cirq/testing/no_identifier_qubit.py +3 -0
- cirq/testing/no_identifier_qubit_test.py +2 -0
- cirq/testing/op_tree.py +2 -0
- cirq/testing/op_tree_test.py +3 -0
- cirq/testing/order_tester.py +2 -0
- cirq/testing/order_tester_test.py +2 -0
- cirq/testing/pytest_utils.py +2 -0
- cirq/testing/pytest_utils_test.py +2 -0
- cirq/testing/random_circuit_test.py +3 -0
- cirq/testing/repr_pretty_tester.py +1 -0
- cirq/testing/repr_pretty_tester_test.py +2 -0
- cirq/testing/routing_devices_test.py +3 -0
- cirq/testing/sample_circuits_test.py +2 -0
- cirq/testing/sample_gates.py +3 -0
- cirq/testing/sample_gates_test.py +3 -0
- cirq/transformers/align_test.py +2 -0
- cirq/transformers/analytical_decompositions/clifford_decomposition_test.py +2 -0
- cirq/transformers/analytical_decompositions/controlled_gate_decomposition_test.py +2 -0
- cirq/transformers/analytical_decompositions/cphase_to_fsim_test.py +2 -0
- cirq/transformers/analytical_decompositions/pauli_string_decomposition.py +2 -0
- cirq/transformers/analytical_decompositions/pauli_string_decomposition_test.py +2 -0
- cirq/transformers/analytical_decompositions/quantum_shannon_decomposition_test.py +2 -0
- cirq/transformers/analytical_decompositions/single_qubit_decompositions.py +2 -0
- cirq/transformers/analytical_decompositions/single_qubit_decompositions_test.py +2 -0
- cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry_test.py +3 -0
- cirq/transformers/analytical_decompositions/three_qubit_decomposition.py +2 -0
- cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py +2 -0
- cirq/transformers/analytical_decompositions/two_qubit_state_preparation_test.py +2 -0
- cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py +2 -0
- cirq/transformers/analytical_decompositions/two_qubit_to_fsim_test.py +2 -0
- cirq/transformers/analytical_decompositions/two_qubit_to_ms.py +2 -2
- cirq/transformers/analytical_decompositions/two_qubit_to_ms_test.py +2 -0
- cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap_test.py +2 -0
- cirq/transformers/drop_empty_moments_test.py +2 -0
- cirq/transformers/drop_negligible_operations_test.py +2 -0
- cirq/transformers/eject_phased_paulis_test.py +3 -0
- cirq/transformers/eject_z_test.py +2 -0
- cirq/transformers/expand_composite_test.py +2 -0
- cirq/transformers/gauge_compiling/cphase_gauge_test.py +2 -0
- cirq/transformers/gauge_compiling/cz_gauge.py +2 -0
- cirq/transformers/gauge_compiling/cz_gauge_test.py +1 -0
- cirq/transformers/gauge_compiling/gauge_compiling.py +9 -5
- cirq/transformers/gauge_compiling/gauge_compiling_test.py +2 -0
- cirq/transformers/gauge_compiling/gauge_compiling_test_utils.py +1 -0
- cirq/transformers/gauge_compiling/gauge_compiling_test_utils_test.py +6 -1
- cirq/transformers/gauge_compiling/iswap_gauge.py +2 -0
- cirq/transformers/gauge_compiling/iswap_gauge_test.py +2 -0
- cirq/transformers/gauge_compiling/spin_inversion_gauge.py +2 -0
- cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py +2 -0
- cirq/transformers/gauge_compiling/sqrt_cz_gauge.py +3 -3
- cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py +2 -0
- cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py +2 -0
- cirq/transformers/gauge_compiling/sqrt_iswap_gauge_test.py +2 -0
- cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils.py +3 -0
- cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils_test.py +3 -0
- cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation_test.py +2 -0
- cirq/transformers/insertion_sort_test.py +2 -0
- cirq/transformers/measurement_transformers_test.py +2 -0
- cirq/transformers/merge_single_qubit_gates_test.py +2 -0
- cirq/transformers/noise_adding.py +2 -0
- cirq/transformers/noise_adding_test.py +2 -0
- cirq/transformers/qubit_management_transformers_test.py +2 -0
- cirq/transformers/randomized_measurements_test.py +2 -0
- cirq/transformers/routing/initial_mapper_test.py +2 -0
- cirq/transformers/routing/line_initial_mapper_test.py +2 -0
- cirq/transformers/routing/mapping_manager_test.py +2 -0
- cirq/transformers/routing/route_circuit_cqc_test.py +2 -0
- cirq/transformers/routing/visualize_routed_circuit_test.py +2 -0
- cirq/transformers/stratify_test.py +3 -0
- cirq/transformers/synchronize_terminal_measurements_test.py +2 -0
- cirq/transformers/tag_transformers.py +10 -8
- cirq/transformers/tag_transformers_test.py +2 -0
- cirq/transformers/target_gatesets/cz_gateset_test.py +2 -0
- cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py +2 -0
- cirq/transformers/transformer_api_test.py +2 -0
- cirq/value/abc_alt.py +2 -0
- cirq/value/abc_alt_test.py +2 -0
- cirq/value/angle.py +5 -2
- cirq/value/angle_test.py +2 -0
- cirq/value/classical_data_test.py +3 -0
- cirq/value/condition_test.py +2 -0
- cirq/value/digits.py +2 -0
- cirq/value/digits_test.py +2 -0
- cirq/value/duration_test.py +2 -0
- cirq/value/linear_dict_test.py +2 -0
- cirq/value/measurement_key.py +5 -5
- cirq/value/measurement_key_test.py +2 -0
- cirq/value/periodic_value_test.py +2 -0
- cirq/value/probability_test.py +2 -0
- cirq/value/product_state_test.py +3 -0
- cirq/value/random_state.py +2 -0
- cirq/value/random_state_test.py +2 -0
- cirq/value/timestamp.py +8 -5
- cirq/value/timestamp_test.py +2 -0
- cirq/value/type_alias.py +2 -0
- cirq/value/value_equality_attr.py +3 -0
- cirq/value/value_equality_attr_test.py +3 -0
- cirq/vis/density_matrix.py +2 -0
- cirq/vis/density_matrix_test.py +3 -0
- cirq/vis/heatmap_test.py +3 -0
- cirq/vis/histogram.py +3 -0
- cirq/vis/histogram_test.py +3 -0
- cirq/vis/state_histogram.py +4 -2
- cirq/vis/state_histogram_test.py +2 -0
- cirq/vis/vis_utils.py +4 -1
- cirq/vis/vis_utils_test.py +3 -0
- cirq/work/collector_test.py +2 -0
- cirq/work/observable_grouping.py +2 -0
- cirq/work/observable_grouping_test.py +2 -0
- cirq/work/observable_measurement_data_test.py +4 -1
- cirq/work/observable_measurement_test.py +3 -0
- cirq/work/observable_settings_test.py +2 -0
- cirq/work/pauli_sum_collector_test.py +2 -0
- {cirq_core-1.6.0.dev20250519212157.dist-info → cirq_core-1.6.0.dev20250520002718.dist-info}/METADATA +1 -1
- {cirq_core-1.6.0.dev20250519212157.dist-info → cirq_core-1.6.0.dev20250520002718.dist-info}/RECORD +166 -166
- {cirq_core-1.6.0.dev20250519212157.dist-info → cirq_core-1.6.0.dev20250520002718.dist-info}/WHEEL +0 -0
- {cirq_core-1.6.0.dev20250519212157.dist-info → cirq_core-1.6.0.dev20250520002718.dist-info}/licenses/LICENSE +0 -0
- {cirq_core-1.6.0.dev20250519212157.dist-info → cirq_core-1.6.0.dev20250520002718.dist-info}/top_level.txt +0 -0
cirq/testing/logs_test.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
from typing import Any, Dict
|
|
15
18
|
|
|
16
19
|
from cirq import protocols
|
cirq/testing/op_tree.py
CHANGED
cirq/testing/op_tree_test.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import pytest
|
|
15
18
|
|
|
16
19
|
import cirq
|
cirq/testing/order_tester.py
CHANGED
cirq/testing/pytest_utils.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import random
|
|
15
18
|
from typing import cast, Dict, Optional, Sequence, Union
|
|
16
19
|
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import networkx as nx
|
|
15
18
|
import pytest
|
|
16
19
|
|
cirq/testing/sample_gates.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import dataclasses
|
|
15
18
|
|
|
16
19
|
import numpy as np
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import numpy as np
|
|
15
18
|
import pytest
|
|
16
19
|
|
cirq/transformers/align_test.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import numpy as np
|
|
15
18
|
import pytest
|
|
16
19
|
|
|
@@ -23,12 +23,12 @@ from __future__ import annotations
|
|
|
23
23
|
|
|
24
24
|
from typing import cast, Iterable, List, Optional, Tuple, TYPE_CHECKING
|
|
25
25
|
|
|
26
|
-
import numpy as np
|
|
27
|
-
|
|
28
26
|
from cirq import linalg, ops, protocols
|
|
29
27
|
from cirq.transformers.analytical_decompositions import single_qubit_decompositions, two_qubit_to_cz
|
|
30
28
|
|
|
31
29
|
if TYPE_CHECKING:
|
|
30
|
+
import numpy as np
|
|
31
|
+
|
|
32
32
|
import cirq
|
|
33
33
|
|
|
34
34
|
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
14
17
|
import dataclasses
|
|
15
18
|
from typing import cast, Iterable
|
|
16
19
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import cirq
|
|
16
18
|
from cirq.transformers.gauge_compiling.cphase_gauge import CPhaseGaugeTransformer
|
|
17
19
|
from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTester
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
"""Creates the abstraction for gauge compiling as a cirq transformer."""
|
|
16
16
|
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
17
19
|
import abc
|
|
18
20
|
import functools
|
|
19
21
|
import itertools
|
|
20
22
|
from dataclasses import dataclass
|
|
21
23
|
from numbers import Real
|
|
22
|
-
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
|
|
24
|
+
from typing import Callable, Dict, List, Optional, Sequence, Tuple, TYPE_CHECKING, Union
|
|
23
25
|
|
|
24
26
|
import numpy as np
|
|
25
27
|
import sympy
|
|
@@ -28,11 +30,13 @@ from attrs import field, frozen
|
|
|
28
30
|
from cirq import circuits, ops
|
|
29
31
|
from cirq.protocols import unitary_protocol
|
|
30
32
|
from cirq.protocols.has_unitary_protocol import has_unitary
|
|
31
|
-
from cirq.study import sweepable
|
|
32
33
|
from cirq.study.sweeps import Points, Zip
|
|
33
34
|
from cirq.transformers import transformer_api
|
|
34
35
|
from cirq.transformers.analytical_decompositions import single_qubit_decompositions
|
|
35
36
|
|
|
37
|
+
if TYPE_CHECKING:
|
|
38
|
+
import cirq
|
|
39
|
+
|
|
36
40
|
|
|
37
41
|
class Gauge(abc.ABC):
|
|
38
42
|
"""A gauge replaces a two qubit gate with an equivalent subcircuit.
|
|
@@ -49,7 +53,7 @@ class Gauge(abc.ABC):
|
|
|
49
53
|
return 1.0
|
|
50
54
|
|
|
51
55
|
@abc.abstractmethod
|
|
52
|
-
def sample(self, gate: ops.Gate, prng: np.random.Generator) ->
|
|
56
|
+
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
53
57
|
"""Returns a ConstantGauge sampled from a family of gauges.
|
|
54
58
|
|
|
55
59
|
Args:
|
|
@@ -80,7 +84,7 @@ class ConstantGauge(Gauge):
|
|
|
80
84
|
)
|
|
81
85
|
swap_qubits: bool = False
|
|
82
86
|
|
|
83
|
-
def sample(self, gate: ops.Gate, prng: np.random.Generator) ->
|
|
87
|
+
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
84
88
|
return self
|
|
85
89
|
|
|
86
90
|
@property
|
|
@@ -256,7 +260,7 @@ class GaugeTransformer:
|
|
|
256
260
|
N: int,
|
|
257
261
|
context: Optional[transformer_api.TransformerContext] = None,
|
|
258
262
|
prng: Optional[np.random.Generator] = None,
|
|
259
|
-
) -> Tuple[circuits.AbstractCircuit,
|
|
263
|
+
) -> Tuple[circuits.AbstractCircuit, cirq.Sweepable]:
|
|
260
264
|
"""Generates a parameterized circuit with *N* sets of sweepable parameters.
|
|
261
265
|
|
|
262
266
|
Args:
|
|
@@ -13,12 +13,17 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import TYPE_CHECKING
|
|
17
19
|
|
|
18
20
|
import cirq
|
|
19
21
|
from cirq.transformers import ConstantGauge, GaugeSelector, GaugeTransformer
|
|
20
22
|
from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTester
|
|
21
23
|
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
import numpy as np
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
class ExampleGate(cirq.testing.TwoQubitGate):
|
|
24
29
|
unitary = cirq.unitary(cirq.CZ**0.123)
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import cirq
|
|
16
18
|
from cirq.transformers.gauge_compiling import SpinInversionGaugeTransformer
|
|
17
19
|
from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTester
|
|
@@ -20,9 +20,6 @@ from __future__ import annotations
|
|
|
20
20
|
from numbers import Real
|
|
21
21
|
from typing import Dict, Sequence, Tuple, TYPE_CHECKING
|
|
22
22
|
|
|
23
|
-
import numpy as np
|
|
24
|
-
import sympy
|
|
25
|
-
|
|
26
23
|
from cirq.ops import CZ, CZPowGate, Gate, Gateset, S, X
|
|
27
24
|
from cirq.transformers.gauge_compiling.gauge_compiling import (
|
|
28
25
|
ConstantGauge,
|
|
@@ -33,6 +30,9 @@ from cirq.transformers.gauge_compiling.gauge_compiling import (
|
|
|
33
30
|
)
|
|
34
31
|
|
|
35
32
|
if TYPE_CHECKING:
|
|
33
|
+
import numpy as np
|
|
34
|
+
import sympy
|
|
35
|
+
|
|
36
36
|
import cirq
|
|
37
37
|
|
|
38
38
|
_SQRT_CZ = CZ**0.5
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import cirq
|
|
16
18
|
from cirq.transformers.gauge_compiling import SqrtCZGaugeTransformer
|
|
17
19
|
from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTester
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
15
17
|
import cirq
|
|
16
18
|
from cirq.transformers.gauge_compiling import SqrtISWAPGaugeTransformer
|
|
17
19
|
from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTester
|