|
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 |
|
16 | 15 | import cirq |
17 | 16 | import cirq_google.experimental.ops.coupler_pulse as coupler_pulse |
@@ -80,39 +79,6 @@ def test_equality(): |
80 | 79 | ) |
81 | 80 |
|
82 | 81 |
|
83 | | -def test_coupler_pulse_validation(): |
84 | | - with pytest.raises(ValueError, match='Total time of coupler pulse'): |
85 | | - _ = coupler_pulse.CouplerPulse( |
86 | | - hold_time=cirq.Duration(nanos=210), coupling_mhz=25.0, rise_time=cirq.Duration(nanos=10) |
87 | | - ) |
88 | | - with pytest.raises(ValueError, match='hold_time must be greater'): |
89 | | - _ = coupler_pulse.CouplerPulse( |
90 | | - hold_time=cirq.Duration(nanos=-10), coupling_mhz=25.0, rise_time=cirq.Duration(nanos=20) |
91 | | - ) |
92 | | - with pytest.raises(ValueError, match='Total time of coupler pulse'): |
93 | | - _ = coupler_pulse.CouplerPulse( |
94 | | - hold_time=cirq.Duration(nanos=10), |
95 | | - coupling_mhz=25.0, |
96 | | - rise_time=cirq.Duration(nanos=20), |
97 | | - padding_time=cirq.Duration(nanos=200), |
98 | | - ) |
99 | | - with pytest.raises(ValueError, match='padding_time must be greater'): |
100 | | - _ = coupler_pulse.CouplerPulse( |
101 | | - hold_time=cirq.Duration(nanos=10), |
102 | | - coupling_mhz=25.0, |
103 | | - rise_time=cirq.Duration(nanos=20), |
104 | | - padding_time=cirq.Duration(nanos=-20), |
105 | | - ) |
106 | | - with pytest.raises(ValueError, match='rise_time must be greater'): |
107 | | - _ = coupler_pulse.CouplerPulse( |
108 | | - hold_time=cirq.Duration(nanos=10), coupling_mhz=25.0, rise_time=cirq.Duration(nanos=-1) |
109 | | - ) |
110 | | - with pytest.raises(ValueError, match='Total time of coupler pulse'): |
111 | | - _ = coupler_pulse.CouplerPulse( |
112 | | - hold_time=cirq.Duration(nanos=10), coupling_mhz=25.0, rise_time=cirq.Duration(nanos=302) |
113 | | - ) |
114 | | - |
115 | | - |
116 | 82 | def test_coupler_pulse_str_repr(): |
117 | 83 | gate = coupler_pulse.CouplerPulse( |
118 | 84 | hold_time=cirq.Duration(nanos=10), coupling_mhz=25.0, rise_time=cirq.Duration(nanos=18) |
|
0 commit comments