def hasLogicalError(self):
for type in self.types:
for charge_type in ['X','Z']:
LogicalLattice = self.Primal.copy()
for node in self.Primal.nodes():
if self.Primal.node[node]['charge'][charge_type] == 0:
LogicalLattice.remove_node(node)
for node1 in LogicalLattice.nodes():
for node2 in LogicalLattice.nodes():
if node1 in self.Boundary[type] and node2 in self.Boundary[type]:
if self.Boundary[type][node1] != self.Boundary[type][node2]:
start, end = node1, node2
if start in LogicalLattice.nodes() and end in LogicalLattice.nodes():
if nx.has_path(LogicalLattice, start, end):
return True
return False
评论列表
文章目录