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
2e5c447f
Commit
2e5c447f
authored
11 years ago
by
Anton Akhmerov
Committed by
Christoph Groth
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix a failing test to not check for an arbitrary phase
parent
cb854082
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/solvers/tests/_test_sparse.py
+10
-2
10 additions, 2 deletions
kwant/solvers/tests/_test_sparse.py
with
10 additions
and
2 deletions
kwant/solvers/tests/_test_sparse.py
+
10
−
2
View file @
2e5c447f
...
...
@@ -26,6 +26,14 @@ class LeadWithOnlySelfEnergy(object):
return
self
.
lead
.
selfenergy
(
energy
)
def
assert_modes_equal
(
modes1
,
modes2
):
assert_almost_equal
(
modes1
.
velocities
,
modes2
.
velocities
)
assert_almost_equal
(
modes1
.
momenta
,
modes2
.
momenta
)
vecs1
,
vecs2
=
modes1
.
wave_functions
,
modes2
.
wave_functions
assert_almost_equal
(
np
.
abs
(
np
.
sum
(
vecs1
/
vecs2
,
axis
=
0
)),
vecs1
.
shape
[
0
])
# Test output sanity: that an error is raised if no output is requested,
# and that solving for a subblock of a scattering matrix is the same as taking
# a subblock of the full scattering matrix.
...
...
@@ -66,8 +74,8 @@ def test_output(solve):
h
=
fsys
.
leads
[
1
].
cell_hamiltonian
()
t
=
fsys
.
leads
[
1
].
inter_cell_hopping
()
modes2
=
kwant
.
physics
.
modes
(
h
,
t
)[
0
]
assert_
almost
_equal
(
modes1
.
wave_functions
,
modes
[
0
].
wave_functions
)
assert_
almost
_equal
(
modes2
.
wave_functions
,
modes
[
1
].
wave_functions
)
assert_
modes
_equal
(
modes1
,
modes
[
0
]
)
assert_
modes
_equal
(
modes2
,
modes
[
1
]
)
# Test that a system with one lead has unitary scattering matrix.
...
...
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