Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Wimmer
kwant
Commits
f082f586
Commit
f082f586
authored
10 years ago
by
Anton Akhmerov
Browse files
Options
Downloads
Patches
Plain Diff
test a raise statement in dispersion
parent
ef955ca6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/physics/tests/test_dispersion.py
+10
-0
10 additions, 0 deletions
kwant/physics/tests/test_dispersion.py
with
10 additions
and
0 deletions
kwant/physics/tests/test_dispersion.py
+
10
−
0
View file @
f082f586
...
...
@@ -7,6 +7,8 @@
# http://kwant-project.org/authors.
from
numpy.testing
import
assert_array_almost_equal
,
assert_almost_equal
from
nose.tools
import
assert_raises
import
kwant
from
math
import
pi
,
cos
,
sin
...
...
@@ -36,3 +38,11 @@ def test_same_as_lead():
for
momentum
in
momenta
:
assert_almost_equal
(
bands
(
momentum
)[
0
],
0
)
def
test_raise_nonhermitian
():
sys
=
kwant
.
Builder
(
kwant
.
TranslationalSymmetry
((
-
1
,)))
lat
=
kwant
.
lattice
.
chain
()
sys
[
lat
(
0
)]
=
1j
sys
[
lat
(
0
),
lat
(
1
)]
=
complex
(
cos
(
0.2
),
sin
(
0.2
))
sys
=
sys
.
finalized
()
assert_raises
(
ValueError
,
kwant
.
physics
.
Bands
,
sys
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment