Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dos for elk not working #46

Open
recohen opened this issue Mar 3, 2021 · 63 comments
Open

dos for elk not working #46

recohen opened this issue Mar 3, 2021 · 63 comments

Comments

@recohen
Copy link

recohen commented Mar 3, 2021

I am trying to plot the dos for elk. I have the proper files:
cohen@tomcat:/home/beegfs/rcohen/ELK/PTO/Yangzheng/EDOS/R3c/110GPa/LMIREP$ ls -ltr DOS
-rw-r--r-- 1 rcohen tomcat 342 Mar 2 23:12 FERMIDOS.OUT
-rw-r--r-- 1 rcohen tomcat 14802 Mar 2 23:30 TDOS.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:31 PDOS_S01_A0001.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:32 PDOS_S01_A0002.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:33 PDOS_S02_A0001.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:33 PDOS_S02_A0002.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:34 PDOS_S03_A0001.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:35 PDOS_S03_A0002.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:36 PDOS_S03_A0003.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:37 PDOS_S03_A0004.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:38 PDOS_S03_A0005.OUT
-rw-r--r-- 1 rcohen tomcat 236832 Mar 2 23:38 PDOS_S03_A0006.OUT
-rw-r--r-- 1 rcohen tomcat 14802 Mar 2 23:38 IDOS.OUT

I can plot bands but for dos I get:

pyprocar.dosplot(elimit=[-3,3],code='elk')


