From 09d21a23c015bc61b2880632ebab000b7ca035ee Mon Sep 17 00:00:00 2001 From: Dan Lykov Date: Sat, 7 Sep 2024 03:17:17 +0000 Subject: [PATCH] optimizer minor fix --- qtensor/optimisation/Optimizer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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]