Author Topic: adding LDOS  (Read 4060 times)

0 Members and 1 Guest are viewing this topic.

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
adding LDOS
« on: October 1, 2010, 14:04 »
Can LDOS be added like effective potential?

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: adding LDOS
« Reply #1 on: October 1, 2010, 14:15 »
I think I know how, I figure i have to use the .toArray() command. but after i add the new sample to the vnl will i still be able to view it?

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: adding LDOS
« Reply #2 on: October 1, 2010, 15:07 »
I want to write a script that adds several LDOS, but  I am having a lot of trouble This is the script I wrote but I couldn't get anywhere with it.
Code
t=0
energies=numpy.linspace(-0.40308,-0.34967,10)*electronVolt

for i in range(len(energies)):
    lo = calculateLocalDensityOfStates(self_consistent_calculation = scf, energy = energies[i], quantum_number = (0.0,0.0))
    lo=lo.toArray()
    t=t+lo


export_cube_file(t,'file.cube')
if processIsMaster(): file.addToSample(t, 'ldosh', 'Local Density Of States Peak homo')
if processIsMaster(): file.addToSample(atomic_configuration,'ldosh')

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5405
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: adding LDOS
« Reply #3 on: October 1, 2010, 18:36 »
You don't write the error message, so I have to guess a bit what goes wrong. Try removing the t=0 line; it makes t an integer, which you then try to add to an array. I'd go with something like
Code
t = None
energies = numpy.linspace(-0.40308,-0.34967,10)*electronVolt

for i in range(len(energies)):
    ldos = calculateLocalDensityOfStates(scf, energy = energies[i], quantum_number = (0.0,0.0))
    if t==None:
        t = ldos.toArray()
    else:
        t = t+ldos.toArray()

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: adding LDOS
« Reply #4 on: October 2, 2010, 20:56 »
Sorry for not writing an error message, I was a bit tired that morning. This  code seemed to be working, i just have to analyze the data now.  :)
Code
from ATK.TwoProbe import *
from ATK.MPI import processIsMaster
import numpy

# Fetch the calculations.
if processIsMaster(): file = VNLFile('ldosh.vnl')

# Read old atomic configuration
vnl_file = VNLFile("gap.vnl")
atomic_configuration = vnl_file.readAtomicConfigurations()["gap"]

scf = restoreSelfConsistentCalculation('CGsupergap.nc')
scf._attributeContainer().getAttributeContainer('SetupAttributes').setDouble(100.,'MeshCutoff')
t=None
energies=numpy.linspace(-0.40308,-0.34967,10)*electronVolt

for i in range(len(energies)):
    ldos = calculateLocalDensityOfStates(scf, energy = energies[i], quantum_number = (0.0,0.0))
    if t==None:
        t = ldos.toArray()
    else:
        t = t+ldos.toArray()

ldos._LocalDensityOfStates__local_density_of_states_data =t

if processIsMaster(): file.addToSample(ldos, 'ldosh', 'Local Density Of States Peak homo')
if processIsMaster(): file.addToSample(atomic_configuration,'ldosh'

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: adding LDOS
« Reply #5 on: October 2, 2010, 20:59 »
How does one change the dE for the LDOS calculation?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5405
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: adding LDOS
« Reply #6 on: October 2, 2010, 21:33 »
dE, you mean in your case the energy spacing/resolution? That's part of the statement
Code
energies=numpy.linspace(-0.40308,-0.34967,10)*electronVol
10 means 10 points in the energy range indicated.

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: adding LDOS
« Reply #7 on: October 3, 2010, 00:59 »
I meant for a single LDOS calculation.


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5405
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: adding LDOS
« Reply #8 on: October 3, 2010, 01:01 »
There is no dE for LDOS... Only E (energy).

Or you mean the infinitesimal? See http://quantumwise.com/documents/manuals/ATK-2008.10/ref.calculatelocaldensityofstates.html
« Last Edit: October 3, 2010, 01:03 by Anders Blom »