Commit 4226d5fd by Christoph Groth

### update examples to work (at all or without warnings)

parent a23b1c96
Pipeline #26957 passed with stages
in 40 minutes and 20 seconds
 ... @@ -47,7 +47,7 @@ def make_system(R): ... @@ -47,7 +47,7 @@ def make_system(R): def main(): def main(): syst = make_system(100) 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__': if __name__ == '__main__': ... ...
 ... @@ -16,7 +16,9 @@ class Lead: ... @@ -16,7 +16,9 @@ class Lead: self.t = t self.t = t self.potential = potential 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, return square_selfenergy(self.width, self.t, self.potential + fermi_energy) self.potential + fermi_energy) ... @@ -73,8 +75,10 @@ class System(kwant.system.FiniteSystem): ... @@ -73,8 +75,10 @@ class System(kwant.system.FiniteSystem): self.leads = [Lead(shape[1], hopping, lead_potentials[i]) self.leads = [Lead(shape[1], hopping, lead_potentials[i]) for i in range(2)] 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.""" """Return an submatrix of the tight-binding Hamiltonian.""" assert not args assert params is None if i == j: if i == j: # An on-site Hamiltonian has been requested. # An on-site Hamiltonian has been requested. result = 4 * self.t + self.pot(self.pos_from_nodeid(i)) result = 4 * self.t + self.pot(self.pos_from_nodeid(i)) ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!