Browse code

update examples to work (at all or without warnings)

Christoph Groth authored on 06/12/2019 14:47:30
Showing 2 changed files
... ...
@@ -47,7 +47,7 @@ def make_system(R):
47 47
 
48 48
 def main():
49 49
     syst = make_system(100)
50
-    print(kwant.smatrix(syst, 1.1, [0.1]).transmission(0, 1))
50
+    print(kwant.smatrix(syst, 1.1, params=dict(B=0.1)).transmission(0, 1))
51 51
 
52 52
 
53 53
 if __name__ == '__main__':
... ...
@@ -16,7 +16,9 @@ class Lead:
16 16
         self.t = t
17 17
         self.potential = potential
18 18
 
19
-    def selfenergy(self, fermi_energy, args=()):
19
+    def selfenergy(self, fermi_energy, args=(), params=None):
20
+        assert not args
21
+        assert params is None
20 22
         return square_selfenergy(self.width, self.t,
21 23
                                  self.potential + fermi_energy)
22 24
 
... ...
@@ -73,8 +75,10 @@ class System(kwant.system.FiniteSystem):
73 75
         self.leads = [Lead(shape[1], hopping, lead_potentials[i])
74 76
                       for i in range(2)]
75 77
 
76
-    def hamiltonian(self, i, j):
78
+    def hamiltonian(self, i, j, *args, params=None):
77 79
         """Return an submatrix of the tight-binding Hamiltonian."""
80
+        assert not args
81
+        assert params is None
78 82
         if i == j:
79 83
             # An on-site Hamiltonian has been requested.
80 84
             result = 4 * self.t + self.pot(self.pos_from_nodeid(i))