romerogroup / pyprocar

A Python library for electronic structure pre/post-processing
GNU General Public License v3.0
165 stars 72 forks source link

DOS qe plot failed #77

Closed IsmaelDiouFY closed 1 year ago

IsmaelDiouFY commented 1 year ago

Hi Dears, Someone can help me please to resolve the error of DOS plot, calculate by DFT. Capture Capture1

lllangWV-zz commented 1 year ago

Hey IsmaelDiouFY,

sorry for the late reply. I have 2 suggestions for a solution.

  1. This version is old and the parsing method has changed to use the .xml file instead. I refer you to the following page https://romerogroup.github.io/pyprocar/dftprep.html#quantum-espresso, this will tell you what you need to do for the density of states calculation
  2. The second suggestion would be to send me the .in file you used and the pseudopotentials, then I can take a look at where the issue is coming from. If I had to guess, the issue is coming from the parsing.

Logan Lang

IsmaelDiouFY commented 1 year ago

Hi Lang, Thank you for your reply. Of course, I used the atomic_proj.xml, charge-density.dat and data-file-schema.xml files in the directory where I ran propycar. I have attached a drobox link to the inputs files.

https://www.dropbox.com/t/n8VMw5fwmddnmAB8

IsmaelDiouFY commented 1 year ago

Hi Lang, I forgot to tell you about two things: The first is that when I ran pyprocar in Jupyter Notebook, the processing take a lot off time before to give me the error (some time 2hours). image The second is, when i tried to do the Fe tuto from pyprocar example, it's give me a bad result after 2hours processing. Fe-qe-6 7(b)_LI To limit the processing time, I was already using the pyprocar filter but it's the same (the processing takes several hours). Can you tell me how well can I use the pyprocar filter for QE? Which files (scf.out, bands.out or kpdos.out) should I run pyprocar-filter with? Or should I use it on all three output files? After, for example, if I run pyprocar-filter to reduce kpoints, should I delete the first input file used to create a pyprocar-out filter, before running pyprocar in the same directory? Can you show me a good command to run pyprocar with QE to reduce bands and Kpoints together and plot after bands are reduced? If you have any suggestions for speeding up the processing, please let me know. Thanks a lot!

lllangWV-zz commented 1 year ago

Hey IsmaelDiouFY,

I am terribly sorry for the late 2-week response. I got swamped with other projects. Okay, so the version of pyprocar you are using is depreciated for using quantum espresso. That version uses regex to parse the kpdos.out file to get the projects and kpoints, this is inefficient. In the version on github, we parse everything from the .xml files making it much more efficient. So I suggest to use the version on github

I ran your calculation with the following code: import pyprocar pyprocar.bandsplot(dirname = 'issues/Ismael/bands',elimit = [-20,20], mode='plain', color = 'blue', code='qe')

As you can see in this version, you have to specify where the calculation took place with "dirname"

image

And for the density of states: pyprocar.dosplot(dirname = 'issues/Ismael/dos',elimit=[-20,20], mode='plain', code='qe')

image

And for bandsdosplot: pyprocar.bandsdosplot(dos_dirname = 'issues/Ismael/dos',bands_dirname = 'issues/Ismael/bands', bands_mode='plain',dos_mode='plain', code='qe')

image

IsmaelDiouFY commented 1 year ago

Hi, Thanks ! I reinstalled pyprocar with version (5.6.5) from github. However after running pyprocar, I still get an error message. [image: image.png] Can you please share your quantum-espresso input files?

Le mer. 10 août 2022 à 18:55, lllangWV @.***> a écrit :

Hey IsmaelDiouFY,

I am terribly sorry for the late 2-week response. I got swamped with other projects. Okay, so the version of pyprocar you are using is depreciated for using quantum espresso. That version uses regex to parse the kpdos.out file to get the projects and kpoints, this is inefficient. In the version on github, we parse everything from the .xml files making it much more efficient. So I suggest to use the version on github

I ran your calculation with the following code:

import pyprocar pyprocar.bandsplot(dirname = 'issues/Ismael/bands',elimit = [-20,20], mode='plain', color = 'blue', code='qe')

As you can see in this version, you have to specify where the calculation took place with "dirname"

[image: image] https://user-images.githubusercontent.com/64661090/183783246-2e6ee878-cc5d-418f-99a2-a59b1288a6d4.png

And for the density of states: pyprocar.dosplot(dirname = 'issues/Ismael/dos',elimit=[-20,20], mode='plain', code='qe')

[image: image] https://user-images.githubusercontent.com/64661090/183967112-d47d1928-a193-43a7-85b1-1eda702cafb5.png

And for bandsdosplot: pyprocar.bandsdosplot(dos_dirname = 'issues/Ismael/dos',bands_dirname = 'issues/Ismael/bands', bands_mode='plain',dos_mode='plain', code='qe')

