Author Topic: Question on script of energy dependent LDOS  (Read 4075 times)

0 Members and 1 Guest are viewing this topic.

Offline kaypu

  • QuantumATK Guru
  • ****
  • Posts: 135
  • Country: 00
  • Reputation: 1
    • View Profile
Question on script of energy dependent LDOS
« on: December 26, 2012, 02:02 »
Dear QuantumWise staff:
   
      i've got a problem in calculating energy dependent LDOS using the script in "http://www.quantumwise.com/documents/tutorials/latest/MolecularDevice/index.html/chap.analysis.html#sect1.analysis.lddos", maybe the memory of my laptop is not enough. So i save the LDOS in separated NC(-1~-0.5eV: LDOS0.nc; -0.4~0eV: LDOS1.nc; 0.1~0.5eV: LDOS2.nc; 0.6~1eV: LDOS3.nc).
     
      how to plot all of these NC in one pic?

PS: the script in the website:

      # import list with lddos
lddos_list = nlread('lddos.nc', LocalDeviceDensityOfStates)            .............how to read all of the NC using nlread?

#Find the z-spacing
dX, dY, dZ = lddos_list[0].volumeElement().convertTo(Ang)
dz = dZ.norm()
shape = lddos_list[0].shape()
z = dz * numpy.arange(shape[2])

# calculate average lddos along z for each spectrum
energies = []
lddos_z = []
for lddos in lddos_list:
    energies = energies + [lddos.energy().inUnitsOf(eV)]
    avg_z = numpy.apply_over_axes(numpy.mean,lddos[:,:,:],[0,1]).flatten()
    lddos_z = lddos_z + [avg_z]

# plot as contour plot
# make variables
energies = numpy.array(energies)
X, Y = numpy.meshgrid(z, energies)
Z = numpy.array(lddos_z).reshape(numpy.shape(X))


import pylab
#plot the LDDOS(E, z)
pylab.xlabel('z (Angstrom)',fontsize=12,family='sans-serif')
pylab.ylabel('Energy (eV)',fontsize=12,family='sans-serif')
contour_values = numpy.linspace(0,0.02,21)
pylab.contourf(X, Y, Z, contour_values)
pylab.colorbar()
pylab.axis([6,16,-3, 3])

pylab.title('Au-DTB-Au : LDDOS(E, z)')
pylab.savefig('lddos.png',dpi=100)


pylab.show()   


Regards
kaypu

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Question on script of energy dependent LDOS
« Reply #1 on: December 26, 2012, 15:35 »
Please define "problem" :)

The other question I believe was answered already separately, right?

Offline kaypu

  • QuantumATK Guru
  • ****
  • Posts: 135
  • Country: 00
  • Reputation: 1
    • View Profile
Re: Question on script of energy dependent LDOS
« Reply #2 on: December 27, 2012, 01:27 »
thank you professor Anders

i have four separated LDOS.nc with different energy interval. Using the script, i can only plot the picture from one of the LDOS.nc(maybe the energy interval is -1eV~-0.5eV), how to modify the script to plot the four LDOS.nc into one picture?

« Last Edit: December 27, 2012, 01:30 by kaypu »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Question on script of energy dependent LDOS
« Reply #3 on: December 27, 2012, 01:36 »
You can either first combine the NC files into one, as described in http://quantumwise.com/forum/index.php?topic=2128.msg10072, or just incorporate that in the LDOS plot script, like
Code: python
...
lddos_list  = nlread('lddos0.nc', LocalDeviceDensityOfStates)
lddos_list += nlread('lddos1.nc', LocalDeviceDensityOfStates)
lddos_list += nlread('lddos2.nc', LocalDeviceDensityOfStates)
lddos_list += nlread('lddos3.nc', LocalDeviceDensityOfStates)
...
Just do a "print energies" also, somewhere later in the script, to make sure the order of the data is correct.

Offline kaypu

  • QuantumATK Guru
  • ****
  • Posts: 135
  • Country: 00
  • Reputation: 1
    • View Profile
Re: Question on script of energy dependent LDOS
« Reply #4 on: December 27, 2012, 04:03 »
thank you professor Anders  i will try

it terminated
*************************************************************************
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
********************************************************************************

what's wrong with it?  is it not enough memory?  i use 12.2
« Last Edit: December 27, 2012, 04:26 by kaypu »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5577
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Question on script of energy dependent LDOS
« Reply #5 on: December 27, 2012, 10:01 »
Usually yes. When does it happen in the script, upon nlread?

If you are trying to run in parallel, don't.