def METHOD_NAME(self):
    """test 2 qubit hamiltonian"""
    qr = QuantumRegister(2)
    cr = ClassicalRegister(2)
    qc = QuantumCircuit(qr, cr)
    matrix = Operator.from_label("XY")
    qc.x(qr[0])
    theta = Parameter("theta")
    uni2q = HamiltonianGate(matrix, theta)
    qc.append(uni2q, [qr[0], qr[1]])
    qc2 = qc.bind_parameters({theta: -np.pi / 2})
    dag = circuit_to_dag(qc2)
    nodes = dag.two_qubit_ops()
    self.assertEqual(len(nodes), 1)
    dnode = nodes[0]
    self.assertIsInstance(dnode.op, HamiltonianGate)
    self.assertEqual(dnode.qargs, (qr[0], qr[1]))
    # Equality based on Pauli exponential identity
    np.testing.assert_array_almost_equal(dnode.op.to_matrix(), 1j * matrix.data)
    qc3 = dag_to_circuit(dag)
    self.assertEqual(qc2, qc3)