[image: image] https://user-images.githubusercontent.com/64661090/183969907-43eddb19-0a6a-4b9c-aa9e-ea0d33757550.png

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1210990892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMDS45U7HWMOIB5QLATVYPNJHANCNFSM54JRY32A . You are receiving this because you authored the thread.Message ID: @.***>

lllangWV-zz commented 1 year ago

Interesting, what was the error?

Here are the files for the bands and dos:

dos.zip bands.zip

IsmaelDiouFY commented 1 year ago

Hi, Thanks for the input files. I again recalculated the bands and DOS using the input files you sent me. I keep getting the error like <<AttributeError: 'Settings' object has no attribute 'general>> (see picture). I installed this version of pyprocar (https://github.com/romerogroup/pyprocar), is it the one you suggested? Do I need to install required-libraries for reading .xml files?

image

lllangWV-zz commented 1 year ago

That is strange. 'settings' should have an attribute general. Where you clone the repository, do you have the following file pyprocar/pyprocar/utils/default_settings.ini? And inside that file, is there a section tag called 'general'?

lllangWV-zz commented 1 year ago

Wait, do you try to install the v5.6.3? image

If so, this is the wrong version. Can you clone the repository directly?

image

IsmaelDiouFY commented 1 year ago

Hi, Yes i find a section tag called 'general' in pyprocar/pyprocar/utils/default_settings.ini:

image

Yes I installed the version https://github.com/romerogroup/pyprocar.git, but after the installation, it is the version 5.6.5 which is displayed not 5.6.3.

image

lllangWV-zz commented 1 year ago

Okay, so I tried to install pyprocar on a fresh virtual machine. I was able to generate the band structure and the density of states without generating your error.

I am trying to see why this issue is coming up. It could be a weird behavior with jupyter notebooks, but I am not sure. My next suggestion is to use the package outside the jupyter notebooks.

If all else fails, uninstall and reinstall it from scratch. I usually like making a conda environment with python==3.8, then installing pyprocar from the directory where I cloned it to.

Logan Lang

IsmaelDiouFY commented 1 year ago

Thank you for your reply. I uninstalled anaconda and all python packages. Then reinstall anaconda by creating an environment: conda create --name jupy python=3.8 ipykernel. I then installed pyprocar: python setup.py install. After running pyprocar on Anaconda-Powershell-prompt, I get the same message: AttributeError: 'Settings' object has no attribute 'general'

[image: image.png]

Le mar. 16 août 2022 à 19:05, lllangWV @.***> a écrit :

Okay, so I tried to install pyprocar on a fresh virtual machine. I was able to generate the band structure and the density of states without generating your error.

I am trying to see why this issue is coming up. It could be a weird behavior with jupyter notebooks, but I am not sure. My next suggestion is to use the package outside the jupyter notebooks.

If all else fails, uninstall and reinstall it from scratch. I usually like making a conda environment with python==3.8, then installing pyprocar from the directory where I cloned it to.

Logan Lang

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1216912673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMC746WHK7N7HQOD3QTVZPC43ANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

IsmaelDiouFY commented 1 year ago

