Author Topic: Charge density around the Fermi energy?  (Read 5573 times)

0 Members and 1 Guest are viewing this topic.

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Charge density around the Fermi energy?
« on: December 26, 2011, 22:46 »
Hi,

How can we get the charge density, for each spin direction, at energies close to the Fermi energy (or for a specific energy interval) for a two probe system?

Offline zh

  • QuantumATK Support
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #1 on: December 27, 2011, 03:22 »
It can be obtained by calling "LocalDeviceDensityOfStates()" for a given energy.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5418
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Charge density around the Fermi energy?
« Reply #2 on: December 27, 2011, 10:50 »
The LDOS is an excellent concept to understand the device characteristics. It's not exactly the "electron density", but note that the electron density is not energy-dependent, so if you want something that is (energy-dependent) then the LDOS is indeed what you want.

Of course you can always compute the real-space electron density for a device, but not for a given energy.

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #3 on: December 27, 2011, 13:50 »
Thanks for your answers,

This is what I want. One more thing:  In order to get the the LDOS difference for spin up and down, I have used "toArray()" in ATK 11.2.3 but it gives  an error:

'LocalDeviceDensityOfStates' object has no attribute 'toArray'

In the reference manual there is such an argument,

what is the reason of that?

Thanks,

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5418
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Charge density around the Fermi energy?
« Reply #4 on: December 27, 2011, 23:25 »
toArray was used in ATK 2008.10, but has been discontinued for quite a while. As far as I know, it shouldn't be mentioned in the manuals either. To get the separate spin up and down LDOS, use the keyword spin=Spin.Up or Spin.Down when you calculate the LDOS, like
Code: python
LDOS_u = LocalDeviceDensityOfStates(device_configuration, energy=0.*eV, spin=Spin.Up)
After that, the need convert the data to raw numbers (which is what toArray did) depends strongly on your objective; for 3D plotting, the best way is to just saved it in an NC file and use VNL. You can also export the data to a Gaussian Cube file from within VNL.

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #5 on: December 27, 2011, 23:33 »
Dr. Blom,

By LDOS difference what I mean is to get LDOS_up - LDOS_down

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5418
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Charge density around the Fermi energy?
« Reply #6 on: December 27, 2011, 23:37 »
Which is real easy :)
Code: python
LDOS_u = LocalDeviceDensityOfStates(device_configuration, energy=0.*eV, spin=Spin.Up)
LDOS_d = LocalDeviceDensityOfStates(device_configuration, energy=0.*eV, spin=Spin.Down)
LDOS_diff = LDOS_u-LDOS_d
nlsave("file.nc",LDOS_u,object_id="LDOS Up")
nlsave("file.nc",LDOS_d,object_id="LDOS Down")
nlsave("file.nc",LDOS_diff,object_id="Difference")
Now you can plot each quantity in VNL. The object_ids are optional, but help identify the data.

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #7 on: December 27, 2011, 23:43 »
Dr. Blom,

Ohh! Actually, I have thought that we must define an argument like "toArray" in 11.2.3. You know in order to get LDOS difference in 2008.10, we should introduce this argument. 

Thanks,

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #8 on: December 28, 2011, 00:39 »
Hi Dr. Blom,

Sorry for inconvenience. Upon running the code, I get the following error:

 Traceback (most recent call last):
  File "file.py", line 33, in <module>
    nlsave('file.nc',LDOS_diff,object_id="LDOS-diff")
  File "./zipdir/NL/IO/NLSaveUtilities.py", line 161, in nlsave
  File "./zipdir/NL/Analysis/LocalDeviceDensityOfStates.py", line 255, in _nlsave
AttributeError: 'LocalDeviceDensityOfStates' object has no attribute '_LocalDeviceDensityOfStates__contributions'

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5418
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Charge density around the Fermi energy?
« Reply #9 on: December 29, 2011, 10:39 »
That looks like a bug. I can design a temporary work-around (Python is nice!), I just need to check a few things first.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5418
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Charge density around the Fermi energy?
« Reply #10 on: December 29, 2011, 15:23 »
It's a bug, of sorts. One can argue which "spin" property the LDOS difference object should have (and this will create some difficulties for us in designing a proper solution), but at least the following lines of code will allow the computed difference LDOS to be saved in the NetCDF and then visualized in VNL:
Code: python
LDOS_u = LocalDeviceDensityOfStates(device_configuration, energy=0.*eV, spin=Spin.Up)  
LDOS_d = LocalDeviceDensityOfStates(device_configuration, energy=0.*eV, spin=Spin.Down)  
LDOS_diff = LDOS_u-LDOS_d  

# Assign missing quantities to the difference object which allows it to be nlsaved
LDOS_diff._LocalDeviceDensityOfStates__contributions = LDOS_d._LocalDeviceDensityOfStates__contributions
LDOS_diff._LocalDeviceDensityOfStates__energy = LDOS_d._LocalDeviceDensityOfStates__energy
LDOS_diff._LocalDeviceDensityOfStates__energy_zero = LDOS_d._LocalDeviceDensityOfStates__energy_zero
LDOS_diff._LocalDeviceDensityOfStates__energy_zero_parameter = LDOS_d._LocalDeviceDensityOfStates__energy_
# For lack of better value, set the spin to Spin.Sum (Up and Down are certainly wrong!)
# This has no influence on plotting etc, it's just a matter of book-keeping
LDOS_diff._LocalDeviceDensityOfStates__spin = Spin.Sum

nlsave("file.nc",LDOS_u,object_id="LDOS Up")
nlsave("file.nc",LDOS_d,object_id="LDOS Down")
nlsave("file.nc",LDOS_diff,object_id="Difference")

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Charge density around the Fermi energy?
« Reply #11 on: January 1, 2012, 00:36 »
Many thanks for your reply...

Happy new year with best wishes...