-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy path__init__.py
121 lines (91 loc) · 3.78 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for testing code."""
from cirq.testing.circuit_compare import (
assert_circuits_with_terminal_measurements_are_equivalent,
assert_circuits_have_same_unitary_given_final_permutation,
assert_has_consistent_apply_channel,
assert_has_consistent_apply_unitary,
assert_has_consistent_apply_unitary_for_various_exponents,
assert_has_diagram,
assert_same_circuits,
highlight_text_differences,
assert_has_consistent_qid_shape,
)
from cirq.testing.consistent_act_on import assert_all_implemented_act_on_effects_match_unitary
from cirq.testing.consistent_channels import assert_consistent_channel, assert_consistent_mixture
from cirq.testing.consistent_controlled_gate_op import (
assert_controlled_and_controlled_by_identical,
assert_controlled_unitary_consistent,
)
from cirq.testing.consistent_decomposition import (
assert_decompose_ends_at_default_gateset,
assert_decompose_is_consistent_with_unitary,
)
from cirq.testing.consistent_pauli_expansion import (
assert_pauli_expansion_is_consistent_with_unitary,
)
from cirq.testing.consistent_phase_by import assert_phase_by_is_consistent_with_unitary
from cirq.testing.consistent_protocols import (
assert_eigengate_implements_consistent_protocols,
assert_has_consistent_trace_distance_bound,
assert_implements_consistent_protocols,
assert_commutes_magic_method_consistent_with_unitaries,
)
from cirq.testing.consistent_qasm import assert_qasm_is_consistent_with_unitary
from cirq.testing.consistent_resolve_parameters import assert_consistent_resolve_parameters
from cirq.testing.consistent_specified_has_unitary import assert_specifies_has_unitary_if_unitary
from cirq.testing.deprecation import assert_deprecated
from cirq.testing.devices import ValidatingTestDevice
from cirq.testing.equals_tester import EqualsTester
from cirq.testing.equivalent_basis_map import assert_equivalent_computational_basis_map
from cirq.testing.equivalent_repr_eval import assert_equivalent_repr
from cirq.testing.gate_features import (
SingleQubitGate,
TwoQubitGate,
ThreeQubitGate,
DoesNotSupportSerializationGate,
)
from cirq.testing.json import assert_json_roundtrip_works
from cirq.testing.lin_alg_utils import (
assert_allclose_up_to_global_phase,
random_density_matrix,
random_orthogonal,
random_special_orthogonal,
random_special_unitary,
random_superposition,
random_unitary,
)
from cirq.testing.logs import assert_logs
from cirq.testing.no_identifier_qubit import NoIdentifierQubit
from cirq.testing.op_tree import assert_equivalent_op_tree
from cirq.testing.order_tester import OrderTester
from cirq.testing.random_circuit import (
DEFAULT_GATE_DOMAIN,
random_circuit,
random_two_qubit_circuit_with_czs,
)
from cirq.testing.repr_pretty_tester import (
assert_repr_pretty,
assert_repr_pretty_contains,
FakePrinter,
)
from cirq.testing.routing_devices import (
construct_grid_device,
construct_ring_device,
RoutingTestingDevice,
)
from cirq.testing.sample_circuits import nonoptimal_toffoli_circuit
from cirq.testing.sample_gates import PhaseUsingCleanAncilla, PhaseUsingDirtyAncilla
from cirq.testing.consistent_unitary import assert_unitary_is_consistent