Hi Dear, I wanted to point out that pyprocar for band structure tracking works fine for all three latest versions of purpocar with qe.7.0 and qe.6.5. The problem was related to the use of mpirun .... -nk 4....($PW_COMMAND $infile -nk 4 | tee $outfile). With the removal of -nk 4 I no longer get the error AttributeError: 'Settings' object has no attribute 'general'. However, for DOS I get with all versions of pyprocar, the following error for collinear spin calculations: [File "D:\Users\ikoun\Desktop\shared\Mn10Ge6\dos7\qe_dos_example.py", line 12, in

pyprocar.dosplot(code='qe',elimit=[-95,10],orientation='vertical', mode='plain') File "C:\Users\ikoun\anaconda3\lib\site-packages\pyprocar\scriptDosplot.py", line 388, in dosplot vaspxml = QEDOSParser(nscfin="nscf.in", File "C:\Users\ikoun\anaconda3\lib\site-packages\pyprocar\qeparser\qe_dos_parser.py", line 99, in __init__ self.data = self.read() File "C:\Users\ikoun\anaconda3\lib\site-packages\pyprocar\qeparser\qe_dos_parser.py", line 113, in read return self.parse_pdos() File "C:\Users\ikoun\anaconda3\lib\site-packages\pyprocar\qeparser\qe_dos_parser.py", line 581, in parse_pdos dos[:,2:5,0] = final_dos[:,1:] ValueError: could not broadcast input array from shape (8831,7) into shape (8831,3)]. However, for non-spin polarized computation, pyprocar plots the back very well without error. > Message ID: ***@***.***> >> >
lllangWV-zz commented 1 year ago

This is strange, I do not understand how running mpirun on inputs would be affecting an external python package (pyprocar). But hey, if it works that is good. Glad to know about this issue. I will discuss this with our collaborators to understand it more.

Now, as for the DOS. I see the pyprocar you are using is using QEDOSParser. This is an old parser. Could you use the pyprocar on the GitHub? I think I already asked you to do this, so I am sorry if I am being repetitive. If this problem still persists, we could talk over zoom or discord to work this problem out.

IsmaelDiouFY commented 1 year ago

Hi, Thanks for your reply. Of course, I used pyprocar from github, i sent you my input files.

https://www.dropbox.com/s/3lyoyyq5funm0ts/dos.rar?dl=0

Le lun. 22 août 2022 à 09:28, lllangWV @.***> a écrit :

  • The problem was related to the use of mpirun .... -nk 4....($PW_COMMAND $infile -nk 4 | tee $outfile). With the removal of -nk 4 I no longer get the error AttributeError: 'Settings' object has no attribute 'general'.

This is strange, I do not understand how running mpirun on inputs would be affecting an external python package (pyprocar). But hey, if it works that is good. Glad to know about this issue. I will discuss this with our collaborators to understand it more.

Now, as for the DOS. I see the pyprocar you are using is using QEDOSParser. This is an old parser. Could you use the pyprocar on the GitHub? I think I already asked you to do this, so I am sorry if I am being repetitive. If this problem still persists, we could talk over zoom or discord to work this problem out.

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1221960304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMC47OWQPPLABMNAGF3V2MTZNANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

lllangWV-zz commented 1 year ago

I think it would be easier to talk over zoom about this. When is the best time for you to talk? My schedule is pretty flexible.

IsmaelDiouFY commented 1 year ago

Hi dear, Yes of course, if is okay for you we can talk tomorrow…

Le lun. 22 août 2022 à 18:35, lllangWV @.***> a écrit :

I think it would be easier to talk over zoom about this. When is the best time for you to talk? My schedule is pretty flexible.

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1222611157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMGCHPETP4GOWVO3UFTV2OT47ANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

lllangWV-zz commented 1 year ago

Sure. What time can you talk? My zoom link is http://wvu.zoom.us/my/physics112.logan

IsmaelDiouFY commented 1 year ago

Thanks ! I will be free tomorrow 25/08 at 11:00 Am.

Le mer. 24 août 2022 à 19:41, lllangWV @.***> a écrit :

Sure. What time can you talk? My zoom link is http://wvu.zoom.us/my/physics112.logan

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1226039419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMGQ27ETXNJWAKAOOFTV2ZNEPANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

lllangWV-zz commented 1 year ago

11:00 A.M Eastern Standard Time? Just making sure

IsmaelDiouFY commented 1 year ago

Sory, i forgot that you are not in France. 11h from Greenwich time (GMT) it is okay for you?

Le mer. 24 août 2022 à 21:23, lllangWV @.***> a écrit :

11:00 A.M Eastern Standard Time? Just making sure

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1226145906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMCXQCCG6DCY2X7TN6DV2ZZDTANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

lllangWV-zz commented 1 year ago

That time works for me! I'll see you then.

IsmaelDiouFY commented 1 year ago

Okay! I am free now so if you are okay my zoom link is @.*** See you !

Le jeu. 25 août 2022 à 09:54, lllangWV @.***> a écrit :

That time works for me! I'll see you then.

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1226907763, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMEYPWKQKKSPUYSBKRTV24RCPANCNFSM54JRY32A . You are receiving this because you modified the open/close state.Message ID: @.***>

lllangWV-zz commented 1 year ago

I can't see what your zoom link is. Mine is http://wvu.zoom.us/my/physics112.logan

IsmaelDiouFY commented 1 year ago

Hi, Yes i find a section tag called 'general' in pyprocar/pyprocar/utils/default_settings.ini: [image: image.png]

Yes I installed the version https://github.com/romerogroup/pyprocar.git, but after the installation, it is the version 5.6.5 which is displayed not 5.6.3.

[image: image.png]

Le ven. 12 août 2022 à 03:10, lllangWV @.***> a écrit :

Wait, do you try to install the v5.6.3? [image: image] https://user-images.githubusercontent.com/64661090/184266907-3f8ea2e9-4b12-4281-a88a-913e62865b0b.png

If so, this is the wrong version. Can you clone the repository directly?

[image: image] https://user-images.githubusercontent.com/64661090/184266989-9ab468bc-bb26-4fef-b567-bc1723ef2fea.png

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/77#issuecomment-1212636558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2HHMEVKVPPG45CFHRVX6LVYWP6TANCNFSM54JRY32A . You are receiving this because you authored the thread.Message ID: @.***>