Browse code

Merge branch 'stable'

Joseph Weston authored on 20/03/2020 10:14:49
Showing 5 changed files
... ...
@@ -338,3 +338,7 @@ Changes in Kwant 1.4.1
338 338
   low-level systems.
339 339
 - A note about an :ref:`whatsnew13-params-api-change` that ocurred in Kwant
340 340
   1.3 was added.
341
+
342
+Changes in Kwant 1.4.2
343
+----------------------
344
+- Minor bugfixes of the KPM module and qsymm integration.
... ...
@@ -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))
... ...
@@ -180,7 +180,11 @@ def sympify(expr, locals=None):
180 180
                 "identifiers and may not be keywords".format(repr(k)))
181 181
 
182 182
     # sympify values of locals before updating it with extra_ns
183
-    locals = {k: sympify(v) for k, v in locals.items()}
183
+    # Cast numpy array values in locals to sympy matrices to make sure they have
184
+    # correct format
185
+    locals = {k: (sympy.Matrix(v) if isinstance(v, np.ndarray) else sympify(v))
186
+              for k, v in locals.items()}
187
+
184 188
     for k, v in extra_ns.items():
185 189
         locals.setdefault(k, v)
186 190
     try:
... ...
@@ -381,18 +381,13 @@ def search_mumps():
381 381
     libmumps-scotch-dev and the MUMPS binaries in the conda-forge channel."""
382 382
     lib_sets = [
383 383
         # Debian
384
-        ['zmumps_scotch', 'mumps_common_scotch', 'mpiseq_scotch'],
384
+        ['zmumps_scotch', 'mumps_common_scotch', 'mpiseq_scotch',
385
+         'pord', 'gfortran'],
385 386
         # Conda (via conda-forge).
386
-        # TODO: remove dependency libs (scotch, metis...) when conda-forge
387
-        # packaged mumps/scotch are built as properly linked shared libs
388
-        # 'openblas' provides Lapack and BLAS symbols
389
-        ['zmumps', 'mumps_common', 'metis', 'esmumps', 'scotch',
390
-         'scotcherr', 'mpiseq', 'openblas'],
387
+        ['zmumps_seq', 'mumps_common_seq'],
391 388
     ]
392
-    common_libs = ['pord', 'gfortran']
393
-
394 389
     for libs in lib_sets:
395
-        found_libs = search_libs(libs + common_libs)
390
+        found_libs = search_libs(libs)
396 391
         if found_libs:
397 392
             return found_libs
398 393
     return []