cirq-core 1.5.0.dev20250327205617__py3-none-any.whl → 1.5.0.dev20250328173208__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/_compat_test.py +11 -9
- cirq/_import.py +6 -7
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/circuits/_block_diagram_drawer.py +1 -2
- cirq/circuits/_block_diagram_drawer_test.py +3 -3
- cirq/circuits/_box_drawing_character_data.py +0 -1
- cirq/circuits/_box_drawing_character_data_test.py +2 -2
- cirq/circuits/_bucket_priority_queue.py +0 -1
- cirq/circuits/_bucket_priority_queue_test.py +1 -1
- cirq/circuits/circuit.py +1 -1
- cirq/circuits/circuit_operation.py +1 -1
- cirq/circuits/circuit_test.py +2 -3
- cirq/circuits/frozen_circuit.py +1 -1
- cirq/circuits/moment.py +4 -5
- cirq/circuits/optimization_pass.py +1 -1
- cirq/circuits/optimization_pass_test.py +3 -2
- cirq/circuits/qasm_output.py +3 -3
- cirq/circuits/qasm_output_test.py +2 -1
- cirq/circuits/text_diagram_drawer.py +3 -3
- cirq/circuits/text_diagram_drawer_test.py +5 -4
- cirq/contrib/acquaintance/bipartite.py +1 -2
- cirq/contrib/acquaintance/bipartite_test.py +0 -1
- cirq/contrib/acquaintance/devices.py +3 -4
- cirq/contrib/acquaintance/devices_test.py +0 -1
- cirq/contrib/acquaintance/executor.py +4 -6
- cirq/contrib/acquaintance/executor_test.py +2 -2
- cirq/contrib/acquaintance/gates.py +2 -3
- cirq/contrib/acquaintance/gates_test.py +1 -1
- cirq/contrib/acquaintance/inspection_utils.py +1 -2
- cirq/contrib/acquaintance/inspection_utils_test.py +1 -1
- cirq/contrib/acquaintance/mutation_utils.py +2 -4
- cirq/contrib/acquaintance/optimizers.py +2 -3
- cirq/contrib/acquaintance/optimizers_test.py +1 -1
- cirq/contrib/acquaintance/permutation.py +1 -1
- cirq/contrib/acquaintance/permutation_test.py +1 -1
- cirq/contrib/acquaintance/shift.py +1 -1
- cirq/contrib/acquaintance/strategies/complete.py +0 -1
- cirq/contrib/acquaintance/strategies/cubic.py +1 -1
- cirq/contrib/circuitdag/circuit_dag.py +2 -2
- cirq/contrib/circuitdag/circuit_dag_test.py +1 -1
- cirq/contrib/graph_device/graph_device.py +1 -3
- cirq/contrib/graph_device/graph_device_test.py +0 -1
- cirq/contrib/graph_device/hypergraph_test.py +1 -0
- cirq/contrib/json_test.py +2 -2
- cirq/contrib/noise_models/noise_models.py +1 -1
- cirq/contrib/paulistring/clifford_optimize.py +1 -1
- cirq/contrib/paulistring/clifford_optimize_test.py +0 -1
- cirq/contrib/paulistring/clifford_target_gateset.py +3 -3
- cirq/contrib/paulistring/optimize.py +2 -2
- cirq/contrib/paulistring/optimize_test.py +0 -1
- cirq/contrib/paulistring/pauli_string_dag_test.py +0 -1
- cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation.py +3 -3
- cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation_test.py +3 -4
- cirq/contrib/paulistring/pauli_string_optimize_test.py +1 -2
- cirq/contrib/paulistring/recombine.py +2 -2
- cirq/contrib/paulistring/recombine_test.py +1 -1
- cirq/contrib/paulistring/separate.py +1 -2
- cirq/contrib/qasm_import/_lexer.py +1 -0
- cirq/contrib/qasm_import/_lexer_test.py +1 -0
- cirq/contrib/qasm_import/_parser.py +2 -3
- cirq/contrib/qasm_import/_parser_test.py +1 -1
- cirq/contrib/qasm_import/qasm_test.py +1 -1
- cirq/contrib/quantum_volume/quantum_volume.py +1 -1
- cirq/contrib/quantum_volume/quantum_volume_test.py +3 -1
- cirq/contrib/quimb/density_matrix.py +1 -1
- cirq/contrib/quimb/state_vector.py +1 -1
- cirq/contrib/quirk/export_to_quirk.py +3 -3
- cirq/contrib/routing/device.py +1 -1
- cirq/contrib/routing/device_test.py +1 -2
- cirq/contrib/routing/greedy.py +2 -2
- cirq/contrib/routing/initialization_test.py +1 -1
- cirq/contrib/routing/swap_network.py +1 -1
- cirq/contrib/routing/utils.py +2 -2
- cirq/contrib/routing/utils_test.py +1 -2
- cirq/contrib/shuffle_circuits/shuffle_circuits_with_readout_benchmarking.py +2 -2
- cirq/contrib/shuffle_circuits/shuffle_circuits_with_readout_benchmarking_test.py +6 -4
- cirq/contrib/svg/svg.py +2 -3
- cirq/devices/device.py +3 -1
- cirq/devices/device_test.py +1 -0
- cirq/devices/grid_device_metadata.py +2 -1
- cirq/devices/grid_device_metadata_test.py +2 -1
- cirq/devices/grid_qubit.py +2 -2
- cirq/devices/insertion_noise_model.py +1 -1
- cirq/devices/insertion_noise_model_test.py +1 -1
- cirq/devices/line_qubit.py +1 -0
- cirq/devices/named_topologies.py +6 -6
- cirq/devices/named_topologies_test.py +5 -4
- cirq/devices/noise_model.py +2 -2
- cirq/devices/noise_properties.py +2 -2
- cirq/devices/noise_properties_test.py +2 -2
- cirq/devices/noise_utils.py +3 -3
- cirq/devices/superconducting_qubits_noise_properties.py +2 -2
- cirq/devices/superconducting_qubits_noise_properties_test.py +3 -3
- cirq/devices/thermal_noise_model.py +2 -1
- cirq/devices/unconstrained_device.py +1 -1
- cirq/experiments/qubit_characterizations.py +9 -10
- cirq/experiments/qubit_characterizations_test.py +4 -6
- cirq/experiments/random_quantum_circuit_generation.py +3 -4
- cirq/experiments/random_quantum_circuit_generation_test.py +4 -4
- cirq/experiments/readout_confusion_matrix.py +5 -3
- cirq/experiments/readout_confusion_matrix_test.py +2 -2
- cirq/experiments/single_qubit_readout_calibration.py +5 -4
- cirq/experiments/single_qubit_readout_calibration_test.py +1 -1
- cirq/experiments/t1_decay_experiment.py +4 -5
- cirq/experiments/t1_decay_experiment_test.py +1 -2
- cirq/experiments/t2_decay_experiment.py +0 -1
- cirq/experiments/t2_decay_experiment_test.py +1 -2
- cirq/experiments/two_qubit_xeb.py +13 -10
- cirq/experiments/two_qubit_xeb_test.py +3 -4
- cirq/experiments/xeb_fitting.py +6 -3
- cirq/experiments/xeb_fitting_test.py +5 -5
- cirq/experiments/xeb_sampling.py +5 -5
- cirq/experiments/xeb_simulation.py +3 -2
- cirq/experiments/z_phase_calibration.py +4 -3
- cirq/experiments/z_phase_calibration_test.py +4 -5
- cirq/interop/quirk/cells/arithmetic_cells.py +8 -8
- cirq/interop/quirk/cells/arithmetic_cells_test.py +1 -1
- cirq/interop/quirk/cells/cell.py +6 -6
- cirq/interop/quirk/cells/composite_cell.py +5 -5
- cirq/interop/quirk/cells/composite_cell_test.py +1 -1
- cirq/interop/quirk/cells/frequency_space_cells.py +2 -2
- cirq/interop/quirk/cells/ignored_cells.py +1 -1
- cirq/interop/quirk/cells/input_cells.py +1 -1
- cirq/interop/quirk/cells/input_cells_test.py +1 -1
- cirq/interop/quirk/cells/input_rotation_cells.py +1 -1
- cirq/interop/quirk/cells/input_rotation_cells_test.py +1 -1
- cirq/interop/quirk/cells/measurement_cells.py +1 -1
- cirq/interop/quirk/cells/parse.py +3 -4
- cirq/interop/quirk/cells/parse_test.py +1 -1
- cirq/interop/quirk/cells/single_qubit_rotation_cells.py +1 -1
- cirq/interop/quirk/cells/swap_cell_test.py +1 -1
- cirq/interop/quirk/cells/unsupported_cells.py +1 -1
- cirq/interop/quirk/url_to_circuit.py +7 -7
- cirq/interop/quirk/url_to_circuit_test.py +1 -1
- cirq/json_resolver_cache.py +6 -5
- cirq/linalg/combinators.py +2 -2
- cirq/linalg/combinators_test.py +1 -1
- cirq/linalg/decompositions.py +2 -2
- cirq/linalg/decompositions_test.py +1 -2
- cirq/linalg/diagonalize.py +1 -1
- cirq/linalg/diagonalize_test.py +1 -1
- cirq/linalg/predicates.py +2 -2
- cirq/linalg/predicates_test.py +1 -0
- cirq/linalg/tolerance.py +1 -1
- cirq/neutral_atoms/convert_to_neutral_atom_gates_test.py +0 -1
- cirq/ops/arithmetic_operation.py +2 -2
- cirq/ops/arithmetic_operation_test.py +2 -2
- cirq/ops/classically_controlled_operation.py +2 -2
- cirq/ops/clifford_gate.py +3 -3
- cirq/ops/clifford_gate_test.py +1 -1
- cirq/ops/common_channels.py +2 -2
- cirq/ops/common_gate_families.py +1 -1
- cirq/ops/common_gate_families_test.py +1 -0
- cirq/ops/common_gates.py +3 -3
- cirq/ops/control_values.py +2 -2
- cirq/ops/control_values_test.py +2 -1
- cirq/ops/controlled_gate.py +2 -2
- cirq/ops/controlled_operation.py +3 -3
- cirq/ops/dense_pauli_string.py +3 -3
- cirq/ops/diagonal_gate.py +1 -1
- cirq/ops/diagonal_gate_test.py +1 -0
- cirq/ops/eigen_gate.py +1 -1
- cirq/ops/eigen_gate_test.py +1 -1
- cirq/ops/fourier_transform.py +1 -1
- cirq/ops/fourier_transform_test.py +2 -1
- cirq/ops/gate_operation.py +5 -5
- cirq/ops/gateset_test.py +4 -2
- cirq/ops/global_phase_op.py +3 -3
- cirq/ops/identity.py +1 -1
- cirq/ops/kraus_channel.py +1 -0
- cirq/ops/kraus_channel_test.py +2 -1
- cirq/ops/linear_combinations.py +9 -9
- cirq/ops/matrix_gates.py +2 -2
- cirq/ops/measure_util.py +2 -2
- cirq/ops/measurement_gate.py +1 -1
- cirq/ops/measurement_gate_test.py +1 -0
- cirq/ops/mixed_unitary_channel.py +1 -0
- cirq/ops/mixed_unitary_channel_test.py +2 -1
- cirq/ops/named_qubit.py +0 -1
- cirq/ops/op_tree.py +1 -1
- cirq/ops/parallel_gate.py +1 -1
- cirq/ops/parallel_gate_test.py +2 -1
- cirq/ops/parity_gates.py +5 -6
- cirq/ops/pauli_gates.py +4 -5
- cirq/ops/pauli_gates_test.py +1 -0
- cirq/ops/pauli_interaction_gate.py +3 -3
- cirq/ops/pauli_interaction_gate_test.py +2 -3
- cirq/ops/pauli_measurement_gate.py +4 -4
- cirq/ops/pauli_string.py +5 -5
- cirq/ops/pauli_string_phasor.py +6 -7
- cirq/ops/pauli_string_phasor_test.py +2 -1
- cirq/ops/pauli_string_raw_types.py +1 -0
- cirq/ops/pauli_sum_exponential.py +1 -1
- cirq/ops/pauli_sum_exponential_test.py +0 -1
- cirq/ops/permutation_gate_test.py +1 -1
- cirq/ops/phased_x_gate.py +3 -4
- cirq/ops/phased_x_z_gate.py +3 -3
- cirq/ops/qubit_manager.py +2 -1
- cirq/ops/qubit_manager_test.py +2 -1
- cirq/ops/qubit_order.py +1 -1
- cirq/ops/random_gate_channel.py +1 -1
- cirq/ops/raw_types.py +4 -4
- cirq/ops/raw_types_test.py +2 -2
- cirq/ops/state_preparation_channel.py +2 -2
- cirq/ops/state_preparation_channel_test.py +2 -1
- cirq/ops/swap_gates.py +2 -2
- cirq/ops/three_qubit_gates.py +2 -3
- cirq/ops/three_qubit_gates_test.py +1 -0
- cirq/ops/two_qubit_diagonal_gate.py +3 -2
- cirq/ops/uniform_superposition_gate.py +3 -3
- cirq/ops/uniform_superposition_gate_test.py +1 -0
- cirq/ops/wait_gate.py +1 -1
- cirq/protocols/act_on_protocol_test.py +1 -1
- cirq/protocols/apply_channel_protocol.py +2 -2
- cirq/protocols/apply_mixture_protocol.py +1 -1
- cirq/protocols/approximate_equality_protocol.py +3 -4
- cirq/protocols/approximate_equality_protocol_test.py +3 -1
- cirq/protocols/circuit_diagram_info_protocol.py +5 -5
- cirq/protocols/decompose_protocol.py +3 -4
- cirq/protocols/decompose_protocol_test.py +1 -0
- cirq/protocols/equal_up_to_global_phase_protocol_test.py +1 -0
- cirq/protocols/has_stabilizer_effect_protocol.py +5 -5
- cirq/protocols/has_unitary_protocol.py +1 -1
- cirq/protocols/inverse_protocol.py +1 -1
- cirq/protocols/json_serialization_test.py +1 -1
- cirq/protocols/kraus_protocol.py +1 -2
- cirq/protocols/kraus_protocol_test.py +0 -1
- cirq/protocols/mixture_protocol_test.py +1 -2
- cirq/protocols/pauli_expansion_protocol.py +1 -0
- cirq/protocols/pow_protocol.py +1 -1
- cirq/protocols/qasm.py +1 -1
- cirq/protocols/qid_shape_protocol.py +1 -1
- cirq/protocols/resolve_parameters.py +1 -2
- cirq/protocols/resolve_parameters_test.py +2 -1
- cirq/protocols/trace_distance_bound.py +1 -1
- cirq/protocols/trace_distance_bound_test.py +1 -0
- cirq/protocols/unitary_protocol.py +2 -2
- cirq/qis/clifford_tableau.py +2 -1
- cirq/qis/entropy.py +1 -1
- cirq/qis/entropy_test.py +2 -1
- cirq/qis/measures.py +3 -3
- cirq/qis/noise_utils_test.py +4 -4
- cirq/qis/quantum_state_representation.py +1 -1
- cirq/qis/states.py +3 -2
- cirq/sim/classical_simulator.py +7 -6
- cirq/sim/classical_simulator_test.py +3 -1
- cirq/sim/clifford/stabilizer_state_ch_form.py +1 -0
- cirq/sim/density_matrix_simulator.py +1 -1
- cirq/sim/density_matrix_utils.py +1 -1
- cirq/sim/mux.py +2 -2
- cirq/sim/simulation_state.py +3 -4
- cirq/sim/simulation_state_base.py +1 -1
- cirq/sim/simulation_utils_test.py +2 -3
- cirq/sim/simulator_base.py +5 -5
- cirq/sim/simulator_test.py +2 -2
- cirq/sim/sparse_simulator.py +2 -2
- cirq/sim/sparse_simulator_test.py +1 -1
- cirq/sim/state_vector.py +2 -2
- cirq/sim/state_vector_simulator.py +4 -4
- cirq/study/flatten_expressions.py +2 -2
- cirq/study/flatten_expressions_test.py +1 -1
- cirq/study/resolver.py +1 -0
- cirq/study/result.py +3 -3
- cirq/study/sweepable.py +3 -2
- cirq/study/sweeps.py +4 -4
- cirq/study/sweeps_test.py +1 -0
- cirq/testing/circuit_compare.py +3 -4
- cirq/testing/circuit_compare_test.py +1 -2
- cirq/testing/consistent_act_on.py +3 -3
- cirq/testing/consistent_channels_test.py +2 -1
- cirq/testing/consistent_controlled_gate_op.py +3 -2
- cirq/testing/consistent_controlled_gate_op_test.py +2 -3
- cirq/testing/consistent_decomposition.py +1 -1
- cirq/testing/consistent_decomposition_test.py +1 -2
- cirq/testing/consistent_phase_by.py +1 -1
- cirq/testing/consistent_phase_by_test.py +1 -2
- cirq/testing/consistent_protocols.py +9 -9
- cirq/testing/consistent_protocols_test.py +3 -4
- cirq/testing/consistent_qasm.py +1 -1
- cirq/testing/consistent_qasm_test.py +1 -1
- cirq/testing/consistent_resolve_parameters.py +2 -1
- cirq/testing/consistent_specified_has_unitary_test.py +1 -1
- cirq/testing/consistent_unitary.py +3 -1
- cirq/testing/consistent_unitary_test.py +3 -3
- cirq/testing/devices.py +1 -1
- cirq/testing/devices_test.py +1 -0
- cirq/testing/equals_tester.py +1 -3
- cirq/testing/equals_tester_test.py +1 -0
- cirq/testing/equivalent_basis_map.py +1 -0
- cirq/testing/equivalent_basis_map_test.py +0 -1
- cirq/testing/json.py +2 -3
- cirq/testing/lin_alg_utils_test.py +1 -1
- cirq/testing/order_tester.py +1 -1
- cirq/testing/order_tester_test.py +1 -1
- cirq/testing/random_circuit.py +2 -2
- cirq/testing/random_circuit_test.py +1 -1
- cirq/testing/routing_devices_test.py +2 -1
- cirq/testing/sample_circuits.py +1 -1
- cirq/testing/sample_gates.py +3 -2
- cirq/testing/sample_gates_test.py +2 -2
- cirq/transformers/align.py +1 -0
- cirq/transformers/analytical_decompositions/clifford_decomposition.py +2 -1
- cirq/transformers/analytical_decompositions/clifford_decomposition_test.py +1 -1
- cirq/transformers/analytical_decompositions/controlled_gate_decomposition.py +1 -1
- cirq/transformers/analytical_decompositions/cphase_to_fsim_test.py +1 -1
- cirq/transformers/analytical_decompositions/pauli_string_decomposition.py +2 -2
- cirq/transformers/analytical_decompositions/pauli_string_decomposition_test.py +4 -4
- cirq/transformers/analytical_decompositions/quantum_shannon_decomposition.py +6 -7
- cirq/transformers/analytical_decompositions/quantum_shannon_decomposition_test.py +5 -5
- cirq/transformers/analytical_decompositions/single_qubit_decompositions.py +1 -1
- cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry.py +1 -1
- cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry_test.py +1 -0
- cirq/transformers/analytical_decompositions/three_qubit_decomposition.py +2 -3
- cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py +1 -1
- cirq/transformers/analytical_decompositions/two_qubit_state_preparation.py +2 -1
- cirq/transformers/analytical_decompositions/two_qubit_state_preparation_test.py +2 -1
- cirq/transformers/analytical_decompositions/two_qubit_to_cz.py +5 -6
- cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py +2 -2
- cirq/transformers/analytical_decompositions/two_qubit_to_fsim.py +1 -1
- cirq/transformers/analytical_decompositions/two_qubit_to_fsim_test.py +1 -2
- cirq/transformers/analytical_decompositions/two_qubit_to_ms.py +2 -2
- cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap.py +1 -1
- cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap_test.py +2 -1
- cirq/transformers/drop_empty_moments.py +1 -0
- cirq/transformers/drop_negligible_operations.py +1 -0
- cirq/transformers/dynamical_decoupling.py +7 -7
- cirq/transformers/dynamical_decoupling_test.py +4 -2
- cirq/transformers/eject_phased_paulis.py +4 -3
- cirq/transformers/eject_phased_paulis_test.py +1 -1
- cirq/transformers/eject_z.py +2 -1
- cirq/transformers/eject_z_test.py +1 -1
- cirq/transformers/gauge_compiling/cphase_gauge.py +5 -5
- cirq/transformers/gauge_compiling/cz_gauge.py +4 -4
- cirq/transformers/gauge_compiling/gauge_compiling.py +9 -9
- cirq/transformers/gauge_compiling/gauge_compiling_test.py +8 -6
- cirq/transformers/gauge_compiling/gauge_compiling_test_utils.py +2 -2
- cirq/transformers/gauge_compiling/gauge_compiling_test_utils_test.py +2 -1
- cirq/transformers/gauge_compiling/iswap_gauge.py +2 -2
- cirq/transformers/gauge_compiling/spin_inversion_gauge.py +2 -2
- cirq/transformers/gauge_compiling/sqrt_cz_gauge.py +5 -5
- cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py +3 -2
- cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils.py +2 -1
- cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils_test.py +1 -1
- cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation.py +4 -4
- cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation_test.py +4 -4
- cirq/transformers/insertion_sort.py +1 -1
- cirq/transformers/merge_k_qubit_gates.py +2 -2
- cirq/transformers/merge_single_qubit_gates.py +1 -1
- cirq/transformers/noise_adding.py +4 -3
- cirq/transformers/noise_adding_test.py +3 -2
- cirq/transformers/optimize_for_target_gateset.py +1 -1
- cirq/transformers/optimize_for_target_gateset_test.py +2 -1
- cirq/transformers/randomized_measurements.py +2 -1
- cirq/transformers/randomized_measurements_test.py +2 -1
- cirq/transformers/routing/initial_mapper.py +1 -1
- cirq/transformers/routing/initial_mapper_test.py +1 -0
- cirq/transformers/routing/line_initial_mapper.py +3 -2
- cirq/transformers/routing/mapping_manager.py +2 -2
- cirq/transformers/routing/mapping_manager_test.py +2 -2
- cirq/transformers/routing/route_circuit_cqc.py +3 -2
- cirq/transformers/routing/route_circuit_cqc_test.py +2 -1
- cirq/transformers/routing/visualize_routed_circuit.py +1 -0
- cirq/transformers/routing/visualize_routed_circuit_test.py +1 -0
- cirq/transformers/stratify.py +2 -2
- cirq/transformers/synchronize_terminal_measurements.py +2 -1
- cirq/transformers/target_gatesets/compilation_target_gateset.py +1 -2
- cirq/transformers/target_gatesets/compilation_target_gateset_test.py +2 -0
- cirq/transformers/target_gatesets/cz_gateset.py +1 -1
- cirq/transformers/target_gatesets/cz_gateset_test.py +4 -2
- cirq/transformers/target_gatesets/sqrt_iswap_gateset.py +1 -1
- cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py +3 -2
- cirq/transformers/transformer_api.py +5 -4
- cirq/transformers/transformer_api_test.py +3 -3
- cirq/transformers/transformer_primitives.py +3 -4
- cirq/transformers/transformer_primitives_test.py +1 -0
- cirq/value/abc_alt.py +1 -2
- cirq/value/angle.py +2 -0
- cirq/value/classical_data.py +1 -0
- cirq/value/digits.py +1 -1
- cirq/value/duration.py +3 -3
- cirq/value/duration_test.py +2 -1
- cirq/value/linear_dict.py +2 -1
- cirq/value/measurement_key.py +1 -2
- cirq/value/periodic_value.py +0 -1
- cirq/value/probability.py +1 -0
- cirq/value/random_state.py +1 -1
- cirq/value/timestamp_test.py +2 -1
- cirq/value/value_equality_attr.py +1 -1
- cirq/vis/density_matrix.py +1 -1
- cirq/vis/density_matrix_test.py +2 -5
- cirq/vis/heatmap.py +0 -1
- cirq/vis/heatmap_test.py +2 -3
- cirq/vis/histogram.py +1 -1
- cirq/vis/histogram_test.py +1 -2
- cirq/vis/state_histogram.py +4 -2
- cirq/vis/state_histogram_test.py +2 -2
- cirq/work/collector.py +1 -1
- cirq/work/observable_grouping.py +2 -2
- cirq/work/observable_measurement.py +3 -3
- cirq/work/observable_measurement_data.py +2 -2
- cirq/work/observable_measurement_test.py +8 -8
- cirq/work/observable_readout_calibration.py +2 -2
- cirq/work/observable_readout_calibration_test.py +2 -1
- cirq/work/observable_settings.py +6 -6
- cirq/work/observable_settings_test.py +2 -2
- cirq/work/pauli_sum_collector.py +1 -1
- cirq/work/sampler.py +2 -3
- cirq/work/sampler_test.py +1 -2
- cirq/work/zeros_sampler.py +1 -1
- {cirq_core-1.5.0.dev20250327205617.dist-info → cirq_core-1.5.0.dev20250328173208.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250327205617.dist-info → cirq_core-1.5.0.dev20250328173208.dist-info}/RECORD +415 -415
- {cirq_core-1.5.0.dev20250327205617.dist-info → cirq_core-1.5.0.dev20250328173208.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250327205617.dist-info → cirq_core-1.5.0.dev20250328173208.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250327205617.dist-info → cirq_core-1.5.0.dev20250328173208.dist-info}/top_level.txt +0 -0
cirq/sim/simulator_test.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""Tests for simulator.py"""
|
|
15
15
|
import abc
|
|
16
|
-
from typing import
|
|
16
|
+
from typing import Any, Dict, Generic, List, Sequence, Union
|
|
17
17
|
from unittest import mock
|
|
18
18
|
|
|
19
19
|
import duet
|
|
@@ -24,13 +24,13 @@ import cirq
|
|
|
24
24
|
from cirq import study
|
|
25
25
|
from cirq.sim.simulation_state import TSimulationState
|
|
26
26
|
from cirq.sim.simulator import (
|
|
27
|
-
TStepResult,
|
|
28
27
|
SimulatesAmplitudes,
|
|
29
28
|
SimulatesExpectationValues,
|
|
30
29
|
SimulatesFinalState,
|
|
31
30
|
SimulatesIntermediateState,
|
|
32
31
|
SimulatesSamples,
|
|
33
32
|
SimulationTrialResult,
|
|
33
|
+
TStepResult,
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
|
cirq/sim/sparse_simulator.py
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
"""A simulator that uses numpy's einsum for sparse matrix operations."""
|
|
16
16
|
|
|
17
|
-
from typing import Any, Iterator, List,
|
|
17
|
+
from typing import Any, Iterator, List, Optional, Sequence, Type, TYPE_CHECKING, Union
|
|
18
18
|
|
|
19
19
|
import numpy as np
|
|
20
20
|
|
|
21
21
|
from cirq import ops
|
|
22
|
-
from cirq.sim import simulator, state_vector,
|
|
22
|
+
from cirq.sim import simulator, state_vector, state_vector_simulation_state, state_vector_simulator
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
25
|
import cirq
|
cirq/sim/state_vector.py
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"""Helpers for handling quantum state vectors."""
|
|
15
15
|
|
|
16
16
|
import abc
|
|
17
|
-
from typing import List, Mapping, Optional, Tuple, TYPE_CHECKING
|
|
17
|
+
from typing import List, Mapping, Optional, Sequence, Tuple, TYPE_CHECKING
|
|
18
18
|
|
|
19
19
|
import numpy as np
|
|
20
20
|
|
|
21
21
|
from cirq import linalg, qis, value
|
|
22
|
-
from cirq.sim import
|
|
22
|
+
from cirq.sim import simulation_utils, simulator
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
25
|
import cirq
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"""Abstract classes for simulations which keep track of state vector."""
|
|
15
15
|
|
|
16
16
|
import abc
|
|
17
|
-
from functools import cached_property
|
|
18
|
-
from typing import Any, Dict, Iterator, Sequence, Type, TYPE_CHECKING, Generic, TypeVar
|
|
19
17
|
import warnings
|
|
18
|
+
from functools import cached_property
|
|
19
|
+
from typing import Any, Dict, Generic, Iterator, Sequence, Type, TYPE_CHECKING, TypeVar
|
|
20
20
|
|
|
21
21
|
import numpy as np
|
|
22
22
|
|
|
23
|
-
from cirq import _compat, ops,
|
|
24
|
-
from cirq.sim import simulator, state_vector, simulator_base
|
|
23
|
+
from cirq import _compat, ops, qis, value
|
|
25
24
|
from cirq.protocols import qid_shape
|
|
25
|
+
from cirq.sim import simulator, simulator_base, state_vector
|
|
26
26
|
|
|
27
27
|
if TYPE_CHECKING:
|
|
28
28
|
import cirq
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""Resolves symbolic expressions to unique symbols."""
|
|
15
15
|
|
|
16
|
-
from typing import Any, Callable, List, Optional, Tuple, Union, TYPE_CHECKING
|
|
17
16
|
import numbers
|
|
17
|
+
from typing import Any, Callable, List, Optional, Tuple, TYPE_CHECKING, Union
|
|
18
18
|
|
|
19
19
|
import sympy
|
|
20
20
|
|
|
21
21
|
from cirq import protocols
|
|
22
|
-
from cirq.study import resolver,
|
|
22
|
+
from cirq.study import resolver, sweepable, sweeps
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
25
|
import cirq
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
import sympy
|
|
16
|
+
|
|
16
17
|
import cirq
|
|
17
18
|
from cirq.study import flatten_expressions
|
|
18
19
|
|
|
19
|
-
|
|
20
20
|
# None of the following tests use expressions of the form
|
|
21
21
|
# <constant term> - <other term> because the string of expressions containing
|
|
22
22
|
# exactly two terms, one constant term and one non-constant term with a negative
|
cirq/study/resolver.py
CHANGED
cirq/study/result.py
CHANGED
|
@@ -19,22 +19,22 @@ import io
|
|
|
19
19
|
from typing import (
|
|
20
20
|
Any,
|
|
21
21
|
Callable,
|
|
22
|
+
cast,
|
|
22
23
|
Dict,
|
|
23
24
|
Iterable,
|
|
24
25
|
Mapping,
|
|
25
26
|
Optional,
|
|
26
27
|
Sequence,
|
|
27
|
-
TYPE_CHECKING,
|
|
28
28
|
Tuple,
|
|
29
|
+
TYPE_CHECKING,
|
|
29
30
|
TypeVar,
|
|
30
31
|
Union,
|
|
31
|
-
cast,
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
import numpy as np
|
|
35
35
|
import pandas as pd
|
|
36
36
|
|
|
37
|
-
from cirq import
|
|
37
|
+
from cirq import ops, value
|
|
38
38
|
from cirq._compat import proper_repr
|
|
39
39
|
from cirq.study import resolver
|
|
40
40
|
|
cirq/study/sweepable.py
CHANGED
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
"""Defines which types are Sweepable."""
|
|
16
16
|
|
|
17
|
-
from typing import Iterable, Iterator, List, Optional, Sequence, Union, cast
|
|
18
17
|
import warnings
|
|
18
|
+
from typing import cast, Iterable, Iterator, List, Optional, Sequence, Union
|
|
19
|
+
|
|
19
20
|
from typing_extensions import Protocol
|
|
20
21
|
|
|
21
22
|
from cirq._doc import document
|
|
22
23
|
from cirq.study.resolver import ParamResolver, ParamResolverOrSimilarType
|
|
23
|
-
from cirq.study.sweeps import ListSweep, Points, Sweep, UnitSweep, Zip
|
|
24
|
+
from cirq.study.sweeps import dict_to_product_sweep, ListSweep, Points, Sweep, UnitSweep, Zip
|
|
24
25
|
|
|
25
26
|
SweepLike = Union[ParamResolverOrSimilarType, Sweep]
|
|
26
27
|
document(SweepLike, """An object similar to an iterable of parameter resolvers.""")
|
cirq/study/sweeps.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
import abc
|
|
15
|
+
import collections
|
|
16
|
+
import itertools
|
|
14
17
|
from typing import (
|
|
15
18
|
Any,
|
|
16
19
|
cast,
|
|
@@ -21,14 +24,11 @@ from typing import (
|
|
|
21
24
|
Optional,
|
|
22
25
|
overload,
|
|
23
26
|
Sequence,
|
|
24
|
-
TYPE_CHECKING,
|
|
25
27
|
Tuple,
|
|
28
|
+
TYPE_CHECKING,
|
|
26
29
|
Union,
|
|
27
30
|
)
|
|
28
31
|
|
|
29
|
-
import abc
|
|
30
|
-
import collections
|
|
31
|
-
import itertools
|
|
32
32
|
import sympy
|
|
33
33
|
|
|
34
34
|
from cirq import protocols
|
cirq/study/sweeps_test.py
CHANGED
cirq/testing/circuit_compare.py
CHANGED
|
@@ -12,16 +12,15 @@
|
|
|
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, Dict, Iterable, List, Optional, Sequence, Union
|
|
16
|
-
|
|
17
|
-
from collections import defaultdict
|
|
18
15
|
import itertools
|
|
19
16
|
import random
|
|
17
|
+
from collections import defaultdict
|
|
18
|
+
from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
|
|
20
19
|
|
|
21
20
|
import numpy as np
|
|
22
21
|
import sympy
|
|
23
22
|
|
|
24
|
-
from cirq import circuits,
|
|
23
|
+
from cirq import circuits, linalg, ops, protocols, qis
|
|
25
24
|
from cirq.testing import lin_alg_utils
|
|
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
|
from cirq.testing.circuit_compare import _assert_apply_unitary_works_when_axes_transposed
|
|
@@ -16,17 +16,17 @@ from typing import Any, cast, Optional, Type
|
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
|
|
19
|
+
from cirq import protocols
|
|
19
20
|
from cirq.circuits.circuit import Circuit
|
|
20
21
|
from cirq.devices import LineQubit
|
|
21
22
|
from cirq.ops import common_gates
|
|
22
23
|
from cirq.ops.dense_pauli_string import DensePauliString
|
|
23
|
-
from cirq import protocols
|
|
24
24
|
from cirq.qis import clifford_tableau
|
|
25
|
-
from cirq.sim import
|
|
25
|
+
from cirq.sim import final_state_vector, state_vector_simulation_state
|
|
26
26
|
from cirq.sim.clifford import (
|
|
27
27
|
clifford_tableau_simulation_state,
|
|
28
|
-
stabilizer_state_ch_form,
|
|
29
28
|
stabilizer_ch_form_simulation_state,
|
|
29
|
+
stabilizer_state_ch_form,
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import Collection, Optional, Sequence, Union
|
|
16
16
|
|
|
17
|
-
from cirq import devices, ops, protocols
|
|
18
17
|
import numpy as np
|
|
19
18
|
|
|
19
|
+
from cirq import devices, ops, protocols
|
|
20
|
+
|
|
20
21
|
|
|
21
22
|
def assert_controlled_and_controlled_by_identical(
|
|
22
23
|
gate: ops.Gate,
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import
|
|
16
|
-
|
|
17
|
-
import pytest
|
|
15
|
+
from typing import Collection, List, Optional, Sequence, Tuple, Union
|
|
18
16
|
|
|
19
17
|
import numpy as np
|
|
18
|
+
import pytest
|
|
20
19
|
|
|
21
20
|
import cirq
|
|
22
21
|
from cirq.ops import control_values as cv
|
|
@@ -19,28 +19,28 @@ import numpy as np
|
|
|
19
19
|
import sympy
|
|
20
20
|
|
|
21
21
|
from cirq import ops, protocols, value
|
|
22
|
-
from cirq.testing.consistent_act_on import assert_all_implemented_act_on_effects_match_unitary
|
|
23
22
|
from cirq.testing.circuit_compare import (
|
|
24
23
|
assert_has_consistent_apply_unitary,
|
|
25
24
|
assert_has_consistent_qid_shape,
|
|
26
25
|
)
|
|
26
|
+
from cirq.testing.consistent_act_on import assert_all_implemented_act_on_effects_match_unitary
|
|
27
|
+
from cirq.testing.consistent_controlled_gate_op import (
|
|
28
|
+
assert_controlled_and_controlled_by_identical,
|
|
29
|
+
assert_controlled_unitary_consistent,
|
|
30
|
+
)
|
|
27
31
|
from cirq.testing.consistent_decomposition import (
|
|
28
|
-
assert_decompose_is_consistent_with_unitary,
|
|
29
32
|
assert_decompose_ends_at_default_gateset,
|
|
33
|
+
assert_decompose_is_consistent_with_unitary,
|
|
30
34
|
)
|
|
31
|
-
from cirq.testing.consistent_phase_by import assert_phase_by_is_consistent_with_unitary
|
|
32
|
-
from cirq.testing.consistent_qasm import assert_qasm_is_consistent_with_unitary
|
|
33
35
|
from cirq.testing.consistent_pauli_expansion import (
|
|
34
36
|
assert_pauli_expansion_is_consistent_with_unitary,
|
|
35
37
|
)
|
|
38
|
+
from cirq.testing.consistent_phase_by import assert_phase_by_is_consistent_with_unitary
|
|
39
|
+
from cirq.testing.consistent_qasm import assert_qasm_is_consistent_with_unitary
|
|
36
40
|
from cirq.testing.consistent_resolve_parameters import assert_consistent_resolve_parameters
|
|
37
41
|
from cirq.testing.consistent_specified_has_unitary import assert_specifies_has_unitary_if_unitary
|
|
38
|
-
from cirq.testing.equivalent_repr_eval import assert_equivalent_repr
|
|
39
|
-
from cirq.testing.consistent_controlled_gate_op import (
|
|
40
|
-
assert_controlled_and_controlled_by_identical,
|
|
41
|
-
assert_controlled_unitary_consistent,
|
|
42
|
-
)
|
|
43
42
|
from cirq.testing.consistent_unitary import assert_unitary_is_consistent
|
|
43
|
+
from cirq.testing.equivalent_repr_eval import assert_equivalent_repr
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def assert_implements_consistent_protocols(
|
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from types import NotImplementedType
|
|
16
|
-
from typing import AbstractSet,
|
|
17
|
-
|
|
18
|
-
import pytest
|
|
16
|
+
from typing import AbstractSet, List, Sequence, Tuple, Union
|
|
19
17
|
|
|
20
18
|
import numpy as np
|
|
19
|
+
import pytest
|
|
21
20
|
import sympy
|
|
22
21
|
|
|
23
22
|
import cirq
|
|
24
|
-
from cirq._compat import proper_repr
|
|
25
23
|
import cirq.testing.consistent_controlled_gate_op_test as controlled_gate_op_test
|
|
24
|
+
from cirq._compat import proper_repr
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
class GoodGate(cirq.testing.SingleQubitGate):
|
cirq/testing/consistent_qasm.py
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
import cirq
|
|
16
|
-
|
|
17
|
-
import pytest
|
|
18
15
|
import numpy as np
|
|
16
|
+
import pytest
|
|
17
|
+
|
|
18
|
+
import cirq
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class InconsistentGate(cirq.Gate):
|
cirq/testing/devices.py
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""Provides test devices that can validate circuits."""
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import AbstractSet, cast, Tuple
|
|
16
16
|
|
|
17
17
|
from cirq import devices, ops
|
|
18
18
|
|
cirq/testing/devices_test.py
CHANGED
cirq/testing/equals_tester.py
CHANGED
|
@@ -21,10 +21,8 @@ equal to each other. It will also check that a==b implies hash(a)==hash(b).
|
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
import collections
|
|
24
|
-
|
|
25
|
-
from typing import Any, Callable, List, Tuple, Union
|
|
26
|
-
|
|
27
24
|
import itertools
|
|
25
|
+
from typing import Any, Callable, List, Tuple, Union
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
class EqualsTester:
|
cirq/testing/json.py
CHANGED
|
@@ -18,12 +18,13 @@ import io
|
|
|
18
18
|
import pathlib
|
|
19
19
|
from dataclasses import dataclass
|
|
20
20
|
from types import ModuleType
|
|
21
|
-
from typing import
|
|
21
|
+
from typing import Dict, Iterator, List, Set, Tuple, Type
|
|
22
22
|
|
|
23
23
|
import numpy as np
|
|
24
24
|
import pandas as pd
|
|
25
25
|
|
|
26
26
|
import cirq
|
|
27
|
+
from cirq.protocols.json_serialization import ObjectFactory
|
|
27
28
|
|
|
28
29
|
# This is the testing framework for json serialization
|
|
29
30
|
# The actual tests live in cirq.protocols.json_serialization_test.py.
|
|
@@ -37,8 +38,6 @@ import cirq
|
|
|
37
38
|
# - resolver cache: a resolver cache for the exposed types - see for example
|
|
38
39
|
# cirq/json_resolver_cache.py or cirq/google/json_resolver_cache.py
|
|
39
40
|
|
|
40
|
-
from cirq.protocols.json_serialization import ObjectFactory
|
|
41
|
-
|
|
42
41
|
|
|
43
42
|
@dataclass
|
|
44
43
|
class ModuleJsonTestSpec:
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import numpy as np
|
|
16
16
|
import pytest
|
|
17
17
|
|
|
18
|
+
from cirq.linalg import is_orthogonal, is_special_orthogonal, is_special_unitary, is_unitary
|
|
18
19
|
from cirq.testing import (
|
|
19
20
|
assert_allclose_up_to_global_phase,
|
|
20
21
|
random_density_matrix,
|
|
@@ -24,7 +25,6 @@ from cirq.testing import (
|
|
|
24
25
|
random_superposition,
|
|
25
26
|
random_unitary,
|
|
26
27
|
)
|
|
27
|
-
from cirq.linalg import is_unitary, is_orthogonal, is_special_unitary, is_special_orthogonal
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
@pytest.mark.parametrize('dim', range(1, 10))
|
cirq/testing/order_tester.py
CHANGED
|
@@ -24,8 +24,8 @@ It will also check that a==b implies hash(a)==hash(b).
|
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
26
|
from typing import Any
|
|
27
|
-
from cirq.testing.equals_tester import EqualsTester
|
|
28
27
|
|
|
28
|
+
from cirq.testing.equals_tester import EqualsTester
|
|
29
29
|
|
|
30
30
|
_NAMED_COMPARISON_OPERATORS = [
|
|
31
31
|
('<', lambda a, b: a < b),
|
cirq/testing/random_circuit.py
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import List,
|
|
15
|
+
from typing import Dict, List, Optional, Sequence, TYPE_CHECKING, Union
|
|
16
16
|
|
|
17
17
|
from cirq import circuits, ops, value
|
|
18
|
-
from cirq.ops import Qid
|
|
19
18
|
from cirq._doc import document
|
|
19
|
+
from cirq.ops import Qid
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
22
|
import cirq
|
|
@@ -11,8 +11,8 @@
|
|
|
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
|
-
from typing import Optional, Dict, Sequence, Union, cast
|
|
15
14
|
import random
|
|
15
|
+
from typing import cast, Dict, Optional, Sequence, Union
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
import pytest
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
import pytest
|
|
15
14
|
import networkx as nx
|
|
15
|
+
import pytest
|
|
16
|
+
|
|
16
17
|
import cirq
|
|
17
18
|
|
|
18
19
|
|