| _ \ _ | _ \ _ __ ___ ___ __ _ _ __
| |
) | | | | |) | '__/ _ \ / / _` | '|
| __/| |
| | /| | | () | (| (| | |
|
| _, || |_| _
/ __,||
|
/
A Python library for electronic structure pre/post-processing.

...
cript initiated
code : elk
vasprun file : vasprun.xml
mode : plain
spin : None
atoms list : None
orbs. list : None
energy range : [-3, 3]
eolormap : jet
vmax : None
vmin : None
grid enabled : True
savefig : None
title : None
Traceback (most recent call last):
File "", line 1, in
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/scriptDosplot.py", line 91, in dosplot
fig, ax1 = dos_plot.plot_total(
UnboundLocalError: local variable 'dos_plot' referenced before assignment

I have tried different options first too, but this most basic form also does run. What am I doing wrong?

I am also interested whether it is possible to plot fatbands, rather than coded bands.
For bands I have a different problem that some seem to belong to no atom! But that is a different issue.

Thank you!

Ron

@petavazohi
Copy link
Member

Hi Ron,

Would you mind sharing your calculations with us?

Pedram

@recohen
Copy link
Author

recohen commented Mar 3, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 3, 2021

Here are the files I think you need. If more, please let me know.
The file was >10MB so here is a dropbox link: https://www.dropbox.com/s/9fw33j6hu9ooq7c/cohendata.tar.gz?dl=0

@recohen
Copy link
Author

recohen commented Mar 3, 2021

Even worse, it seems the bandplot is incorrect. I attach here the bands from elk-bands (pdf) and also from pyprocar (png file) with Ti colors. I don't understand how the bands can be totally different.
elk-bands.pdf
bandplotTi

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 3, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 3, 2021

I tried this and I got:
pyprocar.bandsplot(elimit=[-15,15],cmap='jet',mode='parametric',code='elk',atoms=[2,3],kdirect=False)

...
Elk non spin calculation detected.

Traceback (most recent call last):
File "", line 1, in
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/scriptBandsplot.py", line 223, in bandsplot
procarFile = ElkParser(kdirect=kdirect)
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 63, in init
self._read_bands()
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 212, in _read_bands
rf = open(self.file_names[0], "r")
FileNotFoundError: [Errno 2] No such file or directory: 'BANDS.OUT'

I then tried ln -s BAND.OUT BANDS.OUT and get:
Traceback (most recent call last):
File "", line 1, in
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/scriptBandsplot.py", line 223, in bandsplot
procarFile = ElkParser(kdirect=kdirect)
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 63, in init
self._read_bands()
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 248, in _read_bands
self.kpoints = np.dot(self.kpoints, self.reclat)
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 339, in reclat
lattice_array = np.array(lattice_block[1].split(), dtype=float)
IndexError: list index out of range

@recohen
Copy link
Author

recohen commented Mar 3, 2021

OK--it seems it depends what the task is in elk.in! I had changed it t o get the dos. Now I changed it back to 22 and get a plot. You can see it here without kdirect=False, and there are extra bands!
bandplotTi2
I also tried adding kdirect=False and get this error:
pyprocar.bandsplot(elimit=[-15,15],cmap='jet',mode='parametric',code='elk',atoms=[2,3],kdirect=False)
Python library for electronic structure pre/post-processing.

Version 5.5.2 created on July 27th, 2020

Please cite: Herath, U., Tavadze, P., He, X., Bousquet, E., Singh, S., Muñoz, F. & Romero, A., PyProcar: A Python library for electronic structure pre/post-processing., Computer Physics Communications 251 (2020):107080.

Script initiated
code : elk
input file : None
mode : parametric
spin comp. : 0
atoms list : [2, 3]
orbs. list : [-1]
fermi energy : None
energy range : [-15, 15]
colormap : jet
markersize : 0.02
permissive : False
vmax : None
vmin : None
grid enabled : True
human : False
savefig : None
title : None
outcar : None
k-grid : cartesian (Remember to provide an output file for this case to work.)

Elk non spin calculation detected.

Traceback (most recent call last):
File "", line 1, in
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/scriptBandsplot.py", line 223, in bandsplot
procarFile = ElkParser(kdirect=kdirect)
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 63, in init
self._read_bands()
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 248, in _read_bands
self.kpoints = np.dot(self.kpoints, self.reclat)
File "/home/beegfs/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/pyprocar/elkparser/elkparser.py", line 339, in reclat
lattice_array = np.array(lattice_block[1].split(), dtype=float)
IndexError: list index out of range

@recohen
Copy link
Author

recohen commented Mar 3, 2021

The bands actually look totally different!

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 3, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 3, 2021

No--with kdirect=False it crashes with IndexError: list index out of range
It runs without kdirect=False

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 3, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021

I do not see your plots. I sent you before the comparison. The extra bands are the bottom two conduction bands. The rest of the bands are totally different too. But you have changed the code now?

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 5, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 5, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 8, 2021 via email

@petavazohi
Copy link
Member

petavazohi commented Mar 8, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 8, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 8, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 8, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 8, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 8, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 9, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 9, 2021

your images do not show still. See the github website--no images there. Same in email. You use my elk.in and get a different result?

@recohen
Copy link
Author

recohen commented Mar 9, 2021

Your email looks like this:
Also, when I performed the DFT calculation myself from scratch using the
structure you provided this is what I got:
[image: image.png]
Here you can see that the lower conduction band is indeed of Ti-d in
nature.

When I used the output data from your calculation and using LATTICE.out and
EFERMI.out from my own calculation (since they weren't in your directory so
this is not very accurate) I get this:
[image: image.png]
which is similar to your latest plots.

Now, I don't know enough about PbTiO3 but double check your DFT calculation
inputs to make sure everything is in order.

Best,
Uthpala

@recohen
Copy link
Author

recohen commented Mar 9, 2021

Here are LATTICE.OUT and EFERMI.OUT. You also need my Pb.in Ti.in and O.in because the distributed ones will not work well, certainly not at these high pressures.
Archive.zip

@uthpalaherath
Copy link
Member

Sorry the images don't seem to attach when I respond through email. Here's the plot again:

PbTiO3-d

This is the input I used:

`! Plotting bands for PbTiO3

tasks
0
22

! 10

highq
.true.

!xctype
!100 118 130

spinpol
.false.

lmirep
.true.

demaxbnd
4.5

nrmtscf
4

lradstp
2

epspot
1.d-7

epsengy
1.d-5

mixtype
3

nempty
20

ngridk
12 12 12

wplot
400
400
1
-0.11025 0.11025

plot1d
7 300
0.5 0.0 0.0 : L
0.0 0.0 0.0 : \Gamma
0.5 0.5 0.0 : F
0.5 0.0 0.0 : L
0.5 0.5 0.5 : Z
0.0 0.0 0.0 : \Gamma
0.0 0.0 0.5 : M

sppath
'/home/uthpala/elk/elk-7.0.12/species/'

!scrpath
! '/scratch/'

avec
0.9563710635 0.2065845938 0.2065845938
0.2065845938 0.9563710635 0.2065845938
0.2065845938 0.2065845938 0.9563710635

scale
9.1364949914

atoms
3 : nspecies
'Pb.in' : spfname
2
0.994300000000000 0.994300000000000 0.994300000000000 0.00000000 0.00000000 0.00000000
0.494300000000000 0.494300000000000 0.494300000000000 0.00000000 0.00000000 0.00000000
'Ti.in' : spfname
2
0.227250000000000 0.227250000000000 0.227250000000000 0.00000000 0.00000000 0.00000000
0.727250000000000 0.727250000000000 0.727250000000000 0.00000000 0.00000000 0.00000000
'O.in' : spfname
6
0.535770000000000 0.932780000000000 0.046220000000000 0.00000000 0.00000000 0.00000000
0.432780000000000 0.035770000000000 0.546220000000000 0.00000000 0.00000000 0.00000000
0.546220000000000 0.432780000000000 0.035770000000000 0.00000000 0.00000000 0.00000000
0.035770000000000 0.546220000000000 0.432780000000000 0.00000000 0.00000000 0.00000000
0.932780000000000 0.046220000000000 0.535770000000000 0.00000000 0.00000000 0.00000000
0.046220000000000 0.535770000000000 0.932780000000000 0.00000000 0.00000000 0.00000000
`

I'll check with your pseudos too.

  • Uthpala

@recohen
Copy link
Author

recohen commented Mar 11, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 11, 2021 via email

@uthpalaherath
Copy link
Member

uthpalaherath commented Mar 14, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 14, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 14, 2021

BTW there was a problem with that run--there were ghost bands! The current bands with wc is attached. I was wondering if you were able to fix the dos for elk?

@recohen
Copy link
Author

recohen commented Mar 14, 2021

SOrry here re the bands for 150 GPa.
BandsTid_R3c_150GPa.pdf
They now look similar to the LDA bands.

@recohen
Copy link
Author

recohen commented Apr 7, 2021 via email

@recohen
Copy link
Author

recohen commented Mar 27, 2023

Some years later I tried plotting an elk dos and it is still not working? Or is there an example? I try:

import pyprocar

pyprocar.dosplot(filename='elk.in',code='elk')


| _ \ _ | _ \ _ __ ___ ___ __ _ _ __
| |
) | | | | |) | '__/ _ \ / / _` | '|
| __/| |
| | /| | | () | (| (| | |
|
| _, || |_| _
/ __,||
|
/
A Python library for electronic structure pre/post-processing.

Version 5.6.6 created on March 6th, 2022

Please cite:
Uthpala Herath, Pedram Tavadze, Xu He, Eric Bousquet, Sobhit Singh, Francisco Muñoz and Aldo Romero.,
PyProcar: A Python library for electronic structure pre/post-processing.,
Computer Physics Communications 251 (2020):107080.

...
Script initiated
code : vasp
File name : elk.in
mode : plain
spins : None
atoms list : None
orbs. list : None
energy range : None
colormap : jet
vmax : None
vmin : None
grid enabled : False
savefig : None
title : None
Traceback (most recent call last):
File "", line 1, in
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/pyprocar/scriptDosplot.py", line 364, in dosplot
vaspxml = VaspXML(
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/pyprocar/vaspxml/vaspxml.py", line 33, in init
self.data = self.read()
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/pyprocar/vaspxml/vaspxml.py", line 52, in read
return parse_vasprun(self.filename)
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/pyprocar/vaspxml/vaspxml.py", line 512, in parse_vasprun
tree = ET.parse(vasprun)
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/xml/etree/ElementTree.py", line 1202, in parse
tree.parse(source, parser)
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/xml/etree/ElementTree.py", line 595, in parse
self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0

@petavazohi
Copy link
Member

petavazohi commented Mar 30, 2023 via email

@recohen
Copy link
Author

recohen commented Mar 30, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 14, 2023 via email

@petavazohi
Copy link
Member

petavazohi commented Apr 17, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 17, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 24, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 25, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 25, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 25, 2023

In the routine scriptDosplot.py there should not seem to even exist a section for elk:

rec38) rcohen@tomcat:~/pyprocar/pyprocar$ grep code pyprocar/scripts/scriptDosplot.py
code:str="vasp",
This is used for qe and lobster codes. It specifies the directory the dosplot
code : str, optional (default 'vasp')
Defines the Density Functional Theory code used for the
e.g. code=vasp, code=elk, code=abinit
code=code,
def parse(code: str='vasp',
parser = io.lobster.LobsterParser(dirname = dirname,code = code, dos_interpolation_factor =interpolation_factor)
elif code == "vasp":
elif code == "qe":

just shows up in the doc lines as:
grep elk pyprocar/scripts/scriptDosplot.py
e.g. code=vasp, code=elk, code=abinit

Ron

@recohen
Copy link
Author

recohen commented Apr 25, 2023

I tried deleting all old versions of pyprocar and reinstalling the dev branch using python setup.py install and now get:

import pyprocar

pyoricar.dosplot(code='elk')
Traceback (most recent call last):
File "", line 1, in
NameError: name 'pyoricar' is not defined
pyprocar.dosplot(code='elk')
Traceback (most recent call last):
File "", line 1, in
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/PyProcar2-5.6.5-py3.8.egg/pyprocar/scripts/scriptDosplot.py", line 348, in dosplot
parser = io.Parser(code = code, dir = dirname)
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/PyProcar2-5.6.5-py3.8.egg/pyprocar/io/parser.py", line 27, in init
self.parse()
File "/home/rcohen/.conda/envs/rec38/lib/python3.8/site-packages/PyProcar2-5.6.5-py3.8.egg/pyprocar/io/parser.py", line 51, in parse
self.ebs.bands += self.ebs.efermi
AttributeError: 'NoneType' object has no attribute 'bands'

@petavazohi
Copy link
Member

petavazohi commented Apr 26, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 26, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 26, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 26, 2023 via email

@recohen
Copy link
Author

recohen commented May 1, 2023 via email

@recohen
Copy link
Author

recohen commented May 5, 2023 via email

@recohen
Copy link
Author

recohen commented Apr 12, 2024

I STILL CANNOT PLOT DOS FOR ELK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants