def test_double_excitation_eq(): eq = cirq.testing.EqualsTester() eq.add_equality_group( ofc.DoubleExcitationGate(exponent=1.5), ofc.DoubleExcitationGate(exponent=-0.5), ofc.DoubleExcitationGate(rads=-0.5 * numpy.pi), ofc.DoubleExcitationGate(degs=-90), ofc.DoubleExcitationGate(duration=-0.5 * numpy.pi / 2)) eq.add_equality_group( ofc.DoubleExcitationGate(exponent=0.5), ofc.DoubleExcitationGate(exponent=-1.5), ofc.DoubleExcitationGate(rads=0.5 * numpy.pi), ofc.DoubleExcitationGate(degs=90), ofc.DoubleExcitationGate(duration=-1.5 * numpy.pi / 2)) eq.make_equality_group(lambda: ofc.DoubleExcitationGate(exponent=0.0)) eq.make_equality_group(lambda: ofc.DoubleExcitationGate(exponent=0.75))
def test_double_excitation_init_with_multiple_args_fails(): with pytest.raises(ValueError): _ = ofc.DoubleExcitationGate(exponent=1.0, duration=numpy.pi / 2)