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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Joseph Weston
kwant
Commits
811c030c
Commit
811c030c
authored
11 years ago
by
Christoph Groth
Browse files
Options
Downloads
Patches
Plain Diff
fix import in test
parent
2af4495c
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_leads.py
+14
-14
14 additions, 14 deletions
kwant/physics/tests/test_leads.py
with
14 additions
and
14 deletions
kwant/physics/tests/test_leads.py
+
14
−
14
View file @
811c030c
...
...
@@ -9,9 +9,9 @@
from
__future__
import
division
import
numpy
as
np
from
numpy.testing
import
assert_almost_equal
import
kwant.physics
.selfenergy
as
se
from
kwant.physics
import
leads
modes_se
=
lambda
h
,
t
:
s
e
.
self_energy
(
s
e
.
modes
(
h
,
t
))
modes_se
=
lambda
h
,
t
:
lead
s
.
self_energy
(
lead
s
.
modes
(
h
,
t
))
def
h_slice
(
t
,
w
,
e
):
h
=
(
4
*
t
-
e
)
*
np
.
identity
(
w
)
...
...
@@ -25,7 +25,7 @@ def test_analytic_numeric():
t
=
0.78
# hopping element
e
=
1.3
# Fermi energy
assert_almost_equal
(
s
e
.
square_self_energy
(
w
,
t
,
e
),
assert_almost_equal
(
lead
s
.
square_self_energy
(
w
,
t
,
e
),
modes_se
(
h_slice
(
t
,
w
,
e
),
-
t
*
np
.
identity
(
w
)))
...
...
@@ -48,8 +48,8 @@ def test_regular_fully_degenerate():
h_onslice
[
w
:,
w
:]
=
h_onslice_s
g
=
np
.
zeros
((
2
*
w
,
2
*
w
),
dtype
=
complex
)
g
[:
w
,
:
w
]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[:
w
,
:
w
]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
h_hop
))
...
...
@@ -78,8 +78,8 @@ def test_regular_degenerate_with_crossing():
h_onslice
[
w
:,
w
:]
=
-
h_onslice_s
g
=
np
.
zeros
((
2
*
w
,
2
*
w
),
dtype
=
complex
)
g
[:
w
,
:
w
]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
-
np
.
conj
(
s
e
.
square_self_energy
(
w
,
t
,
e
))
g
[:
w
,
:
w
]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
-
np
.
conj
(
lead
s
.
square_self_energy
(
w
,
t
,
e
))
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
hop
))
...
...
@@ -104,7 +104,7 @@ def test_singular():
h_onslice
[:
w
,
w
:]
=
h_hop_s
h_onslice
[
w
:,
:
w
]
=
h_hop_s
h_onslice
[
w
:,
w
:]
=
h_onslice_s
g
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
print
np
.
round
(
g
,
5
)
/
np
.
round
(
modes_se
(
h_onslice
,
h_hop
),
5
)
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
h_hop
))
...
...
@@ -132,7 +132,7 @@ def test_singular_but_square():
h_onslice
[
w
:,
w
:]
=
h_onslice_s
g
=
np
.
zeros
((
2
*
w
,
2
*
w
),
dtype
=
complex
)
g
[:
w
,
:
w
]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[:
w
,
:
w
]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
h_hop
))
def
test_singular_fully_degenerate
():
...
...
@@ -163,8 +163,8 @@ def test_singular_fully_degenerate():
h_onslice
[
3
*
w
:
4
*
w
,
3
*
w
:
4
*
w
]
=
h_onslice_s
g
=
np
.
zeros
((
2
*
w
,
2
*
w
),
dtype
=
complex
)
g
[:
w
,
:
w
]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[:
w
,
:
w
]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
h_hop
))
...
...
@@ -197,8 +197,8 @@ def test_singular_degenerate_with_crossing():
h_onslice
[
3
*
w
:
4
*
w
,
3
*
w
:
4
*
w
]
=
-
h_onslice_s
g
=
np
.
zeros
((
2
*
w
,
2
*
w
),
dtype
=
complex
)
g
[:
w
,
:
w
]
=
s
e
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
-
np
.
conj
(
s
e
.
square_self_energy
(
w
,
t
,
e
))
g
[:
w
,
:
w
]
=
lead
s
.
square_self_energy
(
w
,
t
,
e
)
g
[
w
:,
w
:]
=
-
np
.
conj
(
lead
s
.
square_self_energy
(
w
,
t
,
e
))
assert_almost_equal
(
g
,
modes_se
(
h_onslice
,
h_hop
))
...
...
@@ -212,7 +212,7 @@ def test_singular_h_and_t():
def
test_modes
():
h
,
t
=
.
3
,
.
7
vecs
,
vecslinv
,
nrprop
,
svd
=
s
e
.
modes
(
np
.
array
([[
h
]]),
np
.
array
([[
t
]]))
vecs
,
vecslinv
,
nrprop
,
svd
=
lead
s
.
modes
(
np
.
array
([[
h
]]),
np
.
array
([[
t
]]))
assert
nrprop
==
1
assert
svd
is
None
np
.
testing
.
assert_almost_equal
((
vecs
[
0
]
*
vecslinv
[
0
].
conj
()).
imag
,
...
...
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