cirq-core 1.5.0.dev20250327175906__py3-none-any.whl → 1.5.0.dev20250327210023__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.

Files changed (415) hide show
  1. cirq/_compat_test.py +11 -9
  2. cirq/_import.py +6 -7
  3. cirq/_version.py +1 -1
  4. cirq/_version_test.py +1 -1
  5. cirq/circuits/_block_diagram_drawer.py +1 -2
  6. cirq/circuits/_block_diagram_drawer_test.py +3 -3
  7. cirq/circuits/_box_drawing_character_data.py +0 -1
  8. cirq/circuits/_box_drawing_character_data_test.py +2 -2
  9. cirq/circuits/_bucket_priority_queue.py +0 -1
  10. cirq/circuits/_bucket_priority_queue_test.py +1 -1
  11. cirq/circuits/circuit.py +1 -1
  12. cirq/circuits/circuit_operation.py +1 -1
  13. cirq/circuits/circuit_test.py +2 -3
  14. cirq/circuits/frozen_circuit.py +1 -1
  15. cirq/circuits/moment.py +4 -5
  16. cirq/circuits/optimization_pass.py +1 -1
  17. cirq/circuits/optimization_pass_test.py +3 -2
  18. cirq/circuits/qasm_output.py +3 -3
  19. cirq/circuits/qasm_output_test.py +2 -1
  20. cirq/circuits/text_diagram_drawer.py +3 -3
  21. cirq/circuits/text_diagram_drawer_test.py +5 -4
  22. cirq/contrib/acquaintance/bipartite.py +1 -2
  23. cirq/contrib/acquaintance/bipartite_test.py +0 -1
  24. cirq/contrib/acquaintance/devices.py +3 -4
  25. cirq/contrib/acquaintance/devices_test.py +0 -1
  26. cirq/contrib/acquaintance/executor.py +4 -6
  27. cirq/contrib/acquaintance/executor_test.py +2 -2
  28. cirq/contrib/acquaintance/gates.py +2 -3
  29. cirq/contrib/acquaintance/gates_test.py +1 -1
  30. cirq/contrib/acquaintance/inspection_utils.py +1 -2
  31. cirq/contrib/acquaintance/inspection_utils_test.py +1 -1
  32. cirq/contrib/acquaintance/mutation_utils.py +2 -4
  33. cirq/contrib/acquaintance/optimizers.py +2 -3
  34. cirq/contrib/acquaintance/optimizers_test.py +1 -1
  35. cirq/contrib/acquaintance/permutation.py +1 -1
  36. cirq/contrib/acquaintance/permutation_test.py +1 -1
  37. cirq/contrib/acquaintance/shift.py +1 -1
  38. cirq/contrib/acquaintance/strategies/complete.py +0 -1
  39. cirq/contrib/acquaintance/strategies/cubic.py +1 -1
  40. cirq/contrib/circuitdag/circuit_dag.py +2 -2
  41. cirq/contrib/circuitdag/circuit_dag_test.py +1 -1
  42. cirq/contrib/graph_device/graph_device.py +1 -3
  43. cirq/contrib/graph_device/graph_device_test.py +0 -1
  44. cirq/contrib/graph_device/hypergraph_test.py +1 -0
  45. cirq/contrib/json_test.py +2 -2
  46. cirq/contrib/noise_models/noise_models.py +1 -1
  47. cirq/contrib/paulistring/clifford_optimize.py +1 -1
  48. cirq/contrib/paulistring/clifford_optimize_test.py +0 -1
  49. cirq/contrib/paulistring/clifford_target_gateset.py +3 -3
  50. cirq/contrib/paulistring/optimize.py +2 -2
  51. cirq/contrib/paulistring/optimize_test.py +0 -1
  52. cirq/contrib/paulistring/pauli_string_dag_test.py +0 -1
  53. cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation.py +3 -3
  54. cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation_test.py +3 -4
  55. cirq/contrib/paulistring/pauli_string_optimize_test.py +1 -2
  56. cirq/contrib/paulistring/recombine.py +2 -2
  57. cirq/contrib/paulistring/recombine_test.py +1 -1
  58. cirq/contrib/paulistring/separate.py +1 -2
  59. cirq/contrib/qasm_import/_lexer.py +1 -0
  60. cirq/contrib/qasm_import/_lexer_test.py +1 -0
  61. cirq/contrib/qasm_import/_parser.py +2 -3
  62. cirq/contrib/qasm_import/_parser_test.py +1 -1
  63. cirq/contrib/qasm_import/qasm_test.py +1 -1
  64. cirq/contrib/quantum_volume/quantum_volume.py +1 -1
  65. cirq/contrib/quantum_volume/quantum_volume_test.py +3 -1
  66. cirq/contrib/quimb/density_matrix.py +1 -1
  67. cirq/contrib/quimb/state_vector.py +1 -1
  68. cirq/contrib/quirk/export_to_quirk.py +3 -3
  69. cirq/contrib/routing/device.py +1 -1
  70. cirq/contrib/routing/device_test.py +1 -2
  71. cirq/contrib/routing/greedy.py +2 -2
  72. cirq/contrib/routing/initialization_test.py +1 -1
  73. cirq/contrib/routing/swap_network.py +1 -1
  74. cirq/contrib/routing/utils.py +2 -2
  75. cirq/contrib/routing/utils_test.py +1 -2
  76. cirq/contrib/shuffle_circuits/shuffle_circuits_with_readout_benchmarking.py +2 -2
  77. cirq/contrib/shuffle_circuits/shuffle_circuits_with_readout_benchmarking_test.py +6 -4
  78. cirq/contrib/svg/svg.py +2 -3
  79. cirq/devices/device.py +3 -1
  80. cirq/devices/device_test.py +1 -0
  81. cirq/devices/grid_device_metadata.py +2 -1
  82. cirq/devices/grid_device_metadata_test.py +2 -1
  83. cirq/devices/grid_qubit.py +2 -2
  84. cirq/devices/insertion_noise_model.py +1 -1
  85. cirq/devices/insertion_noise_model_test.py +1 -1
  86. cirq/devices/line_qubit.py +1 -0
  87. cirq/devices/named_topologies.py +6 -6
  88. cirq/devices/named_topologies_test.py +5 -4
  89. cirq/devices/noise_model.py +2 -2
  90. cirq/devices/noise_properties.py +2 -2
  91. cirq/devices/noise_properties_test.py +2 -2
  92. cirq/devices/noise_utils.py +3 -3
  93. cirq/devices/superconducting_qubits_noise_properties.py +2 -2
  94. cirq/devices/superconducting_qubits_noise_properties_test.py +3 -3
  95. cirq/devices/thermal_noise_model.py +2 -1
  96. cirq/devices/unconstrained_device.py +1 -1
  97. cirq/experiments/qubit_characterizations.py +9 -10
  98. cirq/experiments/qubit_characterizations_test.py +4 -6
  99. cirq/experiments/random_quantum_circuit_generation.py +3 -4
  100. cirq/experiments/random_quantum_circuit_generation_test.py +4 -4
  101. cirq/experiments/readout_confusion_matrix.py +5 -3
  102. cirq/experiments/readout_confusion_matrix_test.py +2 -2
  103. cirq/experiments/single_qubit_readout_calibration.py +5 -4
  104. cirq/experiments/single_qubit_readout_calibration_test.py +1 -1
  105. cirq/experiments/t1_decay_experiment.py +4 -5
  106. cirq/experiments/t1_decay_experiment_test.py +1 -2
  107. cirq/experiments/t2_decay_experiment.py +0 -1
  108. cirq/experiments/t2_decay_experiment_test.py +1 -2
  109. cirq/experiments/two_qubit_xeb.py +13 -10
  110. cirq/experiments/two_qubit_xeb_test.py +3 -4
  111. cirq/experiments/xeb_fitting.py +6 -3
  112. cirq/experiments/xeb_fitting_test.py +5 -5
  113. cirq/experiments/xeb_sampling.py +5 -5
  114. cirq/experiments/xeb_simulation.py +3 -2
  115. cirq/experiments/z_phase_calibration.py +4 -3
  116. cirq/experiments/z_phase_calibration_test.py +4 -5
  117. cirq/interop/quirk/cells/arithmetic_cells.py +8 -8
  118. cirq/interop/quirk/cells/arithmetic_cells_test.py +1 -1
  119. cirq/interop/quirk/cells/cell.py +6 -6
  120. cirq/interop/quirk/cells/composite_cell.py +5 -5
  121. cirq/interop/quirk/cells/composite_cell_test.py +1 -1
  122. cirq/interop/quirk/cells/frequency_space_cells.py +2 -2
  123. cirq/interop/quirk/cells/ignored_cells.py +1 -1
  124. cirq/interop/quirk/cells/input_cells.py +1 -1
  125. cirq/interop/quirk/cells/input_cells_test.py +1 -1
  126. cirq/interop/quirk/cells/input_rotation_cells.py +1 -1
  127. cirq/interop/quirk/cells/input_rotation_cells_test.py +1 -1
  128. cirq/interop/quirk/cells/measurement_cells.py +1 -1
  129. cirq/interop/quirk/cells/parse.py +3 -4
  130. cirq/interop/quirk/cells/parse_test.py +1 -1
  131. cirq/interop/quirk/cells/single_qubit_rotation_cells.py +1 -1
  132. cirq/interop/quirk/cells/swap_cell_test.py +1 -1
  133. cirq/interop/quirk/cells/unsupported_cells.py +1 -1
  134. cirq/interop/quirk/url_to_circuit.py +7 -7
  135. cirq/interop/quirk/url_to_circuit_test.py +1 -1
  136. cirq/json_resolver_cache.py +6 -5
  137. cirq/linalg/combinators.py +2 -2
  138. cirq/linalg/combinators_test.py +1 -1
  139. cirq/linalg/decompositions.py +2 -2
  140. cirq/linalg/decompositions_test.py +1 -2
  141. cirq/linalg/diagonalize.py +1 -1
  142. cirq/linalg/diagonalize_test.py +1 -1
  143. cirq/linalg/predicates.py +2 -2
  144. cirq/linalg/predicates_test.py +1 -0
  145. cirq/linalg/tolerance.py +1 -1
  146. cirq/neutral_atoms/convert_to_neutral_atom_gates_test.py +0 -1
  147. cirq/ops/arithmetic_operation.py +2 -2
  148. cirq/ops/arithmetic_operation_test.py +2 -2
  149. cirq/ops/classically_controlled_operation.py +2 -2
  150. cirq/ops/clifford_gate.py +3 -3
  151. cirq/ops/clifford_gate_test.py +1 -1
  152. cirq/ops/common_channels.py +2 -2
  153. cirq/ops/common_gate_families.py +1 -1
  154. cirq/ops/common_gate_families_test.py +1 -0
  155. cirq/ops/common_gates.py +3 -3
  156. cirq/ops/control_values.py +2 -2
  157. cirq/ops/control_values_test.py +2 -1
  158. cirq/ops/controlled_gate.py +2 -2
  159. cirq/ops/controlled_operation.py +3 -3
  160. cirq/ops/dense_pauli_string.py +3 -3
  161. cirq/ops/diagonal_gate.py +1 -1
  162. cirq/ops/diagonal_gate_test.py +1 -0
  163. cirq/ops/eigen_gate.py +1 -1
  164. cirq/ops/eigen_gate_test.py +1 -1
  165. cirq/ops/fourier_transform.py +1 -1
  166. cirq/ops/fourier_transform_test.py +2 -1
  167. cirq/ops/gate_operation.py +5 -5
  168. cirq/ops/gateset_test.py +4 -2
  169. cirq/ops/global_phase_op.py +3 -3
  170. cirq/ops/identity.py +1 -1
  171. cirq/ops/kraus_channel.py +1 -0
  172. cirq/ops/kraus_channel_test.py +2 -1
  173. cirq/ops/linear_combinations.py +9 -9
  174. cirq/ops/matrix_gates.py +2 -2
  175. cirq/ops/measure_util.py +2 -2
  176. cirq/ops/measurement_gate.py +1 -1
  177. cirq/ops/measurement_gate_test.py +1 -0
  178. cirq/ops/mixed_unitary_channel.py +1 -0
  179. cirq/ops/mixed_unitary_channel_test.py +2 -1
  180. cirq/ops/named_qubit.py +0 -1
  181. cirq/ops/op_tree.py +1 -1
  182. cirq/ops/parallel_gate.py +1 -1
  183. cirq/ops/parallel_gate_test.py +2 -1
  184. cirq/ops/parity_gates.py +5 -6
  185. cirq/ops/pauli_gates.py +4 -5
  186. cirq/ops/pauli_gates_test.py +1 -0
  187. cirq/ops/pauli_interaction_gate.py +3 -3
  188. cirq/ops/pauli_interaction_gate_test.py +2 -3
  189. cirq/ops/pauli_measurement_gate.py +4 -4
  190. cirq/ops/pauli_string.py +5 -5
  191. cirq/ops/pauli_string_phasor.py +6 -7
  192. cirq/ops/pauli_string_phasor_test.py +2 -1
  193. cirq/ops/pauli_string_raw_types.py +1 -0
  194. cirq/ops/pauli_sum_exponential.py +1 -1
  195. cirq/ops/pauli_sum_exponential_test.py +0 -1
  196. cirq/ops/permutation_gate_test.py +1 -1
  197. cirq/ops/phased_x_gate.py +3 -4
  198. cirq/ops/phased_x_z_gate.py +3 -3
  199. cirq/ops/qubit_manager.py +2 -1
  200. cirq/ops/qubit_manager_test.py +2 -1
  201. cirq/ops/qubit_order.py +1 -1
  202. cirq/ops/random_gate_channel.py +1 -1
  203. cirq/ops/raw_types.py +4 -4
  204. cirq/ops/raw_types_test.py +2 -2
  205. cirq/ops/state_preparation_channel.py +2 -2
  206. cirq/ops/state_preparation_channel_test.py +2 -1
  207. cirq/ops/swap_gates.py +2 -2
  208. cirq/ops/three_qubit_gates.py +2 -3
  209. cirq/ops/three_qubit_gates_test.py +1 -0
  210. cirq/ops/two_qubit_diagonal_gate.py +3 -2
  211. cirq/ops/uniform_superposition_gate.py +3 -3
  212. cirq/ops/uniform_superposition_gate_test.py +1 -0
  213. cirq/ops/wait_gate.py +1 -1
  214. cirq/protocols/act_on_protocol_test.py +1 -1
  215. cirq/protocols/apply_channel_protocol.py +2 -2
  216. cirq/protocols/apply_mixture_protocol.py +1 -1
  217. cirq/protocols/approximate_equality_protocol.py +3 -4
  218. cirq/protocols/approximate_equality_protocol_test.py +3 -1
  219. cirq/protocols/circuit_diagram_info_protocol.py +5 -5
  220. cirq/protocols/decompose_protocol.py +3 -4
  221. cirq/protocols/decompose_protocol_test.py +1 -0
  222. cirq/protocols/equal_up_to_global_phase_protocol_test.py +1 -0
  223. cirq/protocols/has_stabilizer_effect_protocol.py +5 -5
  224. cirq/protocols/has_unitary_protocol.py +1 -1
  225. cirq/protocols/inverse_protocol.py +1 -1
  226. cirq/protocols/json_serialization_test.py +1 -1
  227. cirq/protocols/kraus_protocol.py +1 -2
  228. cirq/protocols/kraus_protocol_test.py +0 -1
  229. cirq/protocols/mixture_protocol_test.py +1 -2
  230. cirq/protocols/pauli_expansion_protocol.py +1 -0
  231. cirq/protocols/pow_protocol.py +1 -1
  232. cirq/protocols/qasm.py +1 -1
  233. cirq/protocols/qid_shape_protocol.py +1 -1
  234. cirq/protocols/resolve_parameters.py +1 -2
  235. cirq/protocols/resolve_parameters_test.py +2 -1
  236. cirq/protocols/trace_distance_bound.py +1 -1
  237. cirq/protocols/trace_distance_bound_test.py +1 -0
  238. cirq/protocols/unitary_protocol.py +2 -2
  239. cirq/qis/clifford_tableau.py +2 -1
  240. cirq/qis/entropy.py +1 -1
  241. cirq/qis/entropy_test.py +2 -1
  242. cirq/qis/measures.py +3 -3
  243. cirq/qis/noise_utils_test.py +4 -4
  244. cirq/qis/quantum_state_representation.py +1 -1
  245. cirq/qis/states.py +3 -2
  246. cirq/sim/classical_simulator.py +7 -6
  247. cirq/sim/classical_simulator_test.py +3 -1
  248. cirq/sim/clifford/stabilizer_state_ch_form.py +1 -0
  249. cirq/sim/density_matrix_simulator.py +1 -1
  250. cirq/sim/density_matrix_utils.py +1 -1
  251. cirq/sim/mux.py +2 -2
  252. cirq/sim/simulation_state.py +3 -4
  253. cirq/sim/simulation_state_base.py +1 -1
  254. cirq/sim/simulation_utils_test.py +2 -3
  255. cirq/sim/simulator_base.py +5 -5
  256. cirq/sim/simulator_test.py +2 -2
  257. cirq/sim/sparse_simulator.py +2 -2
  258. cirq/sim/sparse_simulator_test.py +1 -1
  259. cirq/sim/state_vector.py +2 -2
  260. cirq/sim/state_vector_simulator.py +4 -4
  261. cirq/study/flatten_expressions.py +2 -2
  262. cirq/study/flatten_expressions_test.py +1 -1
  263. cirq/study/resolver.py +1 -0
  264. cirq/study/result.py +3 -3
  265. cirq/study/sweepable.py +3 -2
  266. cirq/study/sweeps.py +4 -4
  267. cirq/study/sweeps_test.py +1 -0
  268. cirq/testing/circuit_compare.py +3 -4
  269. cirq/testing/circuit_compare_test.py +1 -2
  270. cirq/testing/consistent_act_on.py +3 -3
  271. cirq/testing/consistent_channels_test.py +2 -1
  272. cirq/testing/consistent_controlled_gate_op.py +3 -2
  273. cirq/testing/consistent_controlled_gate_op_test.py +2 -3
  274. cirq/testing/consistent_decomposition.py +1 -1
  275. cirq/testing/consistent_decomposition_test.py +1 -2
  276. cirq/testing/consistent_phase_by.py +1 -1
  277. cirq/testing/consistent_phase_by_test.py +1 -2
  278. cirq/testing/consistent_protocols.py +9 -9
  279. cirq/testing/consistent_protocols_test.py +3 -4
  280. cirq/testing/consistent_qasm.py +1 -1
  281. cirq/testing/consistent_qasm_test.py +1 -1
  282. cirq/testing/consistent_resolve_parameters.py +2 -1
  283. cirq/testing/consistent_specified_has_unitary_test.py +1 -1
  284. cirq/testing/consistent_unitary.py +3 -1
  285. cirq/testing/consistent_unitary_test.py +3 -3
  286. cirq/testing/devices.py +1 -1
  287. cirq/testing/devices_test.py +1 -0
  288. cirq/testing/equals_tester.py +1 -3
  289. cirq/testing/equals_tester_test.py +1 -0
  290. cirq/testing/equivalent_basis_map.py +1 -0
  291. cirq/testing/equivalent_basis_map_test.py +0 -1
  292. cirq/testing/json.py +2 -3
  293. cirq/testing/lin_alg_utils_test.py +1 -1
  294. cirq/testing/order_tester.py +1 -1
  295. cirq/testing/order_tester_test.py +1 -1
  296. cirq/testing/random_circuit.py +2 -2
  297. cirq/testing/random_circuit_test.py +1 -1
  298. cirq/testing/routing_devices_test.py +2 -1
  299. cirq/testing/sample_circuits.py +1 -1
  300. cirq/testing/sample_gates.py +3 -2
  301. cirq/testing/sample_gates_test.py +2 -2
  302. cirq/transformers/align.py +1 -0
  303. cirq/transformers/analytical_decompositions/clifford_decomposition.py +2 -1
  304. cirq/transformers/analytical_decompositions/clifford_decomposition_test.py +1 -1
  305. cirq/transformers/analytical_decompositions/controlled_gate_decomposition.py +1 -1
  306. cirq/transformers/analytical_decompositions/cphase_to_fsim_test.py +1 -1
  307. cirq/transformers/analytical_decompositions/pauli_string_decomposition.py +2 -2
  308. cirq/transformers/analytical_decompositions/pauli_string_decomposition_test.py +4 -4
  309. cirq/transformers/analytical_decompositions/quantum_shannon_decomposition.py +6 -7
  310. cirq/transformers/analytical_decompositions/quantum_shannon_decomposition_test.py +5 -5
  311. cirq/transformers/analytical_decompositions/single_qubit_decompositions.py +1 -1
  312. cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry.py +1 -1
  313. cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry_test.py +1 -0
  314. cirq/transformers/analytical_decompositions/three_qubit_decomposition.py +2 -3
  315. cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py +1 -1
  316. cirq/transformers/analytical_decompositions/two_qubit_state_preparation.py +2 -1
  317. cirq/transformers/analytical_decompositions/two_qubit_state_preparation_test.py +2 -1
  318. cirq/transformers/analytical_decompositions/two_qubit_to_cz.py +5 -6
  319. cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py +2 -2
  320. cirq/transformers/analytical_decompositions/two_qubit_to_fsim.py +1 -1
  321. cirq/transformers/analytical_decompositions/two_qubit_to_fsim_test.py +1 -2
  322. cirq/transformers/analytical_decompositions/two_qubit_to_ms.py +2 -2
  323. cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap.py +1 -1
  324. cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap_test.py +2 -1
  325. cirq/transformers/drop_empty_moments.py +1 -0
  326. cirq/transformers/drop_negligible_operations.py +1 -0
  327. cirq/transformers/dynamical_decoupling.py +7 -7
  328. cirq/transformers/dynamical_decoupling_test.py +4 -2
  329. cirq/transformers/eject_phased_paulis.py +4 -3
  330. cirq/transformers/eject_phased_paulis_test.py +1 -1
  331. cirq/transformers/eject_z.py +2 -1
  332. cirq/transformers/eject_z_test.py +1 -1
  333. cirq/transformers/gauge_compiling/cphase_gauge.py +5 -5
  334. cirq/transformers/gauge_compiling/cz_gauge.py +4 -4
  335. cirq/transformers/gauge_compiling/gauge_compiling.py +9 -9
  336. cirq/transformers/gauge_compiling/gauge_compiling_test.py +8 -6
  337. cirq/transformers/gauge_compiling/gauge_compiling_test_utils.py +2 -2
  338. cirq/transformers/gauge_compiling/gauge_compiling_test_utils_test.py +2 -1
  339. cirq/transformers/gauge_compiling/iswap_gauge.py +2 -2
  340. cirq/transformers/gauge_compiling/spin_inversion_gauge.py +2 -2
  341. cirq/transformers/gauge_compiling/sqrt_cz_gauge.py +5 -5
  342. cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py +3 -2
  343. cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils.py +2 -1
  344. cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils_test.py +1 -1
  345. cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation.py +4 -4
  346. cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation_test.py +4 -4
  347. cirq/transformers/insertion_sort.py +1 -1
  348. cirq/transformers/merge_k_qubit_gates.py +2 -2
  349. cirq/transformers/merge_single_qubit_gates.py +1 -1
  350. cirq/transformers/noise_adding.py +4 -3
  351. cirq/transformers/noise_adding_test.py +3 -2
  352. cirq/transformers/optimize_for_target_gateset.py +1 -1
  353. cirq/transformers/optimize_for_target_gateset_test.py +2 -1
  354. cirq/transformers/randomized_measurements.py +2 -1
  355. cirq/transformers/randomized_measurements_test.py +2 -1
  356. cirq/transformers/routing/initial_mapper.py +1 -1
  357. cirq/transformers/routing/initial_mapper_test.py +1 -0
  358. cirq/transformers/routing/line_initial_mapper.py +3 -2
  359. cirq/transformers/routing/mapping_manager.py +2 -2
  360. cirq/transformers/routing/mapping_manager_test.py +2 -2
  361. cirq/transformers/routing/route_circuit_cqc.py +3 -2
  362. cirq/transformers/routing/route_circuit_cqc_test.py +2 -1
  363. cirq/transformers/routing/visualize_routed_circuit.py +1 -0
  364. cirq/transformers/routing/visualize_routed_circuit_test.py +1 -0
  365. cirq/transformers/stratify.py +2 -2
  366. cirq/transformers/synchronize_terminal_measurements.py +2 -1
  367. cirq/transformers/target_gatesets/compilation_target_gateset.py +1 -2
  368. cirq/transformers/target_gatesets/compilation_target_gateset_test.py +2 -0
  369. cirq/transformers/target_gatesets/cz_gateset.py +1 -1
  370. cirq/transformers/target_gatesets/cz_gateset_test.py +4 -2
  371. cirq/transformers/target_gatesets/sqrt_iswap_gateset.py +1 -1
  372. cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py +3 -2
  373. cirq/transformers/transformer_api.py +5 -4
  374. cirq/transformers/transformer_api_test.py +3 -3
  375. cirq/transformers/transformer_primitives.py +3 -4
  376. cirq/transformers/transformer_primitives_test.py +1 -0
  377. cirq/value/abc_alt.py +1 -2
  378. cirq/value/angle.py +2 -0
  379. cirq/value/classical_data.py +1 -0
  380. cirq/value/digits.py +1 -1
  381. cirq/value/duration.py +3 -3
  382. cirq/value/duration_test.py +2 -1
  383. cirq/value/linear_dict.py +2 -1
  384. cirq/value/measurement_key.py +1 -2
  385. cirq/value/periodic_value.py +0 -1
  386. cirq/value/probability.py +1 -0
  387. cirq/value/random_state.py +1 -1
  388. cirq/value/timestamp_test.py +2 -1
  389. cirq/value/value_equality_attr.py +1 -1
  390. cirq/vis/density_matrix.py +1 -1
  391. cirq/vis/density_matrix_test.py +2 -5
  392. cirq/vis/heatmap.py +0 -1
  393. cirq/vis/heatmap_test.py +2 -3
  394. cirq/vis/histogram.py +1 -1
  395. cirq/vis/histogram_test.py +1 -2
  396. cirq/vis/state_histogram.py +4 -2
  397. cirq/vis/state_histogram_test.py +2 -2
  398. cirq/work/collector.py +1 -1
  399. cirq/work/observable_grouping.py +2 -2
  400. cirq/work/observable_measurement.py +3 -3
  401. cirq/work/observable_measurement_data.py +2 -2
  402. cirq/work/observable_measurement_test.py +8 -8
  403. cirq/work/observable_readout_calibration.py +2 -2
  404. cirq/work/observable_readout_calibration_test.py +2 -1
  405. cirq/work/observable_settings.py +6 -6
  406. cirq/work/observable_settings_test.py +2 -2
  407. cirq/work/pauli_sum_collector.py +1 -1
  408. cirq/work/sampler.py +2 -3
  409. cirq/work/sampler_test.py +1 -2
  410. cirq/work/zeros_sampler.py +1 -1
  411. {cirq_core-1.5.0.dev20250327175906.dist-info → cirq_core-1.5.0.dev20250327210023.dist-info}/METADATA +1 -1
  412. {cirq_core-1.5.0.dev20250327175906.dist-info → cirq_core-1.5.0.dev20250327210023.dist-info}/RECORD +415 -415
  413. {cirq_core-1.5.0.dev20250327175906.dist-info → cirq_core-1.5.0.dev20250327210023.dist-info}/LICENSE +0 -0
  414. {cirq_core-1.5.0.dev20250327175906.dist-info → cirq_core-1.5.0.dev20250327210023.dist-info}/WHEEL +0 -0
  415. {cirq_core-1.5.0.dev20250327175906.dist-info → cirq_core-1.5.0.dev20250327210023.dist-info}/top_level.txt +0 -0
@@ -12,13 +12,13 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Iterator, Sequence, Any, Dict, TYPE_CHECKING
15
+ from typing import Any, Dict, Iterator, Sequence, TYPE_CHECKING
16
16
 
17
17
  import numpy as np
18
+
19
+ from cirq.ops import raw_types
18
20
  from cirq.ops.common_gates import H, ry
19
21
  from cirq.ops.pauli_gates import X
20
- from cirq.ops import raw_types
21
-
22
22
 
23
23
  if TYPE_CHECKING:
24
24
  import cirq
@@ -14,6 +14,7 @@
14
14
 
15
15
  import numpy as np
16
16
  import pytest
17
+
17
18
  import cirq
18
19
 
19
20
 
cirq/ops/wait_gate.py CHANGED
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
  from typing import AbstractSet, Any, Dict, Optional, Tuple, TYPE_CHECKING
15
15
 
16
- from cirq import value, protocols
16
+ from cirq import protocols, value
17
17
  from cirq.ops import raw_types
18
18
 
19
19
  if TYPE_CHECKING:
@@ -12,10 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  from typing import Any, Sequence, Tuple
15
- from typing_extensions import Self
16
15
 
17
16
  import numpy as np
18
17
  import pytest
18
+ from typing_extensions import Self
19
19
 
