def test_cyxxy_eq():
    eq = EqualsTester()

    eq.add_equality_group(ofc.CYXXY**-0.5, ofc.CYXXYPowGate(exponent=3.5),
                          ofc.CYXXYPowGate(exponent=-0.5))

    eq.add_equality_group(ofc.CYXXYPowGate(exponent=1.5),
                          ofc.CYXXYPowGate(exponent=-2.5))

    eq.make_equality_group(lambda: ofc.CYXXYPowGate(exponent=0))
    eq.make_equality_group(lambda: ofc.CYXXYPowGate(exponent=0.5))
Пример #2
0
def test_cyxxy_repr():
    assert repr(ofc.CYXXYPowGate(exponent=1)) == 'CYXXY'
    assert repr(ofc.CYXXYPowGate(exponent=0.5)) == 'CYXXY**0.5'