def test_zz_unitary(phase):
    """Tests that the ZZ gate is unitary."""
    gate = ionq.ZZGate(theta=phase)

    mat = cirq.protocols.unitary(gate)
    numpy.testing.assert_array_almost_equal(mat.dot(mat.conj().T), numpy.identity(4))
Tests that the ZZ gate is unitary.
cirq-ionq/cirq_ionq/ionq_native_gates_test.py