20
20
  import cirq
21
21
 
@@ -15,16 +15,16 @@
15
15
  """A protocol for implementing high performance channel evolutions."""
16
16
 
17
17
  from types import NotImplementedType
18
- from typing import Any, Iterable, Optional, Sequence, TypeVar, Tuple, Union
18
+ from typing import Any, Iterable, Optional, Sequence, Tuple, TypeVar, Union
19
19
 
20
20
  import numpy as np
21
21
  from typing_extensions import Protocol
22
22
 
23
23
  from cirq import linalg
24
24
  from cirq._doc import doc_private
25
+ from cirq.protocols import qid_shape_protocol
25
26
  from cirq.protocols.apply_unitary_protocol import apply_unitary, ApplyUnitaryArgs
26
27
  from cirq.protocols.kraus_protocol import kraus
27
- from cirq.protocols import qid_shape_protocol
28
28
 
29
29
  # This is a special indicator value used by the apply_channel method
30
30
  # to determine whether or not the caller provided a 'default' argument. It must
@@ -22,9 +22,9 @@ from typing_extensions import Protocol
22
22
 
23
23
  from cirq import linalg
24
24
  from cirq._doc import doc_private
25
+ from cirq.protocols import qid_shape_protocol
25
26
  from cirq.protocols.apply_unitary_protocol import apply_unitary, ApplyUnitaryArgs
