Author Topic: Hexagonal plot of transmission coefficients  (Read 7357 times)

0 Members and 1 Guest are viewing this topic.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Hexagonal plot of transmission coefficients
« on: May 13, 2012, 06:17 »
Normally when you plot the k-point resolved transmission, it becomes a square plot of T vs kA and kB (the actual point K=kA*b1+kB*b2 where b1,2 are the reciprocal lattice vectors), because that is how we sample the Brillouin zone.

In the hexagonal case, it is more illustrative to see the plot in the actual Brillouin zone, i.e. as a function of kx,ky in the hexagon. To make that plot is rather challenging because as it turns out, the Monkhorst-Pack regular grid in kA,kB space actually samples points in the 2nd Brillouin zone, which you then have to map back into the first zone. And, there are some tricks needed in matplotlib to get a hexagonal axis plot. But in the end, you can get the attached picture!

The labels K and M have been added afterwards in an image editing program.

The inspiration for this came from PRB 80, 035408 (2009).
« Last Edit: May 13, 2012, 06:26 by Anders Blom »

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #1 on: April 28, 2020, 04:51 »
Dear Dr. Blom,

Would you like to update this script for the latest version?   It doesn't work for the 2019.12.sp1 version.

Thank you so much.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #2 on: April 29, 2020, 07:21 »
Minor changes, but a bit tricky because of deprecation of matplotlib.mlab.griddata

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #3 on: April 30, 2020, 16:06 »
Thank you Dr. Blom for your new script.

It works now. However, a strange pic is printed, as shown in the attachment named "pic".
It seems that the new script doesn't need the transmission sprectum and only reads the band structure?   

I just got the band of graphene from input.py and the pic from the new script.

The new script seems only to  print the Fermi surface of CBM or VBM (like the Ferm_ surface.py script in the examples https://docs.quantumatk.com/tutorials/topological_insulator_bi2se3/topological_insulator_bi2se3.html)? not the transmission coefficient?
So, 1 ) Would you like to update the script to plot the transission coefficients in the hexgonal?
     2) Would you like to update the script to plot the spin texture  for the newest version 2019.12.sp1?
    3) It's great if you can also update the script for calculating the topological invariants
   
Thank you so much.
« Last Edit: April 30, 2020, 16:48 by Roc2019 »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #4 on: May 5, 2020, 08:29 »
Ok, I didn't notice the original script was for transmission - it is more outdated than the band structure version because nxplot was deprecated already in Matplotlib 1.3. So, more work to update it. But my main problem is actually that I have no good data to test the plot with, I deleted all old "nc" files a long time ago.

Thus, I made a blind attempt to apply the same changes as for band structure - maybe it works, but if not perhaps you can provide me a test HDF5 file with transmission data to experiment on?

The reason for the strange plot is that  you have computed a usual band structure, from G to K to M etc. For this plot you need to get eigenvalues on a regular k-point mesh around the K point (or in the whole zone). The transmission spectrum already has such data, though. I have attached also a script to generate the input data for the band structure plot.

For the other questions, that is outside my expertise, but I understand you are saying the scripts in the tutorial do not work anymore? That should be considered a "bug" and I can report it to have it fixed.
« Last Edit: May 5, 2020, 20:15 by Anders Blom »

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #5 on: May 5, 2020, 11:36 »
Thank you Dr. Blom.
It seems that your script does not work for the new version 2019.12.sp1. 
The attachment is the input and output files for the transmission of graphene obtained by the newest version.
If possible, would you like to test and update the new srcipt to obtain the hexgonal transmission picture using the attachments.

Thank you so much again.
« Last Edit: May 5, 2020, 14:55 by Roc2019 »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #6 on: May 5, 2020, 20:18 »
Ooooh, I just missed that print needs to be a function now...!

So the script should technically work now. Using your HDF5 file didn't allow to make a nice plot to show it, because for whatever reason all transmission is zero for all energies and k-points in your example.
 

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #7 on: May 6, 2020, 03:58 »
Thank you Dr. Blom.

The new script works now. It is great!!!   :D

Expect you or other experts could update some other scripts for the neweast version 2019.12.sp1,  for examples,
     2) the script to plot the spin texture  for the newest version 2019.12.sp1
    3) the script for calculating the topological invariants

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #8 on: June 8, 2020, 14:18 »
Dear Dr. Blom,

Would you like to give the two new files of hexplot.py and transmission_hexplot.py for a spin polarization calculation?   The present version of the both scripts does not work for a spin-resolved calculation.

Thank you very much.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #9 on: June 9, 2020, 09:04 »
I don't have good test data for that but should be easy by just modifying the nlread around line 48-49 to select the right spin component, no?

If the current code doesn't work, try

t = nlread(ncfile, TransmissionSpectrum)[0]
T = t.transmission(spin=Spin.Up or Spin.Down)[Epoint]
« Last Edit: June 9, 2020, 09:05 by Anders Blom »

Offline Roc2019

  • Heavy QuantumATK user
  • ***
  • Posts: 53
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #10 on: June 9, 2020, 15:21 »
Thank you very much, Dr. Blom.  I  get it.   ;)

Offline John Donald Raj

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: in
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #11 on: April 18, 2022, 13:25 »
Dear Dr. Blom,
I tried to run the transmission_hexplot.py to plot the hexagonal transmission plot. But the code is not working for me for the ATK version 2020.09. It will be great if you could you help me to plot the hexagonal transmission plot. I'm attaching my .hdf5 file, which is a spinpolarised transmission file.

Thanking You.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #12 on: June 7, 2022, 02:38 »
Sorry I don't have such an old version installed on my machine. What is the error?

Offline kartiksamanta

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: us
  • Reputation: 0
    • View Profile
Re: Hexagonal plot of transmission coefficients
« Reply #13 on: March 21, 2024, 18:45 »
Dear Anders,

                       Could you please let me know how to extract and write the data points for the kpoint (kx,ky) resolve transmission plot (kx,ky vs T at Fermi energy)  using  your  script transmision_hexaplot.py in a separate file ? If you could modify the script it would be very helpful.
Thanks!

With best,
Kartik

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5394
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Hexagonal plot of transmission coefficients
« Reply #14 on: March 21, 2024, 21:19 »
The variables of relevance for this are kx, ky and zi. You can just loop over them and print to a text file in desired format, although I would argue that any analysis or plotting you want to do might be better done in Python...
Code: python
kvalues = ky[0]
for i in range(len(kvalues)):
    for j in range(len(kvalues)):
        print(kvalues[i], kvalues[j], zi[i,j])
« Last Edit: March 26, 2024, 18:32 by Anders Blom »