def test_common_gate_text_diagrams():
    a = cirq.NamedQubit('a')
    b = cirq.NamedQubit('b')

    circuit = cirq.Circuit.from_ops(ofc.FSWAP(a, b),
                                    ofc.FSWAP(a, b)**0.5, ofc.XXYY(a, b),
                                    ofc.YXXY(a, b))
    cirq.testing.assert_has_diagram(
        circuit, """
a: ───×ᶠ───×ᶠ───────XXYY───YXXY───
      │    │        │      │
b: ───×ᶠ───×ᶠ^0.5───XXYY───#2─────
""")

    cirq.testing.assert_has_diagram(circuit,
                                    """
a: ---fswap---fswap-------XXYY---YXXY---
      |       |           |      |
b: ---fswap---fswap^0.5---XXYY---#2-----
""",
                                    use_unicode_characters=False)

    circuit = cirq.Circuit.from_ops(ofc.XXYY(a, b)**0.5, ofc.YXXY(a, b)**0.5)
    cirq.testing.assert_has_diagram(
        circuit, """
a: ───XXYY───────YXXY─────
      │          │
b: ───XXYY^0.5───#2^0.5───
""")
def test_xxyy_interchangeable():
    a, b = cirq.LineQubit(0), cirq.LineQubit(1)
    assert ofc.XXYY(a, b) == ofc.XXYY(b, a)