Author Topic: difference of two kinds of spin-polarized states for LDOS  (Read 4857 times)

0 Members and 1 Guest are viewing this topic.

Offline renren123123

  • Heavy QuantumATK user
  • ***
  • Posts: 70
  • Reputation: 0
    • View Profile
Today, I want to get the difference of two kinds of spin-polarized states for LDOS for example:LDOS(up)-LDOS(down) at the Fermi level?  But I dont know how to get them?
Thank you very much!!!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: difference of two kinds of spin-polarized states for LDOS
« Reply #1 on: November 18, 2009, 12:50 »
By LDOS in this context, do you mean the local density of states as computed by ATK using calculateLocalDensityOfStates(), for a given energy (E=0 for the Fermi level) and (kx,ky)?

If so, the object returned by the function has a method toArray() which returns a NumPy array. You can directly take the array for spin up minus the one for spin down.

How to proceed from there depends a bit on what you want to do with it, plot it, integrate it, export it, etc.

Offline renren123123

  • Heavy QuantumATK user
  • ***
  • Posts: 70
  • Reputation: 0
    • View Profile
Re: difference of two kinds of spin-polarized states for LDOS
« Reply #2 on: November 19, 2009, 10:05 »
using the function: calculateLocalDensityOfStates, how to get the plot of the difference between LDOS(Ef_UP)-LDOS(Ef_DOWN)?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: difference of two kinds of spin-polarized states for LDOS
« Reply #3 on: November 19, 2009, 13:58 »
Try this
Code
from ATK.TwoProbe import *

#------------------------------------------------------------
# Specify your checkpoint file and other parameters here
checkpointfile = 'checkpointfile.nc'
vnlfile = 'ldos.vnl'
sample_name = 'sample'
energy = 0.*eV
kpoint = (0.,0.)
#------------------------------------------------------------

scf = restoreSelfConsistentCalculation(checkpointfile)

# Compute spin up/down LDOS at specific energy
ldos_up = calculateLocalDensityOfStates(scf,energy,(kpoint,Spin.Up))
ldos_dn = calculateLocalDensityOfStates(scf,energy,(kpoint,Spin.Down))

# Save up/down LDOS
f = VNLFile(vnlfile)
f.addToSample(ldos_up,sample_name,'LDOS up')
f.addToSample(ldos_dn,sample_name,'LDOS down')

# Replace data in up object by difference
ldos_up._LocalDensityOfStates__local_density_of_states_data = ldos_up.toArray()-ldos_dn.toArray()

# Save to VNL file
f.addToSample(ldos_up,sample_name,'LDOS difference')
NOTE that the "up" LDOS object is overwritten, so if you want to save it to the VNL file also, do that in a separate script. If you are adding this to an existing VNL file, use the same sample name as for the configuration for easier plotting.