qiskit/dagcircuit/dagcircuit.py
def remove_op_node(self, node):
        """Remove an operation node n.

        Add edges from predecessors to successors.
        """
        if isinstance(node, int):
            warnings.warn('Calling remove_op_node() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            node = self._id_to_node[node]

        if node.type != 'op':
            raise DAGCircuitError('The method remove_op_node only works on op node types. An "%s" '
                                  'node type was wrongly provided.' % node.type)

        pred_map, succ_map = self._make_pred_succ_maps(node)

        # remove from graph and map
        self._multi_graph.remove_node(node)

        for w in pred_map.keys():
            self._multi_graph.add_edge(pred_map[w], succ_map[w],
                                       name="%s[%s]" % (w[0].name, w[1]), wire=w)
def remove_op_node(self, node):
        if isinstance(node, int):
            warnings.warn('Calling remove_op_node() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            node = self._id_to_node[node]

        if node.type != 'op':
            raise DAGCircuitError('The method remove_op_node only works on op node types. An "%s" '
                                  'node type was wrongly provided.' % node.type)

        pred_map, succ_map = self._make_pred_succ_maps(node)

        # remove from graph and map
        self._multi_graph.remove_node(node)

        for w in pred_map.keys():
            self._multi_graph.add_edge(pred_map[w], succ_map[w],
                                       name="%s[%s]" % (w[0].name, w[1]), wire=w)
def remove_op_node ( self , node ) : if isinstance ( node , int ) : warnings . warn ( 'Calling remove_op_node() with a node id is deprecated,' ' use a DAGNode instead' , DeprecationWarning , 2 ) node = self . _id_to_node [ node ] if node . type != 'op' : raise DAGCircuitError ( 'The method remove_op_node only works on op node types. An "%s" ' 'node type was wrongly provided.' % node . type ) pred_map , succ_map = self . _make_pred_succ_maps ( node ) # remove from graph and map self . _multi_graph . remove_node ( node ) for w in pred_map . keys ( ) : self . _multi_graph . add_edge ( pred_map [ w ] , succ_map [ w ] , name = "%s[%s]" % ( w [ 0 ] . name , w [ 1 ] ) , wire = w )
Remove an operation node n.

        Add edges from predecessors to successors.
Remove an operation node n .