3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 11:13:46 +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 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)

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
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.