diff --git a/qtensor/optimisation/Optimizer.py b/qtensor/optimisation/Optimizer.py index ccb9a37b..17be473a 100644 --- a/qtensor/optimisation/Optimizer.py +++ b/qtensor/optimisation/Optimizer.py @@ -282,8 +282,9 @@ def get_ordering_ints(self, graph, inplace=True): #print('graph nodes', len(graph.nodes)) #print('pgraph nodes', len(p_graph.nodes)) # Remove parallel vars from graph - for var in par_vars: - qtree.graph_model.base.remove_node(self.graph, var) + if hasattr(self, 'graph'): + for var in par_vars: + qtree.graph_model.base.remove_node(self.graph, var) #self.graph = p_graph return peo, [self.treewidth]