Commit 0526bda4 authored by Pablo Piskunow's avatar Pablo Piskunow
Browse files

translate to_fd the sites before checking neighbors

parent 14e2cf6c
Pipeline #38240 passed with stages
in 10 minutes and 10 seconds
...@@ -886,7 +886,7 @@ class Builder: ...@@ -886,7 +886,7 @@ class Builder:
Sites are considered as dangling when less than two hoppings Sites are considered as dangling when less than two hoppings
lead to them. lead to them.
""" """
tfd = self.symmetry.to_fd to_fd = self.symmetry.to_fd
sites = list(site for site in self.H sites = list(site for site in self.H
if self._out_degree(site) < 2) if self._out_degree(site) < 2)
...@@ -894,6 +894,8 @@ class Builder: ...@@ -894,6 +894,8 @@ class Builder:
if site not in self.H: if site not in self.H:
continue continue
while site: while site:
if site not in self.H:
site = to_fd(site)
neighbors = tuple(self._out_neighbors(site)) neighbors = tuple(self._out_neighbors(site))
if neighbors: if neighbors:
assert len(neighbors) == 1 assert len(neighbors) == 1
...@@ -904,8 +906,8 @@ class Builder: ...@@ -904,8 +906,8 @@ class Builder:
if self._out_degree(neighbor) > 1: if self._out_degree(neighbor) > 1:
neighbor = False neighbor = False
else: else:
self._del_edge(*tfd(neighbor, site)) self._del_edge(*to_fd(neighbor, site))
if self._out_degree(tfd(neighbor)) > 1: if self._out_degree(to_fd(neighbor)) > 1:
neighbor = False neighbor = False
else: else:
neighbor = False neighbor = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment