From d6f2fb97b644f117114df281620012d5d9a9d679 Mon Sep 17 00:00:00 2001 From: Michel Ferrero Date: Thu, 5 Sep 2013 17:55:18 +0200 Subject: [PATCH] Fix BZPatch class and partial DOS computation modified: pytriqs/lattice/bz_patch.py modified: pytriqs/lattice/tight_binding.py --- pytriqs/lattice/bz_patch.py | 13 +++++-------- pytriqs/lattice/tight_binding.py | 5 ++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pytriqs/lattice/bz_patch.py b/pytriqs/lattice/bz_patch.py index 50fea788..972dfa7b 100644 --- a/pytriqs/lattice/bz_patch.py +++ b/pytriqs/lattice/bz_patch.py @@ -21,8 +21,9 @@ ################################################################################ #from pytriqs import * -from super_lattice import * +import numpy from pytriqs.dos import DOS +from pytriqs.lattice.tight_binding import dos_patch class BZPatch: """Description of a Patch of the BZ""" @@ -45,11 +46,7 @@ class BZPatch: pnt[1] = pnt[2] else: pnt[np%3] = point - - def dos(self, lattice, n_bins, n_div_triangle): - """ Compute the partial dos of the Patch for the Lattice lattice""" - assert isinstance(lattice, (Lattice, TBSuperLattice)) - return lattice.dos_patch(self._triangles, n_bins, n_div_triangle, self.name) - - + def dos(self, TB, n_eps, n_div): + """ Compute the partial dos of the Patch for the Lattice lattice""" + return dos_patch(TB, numpy.array(self._triangles), n_eps, n_div, self.name) diff --git a/pytriqs/lattice/tight_binding.py b/pytriqs/lattice/tight_binding.py index da0758d2..c441088e 100644 --- a/pytriqs/lattice/tight_binding.py +++ b/pytriqs/lattice/tight_binding.py @@ -31,7 +31,6 @@ from lattice_tools import energies_on_bz_grid, energies_on_bz_path, hopping_stac from pytriqs.dos import DOS import numpy - # MOVE THIS BACK INTO CYTHON !!!! def dos(tight_binding, n_kpts, n_eps, name) : @@ -46,11 +45,11 @@ def dos(tight_binding, n_kpts, n_eps, name) : eps, arr = dos_c(tight_binding, n_kpts, n_eps) return [ DOS (eps, arr[:, i], name) for i in range (arr.shape[1]) ] -def dos_patch(tight_binding, triangles, n_kpts, n_div, name) : +def dos_patch(tight_binding, triangles, n_eps, n_div, name) : """ To be written """ - eps, arr = dos_c(tight_binding, n_kpts, eps) + eps, arr = dos_patch_c(tight_binding, triangles, n_eps, n_div) return DOS (eps, arr, name) # for backward compatibility. Not documented.