Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwantspectrum
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kwant
kwantspectrum
Commits
cd29e9ae
Commit
cd29e9ae
authored
Jan 11, 2020
by
Kloss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catch problem with no bands open
parent
b49e5210
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
kwant_spectrum.py
kwant_spectrum.py
+5
-1
test_kwant_spectrum.py
test_kwant_spectrum.py
+3
-3
No files found.
kwant_spectrum.py
View file @
cd29e9ae
...
...
@@ -804,7 +804,11 @@ class BandSketching:
assert
_is_type
(
band
,
'integer'
)
energy
=
self
.
__call__
(
k
,
band
)
modes
=
self
.
_modes
(
energy
=
energy
)[
0
]
try
:
# kwant fails if energy is exactly at the bandgap
modes
=
self
.
_modes
(
energy
=
energy
)[
0
]
except
ValueError
:
return
-
1
momenta
=
modes
.
momenta
velocities
=
modes
.
velocities
...
...
test_kwant_spectrum.py
View file @
cd29e9ae
...
...
@@ -139,7 +139,7 @@ def test_gap_detection_tolerance():
def
test_scale_invariance
():
def
make_lead
(
scale
=
1
):
syst
=
kwant
.
Builder
(
kwant
.
TranslationalSymmetry
((
-
1
,
0
)))
lat
=
kwant
.
lattice
.
square
()
lat
=
kwant
.
lattice
.
square
(
norbs
=
1
)
syst
[
lat
(
0
,
0
)]
=
1
*
scale
syst
[
lat
(
0
,
1
)]
=
8
*
scale
syst
[
lat
(
1
,
0
),
lat
(
0
,
0
)]
=
-
1
*
scale
...
...
@@ -160,7 +160,7 @@ def test_band_analysis_methods():
# a simple testcase with 3 crossing bands
def
make_lead
():
syst
=
kwant
.
Builder
(
kwant
.
TranslationalSymmetry
((
-
2
,
0
)))
lat
=
kwant
.
lattice
.
square
(
1
)
lat
=
kwant
.
lattice
.
square
(
1
,
norbs
=
1
)
syst
[
lat
(
0
,
0
)]
=
0
syst
[
lat
(
0
,
1
)]
=
0
syst
[
lat
(
1
,
0
)]
=
0
...
...
@@ -171,7 +171,7 @@ def test_band_analysis_methods():
# a simple testcase with 3 non-crossing bands
def
make_simple_lead
(
W
=
3
):
lat
=
kwant
.
lattice
.
square
(
1
)
lat
=
kwant
.
lattice
.
square
(
1
,
norbs
=
1
)
sym
=
kwant
.
TranslationalSymmetry
((
-
1
,
0
))
H
=
kwant
.
Builder
(
sym
)
H
[(
lat
(
0
,
y
)
for
y
in
range
(
W
))]
=
0
...
...
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