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
fad9494d
Commit
fad9494d
authored
12 years ago
by
Joseph Weston
Committed by
Christoph Groth
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add support for args/kwargs where it had been forgotten
parent
ab6df0dd
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/system.py
+6
-4
6 additions, 4 deletions
kwant/system.py
with
6 additions
and
4 deletions
kwant/system.py
+
6
−
4
View file @
fad9494d
...
...
@@ -35,13 +35,13 @@ class System(object):
"""
__metaclass__
=
abc
.
ABCMeta
def
num_orbitals
(
self
,
site
):
def
num_orbitals
(
self
,
site
,
*
args
,
**
kwargs
):
"""
Return the number of orbitals of a site.
This is an inefficient general implementation. It should be
overridden, if a more efficient way to calculate is available.
"""
ham
=
self
.
hamiltonian
(
site
,
site
)
ham
=
self
.
hamiltonian
(
site
,
site
,
*
args
,
**
kwargs
)
return
1
if
np
.
isscalar
(
ham
)
else
ham
.
shape
[
0
]
@abc.abstractmethod
...
...
@@ -136,14 +136,16 @@ class InfiniteSystem(System):
"""
Hamiltonian of a single slice of the infinite system.
"""
slice_sites
=
xrange
(
self
.
slice_size
)
return
self
.
hamiltonian_submatrix
(
slice_sites
,
slice_sites
,
sparse
=
sparse
,
kwargs
=
kwargs
)
sparse
=
sparse
,
args
=
args
,
kwargs
=
kwargs
)
def
inter_slice_hopping
(
self
,
sparse
=
False
,
args
=
(),
kwargs
=
{}):
"""
Hopping Hamiltonian between two slices of the infinite system.
"""
slice_sites
=
xrange
(
self
.
slice_size
)
neighbor_sites
=
xrange
(
self
.
slice_size
,
self
.
graph
.
num_nodes
)
return
self
.
hamiltonian_submatrix
(
slice_sites
,
neighbor_sites
,
sparse
=
sparse
,
kwargs
=
kwargs
)
sparse
=
sparse
,
args
=
args
,
kwargs
=
kwargs
)
def
self_energy
(
self
,
energy
,
args
=
(),
kwargs
=
{}):
"""
Return self-energy of a lead.
...
...
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