cirq-core 1.5.0.dev20240907040843__py3-none-any.whl → 1.5.0.dev20240911234931__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/__init__.py +585 -568
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/circuits/__init__.py +15 -9
- cirq/contrib/__init__.py +2 -2
- cirq/contrib/acquaintance/__init__.py +44 -29
- cirq/contrib/acquaintance/strategies/__init__.py +9 -3
- cirq/contrib/bayesian_network/__init__.py +3 -1
- cirq/contrib/circuitdag/__init__.py +1 -1
- cirq/contrib/circuitdag/circuit_dag.py +6 -8
- cirq/contrib/graph_device/__init__.py +8 -8
- cirq/contrib/noise_models/__init__.py +5 -6
- cirq/contrib/paulistring/__init__.py +18 -10
- cirq/contrib/qasm_import/__init__.py +2 -2
- cirq/contrib/qcircuit/__init__.py +6 -4
- cirq/contrib/quantum_volume/__init__.py +7 -7
- cirq/contrib/quimb/__init__.py +16 -13
- cirq/contrib/quirk/__init__.py +1 -1
- cirq/contrib/routing/__init__.py +12 -9
- cirq/contrib/svg/__init__.py +1 -1
- cirq/devices/__init__.py +34 -25
- cirq/experiments/__init__.py +45 -34
- cirq/interop/__init__.py +4 -1
- cirq/interop/quirk/__init__.py +7 -4
- cirq/interop/quirk/cells/__init__.py +17 -6
- cirq/ion/__init__.py +4 -2
- cirq/linalg/__init__.py +61 -51
- cirq/neutral_atoms/__init__.py +2 -2
- cirq/ops/__init__.py +171 -130
- cirq/ops/boolean_hamiltonian.py +2 -1
- cirq/protocols/__init__.py +135 -83
- cirq/protocols/json_test_data/__init__.py +1 -1
- cirq/qis/__init__.py +48 -36
- cirq/sim/__init__.py +55 -37
- cirq/sim/clifford/__init__.py +17 -9
- cirq/study/__init__.py +26 -21
- cirq/testing/__init__.py +84 -58
- cirq/testing/_compat_test_data/module_a/__init__.py +2 -2
- cirq/testing/_compat_test_data/module_a/sub/subsub/__init__.py +1 -1
- cirq/testing/json.py +2 -1
- cirq/transformers/__init__.py +95 -83
- cirq/transformers/analytical_decompositions/__init__.py +27 -24
- cirq/transformers/gauge_compiling/__init__.py +22 -9
- cirq/transformers/heuristic_decompositions/__init__.py +3 -3
- cirq/transformers/routing/__init__.py +14 -5
- cirq/transformers/target_gatesets/__init__.py +7 -5
- cirq/value/__init__.py +50 -30
- cirq/vis/__init__.py +9 -6
- cirq/work/__init__.py +19 -13
- {cirq_core-1.5.0.dev20240907040843.dist-info → cirq_core-1.5.0.dev20240911234931.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20240907040843.dist-info → cirq_core-1.5.0.dev20240911234931.dist-info}/RECORD +54 -54
- {cirq_core-1.5.0.dev20240907040843.dist-info → cirq_core-1.5.0.dev20240911234931.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20240907040843.dist-info → cirq_core-1.5.0.dev20240911234931.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20240907040843.dist-info → cirq_core-1.5.0.dev20240911234931.dist-info}/top_level.txt +0 -0
cirq/interop/quirk/__init__.py
CHANGED
|
@@ -20,9 +20,12 @@ References:
|
|
|
20
20
|
|
|
21
21
|
# Imports from cells are only to ensure operation reprs work correctly.
|
|
22
22
|
from cirq.interop.quirk.cells import (
|
|
23
|
-
QuirkArithmeticGate,
|
|
24
|
-
QuirkInputRotationOperation,
|
|
25
|
-
QuirkQubitPermutationGate,
|
|
23
|
+
QuirkArithmeticGate as QuirkArithmeticGate,
|
|
24
|
+
QuirkInputRotationOperation as QuirkInputRotationOperation,
|
|
25
|
+
QuirkQubitPermutationGate as QuirkQubitPermutationGate,
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
from cirq.interop.quirk.url_to_circuit import
|
|
28
|
+
from cirq.interop.quirk.url_to_circuit import (
|
|
29
|
+
quirk_json_to_circuit as quirk_json_to_circuit,
|
|
30
|
+
quirk_url_to_circuit as quirk_url_to_circuit,
|
|
31
|
+
)
|
|
@@ -13,17 +13,28 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""This module defines building blocks for parsing Quirk circuits."""
|
|
15
15
|
|
|
16
|
-
from cirq.interop.quirk.cells.all_cells import
|
|
16
|
+
from cirq.interop.quirk.cells.all_cells import (
|
|
17
|
+
generate_all_quirk_cell_makers as generate_all_quirk_cell_makers,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
|
-
from cirq.interop.quirk.cells.cell import
|
|
20
|
+
from cirq.interop.quirk.cells.cell import (
|
|
21
|
+
Cell as Cell,
|
|
22
|
+
CellMaker as CellMaker,
|
|
23
|
+
CellMakerArgs as CellMakerArgs,
|
|
24
|
+
ExplicitOperationsCell as ExplicitOperationsCell,
|
|
25
|
+
)
|
|
19
26
|
|
|
20
|
-
from cirq.interop.quirk.cells.composite_cell import CompositeCell
|
|
27
|
+
from cirq.interop.quirk.cells.composite_cell import CompositeCell as CompositeCell
|
|
21
28
|
|
|
22
|
-
from cirq.interop.quirk.cells.qubit_permutation_cells import
|
|
29
|
+
from cirq.interop.quirk.cells.qubit_permutation_cells import (
|
|
30
|
+
QuirkQubitPermutationGate as QuirkQubitPermutationGate,
|
|
31
|
+
)
|
|
23
32
|
|
|
24
|
-
from cirq.interop.quirk.cells.arithmetic_cells import QuirkArithmeticGate
|
|
33
|
+
from cirq.interop.quirk.cells.arithmetic_cells import QuirkArithmeticGate as QuirkArithmeticGate
|
|
25
34
|
|
|
26
|
-
from cirq.interop.quirk.cells.input_rotation_cells import
|
|
35
|
+
from cirq.interop.quirk.cells.input_rotation_cells import (
|
|
36
|
+
QuirkInputRotationOperation as QuirkInputRotationOperation,
|
|
37
|
+
)
|
|
27
38
|
|
|
28
39
|
import cirq.interop.quirk.cells.swap_cell
|
|
29
40
|
import cirq.interop.quirk.cells.control_cells
|
cirq/ion/__init__.py
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
"""Trapped ion devices, gates, and compiling utilties."""
|
|
16
16
|
|
|
17
|
-
from cirq.ops import ms
|
|
17
|
+
from cirq.ops import ms as ms
|
|
18
18
|
|
|
19
|
-
from cirq.transformers import
|
|
19
|
+
from cirq.transformers import (
|
|
20
|
+
two_qubit_matrix_to_ion_operations as two_qubit_matrix_to_ion_operations,
|
|
21
|
+
)
|
cirq/linalg/__init__.py
CHANGED
|
@@ -17,70 +17,80 @@ Focuses on methods useful for analyzing and optimizing quantum circuits.
|
|
|
17
17
|
Avoids duplicating functionality present in numpy.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
from cirq.linalg.combinators import
|
|
20
|
+
from cirq.linalg.combinators import (
|
|
21
|
+
block_diag as block_diag,
|
|
22
|
+
CONTROL_TAG as CONTROL_TAG,
|
|
23
|
+
dot as dot,
|
|
24
|
+
kron as kron,
|
|
25
|
+
kron_with_controls as kron_with_controls,
|
|
26
|
+
)
|
|
21
27
|
|
|
22
28
|
from cirq.linalg.decompositions import (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
# pylint: disable=line-too-long
|
|
30
|
+
axis_angle as axis_angle,
|
|
31
|
+
AxisAngleDecomposition as AxisAngleDecomposition,
|
|
32
|
+
deconstruct_single_qubit_matrix_into_angles as deconstruct_single_qubit_matrix_into_angles,
|
|
33
|
+
extract_right_diag as extract_right_diag,
|
|
34
|
+
kak_canonicalize_vector as kak_canonicalize_vector,
|
|
35
|
+
kak_decomposition as kak_decomposition,
|
|
36
|
+
kak_vector as kak_vector,
|
|
37
|
+
KakDecomposition as KakDecomposition,
|
|
38
|
+
kron_factor_4x4_to_2x2s as kron_factor_4x4_to_2x2s,
|
|
39
|
+
map_eigenvalues as map_eigenvalues,
|
|
40
|
+
num_cnots_required as num_cnots_required,
|
|
41
|
+
unitary_eig as unitary_eig,
|
|
42
|
+
scatter_plot_normalized_kak_interaction_coefficients as scatter_plot_normalized_kak_interaction_coefficients,
|
|
43
|
+
so4_to_magic_su2s as so4_to_magic_su2s,
|
|
37
44
|
)
|
|
38
45
|
|
|
39
|
-
|
|
40
46
|
from cirq.linalg.diagonalize import (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
# pylint: disable=line-too-long
|
|
48
|
+
bidiagonalize_real_matrix_pair_with_symmetric_products as bidiagonalize_real_matrix_pair_with_symmetric_products,
|
|
49
|
+
bidiagonalize_unitary_with_special_orthogonals as bidiagonalize_unitary_with_special_orthogonals,
|
|
50
|
+
diagonalize_real_symmetric_and_sorted_diagonal_matrices as diagonalize_real_symmetric_and_sorted_diagonal_matrices,
|
|
51
|
+
diagonalize_real_symmetric_matrix as diagonalize_real_symmetric_matrix,
|
|
45
52
|
)
|
|
46
53
|
|
|
47
54
|
from cirq.linalg.operator_spaces import (
|
|
48
|
-
expand_matrix_in_orthogonal_basis,
|
|
49
|
-
hilbert_schmidt_inner_product,
|
|
50
|
-
kron_bases,
|
|
51
|
-
matrix_from_basis_coefficients,
|
|
52
|
-
PAULI_BASIS,
|
|
53
|
-
pow_pauli_combination,
|
|
55
|
+
expand_matrix_in_orthogonal_basis as expand_matrix_in_orthogonal_basis,
|
|
56
|
+
hilbert_schmidt_inner_product as hilbert_schmidt_inner_product,
|
|
57
|
+
kron_bases as kron_bases,
|
|
58
|
+
matrix_from_basis_coefficients as matrix_from_basis_coefficients,
|
|
59
|
+
PAULI_BASIS as PAULI_BASIS,
|
|
60
|
+
pow_pauli_combination as pow_pauli_combination,
|
|
54
61
|
)
|
|
55
62
|
|
|
56
63
|
from cirq.linalg.predicates import (
|
|
57
|
-
allclose_up_to_global_phase,
|
|
58
|
-
is_cptp,
|
|
59
|
-
is_diagonal,
|
|
60
|
-
is_hermitian,
|
|
61
|
-
is_normal,
|
|
62
|
-
is_orthogonal,
|
|
63
|
-
is_special_orthogonal,
|
|
64
|
-
is_special_unitary,
|
|
65
|
-
is_unitary,
|
|
66
|
-
matrix_commutes,
|
|
67
|
-
slice_for_qubits_equal_to,
|
|
64
|
+
allclose_up_to_global_phase as allclose_up_to_global_phase,
|
|
65
|
+
is_cptp as is_cptp,
|
|
66
|
+
is_diagonal as is_diagonal,
|
|
67
|
+
is_hermitian as is_hermitian,
|
|
68
|
+
is_normal as is_normal,
|
|
69
|
+
is_orthogonal as is_orthogonal,
|
|
70
|
+
is_special_orthogonal as is_special_orthogonal,
|
|
71
|
+
is_special_unitary as is_special_unitary,
|
|
72
|
+
is_unitary as is_unitary,
|
|
73
|
+
matrix_commutes as matrix_commutes,
|
|
74
|
+
slice_for_qubits_equal_to as slice_for_qubits_equal_to,
|
|
68
75
|
)
|
|
69
76
|
|
|
70
|
-
from cirq.linalg.tolerance import
|
|
77
|
+
from cirq.linalg.tolerance import (
|
|
78
|
+
all_near_zero as all_near_zero,
|
|
79
|
+
all_near_zero_mod as all_near_zero_mod,
|
|
80
|
+
)
|
|
71
81
|
|
|
72
82
|
from cirq.linalg.transformations import (
|
|
73
|
-
apply_matrix_to_slices,
|
|
74
|
-
density_matrix_kronecker_product,
|
|
75
|
-
match_global_phase,
|
|
76
|
-
partial_trace,
|
|
77
|
-
partial_trace_of_state_vector_as_mixture,
|
|
78
|
-
reflection_matrix_pow,
|
|
79
|
-
state_vector_kronecker_product,
|
|
80
|
-
sub_state_vector,
|
|
81
|
-
targeted_conjugate_about,
|
|
82
|
-
targeted_left_multiply,
|
|
83
|
-
to_special,
|
|
84
|
-
transpose_flattened_array,
|
|
85
|
-
can_numpy_support_shape,
|
|
83
|
+
apply_matrix_to_slices as apply_matrix_to_slices,
|
|
84
|
+
density_matrix_kronecker_product as density_matrix_kronecker_product,
|
|
85
|
+
match_global_phase as match_global_phase,
|
|
86
|
+
partial_trace as partial_trace,
|
|
87
|
+
partial_trace_of_state_vector_as_mixture as partial_trace_of_state_vector_as_mixture,
|
|
88
|
+
reflection_matrix_pow as reflection_matrix_pow,
|
|
89
|
+
state_vector_kronecker_product as state_vector_kronecker_product,
|
|
90
|
+
sub_state_vector as sub_state_vector,
|
|
91
|
+
targeted_conjugate_about as targeted_conjugate_about,
|
|
92
|
+
targeted_left_multiply as targeted_left_multiply,
|
|
93
|
+
to_special as to_special,
|
|
94
|
+
transpose_flattened_array as transpose_flattened_array,
|
|
95
|
+
can_numpy_support_shape as can_numpy_support_shape,
|
|
86
96
|
)
|
cirq/neutral_atoms/__init__.py
CHANGED
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"""Neutral atom devices and gates."""
|
|
16
16
|
|
|
17
17
|
from cirq.neutral_atoms.convert_to_neutral_atom_gates import (
|
|
18
|
-
is_native_neutral_atom_gate,
|
|
19
|
-
is_native_neutral_atom_op,
|
|
18
|
+
is_native_neutral_atom_gate as is_native_neutral_atom_gate,
|
|
19
|
+
is_native_neutral_atom_op as is_native_neutral_atom_op,
|
|
20
20
|
)
|
cirq/ops/__init__.py
CHANGED
|
@@ -14,208 +14,249 @@
|
|
|
14
14
|
"""Gates (unitary and non-unitary), operations, base types, and gate sets.
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
-
from cirq.ops.arithmetic_operation import ArithmeticGate
|
|
17
|
+
from cirq.ops.arithmetic_operation import ArithmeticGate as ArithmeticGate
|
|
18
18
|
|
|
19
|
-
from cirq.ops.clifford_gate import
|
|
19
|
+
from cirq.ops.clifford_gate import (
|
|
20
|
+
CliffordGate as CliffordGate,
|
|
21
|
+
SingleQubitCliffordGate as SingleQubitCliffordGate,
|
|
22
|
+
)
|
|
20
23
|
|
|
21
24
|
from cirq.ops.dense_pauli_string import (
|
|
22
|
-
BaseDensePauliString,
|
|
23
|
-
DensePauliString,
|
|
24
|
-
MutableDensePauliString,
|
|
25
|
+
BaseDensePauliString as BaseDensePauliString,
|
|
26
|
+
DensePauliString as DensePauliString,
|
|
27
|
+
MutableDensePauliString as MutableDensePauliString,
|
|
25
28
|
)
|
|
26
29
|
|
|
27
|
-
from cirq.ops.boolean_hamiltonian import BooleanHamiltonianGate
|
|
30
|
+
from cirq.ops.boolean_hamiltonian import BooleanHamiltonianGate as BooleanHamiltonianGate
|
|
28
31
|
|
|
29
32
|
from cirq.ops.common_channels import (
|
|
30
|
-
amplitude_damp,
|
|
31
|
-
AmplitudeDampingChannel,
|
|
32
|
-
asymmetric_depolarize,
|
|
33
|
-
AsymmetricDepolarizingChannel,
|
|
34
|
-
bit_flip,
|
|
35
|
-
BitFlipChannel,
|
|
36
|
-
depolarize,
|
|
37
|
-
DepolarizingChannel,
|
|
38
|
-
generalized_amplitude_damp,
|
|
39
|
-
GeneralizedAmplitudeDampingChannel,
|
|
40
|
-
phase_damp,
|
|
41
|
-
phase_flip,
|
|
42
|
-
PhaseDampingChannel,
|
|
43
|
-
PhaseFlipChannel,
|
|
44
|
-
R,
|
|
45
|
-
reset,
|
|
46
|
-
reset_each,
|
|
47
|
-
ResetChannel,
|
|
33
|
+
amplitude_damp as amplitude_damp,
|
|
34
|
+
AmplitudeDampingChannel as AmplitudeDampingChannel,
|
|
35
|
+
asymmetric_depolarize as asymmetric_depolarize,
|
|
36
|
+
AsymmetricDepolarizingChannel as AsymmetricDepolarizingChannel,
|
|
37
|
+
bit_flip as bit_flip,
|
|
38
|
+
BitFlipChannel as BitFlipChannel,
|
|
39
|
+
depolarize as depolarize,
|
|
40
|
+
DepolarizingChannel as DepolarizingChannel,
|
|
41
|
+
generalized_amplitude_damp as generalized_amplitude_damp,
|
|
42
|
+
GeneralizedAmplitudeDampingChannel as GeneralizedAmplitudeDampingChannel,
|
|
43
|
+
phase_damp as phase_damp,
|
|
44
|
+
phase_flip as phase_flip,
|
|
45
|
+
PhaseDampingChannel as PhaseDampingChannel,
|
|
46
|
+
PhaseFlipChannel as PhaseFlipChannel,
|
|
47
|
+
R as R,
|
|
48
|
+
reset as reset,
|
|
49
|
+
reset_each as reset_each,
|
|
50
|
+
ResetChannel as ResetChannel,
|
|
48
51
|
)
|
|
49
52
|
|
|
50
53
|
from cirq.ops.common_gates import (
|
|
51
|
-
CNOT,
|
|
52
|
-
CNotPowGate,
|
|
53
|
-
cphase,
|
|
54
|
-
CX,
|
|
55
|
-
CXPowGate,
|
|
56
|
-
CZ,
|
|
57
|
-
CZPowGate,
|
|
58
|
-
H,
|
|
59
|
-
HPowGate,
|
|
60
|
-
Rx,
|
|
61
|
-
Ry,
|
|
62
|
-
Rz,
|
|
63
|
-
rx,
|
|
64
|
-
ry,
|
|
65
|
-
rz,
|
|
66
|
-
S,
|
|
67
|
-
T,
|
|
68
|
-
XPowGate,
|
|
69
|
-
YPowGate,
|
|
70
|
-
ZPowGate,
|
|
54
|
+
CNOT as CNOT,
|
|
55
|
+
CNotPowGate as CNotPowGate,
|
|
56
|
+
cphase as cphase,
|
|
57
|
+
CX as CX,
|
|
58
|
+
CXPowGate as CXPowGate,
|
|
59
|
+
CZ as CZ,
|
|
60
|
+
CZPowGate as CZPowGate,
|
|
61
|
+
H as H,
|
|
62
|
+
HPowGate as HPowGate,
|
|
63
|
+
Rx as Rx,
|
|
64
|
+
Ry as Ry,
|
|
65
|
+
Rz as Rz,
|
|
66
|
+
rx as rx,
|
|
67
|
+
ry as ry,
|
|
68
|
+
rz as rz,
|
|
69
|
+
S as S,
|
|
70
|
+
T as T,
|
|
71
|
+
XPowGate as XPowGate,
|
|
72
|
+
YPowGate as YPowGate,
|
|
73
|
+
ZPowGate as ZPowGate,
|
|
71
74
|
)
|
|
72
75
|
|
|
73
76
|
from cirq.ops.common_gate_families import (
|
|
74
|
-
AnyUnitaryGateFamily,
|
|
75
|
-
AnyIntegerPowerGateFamily,
|
|
76
|
-
ParallelGateFamily,
|
|
77
|
+
AnyUnitaryGateFamily as AnyUnitaryGateFamily,
|
|
78
|
+
AnyIntegerPowerGateFamily as AnyIntegerPowerGateFamily,
|
|
79
|
+
ParallelGateFamily as ParallelGateFamily,
|
|
77
80
|
)
|
|
78
81
|
|
|
79
|
-
from cirq.ops.classically_controlled_operation import
|
|
82
|
+
from cirq.ops.classically_controlled_operation import (
|
|
83
|
+
ClassicallyControlledOperation as ClassicallyControlledOperation,
|
|
84
|
+
)
|
|
80
85
|
|
|
81
|
-
from cirq.ops.controlled_gate import ControlledGate
|
|
86
|
+
from cirq.ops.controlled_gate import ControlledGate as ControlledGate
|
|
82
87
|
|
|
83
|
-
from cirq.ops.diagonal_gate import DiagonalGate
|
|
88
|
+
from cirq.ops.diagonal_gate import DiagonalGate as DiagonalGate
|
|
84
89
|
|
|
85
|
-
from cirq.ops.eigen_gate import EigenGate
|
|
90
|
+
from cirq.ops.eigen_gate import EigenGate as EigenGate
|
|
86
91
|
|
|
87
|
-
from cirq.ops.fourier_transform import
|
|
92
|
+
from cirq.ops.fourier_transform import (
|
|
93
|
+
PhaseGradientGate as PhaseGradientGate,
|
|
94
|
+
qft as qft,
|
|
95
|
+
QuantumFourierTransformGate as QuantumFourierTransformGate,
|
|
96
|
+
)
|
|
88
97
|
|
|
89
|
-
from cirq.ops.fsim_gate import FSimGate, PhasedFSimGate
|
|
98
|
+
from cirq.ops.fsim_gate import FSimGate as FSimGate, PhasedFSimGate as PhasedFSimGate
|
|
90
99
|
|
|
91
|
-
from cirq.ops.gate_features import InterchangeableQubitsGate
|
|
100
|
+
from cirq.ops.gate_features import InterchangeableQubitsGate as InterchangeableQubitsGate
|
|
92
101
|
|
|
93
|
-
from cirq.ops.gate_operation import GateOperation
|
|
102
|
+
from cirq.ops.gate_operation import GateOperation as GateOperation
|
|
94
103
|
|
|
95
|
-
from cirq.ops.gateset import GateFamily, Gateset
|
|
104
|
+
from cirq.ops.gateset import GateFamily as GateFamily, Gateset as Gateset
|
|
96
105
|
|
|
97
|
-
from cirq.ops.identity import I, identity_each, IdentityGate
|
|
106
|
+
from cirq.ops.identity import I as I, identity_each as identity_each, IdentityGate as IdentityGate
|
|
98
107
|
|
|
99
|
-
from cirq.ops.global_phase_op import
|
|
108
|
+
from cirq.ops.global_phase_op import (
|
|
109
|
+
GlobalPhaseGate as GlobalPhaseGate,
|
|
110
|
+
global_phase_operation as global_phase_operation,
|
|
111
|
+
)
|
|
100
112
|
|
|
101
|
-
from cirq.ops.kraus_channel import KrausChannel
|
|
113
|
+
from cirq.ops.kraus_channel import KrausChannel as KrausChannel
|
|
102
114
|
|
|
103
115
|
from cirq.ops.linear_combinations import (
|
|
104
|
-
LinearCombinationOfGates,
|
|
105
|
-
LinearCombinationOfOperations,
|
|
106
|
-
PauliSum,
|
|
107
|
-
PauliSumLike,
|
|
108
|
-
ProjectorSum,
|
|
116
|
+
LinearCombinationOfGates as LinearCombinationOfGates,
|
|
117
|
+
LinearCombinationOfOperations as LinearCombinationOfOperations,
|
|
118
|
+
PauliSum as PauliSum,
|
|
119
|
+
PauliSumLike as PauliSumLike,
|
|
120
|
+
ProjectorSum as ProjectorSum,
|
|
109
121
|
)
|
|
110
122
|
|
|
111
|
-
from cirq.ops.mixed_unitary_channel import MixedUnitaryChannel
|
|
123
|
+
from cirq.ops.mixed_unitary_channel import MixedUnitaryChannel as MixedUnitaryChannel
|
|
112
124
|
|
|
113
|
-
from cirq.ops.pauli_sum_exponential import PauliSumExponential
|
|
125
|
+
from cirq.ops.pauli_sum_exponential import PauliSumExponential as PauliSumExponential
|
|
114
126
|
|
|
115
|
-
from cirq.ops.pauli_measurement_gate import PauliMeasurementGate
|
|
127
|
+
from cirq.ops.pauli_measurement_gate import PauliMeasurementGate as PauliMeasurementGate
|
|
116
128
|
|
|
117
|
-
from cirq.ops.parallel_gate import
|
|
129
|
+
from cirq.ops.parallel_gate import (
|
|
130
|
+
ParallelGate as ParallelGate,
|
|
131
|
+
parallel_gate_op as parallel_gate_op,
|
|
132
|
+
)
|
|
118
133
|
|
|
119
|
-
from cirq.ops.projector import ProjectorString
|
|
134
|
+
from cirq.ops.projector import ProjectorString as ProjectorString
|
|
120
135
|
|
|
121
|
-
from cirq.ops.controlled_operation import ControlledOperation
|
|
136
|
+
from cirq.ops.controlled_operation import ControlledOperation as ControlledOperation
|
|
122
137
|
|
|
123
|
-
from cirq.ops.qubit_manager import
|
|
138
|
+
from cirq.ops.qubit_manager import (
|
|
139
|
+
BorrowableQubit as BorrowableQubit,
|
|
140
|
+
CleanQubit as CleanQubit,
|
|
141
|
+
QubitManager as QubitManager,
|
|
142
|
+
SimpleQubitManager as SimpleQubitManager,
|
|
143
|
+
)
|
|
124
144
|
|
|
125
|
-
from cirq.ops.greedy_qubit_manager import GreedyQubitManager
|
|
145
|
+
from cirq.ops.greedy_qubit_manager import GreedyQubitManager as GreedyQubitManager
|
|
126
146
|
|
|
127
|
-
from cirq.ops.qubit_order import QubitOrder
|
|
147
|
+
from cirq.ops.qubit_order import QubitOrder as QubitOrder
|
|
128
148
|
|
|
129
|
-
from cirq.ops.qubit_order_or_list import QubitOrderOrList
|
|
149
|
+
from cirq.ops.qubit_order_or_list import QubitOrderOrList as QubitOrderOrList
|
|
130
150
|
|
|
131
|
-
from cirq.ops.matrix_gates import MatrixGate
|
|
151
|
+
from cirq.ops.matrix_gates import MatrixGate as MatrixGate
|
|
132
152
|
|
|
133
153
|
from cirq.ops.measure_util import (
|
|
134
|
-
M,
|
|
135
|
-
measure,
|
|
136
|
-
measure_each,
|
|
137
|
-
measure_paulistring_terms,
|
|
138
|
-
measure_single_paulistring,
|
|
154
|
+
M as M,
|
|
155
|
+
measure as measure,
|
|
156
|
+
measure_each as measure_each,
|
|
157
|
+
measure_paulistring_terms as measure_paulistring_terms,
|
|
158
|
+
measure_single_paulistring as measure_single_paulistring,
|
|
139
159
|
)
|
|
140
160
|
|
|
141
|
-
from cirq.ops.measurement_gate import MeasurementGate
|
|
161
|
+
from cirq.ops.measurement_gate import MeasurementGate as MeasurementGate
|
|
142
162
|
|
|
143
|
-
from cirq.ops.named_qubit import NamedQubit, NamedQid
|
|
163
|
+
from cirq.ops.named_qubit import NamedQubit as NamedQubit, NamedQid as NamedQid
|
|
144
164
|
|
|
145
165
|
from cirq.ops.op_tree import (
|
|
146
|
-
flatten_op_tree,
|
|
147
|
-
freeze_op_tree,
|
|
148
|
-
flatten_to_ops,
|
|
149
|
-
flatten_to_ops_or_moments,
|
|
150
|
-
OP_TREE,
|
|
151
|
-
transform_op_tree,
|
|
166
|
+
flatten_op_tree as flatten_op_tree,
|
|
167
|
+
freeze_op_tree as freeze_op_tree,
|
|
168
|
+
flatten_to_ops as flatten_to_ops,
|
|
169
|
+
flatten_to_ops_or_moments as flatten_to_ops_or_moments,
|
|
170
|
+
OP_TREE as OP_TREE,
|
|
171
|
+
transform_op_tree as transform_op_tree,
|
|
152
172
|
)
|
|
153
173
|
|
|
154
|
-
from cirq.ops.parity_gates import
|
|
174
|
+
from cirq.ops.parity_gates import (
|
|
175
|
+
XX as XX,
|
|
176
|
+
XXPowGate as XXPowGate,
|
|
177
|
+
YY as YY,
|
|
178
|
+
YYPowGate as YYPowGate,
|
|
179
|
+
ZZ as ZZ,
|
|
180
|
+
ZZPowGate as ZZPowGate,
|
|
181
|
+
MSGate as MSGate,
|
|
182
|
+
ms as ms,
|
|
183
|
+
)
|
|
155
184
|
|
|
156
|
-
from cirq.ops.pauli_gates import Pauli, X, Y, Z
|
|
185
|
+
from cirq.ops.pauli_gates import Pauli as Pauli, X as X, Y as Y, Z as Z
|
|
157
186
|
|
|
158
|
-
from cirq.ops.pauli_interaction_gate import PauliInteractionGate
|
|
187
|
+
from cirq.ops.pauli_interaction_gate import PauliInteractionGate as PauliInteractionGate
|
|
159
188
|
|
|
160
189
|
from cirq.ops.pauli_string import (
|
|
161
|
-
MutablePauliString,
|
|
162
|
-
PAULI_GATE_LIKE,
|
|
163
|
-
PAULI_STRING_LIKE,
|
|
164
|
-
PauliString,
|
|
165
|
-
SingleQubitPauliStringGateOperation,
|
|
190
|
+
MutablePauliString as MutablePauliString,
|
|
191
|
+
PAULI_GATE_LIKE as PAULI_GATE_LIKE,
|
|
192
|
+
PAULI_STRING_LIKE as PAULI_STRING_LIKE,
|
|
193
|
+
PauliString as PauliString,
|
|
194
|
+
SingleQubitPauliStringGateOperation as SingleQubitPauliStringGateOperation,
|
|
166
195
|
)
|
|
167
196
|
|
|
168
|
-
from cirq.ops.pauli_string_phasor import
|
|
197
|
+
from cirq.ops.pauli_string_phasor import (
|
|
198
|
+
PauliStringPhasor as PauliStringPhasor,
|
|
199
|
+
PauliStringPhasorGate as PauliStringPhasorGate,
|
|
200
|
+
)
|
|
169
201
|
|
|
170
|
-
from cirq.ops.pauli_string_raw_types import PauliStringGateOperation
|
|
202
|
+
from cirq.ops.pauli_string_raw_types import PauliStringGateOperation as PauliStringGateOperation
|
|
171
203
|
|
|
172
|
-
from cirq.ops.permutation_gate import QubitPermutationGate
|
|
204
|
+
from cirq.ops.permutation_gate import QubitPermutationGate as QubitPermutationGate
|
|
173
205
|
|
|
174
|
-
from cirq.ops.phased_iswap_gate import givens, PhasedISwapPowGate
|
|
206
|
+
from cirq.ops.phased_iswap_gate import givens as givens, PhasedISwapPowGate as PhasedISwapPowGate
|
|
175
207
|
|
|
176
|
-
from cirq.ops.phased_x_gate import PhasedXPowGate
|
|
208
|
+
from cirq.ops.phased_x_gate import PhasedXPowGate as PhasedXPowGate
|
|
177
209
|
|
|
178
|
-
from cirq.ops.phased_x_z_gate import PhasedXZGate
|
|
210
|
+
from cirq.ops.phased_x_z_gate import PhasedXZGate as PhasedXZGate
|
|
179
211
|
|
|
180
|
-
from cirq.ops.qid_util import q
|
|
212
|
+
from cirq.ops.qid_util import q as q
|
|
181
213
|
|
|
182
|
-
from cirq.ops.random_gate_channel import RandomGateChannel
|
|
214
|
+
from cirq.ops.random_gate_channel import RandomGateChannel as RandomGateChannel
|
|
183
215
|
|
|
184
|
-
from cirq.ops.raw_types import
|
|
216
|
+
from cirq.ops.raw_types import (
|
|
217
|
+
Gate as Gate,
|
|
218
|
+
Operation as Operation,
|
|
219
|
+
Qid as Qid,
|
|
220
|
+
TaggedOperation as TaggedOperation,
|
|
221
|
+
)
|
|
185
222
|
|
|
186
223
|
from cirq.ops.swap_gates import (
|
|
187
|
-
ISWAP,
|
|
188
|
-
ISwapPowGate,
|
|
189
|
-
ISWAP_INV,
|
|
190
|
-
riswap,
|
|
191
|
-
SQRT_ISWAP,
|
|
192
|
-
SQRT_ISWAP_INV,
|
|
193
|
-
SWAP,
|
|
194
|
-
SwapPowGate,
|
|
224
|
+
ISWAP as ISWAP,
|
|
225
|
+
ISwapPowGate as ISwapPowGate,
|
|
226
|
+
ISWAP_INV as ISWAP_INV,
|
|
227
|
+
riswap as riswap,
|
|
228
|
+
SQRT_ISWAP as SQRT_ISWAP,
|
|
229
|
+
SQRT_ISWAP_INV as SQRT_ISWAP_INV,
|
|
230
|
+
SWAP as SWAP,
|
|
231
|
+
SwapPowGate as SwapPowGate,
|
|
195
232
|
)
|
|
196
233
|
|
|
197
|
-
from cirq.ops.tags import RoutingSwapTag, VirtualTag
|
|
234
|
+
from cirq.ops.tags import RoutingSwapTag as RoutingSwapTag, VirtualTag as VirtualTag
|
|
198
235
|
|
|
199
236
|
from cirq.ops.three_qubit_gates import (
|
|
200
|
-
CCNOT,
|
|
201
|
-
CCNotPowGate,
|
|
202
|
-
CCX,
|
|
203
|
-
CCXPowGate,
|
|
204
|
-
CCZ,
|
|
205
|
-
CCZPowGate,
|
|
206
|
-
CSWAP,
|
|
207
|
-
CSwapGate,
|
|
208
|
-
FREDKIN,
|
|
209
|
-
ThreeQubitDiagonalGate,
|
|
210
|
-
TOFFOLI,
|
|
237
|
+
CCNOT as CCNOT,
|
|
238
|
+
CCNotPowGate as CCNotPowGate,
|
|
239
|
+
CCX as CCX,
|
|
240
|
+
CCXPowGate as CCXPowGate,
|
|
241
|
+
CCZ as CCZ,
|
|
242
|
+
CCZPowGate as CCZPowGate,
|
|
243
|
+
CSWAP as CSWAP,
|
|
244
|
+
CSwapGate as CSwapGate,
|
|
245
|
+
FREDKIN as FREDKIN,
|
|
246
|
+
ThreeQubitDiagonalGate as ThreeQubitDiagonalGate,
|
|
247
|
+
TOFFOLI as TOFFOLI,
|
|
211
248
|
)
|
|
212
249
|
|
|
213
|
-
from cirq.ops.two_qubit_diagonal_gate import TwoQubitDiagonalGate
|
|
250
|
+
from cirq.ops.two_qubit_diagonal_gate import TwoQubitDiagonalGate as TwoQubitDiagonalGate
|
|
214
251
|
|
|
215
|
-
from cirq.ops.wait_gate import wait, WaitGate
|
|
252
|
+
from cirq.ops.wait_gate import wait as wait, WaitGate as WaitGate
|
|
216
253
|
|
|
217
|
-
from cirq.ops.state_preparation_channel import StatePreparationChannel
|
|
254
|
+
from cirq.ops.state_preparation_channel import StatePreparationChannel as StatePreparationChannel
|
|
218
255
|
|
|
219
|
-
from cirq.ops.control_values import
|
|
256
|
+
from cirq.ops.control_values import (
|
|
257
|
+
AbstractControlValues as AbstractControlValues,
|
|
258
|
+
ProductOfSums as ProductOfSums,
|
|
259
|
+
SumOfProducts as SumOfProducts,
|
|
260
|
+
)
|
|
220
261
|
|
|
221
|
-
from cirq.ops.uniform_superposition_gate import UniformSuperpositionGate
|
|
262
|
+
from cirq.ops.uniform_superposition_gate import UniformSuperpositionGate as UniformSuperpositionGate
|
cirq/ops/boolean_hamiltonian.py
CHANGED
|
@@ -31,7 +31,8 @@ import sympy.parsing.sympy_parser as sympy_parser
|
|
|
31
31
|
import cirq
|
|
32
32
|
from cirq import value
|
|
33
33
|
from cirq.ops import raw_types
|
|
34
|
-
from cirq.ops.linear_combinations import PauliSum
|
|
34
|
+
from cirq.ops.linear_combinations import PauliSum
|
|
35
|
+
from cirq.ops.pauli_string import PauliString
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
@value.value_equality
|