Skip to content

Commit

Permalink
fix handling of par_vars in TensorNet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danlkv committed Sep 20, 2024
1 parent 09d21a2 commit 2069353
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qtensor/optimisation/TensorNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def set_free_qubits(self, free):
self.bra_vars = [var for var in self.bra_vars if var not in self.free_vars]

def simulation_cost(self, peo):
ignore_vars = self.bra_vars + self.ket_vars + self.free_vars
peo = [int(x) for x in peo if x not in ignore_vars]
ignore_vars = [int(x) for x in self.bra_vars + self.ket_vars]
peo = [int(x) for x in peo if int(x) not in ignore_vars]
#peo += [int(x) for x in self.free_vars]
print("Set graph minus set peo", set(self.get_line_graph().nodes) - set(peo))
g, _ = utils.reorder_graph(self.get_line_graph(), peo)
mems, flops = qtree.graph_model.get_contraction_costs(g)
return mems, flops
Expand Down

0 comments on commit 2069353

Please sign in to comment.