Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
Dennis Heffels
kwant
Commits
74219a7e
Commit
74219a7e
authored
4 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
update 'SMatrix' to handle data from calculations with selfenergy leads
parent
933f28be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/solvers/common.py
+19
-2
19 additions, 2 deletions
kwant/solvers/common.py
with
19 additions
and
2 deletions
kwant/solvers/common.py
+
19
−
2
View file @
74219a7e
...
...
@@ -15,7 +15,7 @@ from numbers import Integral
import
numpy
as
np
import
scipy.sparse
as
sp
from
.._common
import
ensure_isinstance
,
deprecate_args
from
..
import
system
from
..
import
system
,
physics
from
functools
import
reduce
# Until v0.13.0, scipy.sparse did not support making block matrices out of
...
...
@@ -802,6 +802,8 @@ class SMatrix(BlockResult):
matrix.
lead_info : list of data
a list containing `kwant.physics.PropagatingModes` for each lead.
If a lead is a selfenergy lead, then the corresponding entry
in lead_info is a selfenergy.
out_leads, in_leads : sequence of integers
indices of the leads where current is extracted (out) or injected
(in). Only those are listed for which SMatrix contains the
...
...
@@ -810,7 +812,22 @@ class SMatrix(BlockResult):
def
__init__
(
self
,
data
,
lead_info
,
out_leads
,
in_leads
,
current_conserving
=
False
):
sizes
=
[
len
(
i
.
momenta
)
//
2
for
i
in
lead_info
]
# An equivalent condition to this is checked in 'Solver.smatrix',
# but we add it here again as a sanity check. If 'lead_info' is not
# a 'PropagatingModes' that means that the corresponding lead is a
# selfenergy lead. Scattering matrix elements to/from a selfenergy lead
# are not defined.
assert
not
any
(
not
isinstance
(
info
,
physics
.
PropagatingModes
)
and
leadnum
in
(
out_leads
+
in_leads
)
for
leadnum
,
info
in
enumerate
(
lead_info
)
)
# 'getattr' in order to handle self-energy leads, for which
# 'info' is just a matrix (so no 'momenta').
sizes
=
[
len
(
getattr
(
info
,
"
momenta
"
,
[]))
//
2
for
info
in
lead_info
]
super
().
__init__
(
data
,
lead_info
,
out_leads
,
in_leads
,
sizes
,
current_conserving
)
# in_offsets marks beginnings and ends of blocks in the scattering
...
...
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