3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 22:03:43 +01:00

Fix BZPatch class and partial DOS computation

modified:   pytriqs/lattice/bz_patch.py
  modified:   pytriqs/lattice/tight_binding.py
This commit is contained in:
Michel Ferrero 2013-09-05 17:55:18 +02:00
parent eaad5fa41d
commit d6f2fb97b6
2 changed files with 7 additions and 11 deletions

View File

@ -21,8 +21,9 @@
################################################################################ ################################################################################
#from pytriqs import * #from pytriqs import *
from super_lattice import * import numpy
from pytriqs.dos import DOS from pytriqs.dos import DOS
from pytriqs.lattice.tight_binding import dos_patch
class BZPatch: class BZPatch:
"""Description of a Patch of the BZ""" """Description of a Patch of the BZ"""
@ -46,10 +47,6 @@ class BZPatch:
else: else:
pnt[np%3] = point pnt[np%3] = point
def dos(self, lattice, n_bins, n_div_triangle): def dos(self, TB, n_eps, n_div):
""" Compute the partial dos of the Patch for the Lattice lattice""" """ Compute the partial dos of the Patch for the Lattice lattice"""
assert isinstance(lattice, (Lattice, TBSuperLattice)) return dos_patch(TB, numpy.array(self._triangles), n_eps, n_div, self.name)
return lattice.dos_patch(self._triangles, n_bins, n_div_triangle, self.name)

View File

@ -31,7 +31,6 @@ from lattice_tools import energies_on_bz_grid, energies_on_bz_path, hopping_stac
from pytriqs.dos import DOS from pytriqs.dos import DOS
import numpy import numpy
# MOVE THIS BACK INTO CYTHON !!!! # MOVE THIS BACK INTO CYTHON !!!!
def dos(tight_binding, n_kpts, n_eps, name) : 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) eps, arr = dos_c(tight_binding, n_kpts, n_eps)
return [ DOS (eps, arr[:, i], name) for i in range (arr.shape[1]) ] 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 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) return DOS (eps, arr, name)
# for backward compatibility. Not documented. # for backward compatibility. Not documented.