26
27
  from cirq.protocols.mixture_protocol import mixture
27
- from cirq.protocols import qid_shape_protocol
28
28
 
29
29
  # This is a special indicator value used by the apply_mixture method
30
30
  # to determine whether or not the caller provided a 'default' argument. It must
@@ -12,14 +12,13 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, Iterable
16
- from fractions import Fraction
15
+ import numbers
17
16
  from decimal import Decimal
17
+ from fractions import Fraction
18
+ from typing import Any, Iterable
18
19
 
19
- import numbers
20
20
  import numpy as np
21
21
  import sympy
22
-
23
22
  from typing_extensions import Protocol
24
23
 
25
24
  from cirq._doc import doc_private
@@ -12,12 +12,14 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from fractions import Fraction
16
15
  from decimal import Decimal
16
+ from fractions import Fraction
17
17
  from numbers import Number
18
+
18
19
  import numpy as np
19
20
  import pytest
20
21
  import sympy
22
+
21
23
  import cirq
22
24
 
23
25
 
@@ -16,15 +16,15 @@ import re
16
16
  from fractions import Fraction
17
17
  from typing import (
18
18
  Any,
19
- TYPE_CHECKING,
20
- Optional,
21
- Union,
22
- TypeVar,
23
19
  Dict,
24
- overload,
25
20
  Iterable,
26
21
  List,
22
+ Optional,
23
+ overload,
27
24
  Sequence,
25
+ TYPE_CHECKING,
26
+ TypeVar,
27
+ Union,
28
28
  )
