def test_near_zero_mod(): atol = 5 assert near_zero_mod(0, 100, atol=atol) assert near_zero_mod(4.5, 100, atol=atol) assert not near_zero_mod(5.5, 100, atol=atol) assert near_zero_mod(100, 100, atol=atol) assert near_zero_mod(95.5, 100, atol=atol) assert not near_zero_mod(94.5, 100, atol=atol) assert near_zero_mod(-4.5, 100, atol=atol) assert not near_zero_mod(-5.5, 100, atol=atol) assert near_zero_mod(104.5, 100, atol=atol) assert not near_zero_mod(105.5, 100, atol=atol)
def is_clifford_rotation(half_turns): return near_zero_mod(half_turns, 0.5, atol=atol)