QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: ams_nanolab on February 13, 2017, 12:10

Title: Bandstructure export data
Post by: ams_nanolab on February 13, 2017, 12:10
In the ATK 2016.3 , the export bandstructure has lot more data including the k-point co-ordinates which is very good, but I want to export a more simple two column data (like earlier versions of ATK did) to a .dat file from the bandstructure object.

Could you help me with a python script for that?
Title: Re: Bandstructure export data
Post by: Jess Wellendorff on February 13, 2017, 12:54
Exactly what data should be in those 2 columns?
It's fairly easy to write a python script that print data to file:
Code
f = open('file.dat', 'w')
data1 = [1,2,3]
data2 = [4,5,6]
for d1,d2 in zip(data1,data2):
    print >> f, d1, d2
f.close()
I suggest you take a look at the documentation for the Bandstructure object to figure out how to retrieve the band struacture data you want before writing it to file: http://docs.quantumwise.com/manuals/Types/Bandstructure/Bandstructure.html (http://docs.quantumwise.com/manuals/Types/Bandstructure/Bandstructure.html)
Title: Re: Bandstructure export data
Post by: ams_nanolab on February 13, 2017, 13:31
I just want the E-k plot data and nothing else.

from the link I could not pick out the variables I need. kindly help.

I am getting:

# Band 0
x           Energy / eV  Fractional k-point
0.0000e+00  -1.7795e+01   [0.0000e+00, 0.0000e+00, 0.0000e+00]
2.0000e-02  -1.7794e+01   [0.0000e+00, 0.0000e+00, 1.0000e-02]
4.0000e-02  -1.7791e+01   [0.0000e+00, 0.0000e+00, 2.0000e-02]
6.0000e-02  -1.7785e+01   [0.0000e+00, 0.0000e+00, 3.0000e-02]

But I need

x           Energy / eV 
0.0000e+00  -1.7795e+01 
2.0000e-02  -1.7794e+01   
4.0000e-02  -1.7791e+01 
6.0000e-02  -1.7785e+01   

I could of course do post-processing, but a script helps in saving data directly into the format wanted.
Title: Re: Bandstructure export data
Post by: Petr Khomyakov on February 13, 2017, 15:19
This option of saving the band structure to a data file in xy-format will be available in the Bandstructure Analyzer in ATK2016.4 release that is really coming soon, not later than the end of this week.
Title: Re: Bandstructure export data
Post by: ams_nanolab on February 13, 2017, 15:19
Okay that's good  :) Also is it possible to plot in 3D (like the Graphene mexican hat) image attached.
Title: Re: Bandstructure export data
Post by: Anders Blom on February 14, 2017, 21:24
Sure, just compute the energy eigenvalues for a regular k-point grid in 2D, collect data in suitable arrays, and use matplotlib to plot it. Just like they did in the figure ;)
Title: Re: Bandstructure export data
Post by: ams_nanolab on February 14, 2017, 22:06
Okay. Will do that.