29
29
 
30
30
  import numpy as np
@@ -11,13 +11,12 @@
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
- import itertools
15
14
  import dataclasses
16
15
  import inspect
16
+ import itertools
17
17
  from collections import defaultdict
18
18
  from types import NotImplementedType
19
19
  from typing import (
20
- TYPE_CHECKING,
21
20
  Any,
22
21
  Callable,
23
22
  Dict,
@@ -28,12 +27,12 @@ from typing import (
28
27
  overload,
29
28
  Sequence,
30
29
  Tuple,
30
+ TYPE_CHECKING,
31
31
  TypeVar,
32
32
  Union,
33
33
  )
34
- from typing_extensions import runtime_checkable
35
34
 
36
- from typing_extensions import Protocol
35
+ from typing_extensions import Protocol, runtime_checkable
37
36
 
38
37
  from cirq import devices, ops
39
38
  from cirq._doc import doc_private
@@ -14,6 +14,7 @@
14
14
  import itertools
15
15
  from typing import Optional
16
16
  from unittest import mock
17
+
17
18
  import pytest
18
19
 
19
20
  import cirq
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  import numpy as np
15
+
15
16
  import cirq
16
17
 
17
18
 
@@ -14,13 +14,13 @@
14
14
 
15
15
  from typing import Any, Optional
16
16
 
17
- from cirq.ops.clifford_gate import SingleQubitCliffordGate
18
- from cirq.ops.dense_pauli_string import DensePauliString
19
- from cirq._import import LazyLoader
20
- import cirq.protocols.unitary_protocol as unitary_protocol
17
+ import cirq.protocols.decompose_protocol as decompose_protocol
21
18
  import cirq.protocols.has_unitary_protocol as has_unitary_protocol
22
19
  import cirq.protocols.qid_shape_protocol as qid_shape_protocol
23
- import cirq.protocols.decompose_protocol as decompose_protocol
20
+ import cirq.protocols.unitary_protocol as unitary_protocol
21
+ from cirq._import import LazyLoader
22
+ from cirq.ops.clifford_gate import SingleQubitCliffordGate
23
+ from cirq.ops.dense_pauli_string import DensePauliString
24
24
 
25
25
  pauli_string_decomposition = LazyLoader(
26
26
  "pauli_string_decomposition",
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, TypeVar, Optional
15
+ from typing import Any, Optional, TypeVar
16
16
 
17
17
  import numpy as np
18
18
  from typing_extensions import Protocol
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, List, overload, Tuple, TYPE_CHECKING, TypeVar, Union, Iterable
15
+ from typing import Any, Iterable, List, overload, Tuple, TYPE_CHECKING, TypeVar, Union
16
16
 
17
17
  from cirq import ops
18
18
 
@@ -33,7 +33,7 @@ import sympy
33
33
  import cirq
34
34
  from cirq._compat import proper_eq
35
35
  from cirq.protocols import json_serialization
36
- from cirq.testing.json import ModuleJsonTestSpec, spec_for, assert_json_roundtrip_works
36
+ from cirq.testing.json import assert_json_roundtrip_works, ModuleJsonTestSpec, spec_for
37
37
 
38
38
  REPO_ROOT = pathlib.Path(__file__).parent.parent.parent.parent
39
39
 
@@ -14,9 +14,9 @@
14
14
 
15
15
  """Protocol and methods for obtaining Kraus representation of quantum channels."""
16
16
 
17
+ import warnings
17
18
  from types import NotImplementedType
18
19
  from typing import Any, Sequence, Tuple, TypeVar, Union
19
- import warnings
20
20
 
21
21
  import numpy as np
22
22
  from typing_extensions import Protocol
@@ -25,7 +25,6 @@ from cirq._doc import doc_private
25
25
  from cirq.protocols.decompose_protocol import _try_decompose_into_operations_and_qubits
26
26
  from cirq.protocols.mixture_protocol import has_mixture
27
27
 
28
-
29
28
  # This is a special indicator value used by the channel method to determine
30
29
  # whether or not the caller provided a 'default' argument. It must be of type
31
30
  # Sequence[np.ndarray] to ensure the method has the correct type signature in
@@ -21,7 +21,6 @@ import pytest
21
21
 
22
22
  import cirq
23
23
 
24
-
25
24
  LOCAL_DEFAULT: List[np.ndarray] = [np.array([])]
26
25
 
27
26
 
@@ -12,9 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import pytest
16
-
17
15
  import numpy as np
16
+ import pytest
18
17
 
19
18
  import cirq
20
19
 
@@ -14,6 +14,7 @@
14
14
  """Protocol for obtaining expansion of linear operators in Pauli basis."""
15
15
 
16
16
  from typing import Any, TypeVar, Union
17
+
17
18
  from typing_extensions import Protocol
18
19
 
19
20
  from cirq import value
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, Callable, Optional, overload, TypeVar, TYPE_CHECKING, Union
15
+ from typing import Any, Callable, Optional, overload, TYPE_CHECKING, TypeVar, Union
16
16
 
17
17
  if TYPE_CHECKING:
18
18
  import cirq
cirq/protocols/qasm.py CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  import string
16
16
  from types import NotImplementedType
17
- from typing import TYPE_CHECKING, Union, Any, Tuple, TypeVar, Optional, Dict, Iterable
17
+ from typing import Any, Dict, Iterable, Optional, Tuple, TYPE_CHECKING, TypeVar, Union
18
18
 
19
19
  from typing_extensions import Protocol
20
20
 
@@ -18,7 +18,7 @@ from typing import Any, Sequence, Tuple, TypeVar, Union
18
18
  from typing_extensions import Protocol
19
19
 
20
20
  from cirq import ops
21
- from cirq._doc import document, doc_private
21
+ from cirq._doc import doc_private, document
22
22
 
23
23
  # This is a special indicator value used by the methods to determine whether or
24
24
  # not the caller provided a 'default' argument. It must be of type
@@ -14,10 +14,9 @@
14
14
 
15
15
  import numbers
16
16
  from typing import AbstractSet, Any, cast, TYPE_CHECKING, TypeVar
17
- from typing_extensions import Self
18
17
 
19
18
  import sympy
20
- from typing_extensions import Protocol
19
+ from typing_extensions import Protocol, Self
21
20
 
22
21
  from cirq import study
23
22
  from cirq._doc import doc_private
@@ -12,7 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import pytest, sympy
15
+ import pytest
16
+ import sympy
16
17
 
17
18
  import cirq
18
19
  from cirq.study import ParamResolver
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, TypeVar, Optional, Sequence, Union
15
+ from typing import Any, Optional, Sequence, TypeVar, Union
16
16
 
17
17
  import numpy as np
18
18
  from typing_extensions import Protocol
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import numpy as np
16
+
16
17
  import cirq
17
18
 
18
19
 
@@ -13,14 +13,14 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from types import NotImplementedType
16
- from typing import Any, TypeVar, Union, Optional
16
+ from typing import Any, Optional, TypeVar, Union
17
17
 
18
18
  import numpy as np
19
19
  from typing_extensions import Protocol
20
20
 
21
21
  from cirq._doc import doc_private
22
22
  from cirq.protocols import qid_shape_protocol
23
- from cirq.protocols.apply_unitary_protocol import ApplyUnitaryArgs, apply_unitaries
23
+ from cirq.protocols.apply_unitary_protocol import apply_unitaries, ApplyUnitaryArgs
24
24
  from cirq.protocols.decompose_protocol import _try_decompose_into_operations_and_qubits
25
25
 
26
26
  # This is a special indicator value used by the unitary method to determine
@@ -14,10 +14,11 @@
14
14
 
15
15
  import abc
16
16
  from typing import Any, Dict, List, Optional, Sequence, TYPE_CHECKING
17
+
17
18
  import numpy as np
18
19
 
19
20
  from cirq import protocols
20
- from cirq._compat import proper_repr, _method_cache_name, cached_method
21
+ from cirq._compat import _method_cache_name, cached_method, proper_repr
21
22
  from cirq.qis import quantum_state_representation
22
23
  from cirq.value import big_endian_int_to_digits, linear_dict, random_state
23
24
 
cirq/qis/entropy.py CHANGED
@@ -12,8 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from concurrent.futures import ThreadPoolExecutor
16
15
  from collections.abc import Sequence
16
+ from concurrent.futures import ThreadPoolExecutor
17
17
  from itertools import product
18
18
  from typing import Any, Optional
19
19
 
cirq/qis/entropy_test.py CHANGED
@@ -13,8 +13,9 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from concurrent.futures import ThreadPoolExecutor
16
- import pytest
16
+
17
17
  import numpy as np
18
+ import pytest
18
19
 
19
20
  from cirq.qis.entropy import process_renyi_entropy_from_bitstrings
20
21
 
cirq/qis/measures.py CHANGED
@@ -14,15 +14,15 @@
14
14
  """Measures on and between quantum states and operations."""
15
15
 
16
16
 
17
- from typing import Optional, TYPE_CHECKING, Tuple
17
+ from typing import Optional, Tuple, TYPE_CHECKING
18
18
 
19
19
  import numpy as np
20
20
 
21
- from cirq import protocols, value, _import
21
+ from cirq import _import, protocols, value
22
22
  from cirq.qis.states import (
23
- QuantumState,
24
23
  infer_qid_shape,
25
24
  quantum_state,
25
+ QuantumState,
26
26
  validate_density_matrix,
27
27
  validate_normalized_state_vector,
28
28
  )
@@ -16,13 +16,13 @@ import numpy as np
16
16
  import pytest
17
17
 
18
18
  from cirq.qis.noise_utils import (
19
- decay_constant_to_xeb_fidelity,
19
+ average_error,
20
20
  decay_constant_to_pauli_error,
21
+ decay_constant_to_xeb_fidelity,
22
+ decoherence_pauli_error,
23
+ pauli_error_from_t1,
21
24
  pauli_error_to_decay_constant,
22
25
  xeb_fidelity_to_decay_constant,
23
- pauli_error_from_t1,
24
- average_error,
25
- decoherence_pauli_error,
26
26
  )
27
27
 
28
28
 
@@ -14,9 +14,9 @@
14
14
 
15
15
  import abc
16
16
  from typing import List, Sequence, Tuple, TYPE_CHECKING
17
- from typing_extensions import Self
18
17
 
19
18
  import numpy as np
19
+ from typing_extensions import Self
20
20
 
21
21
  from cirq import value
22
22
 
cirq/qis/states.py CHANGED
@@ -14,8 +14,8 @@
14
14
 
15
15
  """Classes and methods for quantum states."""
16
16
 
17
- from typing import Any, cast, Iterable, List, Optional, Sequence, Set, TYPE_CHECKING, Tuple, Union
18
17
  import itertools
18
+ from typing import Any, cast, Iterable, List, Optional, Sequence, Set, Tuple, TYPE_CHECKING, Union
19
19
 
20
20
  import numpy as np
21
21
 
@@ -23,9 +23,10 @@ from cirq import value
23
23
  from cirq._doc import document
24
24
 
25
25
  if TYPE_CHECKING:
26
- import cirq
27
26
  from numpy.typing import DTypeLike
28
27
 
28
+ import cirq
29
+
29
30
  DEFAULT_COMPLEX_DTYPE = np.complex64
30
31
 
31
32
  STATE_VECTOR_LIKE = Union[
@@ -13,14 +13,15 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- from typing import Dict, Generic, Any, Sequence, List, Optional, Union, TYPE_CHECKING
17
- from copy import deepcopy, copy
18
- from cirq import ops, qis
19
- from cirq.value import big_endian_int_to_bits
20
- from cirq import sim
21
- from cirq.sim.simulation_state import TSimulationState, SimulationState
16
+ from copy import copy, deepcopy
17
+ from typing import Any, Dict, Generic, List, Optional, Sequence, TYPE_CHECKING, Union
18
+
22
19
  import numpy as np
23
20
 
21
+ from cirq import ops, qis, sim
22
+ from cirq.sim.simulation_state import SimulationState, TSimulationState
23
+ from cirq.value import big_endian_int_to_bits
24
+
24
25
  if TYPE_CHECKING:
25
26
  import cirq
26
27
 
@@ -13,11 +13,13 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from itertools import product
16
+
16
17
  import numpy as np
17
18
  import pytest
18
- import cirq
19
19
  import sympy
20
20
 
21
+ import cirq
22
+
21
23
 
22
24
  def test_x_gate():
23
25
  q0, q1 = cirq.LineQubit.range(2)
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from typing import Any, Dict, List, Sequence
16
+
16
17
  import numpy as np
17
18
 
18
19
  import cirq
@@ -18,7 +18,7 @@ import numpy as np
18
18
 
19
19
  from cirq import ops, protocols, study, value
20
20
  from cirq._compat import proper_repr
21
- from cirq.sim import simulator, density_matrix_simulation_state, simulator_base
21
+ from cirq.sim import density_matrix_simulation_state, simulator, simulator_base
22
22
 
23
23
  if TYPE_CHECKING:
24
24
  import cirq
@@ -14,7 +14,7 @@
14
14
 
15
15
  """Code to handle density matrices."""
16
16
 
17
- from typing import List, Optional, TYPE_CHECKING, Tuple, Sequence
17
+ from typing import List, Optional, Sequence, Tuple, TYPE_CHECKING
18
18
 
19
19
  import numpy as np
20
20
 
cirq/sim/mux.py CHANGED
@@ -21,9 +21,9 @@ from typing import List, Optional, Sequence, Type, TYPE_CHECKING, Union
21
21
 
22
22
  import numpy as np
23
23
 
24
- from cirq import circuits, protocols, study, devices, ops, value
24
+ from cirq import circuits, devices, ops, protocols, study, value
25
25
  from cirq._doc import document
26
- from cirq.sim import sparse_simulator, density_matrix_simulator
26
+ from cirq.sim import density_matrix_simulator, sparse_simulator
27
27
  from cirq.sim.clifford import clifford_simulator
28
28
  from cirq.transformers import measurement_transformers
29
29
 
@@ -24,16 +24,15 @@ from typing import (
24
24
  Optional,
25
25
  Sequence,
26
26
  Set,
27
- TypeVar,
28
- TYPE_CHECKING,
29
27
  Tuple,
28
+ TYPE_CHECKING,
29
+ TypeVar,
30
30
  )
31
- from typing_extensions import Self
32
31
 
33
32
  import numpy as np
33
+ from typing_extensions import Self
34
34
 
35
35
  from cirq import ops, protocols, value
36
-
37
36
  from cirq.sim.simulation_state_base import SimulationStateBase
38
37
 
39
38
  TState = TypeVar('TState', bound='cirq.QuantumStateRepresentation')
@@ -28,9 +28,9 @@ from typing import (
28
28
  TypeVar,
29
29
  Union,
30
30
  )
31
- from typing_extensions import Self
32
31
 
33
32
  import numpy as np
33
+ from typing_extensions import Self
34
34
 
35
35
  from cirq import protocols, value
36
36
 
@@ -11,12 +11,11 @@
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
- import pytest
15
-
16
14
  import numpy as np
15
+ import pytest
17
16
 
18
- from cirq.sim import simulation_utils
19
17
  from cirq import testing
18
+ from cirq.sim import simulation_utils
20
19
 
21
20
 
22
21
  @pytest.mark.parametrize('n,m', [(n, m) for n in range(1, 4) for m in range(1, n + 1)])
@@ -20,15 +20,15 @@ from typing import (
20
20
  Any,
21
21
  cast,
22
22
  Dict,
23
- Iterator,
24
23
  Generic,
24
+ Iterator,
25
25
  List,
26
26
  Optional,
27
27
  Sequence,
28
28
  Tuple,
29
29
  Type,
30
- TypeVar,
31
30
  TYPE_CHECKING,
31
+ TypeVar,
32
32
  )
33
33
 
34
34
  import numpy as np
@@ -38,13 +38,13 @@ from cirq.sim.simulation_product_state import SimulationProductState
38
38
  from cirq.sim.simulation_state import TSimulationState
39
39
  from cirq.sim.simulation_state_base import SimulationStateBase
40
40
  from cirq.sim.simulator import (
41
- TSimulationTrialResult,
41
+ check_all_resolved,
42
42
  SimulatesIntermediateState,
43
43
  SimulatesSamples,
44
- StepResult,
45
44
  SimulationTrialResult,
46
- check_all_resolved,
47
45
  split_into_matching_protocol_then_general,
46
+ StepResult,
47
+ TSimulationTrialResult,
48
48
  )
49
49
 
50
50
  if TYPE_CHECKING: