Author Topic: Help in python code  (Read 1025 times)

0 Members and 1 Guest are viewing this topic.

Offline Jahanzaib

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: gb
  • Reputation: 2
    • View Profile
Help in python code
« on: December 6, 2023, 05:11 »
Dear Expert
My python code for DOS works perfectly fine but I need to adjust a bit which I already tried but I couldn't succeeded. Can anyone share some tips or tricks so I can get required DOS.

Please find the attached code - there are two part of code
1) # Plot DOS 1 in the first subplot
     Herein, I have stanene nanoribbons consist of Tin 120 and H 24 (total 144 atoms) - my code gives me DOS for complete system but I am interested in
                         - Only p-orbitals of Tin, I know about projection stuff but I don't know how to loop it over complete all Tin.

2) # Plot DOS 2 in the second subplot
    Herein, I adsorbed FeSn10 on stanene nanoribbon and I am interested in
                        - Both p - orbitals of Tin, and Fe (atom indices = 144 and d-orbitals)

Thank you

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Help in python code
« Reply #1 on: December 9, 2023, 01:00 »
The plotting script is not helpful to answer the question, it's just plotting data once you have already extracted it. The question is really about how you computed the DOS, with which projections, and how to extract them. It's also a bit unclear what you want to plot, do you need multiple lines for the projected DOS of p-orbitals, one line for each atom, or just p for all atoms, one line? I guess my confusion is from the "loop", is it over atoms or projections? Seems like you should use ProjectOnShellsByElement, but I agree it's a bit hard to know from the manual how you use "evaluate" to get the individual data out. If you give me a bit more info, I can try to help.

Offline Jahanzaib

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: gb
  • Reputation: 2
    • View Profile
Re: Help in python code
« Reply #2 on: December 9, 2023, 04:35 »
Sorry Dr. Blom for inconveniences.

Please the find complete code for reference, and I have sent hdf5 file on email (quantumatk-support@synopsys.com) and I cannot share my results. Please have a look.
 1) DOS1
      Herein, I am only interested in p-orbitals of Tin. For "loop", I was trying to say that I have a long stanene nanoribbon (Tin=120 and H=24), is it the way to do to get the DOS for all 120 tin?
Projection(spin=Spin.Up, atoms=[Tin]) + Projection(spin=Spin.Down, atoms=[Tin]) - also i tried this but not worked for me.
then how to do angular_momenta=[1]????

2)DOS2
I think it's clear for you, just interested in Both p - orbitals of Tin, and Fe (atom indices = 144 and d-orbitals).

Thank you

Offline Jahanzaib

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: gb
  • Reputation: 2
    • View Profile
Re: Help in python code
« Reply #3 on: December 13, 2023, 02:17 »
Dear Dr Blom

For DOS1: I tried the projection and it works fine but I am interested in broadening=0.03 * eV which I think we cannot get through PDOS?

dos_Up = dos.evaluate(projection_list=ProjectionList(elements=[Tin], angular_momenta=[1]), spin=Spin.Up)
dos_Down = dos.evaluate(projection_list=ProjectionList(elements=[Tin], angular_momenta=[1]), spin=Spin.Down)


For DOS2, still trying.

Thank you
« Last Edit: December 18, 2023, 01:30 by Jahanzaib »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5411
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Help in python code
« Reply #4 on: January 19, 2024, 00:57 »
Sorry for the delay.

In general, I would avoid using DensityOfStates, as it's by now just a legacy object. PDOS really has all the same functionality, but is better supported and a LOT faster. And, you can use broadening in PDOS, but it's a bit hidden. Just set set spectrum_method=GaussianBroadening(broadening=0.03*eV).

So, for both DOS1 and DOS2, using ProjectOnShellsBySites in PDOS should give you the data you need, and then you can filter it down for plotting.

Offline Jahanzaib

  • Heavy QuantumATK user
  • ***
  • Posts: 81
  • Country: gb
  • Reputation: 2
    • View Profile
Re: Help in python code
« Reply #5 on: January 19, 2024, 11:05 »
Thank you Dr Blom for you guidance.
I already got with PDOS but don't have an idea for broadening in PDOS - i will try that.