I have calculated a system using ATK2008-10. We can obtain the PDOS using the script below. But if the K-point sampling in x and y directions is 3*3. How do I modify this script?
from ATK.TwoProbe import *; import numpy
from projected_density_of_states import *
scf = restoreSelfConsistentCalculation('lih2li.nc')
projection_atoms = [5,6]
pdos = calculateProjectedDensityOfStates(scf,numpy.arange(-3,3.01,0.01)*Units.eV,
projection_atoms = projection_atoms)
nlPrint(pdos)
from ATK.TwoProbe import *; import numpy as np
def calculateProjectedDensityOfStates(self_consistent_calculation = None,
energies = None,
brillouin_zone_integration_parameters = None,
green_function_infinitesimal = None,
projection_atoms = []):
"""
Written by Nordland !
Extreme usage of ATK backengine!
Module for calculate the density of states projected onto the atoms.
Uses the same interfaces as calculateDensityOfStates, but is extended with a parameter
called projection_atoms.
Give the projection atoms as a sequence of the indicies of the atoms to project onto
for instance projection_atoms = [3,6,7,8]
"""
atom_container = self_consistent_calculation._attributeContainer().getAtomContainer("AtomContainer")
number_of_atoms = atom_container.numberOfAtoms()
old_contact = [(atom_container.atoms()).isContact() for i in range(number_of_atoms)]
first_atom_index = \
np.where([ not(atom_container.atoms()).isElectrode() for i in range(number_of_atoms)])[0][0]
new_contact = np.array([False]*number_of_atoms)
indicies = np.array(projection_atoms)+first_atom_index
new_contact[indicies] = True
# Insert the new contact atoms.
for i,c in enumerate(new_contact):
(atom_container.atoms()).setContact(bool(c))
pdos = calculateDensityOfStates(self_consistent_calculation,
energies,
brillouin_zone_integration_parameters,
green_function_infinitesimal)
# Restore the old contact atoms.
for i,c in enumerate(old_contact):
(atom_container.atoms()).setContact(bool(c))
# Return the projected density of states.
return pdos