Corrupted Projected Density of State Files

This is just a quick entry to describe an issue that I had with xmgrace and projected density of state files from PWSCF.

As you may be aware, the majority of my research has to do with semiconductors, both organic and inorganic. While PWSCF, and Density Functional Theory in general, has issues with semiconductors, especially those having to do with bandgaps, it is one of the most powerful tools we have for high throughput design of atomic systems.

But I digress. Today, I was doing a routine Density of States plot on a new system we are exploring. I was using xmgrace to plot it and it plotted something like this:

Screen Shot 2014-04-03 at 5.36.40 PM

Where it should look something like this:

Screen Shot 2014-04-03 at 5.37.33 PM

So what exactly is going on here? If I look at the files that I have in my folder, I am presented with something like this:

2206346.e20165                    MK21xThio.pdos_atm#15(K)_wfc#2(p) MK21xThio.pdos_atm#21(O)_wfc#1(s) MK21xThio.pdos_atm#27(O)_wfc#2(p) MK21xThio.pdos_atm#33(H)_wfc#1(s) MK21xThio.pdos_atm#7(O)_wfc#2(p)  pdos.out
2206346.e20166                    MK21xThio.pdos_atm#16(K)_wfc#1(s) MK21xThio.pdos_atm#21(O)_wfc#2(p) MK21xThio.pdos_atm#28(O)_wfc#1(s) MK21xThio.pdos_atm#34(H)_wfc#1(s) MK21xThio.pdos_atm#8(O)_wfc#1(s)  relax.in
2206346.o20165                    MK21xThio.pdos_atm#16(K)_wfc#2(p) MK21xThio.pdos_atm#22(O)_wfc#1(s) MK21xThio.pdos_atm#28(O)_wfc#2(p) MK21xThio.pdos_atm#35(H)_wfc#1(s) MK21xThio.pdos_atm#8(O)_wfc#2(p)  relax.out
2206346.o20166                    MK21xThio.pdos_atm#17(K)_wfc#1(s) MK21xThio.pdos_atm#22(O)_wfc#2(p) MK21xThio.pdos_atm#29(O)_wfc#1(s) MK21xThio.pdos_atm#36(H)_wfc#1(s) MK21xThio.pdos_atm#9(H)_wfc#1(s)  relax.xyz
MK21xThio.dos                     MK21xThio.pdos_atm#17(K)_wfc#2(p) MK21xThio.pdos_atm#23(O)_wfc#1(s) MK21xThio.pdos_atm#29(O)_wfc#2(p) MK21xThio.pdos_atm#37(H)_wfc#1(s) MK21xThio.pdos_tot                scf.in
MK21xThio.pdos_atm#10(H)_wfc#1(s) MK21xThio.pdos_atm#18(F)_wfc#1(s) MK21xThio.pdos_atm#23(O)_wfc#2(p) MK21xThio.pdos_atm#3(K)_wfc#1(s)  MK21xThio.pdos_atm#38(H)_wfc#1(s) Remover.sh                        scf.out
MK21xThio.pdos_atm#12(P)_wfc#1(s) MK21xThio.pdos_atm#18(F)_wfc#2(p) MK21xThio.pdos_atm#24(O)_wfc#1(s) MK21xThio.pdos_atm#3(K)_wfc#2(p)  MK21xThio.pdos_atm#4(F)_wfc#1(s)  ZrP-K                             test.dat
MK21xThio.pdos_atm#12(P)_wfc#2(p) MK21xThio.pdos_atm#19(F)_wfc#1(s) MK21xThio.pdos_atm#24(O)_wfc#2(p) MK21xThio.pdos_atm#30(O)_wfc#1(s) MK21xThio.pdos_atm#4(F)_wfc#2(p)  bak                               testing123
MK21xThio.pdos_atm#13(P)_wfc#1(s) MK21xThio.pdos_atm#19(F)_wfc#2(p) MK21xThio.pdos_atm#25(O)_wfc#1(s) MK21xThio.pdos_atm#30(O)_wfc#2(p) MK21xThio.pdos_atm#5(O)_wfc#1(s)  dos.in                            testing123.dat
MK21xThio.pdos_atm#13(P)_wfc#2(p) MK21xThio.pdos_atm#2(P)_wfc#1(s)  MK21xThio.pdos_atm#25(O)_wfc#2(p) MK21xThio.pdos_atm#31(O)_wfc#1(s) MK21xThio.pdos_atm#5(O)_wfc#2(p)  dos.out
MK21xThio.pdos_atm#14(P)_wfc#1(s) MK21xThio.pdos_atm#2(P)_wfc#2(p)  MK21xThio.pdos_atm#26(O)_wfc#1(s) MK21xThio.pdos_atm#31(O)_wfc#2(p) MK21xThio.pdos_atm#6(O)_wfc#1(s)  nscf.in
MK21xThio.pdos_atm#14(P)_wfc#2(p) MK21xThio.pdos_atm#20(F)_wfc#1(s) MK21xThio.pdos_atm#26(O)_wfc#2(p) MK21xThio.pdos_atm#32(O)_wfc#1(s) MK21xThio.pdos_atm#6(O)_wfc#2(p)  nscf.out
MK21xThio.pdos_atm#15(K)_wfc#1(s) MK21xThio.pdos_atm#20(F)_wfc#2(p) MK21xThio.pdos_atm#27(O)_wfc#1(s) MK21xThio.pdos_atm#32(O)_wfc#2(p) MK21xThio.pdos_atm#7(O)_wfc#1(s)  pdos.in

‘Cat’-ing one of this files reveals the following at the top of every one of these files:


# E (eV)   ldos(E)   pdos(E)    pdos(E)    pdos(E)
 ******* -0.250E-03 -0.993E-04 -0.962E-04 -0.549E-04
 -99.900 -0.990E-04 -0.401E-04 -0.366E-04 -0.223E-04
 -99.800 -0.256E-04 -0.105E-04 -0.919E-05 -0.587E-05
 -99.700 -0.465E-05 -0.194E-05 -0.163E-05 -0.108E-05
 -99.600 -0.613E-06 -0.259E-06 -0.209E-06 -0.145E-06
 -99.500 -0.594E-07 -0.254E-07 -0.198E-07 -0.142E-07
 -99.400 -0.428E-08 -0.185E-08 -0.139E-08 -0.104E-08
 -99.300 -0.231E-09 -0.101E-09 -0.731E-10 -0.565E-10
 -99.200 -0.933E-11 -0.413E-11 -0.289E-11 -0.231E-11
 -99.100 -0.284E-12 -0.127E-12 -0.856E-13 -0.713E-13
 -99.000  0.000E+00  0.000E+00  0.000E+00  0.000E+00
 -98.900  0.000E+00  0.000E+00  0.000E+00  0.000E+00
 -98.800  0.000E+00  0.000E+00  0.000E+00  0.000E+00
 -98.700  0.000E+00  0.000E+00  0.000E+00  0.000E+00

What appeared to be happening is those ******* were causing the issues, forcing xmgrace to move over one column and plot ldos vs pdos. I am sure you could fix this in xmgrace, but it is also very easy to do in bash:


#!/bin/bash
for i in MK21xThio.pdos_atm#*
do
sed -ibak '2d' $i > $i
done

Have to get rid of the “bak” files, but a quick and dirty solution. Then I plot it:
Screen Shot 2014-04-03 at 6.08.33 PM

Which is not exactly what I was expecting (looks like I have some sort of bonding issue in this structure); but hey, that looks like a Density of States plot to me!

Until next time!

Levi

Leave a Reply

Your email address will not be published. Required fields are marked *