Skip to content
Snippets Groups Projects
Commit 4226d5fd authored by Christoph Groth's avatar Christoph Groth
Browse files

update examples to work (at all or without warnings)

parent a23b1c96
No related branches found
No related tags found
No related merge requests found
Pipeline #26957 passed with warnings
......@@ -47,7 +47,7 @@ def make_system(R):
def main():
syst = make_system(100)
print(kwant.smatrix(syst, 1.1, [0.1]).transmission(0, 1))
print(kwant.smatrix(syst, 1.1, params=dict(B=0.1)).transmission(0, 1))
if __name__ == '__main__':
......
......@@ -16,7 +16,9 @@ class Lead:
self.t = t
self.potential = potential
def selfenergy(self, fermi_energy, args=()):
def selfenergy(self, fermi_energy, args=(), params=None):
assert not args
assert params is None
return square_selfenergy(self.width, self.t,
self.potential + fermi_energy)
......@@ -73,8 +75,10 @@ class System(kwant.system.FiniteSystem):
self.leads = [Lead(shape[1], hopping, lead_potentials[i])
for i in range(2)]
def hamiltonian(self, i, j):
def hamiltonian(self, i, j, *args, params=None):
"""Return an submatrix of the tight-binding Hamiltonian."""
assert not args
assert params is None
if i == j:
# An on-site Hamiltonian has been requested.
result = 4 * self.t + self.pot(self.pos_from_nodeid(i))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment