3
0
mirror of https://github.com/triqs/dft_tools synced 2025-04-18 14:30:19 +02:00

Two fixes in tight binding part

This commit is contained in:
Michel Ferrero 2014-10-06 23:18:10 +02:00
parent 71fa498833
commit 3b59d26a67
2 changed files with 4 additions and 6 deletions

View File

@ -61,10 +61,10 @@ class TBLattice:
def reg(k) : return tuple( int(x) for x in k)
self._hop = dict ( ( reg(k), numpy.array(v)) for k, v in hopping.items())
orb = dict ( (str(i), orb) for (i, orb) in enumerate(orbital_positions ))
self.bl = BravaisLattice(units, orb)
self.bl = BravaisLattice(units, orbital_positions)
self.tb = TightBinding(self.bl, self._hop) #, orbital_positions )
self.dim = self.bl.dim
self.NOrbitalsInUnitCell = self.bl.n_orbitals()
self.NOrbitalsInUnitCell = self.bl.n_orbitals
self.Units = units
self.OrbitalPositions = orbital_positions
self.OrbitalNames = orbital_names

View File

@ -135,15 +135,13 @@ namespace lattice {
rho() = 0;
for (int l = 0; l < norb; l++) {
for (int j = 0; j < grid.size(); j++) {
int a = int((eval(l, j) - epsmin) / deps);
if (a == int(neps)) a = a - 1;
for (int k = 0; k < norb; k++) {
int a = int((eval(k, j) - epsmin) / deps);
if (a == int(neps)) a = a - 1;
rho(a, l) += real(conj(evec(l, k, j)) * evec(l, k, j));
// dos(a) += real(conj(evec(l,k,j))*evec(l,k,j));
}
}
}
// rho = rho / double(grid.size()*deps);
rho /= grid.size() * deps;
return std::make_pair(epsilon, rho);
}