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:
parent
eaad5fa41d
commit
d6f2fb97b6
@ -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"""
|
||||||
@ -45,11 +46,7 @@ class BZPatch:
|
|||||||
pnt[1] = pnt[2]
|
pnt[1] = pnt[2]
|
||||||
else:
|
else:
|
||||||
pnt[np%3] = point
|
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)
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user