def test_basic(self):
    'Test decompose a single H into u2.\n        '
    qr = QuantumRegister(1, 'qr')
    circuit = QuantumCircuit(qr)
    circuit.h(qr[0])
    dag = circuit_to_dag(circuit)
    pass_ = Decompose(HGate)
    after_dag = pass_.run(dag)
    op_nodes = after_dag.op_nodes()
    self.assertEqual(len(op_nodes), 1)
    self.assertEqual(op_nodes[0].name, 'u2')
Test decompose a single H into u2.
def test_basic(self):
    '\n        '
    qr = QuantumRegister(1, 'qr')
    circuit = QuantumCircuit(qr)
    circuit.h(qr[0])
    dag = circuit_to_dag(circuit)
    pass_ = Decompose(HGate)
    after_dag = pass_.run(dag)
    op_nodes = after_dag.op_nodes()
    self.assertEqual(len(op_nodes), 1)
    self.assertEqual(op_nodes[0].name, 'u2')