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/protocols/__init__.py
CHANGED
|
@@ -14,114 +14,166 @@
|
|
|
14
14
|
|
|
15
15
|
"""Protocols (structural subtyping) supported in Cirq."""
|
|
16
16
|
|
|
17
|
-
from cirq.protocols.act_on_protocol import
|
|
17
|
+
from cirq.protocols.act_on_protocol import (
|
|
18
|
+
act_on as act_on,
|
|
19
|
+
SupportsActOn as SupportsActOn,
|
|
20
|
+
SupportsActOnQubits as SupportsActOnQubits,
|
|
21
|
+
)
|
|
22
|
+
|
|
18
23
|
from cirq.protocols.apply_unitary_protocol import (
|
|
19
|
-
apply_unitaries,
|
|
20
|
-
apply_unitary,
|
|
21
|
-
ApplyUnitaryArgs,
|
|
22
|
-
SupportsConsistentApplyUnitary,
|
|
24
|
+
apply_unitaries as apply_unitaries,
|
|
25
|
+
apply_unitary as apply_unitary,
|
|
26
|
+
ApplyUnitaryArgs as ApplyUnitaryArgs,
|
|
27
|
+
SupportsConsistentApplyUnitary as SupportsConsistentApplyUnitary,
|
|
23
28
|
)
|
|
29
|
+
|
|
24
30
|
from cirq.protocols.apply_channel_protocol import (
|
|
25
|
-
apply_channel,
|
|
26
|
-
ApplyChannelArgs,
|
|
27
|
-
SupportsApplyChannel,
|
|
31
|
+
apply_channel as apply_channel,
|
|
32
|
+
ApplyChannelArgs as ApplyChannelArgs,
|
|
33
|
+
SupportsApplyChannel as SupportsApplyChannel,
|
|
28
34
|
)
|
|
35
|
+
|
|
29
36
|
from cirq.protocols.apply_mixture_protocol import (
|
|
30
|
-
apply_mixture,
|
|
31
|
-
ApplyMixtureArgs,
|
|
32
|
-
SupportsApplyMixture,
|
|
37
|
+
apply_mixture as apply_mixture,
|
|
38
|
+
ApplyMixtureArgs as ApplyMixtureArgs,
|
|
39
|
+
SupportsApplyMixture as SupportsApplyMixture,
|
|
33
40
|
)
|
|
34
|
-
|
|
35
|
-
from cirq.protocols.
|
|
36
|
-
|
|
41
|
+
|
|
42
|
+
from cirq.protocols.approximate_equality_protocol import (
|
|
43
|
+
approx_eq as approx_eq,
|
|
44
|
+
SupportsApproximateEquality as SupportsApproximateEquality,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
from cirq.protocols.kraus_protocol import (
|
|
48
|
+
kraus as kraus,
|
|
49
|
+
has_kraus as has_kraus,
|
|
50
|
+
SupportsKraus as SupportsKraus,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
from cirq.protocols.commutes_protocol import (
|
|
54
|
+
commutes as commutes,
|
|
55
|
+
definitely_commutes as definitely_commutes,
|
|
56
|
+
SupportsCommutes as SupportsCommutes,
|
|
57
|
+
)
|
|
58
|
+
|
|
37
59
|
from cirq.protocols.control_key_protocol import (
|
|
38
|
-
control_keys,
|
|
39
|
-
measurement_keys_touched,
|
|
40
|
-
SupportsControlKey,
|
|
60
|
+
control_keys as control_keys,
|
|
61
|
+
measurement_keys_touched as measurement_keys_touched,
|
|
62
|
+
SupportsControlKey as SupportsControlKey,
|
|
41
63
|
)
|
|
64
|
+
|
|
42
65
|
from cirq.protocols.circuit_diagram_info_protocol import (
|
|
43
|
-
circuit_diagram_info,
|
|
44
|
-
CircuitDiagramInfo,
|
|
45
|
-
CircuitDiagramInfoArgs,
|
|
46
|
-
LabelEntity,
|
|
47
|
-
SupportsCircuitDiagramInfo,
|
|
66
|
+
circuit_diagram_info as circuit_diagram_info,
|
|
67
|
+
CircuitDiagramInfo as CircuitDiagramInfo,
|
|
68
|
+
CircuitDiagramInfoArgs as CircuitDiagramInfoArgs,
|
|
69
|
+
LabelEntity as LabelEntity,
|
|
70
|
+
SupportsCircuitDiagramInfo as SupportsCircuitDiagramInfo,
|
|
48
71
|
)
|
|
72
|
+
|
|
49
73
|
from cirq.protocols.decompose_protocol import (
|
|
50
|
-
decompose,
|
|
51
|
-
decompose_once,
|
|
52
|
-
decompose_once_with_qubits,
|
|
53
|
-
DecompositionContext,
|
|
54
|
-
SupportsDecompose,
|
|
55
|
-
SupportsDecomposeWithQubits,
|
|
74
|
+
decompose as decompose,
|
|
75
|
+
decompose_once as decompose_once,
|
|
76
|
+
decompose_once_with_qubits as decompose_once_with_qubits,
|
|
77
|
+
DecompositionContext as DecompositionContext,
|
|
78
|
+
SupportsDecompose as SupportsDecompose,
|
|
79
|
+
SupportsDecomposeWithQubits as SupportsDecomposeWithQubits,
|
|
56
80
|
)
|
|
81
|
+
|
|
57
82
|
from cirq.protocols.equal_up_to_global_phase_protocol import (
|
|
58
|
-
equal_up_to_global_phase,
|
|
59
|
-
SupportsEqualUpToGlobalPhase,
|
|
83
|
+
equal_up_to_global_phase as equal_up_to_global_phase,
|
|
84
|
+
SupportsEqualUpToGlobalPhase as SupportsEqualUpToGlobalPhase,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
from cirq.protocols.has_stabilizer_effect_protocol import (
|
|
88
|
+
has_stabilizer_effect as has_stabilizer_effect,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
from cirq.protocols.has_unitary_protocol import (
|
|
92
|
+
has_unitary as has_unitary,
|
|
93
|
+
SupportsExplicitHasUnitary as SupportsExplicitHasUnitary,
|
|
60
94
|
)
|
|
61
|
-
|
|
62
|
-
from cirq.protocols.
|
|
63
|
-
|
|
95
|
+
|
|
96
|
+
from cirq.protocols.inverse_protocol import inverse as inverse
|
|
97
|
+
|
|
64
98
|
from cirq.protocols.json_serialization import (
|
|
65
|
-
cirq_type_from_json,
|
|
66
|
-
DEFAULT_RESOLVERS,
|
|
67
|
-
HasJSONNamespace,
|
|
68
|
-
JsonResolver,
|
|
69
|
-
json_cirq_type,
|
|
70
|
-
json_namespace,
|
|
71
|
-
to_json_gzip,
|
|
72
|
-
read_json_gzip,
|
|
73
|
-
to_json,
|
|
74
|
-
read_json,
|
|
75
|
-
obj_to_dict_helper,
|
|
76
|
-
dataclass_json_dict,
|
|
77
|
-
SerializableByKey,
|
|
78
|
-
SupportsJSON,
|
|
99
|
+
cirq_type_from_json as cirq_type_from_json,
|
|
100
|
+
DEFAULT_RESOLVERS as DEFAULT_RESOLVERS,
|
|
101
|
+
HasJSONNamespace as HasJSONNamespace,
|
|
102
|
+
JsonResolver as JsonResolver,
|
|
103
|
+
json_cirq_type as json_cirq_type,
|
|
104
|
+
json_namespace as json_namespace,
|
|
105
|
+
to_json_gzip as to_json_gzip,
|
|
106
|
+
read_json_gzip as read_json_gzip,
|
|
107
|
+
to_json as to_json,
|
|
108
|
+
read_json as read_json,
|
|
109
|
+
obj_to_dict_helper as obj_to_dict_helper,
|
|
110
|
+
dataclass_json_dict as dataclass_json_dict,
|
|
111
|
+
SerializableByKey as SerializableByKey,
|
|
112
|
+
SupportsJSON as SupportsJSON,
|
|
79
113
|
)
|
|
114
|
+
|
|
80
115
|
from cirq.protocols.measurement_key_protocol import (
|
|
81
|
-
is_measurement,
|
|
82
|
-
measurement_key_name,
|
|
83
|
-
measurement_key_obj,
|
|
84
|
-
measurement_key_names,
|
|
85
|
-
measurement_key_objs,
|
|
86
|
-
with_key_path,
|
|
87
|
-
with_key_path_prefix,
|
|
88
|
-
with_measurement_key_mapping,
|
|
89
|
-
with_rescoped_keys,
|
|
90
|
-
SupportsMeasurementKey,
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
from cirq.protocols.
|
|
94
|
-
|
|
116
|
+
is_measurement as is_measurement,
|
|
117
|
+
measurement_key_name as measurement_key_name,
|
|
118
|
+
measurement_key_obj as measurement_key_obj,
|
|
119
|
+
measurement_key_names as measurement_key_names,
|
|
120
|
+
measurement_key_objs as measurement_key_objs,
|
|
121
|
+
with_key_path as with_key_path,
|
|
122
|
+
with_key_path_prefix as with_key_path_prefix,
|
|
123
|
+
with_measurement_key_mapping as with_measurement_key_mapping,
|
|
124
|
+
with_rescoped_keys as with_rescoped_keys,
|
|
125
|
+
SupportsMeasurementKey as SupportsMeasurementKey,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
from cirq.protocols.mixture_protocol import (
|
|
129
|
+
has_mixture as has_mixture,
|
|
130
|
+
mixture as mixture,
|
|
131
|
+
SupportsMixture as SupportsMixture,
|
|
132
|
+
validate_mixture as validate_mixture,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
from cirq.protocols.mul_protocol import mul as mul
|
|
136
|
+
|
|
137
|
+
from cirq.protocols.pauli_expansion_protocol import (
|
|
138
|
+
pauli_expansion as pauli_expansion,
|
|
139
|
+
SupportsPauliExpansion as SupportsPauliExpansion,
|
|
140
|
+
)
|
|
95
141
|
|
|
96
142
|
# pylint: disable=redefined-builtin
|
|
97
|
-
from cirq.protocols.pow_protocol import pow
|
|
143
|
+
from cirq.protocols.pow_protocol import pow as pow
|
|
98
144
|
|
|
99
145
|
# pylint: enable=redefined-builtin
|
|
146
|
+
|
|
100
147
|
from cirq.protocols.qasm import (
|
|
101
|
-
qasm,
|
|
102
|
-
QasmArgs,
|
|
103
|
-
SupportsQasm,
|
|
104
|
-
SupportsQasmWithArgs,
|
|
105
|
-
SupportsQasmWithArgsAndQubits,
|
|
148
|
+
qasm as qasm,
|
|
149
|
+
QasmArgs as QasmArgs,
|
|
150
|
+
SupportsQasm as SupportsQasm,
|
|
151
|
+
SupportsQasmWithArgs as SupportsQasmWithArgs,
|
|
152
|
+
SupportsQasmWithArgsAndQubits as SupportsQasmWithArgsAndQubits,
|
|
106
153
|
)
|
|
154
|
+
|
|
107
155
|
from cirq.protocols.trace_distance_bound import (
|
|
108
|
-
SupportsTraceDistanceBound,
|
|
109
|
-
trace_distance_bound,
|
|
110
|
-
trace_distance_from_angle_list,
|
|
156
|
+
SupportsTraceDistanceBound as SupportsTraceDistanceBound,
|
|
157
|
+
trace_distance_bound as trace_distance_bound,
|
|
158
|
+
trace_distance_from_angle_list as trace_distance_from_angle_list,
|
|
111
159
|
)
|
|
160
|
+
|
|
112
161
|
from cirq.protocols.resolve_parameters import (
|
|
113
|
-
is_parameterized,
|
|
114
|
-
parameter_names,
|
|
115
|
-
parameter_symbols,
|
|
116
|
-
resolve_parameters,
|
|
117
|
-
resolve_parameters_once,
|
|
118
|
-
SupportsParameterization,
|
|
119
|
-
)
|
|
120
|
-
|
|
162
|
+
is_parameterized as is_parameterized,
|
|
163
|
+
parameter_names as parameter_names,
|
|
164
|
+
parameter_symbols as parameter_symbols,
|
|
165
|
+
resolve_parameters as resolve_parameters,
|
|
166
|
+
resolve_parameters_once as resolve_parameters_once,
|
|
167
|
+
SupportsParameterization as SupportsParameterization,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
from cirq.protocols.phase_protocol import phase_by as phase_by, SupportsPhase as SupportsPhase
|
|
171
|
+
|
|
121
172
|
from cirq.protocols.qid_shape_protocol import (
|
|
122
|
-
num_qubits,
|
|
123
|
-
qid_shape,
|
|
124
|
-
SupportsExplicitQidShape,
|
|
125
|
-
SupportsExplicitNumQubits,
|
|
173
|
+
num_qubits as num_qubits,
|
|
174
|
+
qid_shape as qid_shape,
|
|
175
|
+
SupportsExplicitQidShape as SupportsExplicitQidShape,
|
|
176
|
+
SupportsExplicitNumQubits as SupportsExplicitNumQubits,
|
|
126
177
|
)
|
|
127
|
-
|
|
178
|
+
|
|
179
|
+
from cirq.protocols.unitary_protocol import SupportsUnitary as SupportsUnitary, unitary as unitary
|
cirq/qis/__init__.py
CHANGED
|
@@ -15,49 +15,61 @@
|
|
|
15
15
|
"""Tools and methods for primitives used in quantum information science."""
|
|
16
16
|
|
|
17
17
|
from cirq.qis.channels import (
|
|
18
|
-
choi_to_kraus,
|
|
19
|
-
choi_to_superoperator,
|
|
20
|
-
kraus_to_choi,
|
|
21
|
-
kraus_to_superoperator,
|
|
22
|
-
operation_to_choi,
|
|
23
|
-
operation_to_superoperator,
|
|
24
|
-
superoperator_to_choi,
|
|
25
|
-
superoperator_to_kraus,
|
|
18
|
+
choi_to_kraus as choi_to_kraus,
|
|
19
|
+
choi_to_superoperator as choi_to_superoperator,
|
|
20
|
+
kraus_to_choi as kraus_to_choi,
|
|
21
|
+
kraus_to_superoperator as kraus_to_superoperator,
|
|
22
|
+
operation_to_choi as operation_to_choi,
|
|
23
|
+
operation_to_superoperator as operation_to_superoperator,
|
|
24
|
+
superoperator_to_choi as superoperator_to_choi,
|
|
25
|
+
superoperator_to_kraus as superoperator_to_kraus,
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
from cirq.qis.clifford_tableau import
|
|
28
|
+
from cirq.qis.clifford_tableau import (
|
|
29
|
+
CliffordTableau as CliffordTableau,
|
|
30
|
+
StabilizerState as StabilizerState,
|
|
31
|
+
)
|
|
29
32
|
|
|
30
|
-
from cirq.qis.measures import
|
|
33
|
+
from cirq.qis.measures import (
|
|
34
|
+
entanglement_fidelity as entanglement_fidelity,
|
|
35
|
+
fidelity as fidelity,
|
|
36
|
+
von_neumann_entropy as von_neumann_entropy,
|
|
37
|
+
)
|
|
31
38
|
|
|
32
|
-
from cirq.qis.quantum_state_representation import
|
|
39
|
+
from cirq.qis.quantum_state_representation import (
|
|
40
|
+
QuantumStateRepresentation as QuantumStateRepresentation,
|
|
41
|
+
)
|
|
33
42
|
|
|
34
43
|
from cirq.qis.states import (
|
|
35
|
-
bloch_vector_from_state_vector,
|
|
36
|
-
density_matrix,
|
|
37
|
-
density_matrix_from_state_vector,
|
|
38
|
-
dirac_notation,
|
|
39
|
-
eye_tensor,
|
|
40
|
-
infer_qid_shape,
|
|
41
|
-
one_hot,
|
|
42
|
-
QUANTUM_STATE_LIKE,
|
|
43
|
-
QuantumState,
|
|
44
|
-
quantum_state,
|
|
45
|
-
STATE_VECTOR_LIKE,
|
|
46
|
-
to_valid_density_matrix,
|
|
47
|
-
to_valid_state_vector,
|
|
48
|
-
validate_density_matrix,
|
|
49
|
-
validate_indices,
|
|
50
|
-
validate_qid_shape,
|
|
51
|
-
validate_normalized_state_vector,
|
|
44
|
+
bloch_vector_from_state_vector as bloch_vector_from_state_vector,
|
|
45
|
+
density_matrix as density_matrix,
|
|
46
|
+
density_matrix_from_state_vector as density_matrix_from_state_vector,
|
|
47
|
+
dirac_notation as dirac_notation,
|
|
48
|
+
eye_tensor as eye_tensor,
|
|
49
|
+
infer_qid_shape as infer_qid_shape,
|
|
50
|
+
one_hot as one_hot,
|
|
51
|
+
QUANTUM_STATE_LIKE as QUANTUM_STATE_LIKE,
|
|
52
|
+
QuantumState as QuantumState,
|
|
53
|
+
quantum_state as quantum_state,
|
|
54
|
+
STATE_VECTOR_LIKE as STATE_VECTOR_LIKE,
|
|
55
|
+
to_valid_density_matrix as to_valid_density_matrix,
|
|
56
|
+
to_valid_state_vector as to_valid_state_vector,
|
|
57
|
+
validate_density_matrix as validate_density_matrix,
|
|
58
|
+
validate_indices as validate_indices,
|
|
59
|
+
validate_qid_shape as validate_qid_shape,
|
|
60
|
+
validate_normalized_state_vector as validate_normalized_state_vector,
|
|
52
61
|
)
|
|
53
62
|
|
|
54
63
|
from cirq.qis.noise_utils import (
|
|
55
|
-
decay_constant_to_xeb_fidelity,
|
|
56
|
-
decay_constant_to_pauli_error,
|
|
57
|
-
pauli_error_to_decay_constant,
|
|
58
|
-
xeb_fidelity_to_decay_constant,
|
|
59
|
-
pauli_error_from_t1,
|
|
60
|
-
average_error,
|
|
61
|
-
decoherence_pauli_error,
|
|
64
|
+
decay_constant_to_xeb_fidelity as decay_constant_to_xeb_fidelity,
|
|
65
|
+
decay_constant_to_pauli_error as decay_constant_to_pauli_error,
|
|
66
|
+
pauli_error_to_decay_constant as pauli_error_to_decay_constant,
|
|
67
|
+
xeb_fidelity_to_decay_constant as xeb_fidelity_to_decay_constant,
|
|
68
|
+
pauli_error_from_t1 as pauli_error_from_t1,
|
|
69
|
+
average_error as average_error,
|
|
70
|
+
decoherence_pauli_error as decoherence_pauli_error,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
from cirq.qis.entropy import (
|
|
74
|
+
process_renyi_entropy_from_bitstrings as process_renyi_entropy_from_bitstrings,
|
|
62
75
|
)
|
|
63
|
-
from cirq.qis.entropy import process_renyi_entropy_from_bitstrings
|
cirq/sim/__init__.py
CHANGED
|
@@ -15,63 +15,81 @@
|
|
|
15
15
|
"""Classes for circuit simulators and base implementations of these classes."""
|
|
16
16
|
|
|
17
17
|
from cirq.sim.clifford import (
|
|
18
|
-
CliffordSimulator,
|
|
19
|
-
CliffordSimulatorStepResult,
|
|
20
|
-
CliffordState,
|
|
21
|
-
CliffordTrialResult,
|
|
22
|
-
CliffordTableauSimulationState,
|
|
23
|
-
StabilizerChFormSimulationState,
|
|
24
|
-
StabilizerSampler,
|
|
25
|
-
StabilizerSimulationState,
|
|
26
|
-
StabilizerStateChForm,
|
|
18
|
+
CliffordSimulator as CliffordSimulator,
|
|
19
|
+
CliffordSimulatorStepResult as CliffordSimulatorStepResult,
|
|
20
|
+
CliffordState as CliffordState,
|
|
21
|
+
CliffordTrialResult as CliffordTrialResult,
|
|
22
|
+
CliffordTableauSimulationState as CliffordTableauSimulationState,
|
|
23
|
+
StabilizerChFormSimulationState as StabilizerChFormSimulationState,
|
|
24
|
+
StabilizerSampler as StabilizerSampler,
|
|
25
|
+
StabilizerSimulationState as StabilizerSimulationState,
|
|
26
|
+
StabilizerStateChForm as StabilizerStateChForm,
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
from cirq.sim.density_matrix_simulation_state import
|
|
29
|
+
from cirq.sim.density_matrix_simulation_state import (
|
|
30
|
+
DensityMatrixSimulationState as DensityMatrixSimulationState,
|
|
31
|
+
)
|
|
30
32
|
|
|
31
33
|
from cirq.sim.density_matrix_simulator import (
|
|
32
|
-
DensityMatrixSimulator,
|
|
33
|
-
DensityMatrixStepResult,
|
|
34
|
-
DensityMatrixTrialResult,
|
|
34
|
+
DensityMatrixSimulator as DensityMatrixSimulator,
|
|
35
|
+
DensityMatrixStepResult as DensityMatrixStepResult,
|
|
36
|
+
DensityMatrixTrialResult as DensityMatrixTrialResult,
|
|
35
37
|
)
|
|
36
38
|
|
|
37
|
-
from cirq.sim.density_matrix_utils import
|
|
39
|
+
from cirq.sim.density_matrix_utils import (
|
|
40
|
+
measure_density_matrix as measure_density_matrix,
|
|
41
|
+
sample_density_matrix as sample_density_matrix,
|
|
42
|
+
)
|
|
38
43
|
|
|
39
44
|
from cirq.sim.mux import (
|
|
40
|
-
CIRCUIT_LIKE,
|
|
41
|
-
final_density_matrix,
|
|
42
|
-
final_state_vector,
|
|
43
|
-
sample,
|
|
44
|
-
sample_sweep,
|
|
45
|
+
CIRCUIT_LIKE as CIRCUIT_LIKE,
|
|
46
|
+
final_density_matrix as final_density_matrix,
|
|
47
|
+
final_state_vector as final_state_vector,
|
|
48
|
+
sample as sample,
|
|
49
|
+
sample_sweep as sample_sweep,
|
|
45
50
|
)
|
|
46
51
|
|
|
47
|
-
from cirq.sim.simulation_product_state import SimulationProductState
|
|
52
|
+
from cirq.sim.simulation_product_state import SimulationProductState as SimulationProductState
|
|
48
53
|
|
|
49
|
-
from cirq.sim.simulation_state import SimulationState
|
|
54
|
+
from cirq.sim.simulation_state import SimulationState as SimulationState
|
|
50
55
|
|
|
51
|
-
from cirq.sim.simulation_state_base import SimulationStateBase
|
|
56
|
+
from cirq.sim.simulation_state_base import SimulationStateBase as SimulationStateBase
|
|
52
57
|
|
|
53
58
|
from cirq.sim.simulator import (
|
|
54
|
-
SimulatesAmplitudes,
|
|
55
|
-
SimulatesExpectationValues,
|
|
56
|
-
SimulatesFinalState,
|
|
57
|
-
SimulatesIntermediateState,
|
|
58
|
-
SimulatesSamples,
|
|
59
|
-
SimulationTrialResult,
|
|
60
|
-
StepResult,
|
|
59
|
+
SimulatesAmplitudes as SimulatesAmplitudes,
|
|
60
|
+
SimulatesExpectationValues as SimulatesExpectationValues,
|
|
61
|
+
SimulatesFinalState as SimulatesFinalState,
|
|
62
|
+
SimulatesIntermediateState as SimulatesIntermediateState,
|
|
63
|
+
SimulatesSamples as SimulatesSamples,
|
|
64
|
+
SimulationTrialResult as SimulationTrialResult,
|
|
65
|
+
StepResult as StepResult,
|
|
61
66
|
)
|
|
62
67
|
|
|
63
|
-
from cirq.sim.simulator_base import
|
|
68
|
+
from cirq.sim.simulator_base import (
|
|
69
|
+
SimulationTrialResultBase as SimulationTrialResultBase,
|
|
70
|
+
SimulatorBase as SimulatorBase,
|
|
71
|
+
StepResultBase as StepResultBase,
|
|
72
|
+
)
|
|
64
73
|
|
|
65
|
-
from cirq.sim.sparse_simulator import
|
|
74
|
+
from cirq.sim.sparse_simulator import (
|
|
75
|
+
Simulator as Simulator,
|
|
76
|
+
SparseSimulatorStep as SparseSimulatorStep,
|
|
77
|
+
)
|
|
66
78
|
|
|
67
|
-
from cirq.sim.state_vector import
|
|
79
|
+
from cirq.sim.state_vector import (
|
|
80
|
+
measure_state_vector as measure_state_vector,
|
|
81
|
+
sample_state_vector as sample_state_vector,
|
|
82
|
+
StateVectorMixin as StateVectorMixin,
|
|
83
|
+
)
|
|
68
84
|
|
|
69
|
-
from cirq.sim.state_vector_simulation_state import
|
|
85
|
+
from cirq.sim.state_vector_simulation_state import (
|
|
86
|
+
StateVectorSimulationState as StateVectorSimulationState,
|
|
87
|
+
)
|
|
70
88
|
|
|
71
|
-
from cirq.sim.classical_simulator import ClassicalStateSimulator
|
|
89
|
+
from cirq.sim.classical_simulator import ClassicalStateSimulator as ClassicalStateSimulator
|
|
72
90
|
|
|
73
91
|
from cirq.sim.state_vector_simulator import (
|
|
74
|
-
SimulatesIntermediateStateVector,
|
|
75
|
-
StateVectorStepResult,
|
|
76
|
-
StateVectorTrialResult,
|
|
92
|
+
SimulatesIntermediateStateVector as SimulatesIntermediateStateVector,
|
|
93
|
+
StateVectorStepResult as StateVectorStepResult,
|
|
94
|
+
StateVectorTrialResult as StateVectorTrialResult,
|
|
77
95
|
)
|
cirq/sim/clifford/__init__.py
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
# pylint: disable=wrong-or-nonexistent-copyright-notice
|
|
2
2
|
|
|
3
3
|
from cirq.sim.clifford.clifford_simulator import (
|
|
4
|
-
CliffordSimulator,
|
|
5
|
-
CliffordSimulatorStepResult,
|
|
6
|
-
CliffordState,
|
|
7
|
-
CliffordTrialResult,
|
|
4
|
+
CliffordSimulator as CliffordSimulator,
|
|
5
|
+
CliffordSimulatorStepResult as CliffordSimulatorStepResult,
|
|
6
|
+
CliffordState as CliffordState,
|
|
7
|
+
CliffordTrialResult as CliffordTrialResult,
|
|
8
8
|
)
|
|
9
9
|
|
|
10
|
-
from cirq.sim.clifford.clifford_tableau_simulation_state import
|
|
10
|
+
from cirq.sim.clifford.clifford_tableau_simulation_state import (
|
|
11
|
+
CliffordTableauSimulationState as CliffordTableauSimulationState,
|
|
12
|
+
)
|
|
11
13
|
|
|
12
|
-
from cirq.sim.clifford.stabilizer_ch_form_simulation_state import
|
|
14
|
+
from cirq.sim.clifford.stabilizer_ch_form_simulation_state import (
|
|
15
|
+
StabilizerChFormSimulationState as StabilizerChFormSimulationState,
|
|
16
|
+
)
|
|
13
17
|
|
|
14
|
-
from cirq.sim.clifford.stabilizer_sampler import StabilizerSampler
|
|
18
|
+
from cirq.sim.clifford.stabilizer_sampler import StabilizerSampler as StabilizerSampler
|
|
15
19
|
|
|
16
|
-
from cirq.sim.clifford.stabilizer_simulation_state import
|
|
20
|
+
from cirq.sim.clifford.stabilizer_simulation_state import (
|
|
21
|
+
StabilizerSimulationState as StabilizerSimulationState,
|
|
22
|
+
)
|
|
17
23
|
|
|
18
|
-
from cirq.sim.clifford.stabilizer_state_ch_form import
|
|
24
|
+
from cirq.sim.clifford.stabilizer_state_ch_form import (
|
|
25
|
+
StabilizerStateChForm as StabilizerStateChForm,
|
|
26
|
+
)
|
cirq/study/__init__.py
CHANGED
|
@@ -15,33 +15,38 @@
|
|
|
15
15
|
"""Parameterized circuits and results."""
|
|
16
16
|
|
|
17
17
|
from cirq.study.flatten_expressions import (
|
|
18
|
-
ExpressionMap,
|
|
19
|
-
flatten,
|
|
20
|
-
flatten_with_params,
|
|
21
|
-
flatten_with_sweep,
|
|
18
|
+
ExpressionMap as ExpressionMap,
|
|
19
|
+
flatten as flatten,
|
|
20
|
+
flatten_with_params as flatten_with_params,
|
|
21
|
+
flatten_with_sweep as flatten_with_sweep,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
from cirq.study.resolver import (
|
|
25
|
-
ParamDictType,
|
|
26
|
-
ParamMappingType,
|
|
27
|
-
ParamResolver,
|
|
28
|
-
ParamResolverOrSimilarType,
|
|
25
|
+
ParamDictType as ParamDictType,
|
|
26
|
+
ParamMappingType as ParamMappingType,
|
|
27
|
+
ParamResolver as ParamResolver,
|
|
28
|
+
ParamResolverOrSimilarType as ParamResolverOrSimilarType,
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
from cirq.study.sweepable import
|
|
31
|
+
from cirq.study.sweepable import (
|
|
32
|
+
Sweepable as Sweepable,
|
|
33
|
+
to_resolvers as to_resolvers,
|
|
34
|
+
to_sweep as to_sweep,
|
|
35
|
+
to_sweeps as to_sweeps,
|
|
36
|
+
)
|
|
32
37
|
|
|
33
38
|
from cirq.study.sweeps import (
|
|
34
|
-
Linspace,
|
|
35
|
-
ListSweep,
|
|
36
|
-
Points,
|
|
37
|
-
Product,
|
|
38
|
-
Sweep,
|
|
39
|
-
UNIT_SWEEP,
|
|
40
|
-
UnitSweep,
|
|
41
|
-
Zip,
|
|
42
|
-
ZipLongest,
|
|
43
|
-
dict_to_product_sweep,
|
|
44
|
-
dict_to_zip_sweep,
|
|
39
|
+
Linspace as Linspace,
|
|
40
|
+
ListSweep as ListSweep,
|
|
41
|
+
Points as Points,
|
|
42
|
+
Product as Product,
|
|
43
|
+
Sweep as Sweep,
|
|
44
|
+
UNIT_SWEEP as UNIT_SWEEP,
|
|
45
|
+
UnitSweep as UnitSweep,
|
|
46
|
+
Zip as Zip,
|
|
47
|
+
ZipLongest as ZipLongest,
|
|
48
|
+
dict_to_product_sweep as dict_to_product_sweep,
|
|
49
|
+
dict_to_zip_sweep as dict_to_zip_sweep,
|
|
45
50
|
)
|
|
46
51
|
|
|
47
|
-
from cirq.study.result import ResultDict, Result
|
|
52
|
+
from cirq.study.result import ResultDict as ResultDict, Result as Result
|