Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
kwant
kwant
Commits
0526bda4
Commit
0526bda4
authored
Jun 25, 2020
by
Pablo Piskunow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
translate to_fd the sites before checking neighbors
parent
14e2cf6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
kwant/builder.py
kwant/builder.py
+5
-3
No files found.
kwant/builder.py
View file @
0526bda4
...
...
@@ -886,7 +886,7 @@ class Builder:
Sites are considered as dangling when less than two hoppings
lead to them.
"""
tfd
=
self
.
symmetry
.
to_fd
t
o_
fd
=
self
.
symmetry
.
to_fd
sites
=
list
(
site
for
site
in
self
.
H
if
self
.
_out_degree
(
site
)
<
2
)
...
...
@@ -894,6 +894,8 @@ class Builder:
if
site
not
in
self
.
H
:
continue
while
site
:
if
site
not
in
self
.
H
:
site
=
to_fd
(
site
)
neighbors
=
tuple
(
self
.
_out_neighbors
(
site
))
if
neighbors
:
assert
len
(
neighbors
)
==
1
...
...
@@ -904,8 +906,8 @@ class Builder:
if
self
.
_out_degree
(
neighbor
)
>
1
:
neighbor
=
False
else
:
self
.
_del_edge
(
*
tfd
(
neighbor
,
site
))
if
self
.
_out_degree
(
tfd
(
neighbor
))
>
1
:
self
.
_del_edge
(
*
t
o_
fd
(
neighbor
,
site
))
if
self
.
_out_degree
(
t
o_
fd
(
neighbor
))
>
1
:
neighbor
=
False
else
:
neighbor
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment