def test_decompose_only_h(self):
    'Test to decompose a single H, without the rest\n        '
    qr = QuantumRegister(2, 'qr')
    circuit = QuantumCircuit(qr)
    circuit.h(qr[0])
    circuit.cx(qr[0], qr[1])
    dag = circuit_to_dag(circuit)
    pass_ = Decompose(HGate)
    after_dag = pass_.run(dag)
    op_nodes = after_dag.op_nodes()
    self.assertEqual(len(op_nodes), 2)
    for node in op_nodes:
        self.assertIn(node.name, ['cx', 'u2'])
Test to decompose a single H, without the rest
def test_decompose_only_h(self):
    '\n        '
    qr = QuantumRegister(2, 'qr')
    circuit = QuantumCircuit(qr)
    circuit.h(qr[0])
    circuit.cx(qr[0], qr[1])
    dag = circuit_to_dag(circuit)
    pass_ = Decompose(HGate)
    after_dag = pass_.run(dag)
    op_nodes = after_dag.op_nodes()
    self.assertEqual(len(op_nodes), 2)
    for node in op_nodes:
        self.assertIn(node.name, ['cx', 'u2'])