Esempio n. 1
0
    def get_wigner_seitz_ldos(self, a, spin=0, npts=201, width=None):
        """The Local Density of States, using a Wigner-Seitz basis function.

        Project wave functions onto a Wigner-Seitz box at atom ``a``, and
        use this as weight when summing the eigenvalues."""
        if width is None:
            width = 0.1

        from gpaw.utilities.dos import raw_wignerseitz_LDOS, fold
        energies, weights = raw_wignerseitz_LDOS(self, a, spin)
        return fold(energies * Ha, weights, npts, width)
Esempio n. 2
0
    def get_wigner_seitz_ldos(self, a, spin=0, npts=201, width=None):
        """The Local Density of States, using a Wigner-Seitz basis function.

        Project wave functions onto a Wigner-Seitz box at atom ``a``, and
        use this as weight when summing the eigenvalues."""
        if width is None:
            width = self.get_electronic_temperature()
        if width == 0:
            width = 0.1

        from gpaw.utilities.dos import raw_wignerseitz_LDOS, fold
        energies, weights = raw_wignerseitz_LDOS(self, a, spin)
        return fold(energies * Hartree, weights, npts, width)
Esempio n. 3
0
            communicator=comm)
Hspin.set_calculator(calc)
e_Hspin = Hspin.get_potential_energy()
niter_Hspin = calc.get_number_of_iterations()
energies, sweight_spin = raw_orbital_LDOS(calc, a=0, spin=0, angular='s')

calc = GPAW(
    gpts=(32, 32, 40),
    nbands=2,  #eigensolver='dav',
    communicator=comm)
LiH.set_calculator(calc)
e_LiH = LiH.get_potential_energy()
niter_LiH = calc.get_number_of_iterations()
energies, Li_orbitalweight = raw_orbital_LDOS(calc, a=0, spin=0, angular=None)
energies, H_orbitalweight = raw_orbital_LDOS(calc, a=1, spin=0, angular=None)
energies, Li_wzweight = raw_wignerseitz_LDOS(calc, a=0, spin=0)
energies, H_wzweight = raw_wignerseitz_LDOS(calc, a=1, spin=0)
n_a = calc.get_wigner_seitz_densities(spin=0)

print sweight, pdfweight
print sweight_spin
print Li_wzweight
print H_wzweight
print n_a

equal(sweight[0], 1., .06)
equal(pdfweight[0], 0., .0001)
equal(sweight_spin[0], 1.14, .06)
assert ((Li_wzweight - [.13, .93]).round(2) == 0).all()
assert ((H_wzweight - [.87, .07]).round(2) == 0).all()
assert ((Li_wzweight + H_wzweight).round(5) == 1).all()
Esempio n. 4
0
calc = GPAW(gpts=(24, 24, 24), occupations=FermiDirac(width=0, fixmagmom=True),
            hund=True, communicator=comm)
Hspin.set_calculator(calc)
e_Hspin = Hspin.get_potential_energy()
niter_Hspin = calc.get_number_of_iterations()
energies,sweight_spin = raw_orbital_LDOS(calc, a=0, spin=0, angular='s')

calc = GPAW(gpts=(32, 32, 40), nbands=2, #eigensolver='dav',
            communicator=comm)
LiH.set_calculator(calc)
e_LiH = LiH.get_potential_energy()
niter_LiH = calc.get_number_of_iterations()
energies, Li_orbitalweight = raw_orbital_LDOS(calc, a=0, spin=0, angular=None)
energies, H_orbitalweight = raw_orbital_LDOS(calc, a=1, spin=0, angular=None)
energies, Li_wzweight = raw_wignerseitz_LDOS(calc, a=0, spin=0)
energies, H_wzweight = raw_wignerseitz_LDOS(calc, a=1, spin=0)
n_a = calc.get_wigner_seitz_densities(spin=0)

print(sweight, pdfweight)
print(sweight_spin)
print(Li_wzweight)
print(H_wzweight)
print(n_a)

equal(sweight[0], 1., .06)
equal(pdfweight[0], 0., .0001)
equal(sweight_spin[0], 1.14, .06)
assert ((Li_wzweight - [.13, .93]).round(2) == 0).all()
assert ((H_wzweight - [.87, .07]).round(2) == 0).all()
assert ((Li_wzweight + H_wzweight).round(5) == 1).all()