Lines Matching refs:atol

25     assert not cirq.approx_eq(1, 2, atol=1e-01)
26 assert cirq.approx_eq(1.0, 1.0 + 1e-10, atol=1e-09)
27 assert not cirq.approx_eq(1.0, 1.0 + 1e-10, atol=1e-11)
28 assert cirq.approx_eq(0.0, 1e-10, atol=1e-09)
29 assert not cirq.approx_eq(0.0, 1e-10, atol=1e-11)
30 assert cirq.approx_eq(complex(1, 1), complex(1.1, 1.2), atol=0.3)
31 assert not cirq.approx_eq(complex(1, 1), complex(1.1, 1.2), atol=0.1)
32 assert cirq.approx_eq('ab', 'ab', atol=1e-3)
33 assert not cirq.approx_eq('ab', 'ac', atol=1e-3)
34 assert not cirq.approx_eq('1', '2', atol=999)
35 assert not cirq.approx_eq('test', 1, atol=1e-3)
36 assert not cirq.approx_eq('1', 1, atol=1e-3)
40 assert cirq.approx_eq(complex(1, 1e-10), 1, atol=1e-09)
41 assert not cirq.approx_eq(complex(1, 1e-4), 1, atol=1e-09)
42 assert cirq.approx_eq(complex(1, 1e-10), 1.0, atol=1e-09)
43 assert not cirq.approx_eq(complex(1, 1e-8), 1.0, atol=1e-09)
44 assert cirq.approx_eq(1, 1.0 + 1e-10, atol=1e-9)
45 assert not cirq.approx_eq(1, 1.0 + 1e-10, atol=1e-11)
52 assert cirq.approx_eq(i_type(i_a), i_type(i_b), atol=1)
53 assert not cirq.approx_eq(i_type(i_a), i_type(i_c), atol=1)
56 assert cirq.approx_eq(u_type(i_a), u_type(i_b), atol=1)
57 assert not cirq.approx_eq(u_type(i_a), u_type(i_c), atol=1)
64 assert cirq.approx_eq(f_type(f_a), f_type(f_b), atol=1e-8)
65 assert not cirq.approx_eq(f_type(f_a), f_type(f_c), atol=1e-8)
72 assert cirq.approx_eq(c_type(c_a), c_type(c_b), atol=1e-8)
73 assert not cirq.approx_eq(c_type(c_a), c_type(c_c), atol=1e-8)
77 assert cirq.approx_eq(Fraction(0), Fraction(1, int(1e10)), atol=1e-9)
78 assert not cirq.approx_eq(Fraction(0), Fraction(1, int(1e7)), atol=1e-9)
82 assert cirq.approx_eq(Decimal('0'), Decimal('0.0000000001'), atol=1e-9)
83 assert not cirq.approx_eq(Decimal('0'), Decimal('0.00000001'), atol=1e-9)
84 assert not cirq.approx_eq(Decimal('NaN'), Decimal('-Infinity'), atol=1e-9)
88 assert cirq.approx_eq(np.float32(1), 1.0 + 1e-10, atol=1e-9)
89 assert cirq.approx_eq(np.float64(1), np.complex64(1 + 1e-8j), atol=1e-4)
90 assert cirq.approx_eq(np.uint8(1), np.complex64(1 + 1e-8j), atol=1e-4)
92 assert cirq.approx_eq(np.complex256(1), complex(1, 1e-8), atol=1e-4)
93 assert cirq.approx_eq(np.int32(1), 1, atol=1e-9)
94 assert cirq.approx_eq(complex(0.5, 0), Fraction(1, 2), atol=0.0)
95 assert cirq.approx_eq(0.5 + 1e-4j, Fraction(1, 2), atol=1e-4)
96 assert cirq.approx_eq(0, Fraction(1, 100000000), atol=1e-8)
97 assert cirq.approx_eq(np.uint16(1), Decimal('1'), atol=0.0)
98 assert cirq.approx_eq(np.float64(1.0), Decimal('1.00000001'), atol=1e-8)
99 assert not cirq.approx_eq(np.complex64(1e-5j), Decimal('0.001'), atol=1e-4)
103 assert not cirq.approx_eq(float('nan'), 0, atol=0.0)
104 assert not cirq.approx_eq(float('nan'), float('nan'), atol=0.0)
105 assert not cirq.approx_eq(float('inf'), float('-inf'), atol=0.0)
106 assert not cirq.approx_eq(float('inf'), 5, atol=0.0)
107 assert not cirq.approx_eq(float('inf'), 0, atol=0.0)
108 assert cirq.approx_eq(float('inf'), float('inf'), atol=0.0)
131 assert cirq.approx_eq(C(0), C(0), atol=0.0)
132 assert not cirq.approx_eq(X(0), X(1), atol=0.0)
133 assert not cirq.approx_eq(X(0), 0, atol=0.0)
134 assert not cirq.approx_eq(Y(), 1, atol=0.0)
138 assert cirq.approx_eq((1, 1), (1, 1), atol=0.0)
139 assert not cirq.approx_eq((1, 1), (1, 1, 1), atol=0.0)
140 assert not cirq.approx_eq((1, 1), (1,), atol=0.0)
141 assert cirq.approx_eq((1.1, 1.2, 1.3), (1, 1, 1), atol=0.4)
142 assert not cirq.approx_eq((1.1, 1.2, 1.3), (1, 1, 1), atol=0.2)
146 assert cirq.approx_eq([], [], atol=0.0)
147 assert not cirq.approx_eq([], [[]], atol=0.0)
148 assert cirq.approx_eq([1, 1], [1, 1], atol=0.0)
149 assert not cirq.approx_eq([1, 1], [1, 1, 1], atol=0.0)
155 atol=0.0,
157 assert cirq.approx_eq([1.1, 1.2, 1.3], [1, 1, 1], atol=0.4)
158 assert not cirq.approx_eq([1.1, 1.2, 1.3], [1, 1, 1], atol=0.2)
166 assert not cirq.approx_eq(t + 1.51 + s, t + 1.50 + s, atol=0.005)
167 assert cirq.approx_eq(t + 1.51 + s, t + 1.50 + s, atol=0.020)
174 cirq.approx_eq(t, 0.0, atol=0.005)
178 assert cirq.approx_eq(symbol_1, symbol_2, atol=0.2)
186 cirq.approx_eq(symbol_1, symbol_3, atol=0.2)
201 assert cirq.approx_eq((1, 1), [1, 1], atol=0.0)
202 assert cirq.approx_eq((1, 1), gen_1_1(), atol=0.0)
203 assert cirq.approx_eq(gen_1_1(), [1, 1], atol=0.0)
210 def _approx_eq_(self, other, atol): argument
213 return cirq.approx_eq(self.val, other.val, atol=atol)
220 def _approx_eq_(self, other, atol): argument
223 return cirq.approx_eq(self.val, other, atol=atol)
227 assert cirq.approx_eq(A(0.0), A(0.1), atol=0.1)
228 assert not cirq.approx_eq(A(0.0), A(0.1), atol=0.0)
229 assert cirq.approx_eq(B(0.0), 0.1, atol=0.1)
230 assert cirq.approx_eq(0.1, B(0.0), atol=0.1)
244 assert cirq.approx_eq(C(0), C(0), atol=0.0)
245 assert not cirq.approx_eq(C(1), C(2), atol=0.0)
246 assert cirq.approx_eq([C(0)], [C(0)], atol=0.0)
247 assert not cirq.approx_eq([C(1)], [C(2)], atol=0.0)
248 assert cirq.approx_eq(complex(0, 0), 0, atol=0.0)
249 assert cirq.approx_eq(0, complex(0, 0), atol=0.0)
253 assert not cirq.approx_eq(0, A(0), atol=0.0)
254 assert not cirq.approx_eq(A(0), 0, atol=0.0)
255 assert not cirq.approx_eq(B(0), A(0), atol=0.0)
256 assert not cirq.approx_eq(A(0), B(0), atol=0.0)
257 assert not cirq.approx_eq(C(0), A(0), atol=0.0)
258 assert not cirq.approx_eq(A(0), C(0), atol=0.0)
259 assert not cirq.approx_eq(0, [0], atol=1.0)
260 assert not cirq.approx_eq([0], 0, atol=0.0)