pyprocar icon indicating copy to clipboard operation
pyprocar copied to clipboard

quantum espresso dos without band structure

Open recohen opened this issue 5 months ago • 46 comments

Because of all my problems with VASP I have now run with quantum espresso, but now have problems there. How do I plot the partial dos for quantum espresso without band structures? It seems pyprocar requires band info even to plot the dos? HSE bands are not possible, so I just want to plot the DOS. I though get:

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:187, in Parser._parse_qe(self) 178 def _parse_qe(self): 179 """parses qe files 180 181 Returns (...) 184 None 185 """ --> 187 parser = qe.QEParser( 188 dirpath=self.dirpath, 189 scf_in_filepath="scf.in", 190 bands_in_filepath="bands.in", 191 pdos_in_filepath="pdos.in", 192 kpdos_in_filepath="kpdos.in", 193 atomic_proj_xml_filepath="atomic_proj.xml", 194 ) 196 self.ebs = parser.ebs 197 self.kpath = parser.kpath

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:73, in QEParser.init(self, dirpath, scf_in_filepath, bands_in_filepath, pdos_in_filepath, kpdos_in_filepath, atomic_proj_xml_filepath) 71 self._parse_magnetization(main_xml_root=xml_root) 72 self._parse_structure(main_xml_root=xml_root) ---> 73 self._parse_band_structure_tag(main_xml_root=xml_root) 74 self._parse_symmetries(main_xml_root=xml_root) 76 # Parsing projections spd array and spd phase arrays

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:1148, in QEParser._parse_band_structure_tag(self, main_xml_root) 1144 self.nk3 = float(monkhorst_tag.attrib["k3"]) 1146 self.nks = int(main_xml_root.findall(".//output/band_structure/nks")[0].text) 1147 self.atm_wfc = int( -> 1148 main_xml_root.findall(".//output/band_structure/num_of_atomic_wfc")[0].text 1149 ) 1151 self.nelec = float( 1152 main_xml_root.findall(".//output/band_structure/nelec")[0].text 1153 ) 1154 if self.n_spin == 2:

IndexError: list index out of range

recohen avatar Jul 29 '25 17:07 recohen

Hey Ron!

I am looking into this. For quantum espresso weather it is just a band structure or density of states calculation, you will always get the band_structure element in the xml file.

I am confused about why is it hitting an list index out of range. Maybe they changed they're schema in a newer version. What version of quantum espresso are you using?

Also just to be clear on the process you ran the following calculations:

mpirun -np 20 pw.x <scf.in> scf.out
mpirun -np 20 pw.x <nscf.in> nscf.out
mpirun -np 20 projwfc.x <pdos.in> pdos.out

Logan Lang

lllangWV avatar Aug 06 '25 12:08 lllangWV

No there is no nscf in a hse or hartree fock like calculation. One has a single scf with full kpoints. Then projwfc.x. I am using the lastedt qe version. Thanks! Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 08:51 Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3160040241

Hey Ron!

I am looking into this. For quantum espresso weather it is just a band structure or density of states calculation, you will always get the band_structure element in the xml file.

I am confused about why is it hitting an list index out of range. Maybe they changed they're schema in a newer version. What version of quantum espresso are you using?

Also just to be clear on the process you ran the following calculations:

mpirun -np 20 pw.x <scf.in> scf.out mpirun -np 20 pw.x <nscf.in> nscf.out mpirun -np 20 projwfc.x <pdos.in> pdos.out

Logan Lang

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

recohen avatar Aug 06 '25 13:08 recohen

Okay. I did not consider that when I first created the quantum espresso parser. Could you send me the the save xml file?

It should be located in {CALC_DIRPATH} / {outdir} / {prefix}.xml

lllangWV avatar Aug 06 '25 13:08 lllangWV

Here are all the xml files from one run. Thanks!

Ron FMSOK666nosymHSE06xml.tar.gz https://drive.google.com/file/d/10LkTzOPWwHERoiFm-e9oO2y_O9IXvEX6/view?usp=drive_web

Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 9:23 AM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3160163277

Okay. I did not consider that when I first created the quantum espresso parser. Could you send me the the save xml file?

It should be located in {CALC_DIRPATH} / {outdir} / {prefix}.xml

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

recohen avatar Aug 06 '25 14:08 recohen

I am also wondering how to do this spin projections in the SO case from qe. Thanks! Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 09:23 Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3160163277

Okay. I did not consider that when I first created the quantum espresso parser. Could you send me the the save xml file?

It should be located in {CALC_DIRPATH} / {outdir} / {prefix}.xml

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

recohen avatar Aug 06 '25 14:08 recohen

Okay, I made a fix to where this was catching an indexing error. This should be okay now. Since I didn't have all the files I couldn't test to be sure.

pip uninstall pyprocar
pip install --pre pyprocar

I am also wondering how to do this spin projections in the SO case from QE.

So this is a somewhat complicated. A couple years ago we were working with a QE developer and created a branch that would print of the spin projections in the spin-orbit case. Sadly, this was never adapted into the main QE branch and it seems the branch has since then been deleted.

Currently, there is no way in quantum espresso to get the spin projections in the SO case that I know of.

lllangWV avatar Aug 07 '25 02:08 lllangWV

Thank you so much! Actually it prints the spin projections each iteration in the scf.out file. I will send all the files later. Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 22:57 Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3162245656

Okay, I made a fix to where this was catching an indexing error. This should be okay now. Since I didn't have all the files I couldn't test to be sure.

pip uninstall pyprocarpip install --pre pyprocar

I am also wondering how to do this spin projections in the SO case from QE.

So this is a somewhat complicated. A couple years ago we were working with a QE developer and created a branch that would print of the spin projections in the spin-orbit case. Sadly, this was never adapted into the main QE branch and it seems the branch has since then been deleted.

Currently, there is no way in quantum espresso to get the spin projections in the SO case that I know of.

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

recohen avatar Aug 07 '25 10:08 recohen

You are right -- it is a problem. The spin projections printed are from the charge(spin) density in real space. I don't see a way to convert from the jl representations in the projwfc output and spin projections, but maybe there is a way. It prints columns with: Atomic states used for projection (read from pseudopotential files):

 state #   1: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j=-3.5)
 state #   2: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j=-2.5)
 state #   3: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j=-1.5)
 state #   4: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j=-0.5)
 state #   5: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j= 0.5)
 state #   6: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j= 1.5)
 state #   7: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j= 2.5)
 state #   8: atom   1 (Nd ), wfc  1 (l=3 j=3.5 m_j= 3.5)
 state #   9: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j=-2.5)
 state #  10: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j=-1.5)
 state #  11: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j=-0.5)
 state #  12: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j= 0.5)
 state #  13: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j= 1.5)
 state #  14: atom   1 (Nd ), wfc  2 (l=3 j=2.5 m_j= 2.5)

Deepseek gives me the formula using the actual orbitals. I am not sure if one can do the same from the projections, but I think so.

Files are attached,

Thank you!

Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 10:57 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3162245656

Okay, I made a fix to where this was catching an indexing error. This should be okay now. Since I didn't have all the files I couldn't test to be sure.

pip uninstall pyprocarpip install --pre pyprocar

I am also wondering how to do this spin projections in the SO case from QE.

So this is a somewhat complicated. A couple years ago we were working with a QE developer and created a branch that would print of the spin projections in the spin-orbit case. Sadly, this was never adapted into the main QE branch and it seems the branch has since then been deleted.

Currently, there is no way in quantum espresso to get the spin projections in the SO case that I know of.

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

recohen avatar Aug 07 '25 12:08 recohen

I wonder if wannier90 is the way to do this? I find this in the docs:

dos = true https://wannier90.readthedocs.io/en/latest/tutorials/tutorial_17/?h=spin+orbit#__codelineno-18-2 https://wannier90.readthedocs.io/en/latest/tutorials/tutorial_17/?h=spin+orbit#__codelineno-18-3spin_decomp = true

for getting spin projections from spin-orbit.

Do you have experience with this?

Sincerely,

Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 10:57 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3162245656

Okay, I made a fix to where this was catching an indexing error. This should be okay now. Since I didn't have all the files I couldn't test to be sure.

pip uninstall pyprocarpip install --pre pyprocar

I am also wondering how to do this spin projections in the SO case from QE.

So this is a somewhat complicated. A couple years ago we were working with a QE developer and created a branch that would print of the spin projections in the spin-orbit case. Sadly, this was never adapted into the main QE branch and it seems the branch has since then been deleted.

Currently, there is no way in quantum espresso to get the spin projections in the SO case that I know of.

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

recohen avatar Aug 07 '25 12:08 recohen

I tried what you said and I still get the error:

---------------------------------------------------------------------------IndexError Traceback (most recent call last) Cell In[4], line 12 10 #orbitals=[0] 11 spins=[3]---> 12 dos=pyprocar.dosplot( 13 #items=items, 14 atoms=atoms, 15 dos_limit=[-40,25], 16 spins=spins, 17 code=code, 18 elimit=[-5, 4], 19 mode='stack_orbitals', 20 fermi=FERMI, 21 plot_total=True, 22 dirname=data_dir)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py:323 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py#line=322, in dosplot(code, dirname, mode, orientation, spins, atoms, orbitals, items, normalize_dos_mode, fermi, fermi_shift, elimit, dos_limit, savefig, labels, projection_mask, ax, show, print_plot_opts, export_data_file, export_append_mode, use_cache, verbose, **kwargs) 320 if not os.path.exists(dos_pkl_filepath): 321 logger.info(f"Parsing DOS from {dirname}")--> 323 parser = io.Parser(code=code, dirpath=dirname) 324 dos = parser.dos 325 structure = parser.structure

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:30 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=29, in Parser.init(self, code, dirpath, verbose) 27 self.dos = None 28 self.structure = None---> 30 self._parse()

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:47 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=46, in Parser._parse(self) 44 self._parse_bxsf() 46 elif self.code == "qe":---> 47 self._parse_qe() 49 elif self.code == "siesta": 50 self._parse_siesta()

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:187 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=186, in Parser._parse_qe(self) 178 def _parse_qe(self): 179 """parses qe files 180 181 Returns (...) 184 None 185 """--> 187 parser = qe.QEParser( 188 dirpath=self.dirpath, 189 scf_in_filepath="scf.in", 190 bands_in_filepath="bands.in", 191 pdos_in_filepath="pdos.in", 192 kpdos_in_filepath="kpdos.in", 193 atomic_proj_xml_filepath="atomic_proj.xml", 194 ) 196 self.ebs = parser.ebs 197 self.kpath = parser.kpath

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:64 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py#line=63, in QEParser.init(self, dirpath, scf_in_filepath, bands_in_filepath, pdos_in_filepath, kpdos_in_filepath, atomic_proj_xml_filepath) 52 self.dirpath = Path(dirpath).resolve() 54 # Handles the pathing to the files 55 ( 56 prefix, 57 xml_root, 58 atomic_proj_xml_filepath, 59 pdos_in_filepath, 60 bands_in_filepath, 61 pdos_out_filepath, 62 projwfc_out_filepath, 63 self.scf_out_filepath,---> 64 ) = self._initialize_filenames( 65 scf_in_filepath=scf_in_filepath, 66 bands_in_filepath=bands_in_filepath, 67 pdos_in_filepath=pdos_in_filepath, 68 ) 69 # Parsing structual and calculation type information 70 self._parse_efermi(main_xml_root=xml_root)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:593 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py#line=592, in QEParser._initialize_filenames(self, scf_in_filepath, bands_in_filepath, pdos_in_filepath) 590 scf_in = f.read() 592 outdir = re.findall("outdir\s*=\s*'\S*?(.)'", scf_in)[0]--> 593 prefix = re.findall("prefix\s=\s*'(.*)'", scf_in)[0] 594 xml_filename = prefix + ".xml" 596 atomic_proj_xml_filepath = ( 597 Path(self.dirpath) / https://portal.eplhpc.carnegiescience.edu/ outdir / https://portal.eplhpc.carnegiescience.edu/ f"{prefix}.save" / https://portal.eplhpc.carnegiescience.edu/ "atomic_proj.xml" 598 ) IndexError: list index out of range


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 6, 2025 at 10:57 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3162245656

Okay, I made a fix to where this was catching an indexing error. This should be okay now. Since I didn't have all the files I couldn't test to be sure.

pip uninstall pyprocarpip install --pre pyprocar

I am also wondering how to do this spin projections in the SO case from QE.

So this is a somewhat complicated. A couple years ago we were working with a QE developer and created a branch that would print of the spin projections in the spin-orbit case. Sadly, this was never adapted into the main QE branch and it seems the branch has since then been deleted.

Currently, there is no way in quantum espresso to get the spin projections in the SO case that I know of.

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

recohen avatar Aug 07 '25 13:08 recohen

I don't see a way to convert from the. jl representations in the projwfc output and spin projections, but maybe

I tried to do this in the past. I thought this should be possible as the total angular momentum jl basis and the lm basis are related through the clebsch-gordan coefficients. I got held up on the exact formulas.

The projected density of states is

$$ \text{PDOS}i(E) = \sum{n, \mathbf{k}} | \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle |^2 \delta(E - E_{n, \mathbf{k}}) $$

where

$| \phi_{JM} \rangle$ : the atomic orbital wave function $\langle \psi_{n, \mathbf{k}}$ : the kohn sham wave function

Now in spin-orbit calculation, they calculate the projections in the total angular momentum jl basis. To convert to the lm basis we can use the completeness relation.

$$ \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle = \langle \psi_{n, \mathbf{k}} | \psi_{j_1lm_1m}\rangle \langle \psi_{j_1lm_1m} | \phi_{jm} \rangle $$

or

$$ \langle \psi_{n, \mathbf{k}} | \psi_{j_1lm_1m}\rangle = \frac{ \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle }{ \langle \psi_{j_1lm_1m} | \phi_{jm} \rangle } $$

$\langle \psi_{j_1lm_1m} | \phi_{jm} \rangle$ : Clebsch gordan coeffecient. This is just a constant

I got held up here as the values you find in the density of states are not $\langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle$. I think I would have to go from the values found in the atomic_proj.xml, then recalculate the density of states.

Evenmore, this doesn't compute the spin-component projects $S_x$, $S_y$, and $S_z$. For that I would have to introduce the pauli matrices in the derivation.

Files are attached,

I can't seem to find where you attached these files

I tried what you said and I still get the error

Yeah I need all the files to properly debug this then.

I wonder if wannier90 is the way to do this? I find this in the docs:

I believe it is definitely possible. I do not have experience in performing the wannerization.

If you provide the files from the wannerization, I can create a parser to integrate it into pyprocar.

lllangWV avatar Aug 07 '25 14:08 lllangWV

I got an error message that files were too large. So here is a google drive link:

https://drive.google.com/drive/folders/19oooXUIrlvoSRtfaXvy4SaK26V71Jw_u?usp=drive_link


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Thu, Aug 7, 2025 at 10:12 AM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3164374640

I don't see a way to convert from the. jl representations in the projwfc output and spin projections, but maybe

I tried to do this in the past. I thought this should be possible as the total angular momentum jl basis and the lm basis are related through the clebsch-gordan coefficients. I got held up on the exact formulas.

The projected density of states is

$$ \text{PDOS}i(E) = \sum{n, \mathbf{k}} | \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle |^2 \delta(E - E_{n, \mathbf{k}}) $$

where

$| \phi_{JM} \rangle$ : the atomic orbital wave function $\langle \psi_{n, \mathbf{k}}$ : the kohn sham wave function

Now in spin-orbit calculation, they calculate the projections in the total angular momentum jl basis. To convert to the lm basis we can use the completeness relation.

$$ \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle = \langle \psi_{n, \mathbf{k}} | \psi_{j_1lm_1m}\rangle \langle \psi_{j_1lm_1m} | \phi_{jm} \rangle $$

or

$$ \langle \psi_{n, \mathbf{k}} | \psi_{j_1lm_1m}\rangle = \frac{ \langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle }{ \langle \psi_{j_1lm_1m} | \phi_{jm} \rangle } $$

$\langle \psi_{j_1lm_1m} | \phi_{jm} \rangle$ : Clebsch gordan coeffecient. This is just a constant

I got held up here as the values you find in the density of states are not $\langle \psi_{n, \mathbf{k}} | \phi_{jm} \rangle$. I think I would have to go from the values found in the atomic_proj.xml, then recalculate the density of states.

Evenmore, this doesn't compute the spin-component projects $S_x$, $S_y$, and $S_z$. For that I would have to introduce the pauli matrices in the derivation.

Files are attached,

I can't seem to find where you attached these files

I tried what you said and I still get the error

Yeah I need all the files to properly debug this then.

I wonder if wannier90 is the way to do this? I find this in the docs:

I believe it is definitely possible. I do not have experience in performing the wannerization.

If you provide the files from the wannerization, I can create a parser to integrate it into pyprocar.

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

recohen avatar Aug 07 '25 17:08 recohen

So again, I am still getting the error: IndexError: list index out of range

recohen avatar Aug 08 '25 17:08 recohen

I am working on this now. I'll let you know.

lllangWV avatar Aug 08 '25 21:08 lllangWV

Hey @recohen,

I reviewed your calculation and fixed the index error — the fix has been pushed to main.

While checking, I also noticed a few other issues in your workflow. Here’s the recommended sequence for running the Density of States calculation:


Steps:

  1. Create a directory called dos.
  2. Run pw.x on your scf.in file. (pw.x <scf.in> scf.out)
  3. Run pw.x on your nscf.in file. (pw.x <nscf.in> nscf.out)
  4. Run projwfc.x on your pdos.in file (ensure kresolveddos = .false.). (projwfc.x <pdos.in> pdos.out)
  5. Run:
    pyprocar.dosplot(dirname='bands', mode='plain', code='qe')
    

Important Notes:

  • Rename your projwfc.in file to pdos.in and ensure it writes to pdos.out.

  • In your pdos.in file, set the following parameters:

    &projwfc
       outdir = './out', 
       prefix = 'SrVO3',
       filpdos = 'SrVO3.k',
       filproj = 'SrVO3.k'
      kresolveddos = .false.
    /
    

About the Parser

Quantum ESPRESSO input can be quite strict. I wrote the original parser when I was still learning, so it’s not very forgiving. Over the weekend, I started a major rewrite of the QE parser with these goals:

  1. Make it more lenient with file names and formats (auto-detect files).
  2. Replace the monolithic parser with specialized parsers for each QE file type.
  3. Improve validation of parsed properties.

The rewrite isn’t finished yet. I still need to implement the global QEParser that integrates the individual file parsers into the core pyprocar data objects.

If you’re curious, you can check the progress on the qe-rewrite branch.

Currently implemented parsers:

  • projwfc.in
  • projwfc.out (parses all coefficients)
  • scf.in
  • scf.out
  • data-schema-file.xml
  • atomic_proj.xml

Logan Lang

lllangWV avatar Aug 11 '25 03:08 lllangWV

Dear Logan Lang,

Thank you so much. I don't understand what you are saying about the workflow. nscf doesn't work with any exact exchange calculations afaik. Did you find otherwise? The links in your message like for nscf.in go irrelevant places.

Sincerely,

Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Sun, Aug 10, 2025 at 11:35 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3173179191

Hey @recohen https://github.com/recohen,

I reviewed your calculation and fixed the index error — the fix has been pushed to main.

While checking, I also noticed a few other issues in your workflow. Here’s the recommended sequence for running the Density of States calculation:

Steps:

  1. Create a directory called dos.
  2. Run pw.x on your scf.in file. (pw.x <scf.in> scf.out)
  3. Run pw.x on your nscf.in file. (pw.x <nscf.in> nscf.out)
  4. Run projwfc.x on your pdos.in file (ensure kresolveddos = .false.). (projwfc.x <pdos.in> pdos.out)
  5. Run:

pyprocar.dosplot(dirname='bands', mode='plain', code='qe')


Important Notes:

Rename your projwfc.in file to pdos.in and ensure it writes to pdos.out .

In your pdos.in file, set the following parameters:

&projwfc outdir = './out', prefix = 'SrVO3', filpdos = 'SrVO3.k', filproj = 'SrVO3.k' kresolveddos = .false. /


About the Parser

Quantum ESPRESSO input can be quite strict. I wrote the original parser when I was still learning, so it’s not very forgiving. Over the weekend, I started a major rewrite of the QE parser with these goals:

  1. Make it more lenient with file names and formats (auto-detect files).
  2. Replace the monolithic parser with specialized parsers for each QE file type.
  3. Improve validation of parsed properties.

The rewrite isn’t finished yet. I still need to implement the global QEParser that integrates the individual file parsers into the core pyprocar data objects.

If you’re curious, you can check the progress on the qe-rewrite https://github.com/romerogroup/pyprocar/tree/qe-rewrite branch.

Currently implemented parsers:

  • projwfc.in
  • projwfc.out (parses all coefficients)
  • scf.in
  • scf.out
  • data-schema-file.xml
  • atomic_proj.xml

Logan Lang

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3173179191, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5OYTYJ27ESDFWI5BG33NAFPHAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZTGE3TSMJZGE . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Aug 11 '25 12:08 recohen

PS even restart doesn't work for HF .


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Sun, Aug 10, 2025 at 11:35 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3173179191

Hey @recohen https://github.com/recohen,

I reviewed your calculation and fixed the index error — the fix has been pushed to main.

While checking, I also noticed a few other issues in your workflow. Here’s the recommended sequence for running the Density of States calculation:

Steps:

  1. Create a directory called dos.
  2. Run pw.x on your scf.in file. (pw.x <scf.in> scf.out)
  3. Run pw.x on your nscf.in file. (pw.x <nscf.in> nscf.out)
  4. Run projwfc.x on your pdos.in file (ensure kresolveddos = .false.). (projwfc.x <pdos.in> pdos.out)
  5. Run:

pyprocar.dosplot(dirname='bands', mode='plain', code='qe')


Important Notes:

Rename your projwfc.in file to pdos.in and ensure it writes to pdos.out .

In your pdos.in file, set the following parameters:

&projwfc outdir = './out', prefix = 'SrVO3', filpdos = 'SrVO3.k', filproj = 'SrVO3.k' kresolveddos = .false. /


About the Parser

Quantum ESPRESSO input can be quite strict. I wrote the original parser when I was still learning, so it’s not very forgiving. Over the weekend, I started a major rewrite of the QE parser with these goals:

  1. Make it more lenient with file names and formats (auto-detect files).
  2. Replace the monolithic parser with specialized parsers for each QE file type.
  3. Improve validation of parsed properties.

The rewrite isn’t finished yet. I still need to implement the global QEParser that integrates the individual file parsers into the core pyprocar data objects.

If you’re curious, you can check the progress on the qe-rewrite https://github.com/romerogroup/pyprocar/tree/qe-rewrite branch.

Currently implemented parsers:

  • projwfc.in
  • projwfc.out (parses all coefficients)
  • scf.in
  • scf.out
  • data-schema-file.xml
  • atomic_proj.xml

Logan Lang

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3173179191, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5OYTYJ27ESDFWI5BG33NAFPHAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZTGE3TSMJZGE . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Aug 11 '25 12:08 recohen

Hi Ron,

Thanks for clarifying. I was initially confused by the comment that nscf doesn't work, since that's the standard way to get a well-resolved density of states after an scf run.

Okay, I think we're on the same page now, and I recall we've touched on this before. With HSE, the non-local potential means the typical nscf step for getting a dense DOS isn't feasible.

If that's the case, then the correct workflow for getting a projected DOS with HSE would be to skip the nscf part and run projwfc.x directly after the scf calculation, like this:

  1. pw.x \<scf.in\> scf.out
  2. projwfc.x \<projwfc.in\> projwfc.out

This would mean the PDOS is calculated on the coarser scf k-point grid, but it's the practical way forward. Is this what you were referring to?

lllangWV avatar Aug 11 '25 13:08 lllangWV

Yes, that's what I did,

Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Mon, Aug 11, 2025 at 9:13 AM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3174778231

Hi Ron,

Thanks for clarifying. I was initially confused by the comment that nscf doesn't work, since that's the standard way to get a well-resolved density of states after an scf run.

Okay, I think we're on the same page now, and I recall we've touched on this before. With HSE, the non-local potential means the typical nscf step for getting a dense DOS isn't feasible.

If that's the case, then the correct workflow for getting a projected DOS with HSE would be to skip the nscf part and run projwfc.x directly after the scf calculation, like this:

  1. pw.x <scf.in> scf.out
  2. projwfc.x <projwfc.in> projwfc.out

This would mean the PDOS is calculated on the coarser scf k-point grid, but it's the practical way forward. Is this what you were referring to?

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3174778231, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5PSBPR4LZ7SFPZM6B33NCJFXAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZUG43TQMRTGE . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Aug 11 '25 20:08 recohen

Hey @recohen,

I just finished the quantum espresso parser rewrite and merged it into the main branch.

You can test it out with

pip uninstall pyprocar
pip install --pre pyprocar

Also, if you want me to test the density of states on your files. I would need the .pdos_atom and .pdos_tot files from the projwfc.x calculation.

Image

Logan Lang

lllangWV avatar Aug 13 '25 14:08 lllangWV

I am not sure. I have for example:

rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 126663 Jul 28 10:43 pdos.dat.pdos_tot -rw-r--r-- 1 rcohen domain users 20352811 Jul 28 10:43 projwfc.out -rw-r--r-- 1 rcohen domain users 77633 Jul 29 16:27 atom_B_tot.dat -rw-r--r-- 1 rcohen domain users 77633 Jul 29 16:28 atom_C_tot.dat -rw-r--r-- 1 rcohen domain users 77633 Jul 29 16:28 atom_Nd_tot.dat -rw-r--r-- 1 rcohen domain users 77633 Jul 29 16:28 atom_Ndf_tot.dat


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.*** @.***>

On Aug 13, 2025, at 10:31 AM, Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3184176922 Hey @recohen https://github.com/recohen,

I just finished the quantum espresso parser rewrite and merged it into the main branch.

You can test it out with

pip uninstall pyprocar pip install --pre pyprocar Also, if you want me to test the density of states on your files. I would need the .pdos_atom and .pdos_tot files from the projwfc.x calculation.

image.png (view on web) https://github.com/user-attachments/assets/4d36e77c-0601-485a-a0c8-4559cf88bac0 Logan Lang

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3184176922, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5IGQNDIITPOIC7WVAT3NND2XAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOBUGE3TMOJSGI. You are receiving this because you were mentioned.

recohen avatar Aug 13 '25 15:08 recohen

Yep! So those are the files are the ones you need.

rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 126663 Jul 28 10:43 pdos.dat.pdos_tot****

also you need the

projwfc.in projwfc.out

atom_Nd_tot.dat is unfamiliar to me. Did projwfc.x. output these as well?

lllangWV avatar Aug 13 '25 18:08 lllangWV

I tried the new version and get:

---------------------------------------------------------------------------IndexError Traceback (most recent call last) Cell In[8], line 12 10 #orbitals=[0] 11 spins=[3]---> 12 dos=pyprocar.dosplot( 13 #items=items, 14 atoms=atoms, 15 dos_limit=[-40,25], 16 spins=spins, 17 code=code, 18 elimit=[-5, 4], 19 mode='stack_orbitals', 20 fermi=FERMI, 21 plot_total=True, 22 dirname=data_dir)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py:323 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/workspaces/auto-y/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py#line=322, in dosplot(code, dirname, mode, orientation, spins, atoms, orbitals, items, normalize_dos_mode, fermi, fermi_shift, elimit, dos_limit, savefig, labels, projection_mask, ax, show, print_plot_opts, export_data_file, export_append_mode, use_cache, verbose, **kwargs) 320 if not os.path.exists(dos_pkl_filepath): 321 logger.info(f"Parsing DOS from {dirname}")--> 323 parser = io.Parser(code=code, dirpath=dirname) 324 dos = parser.dos 325 structure = parser.structure

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:30 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/workspaces/auto-y/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=29, in Parser.init(self, code, dirpath, verbose) 27 self.dos = None 28 self.structure = None---> 30 self._parse()

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:47 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/workspaces/auto-y/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=46, in Parser._parse(self) 44 self._parse_bxsf() 46 elif self.code == "qe":---> 47 self._parse_qe() 49 elif self.code == "siesta": 50 self._parse_siesta()

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py:187 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/workspaces/auto-y/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/parser.py#line=186, in Parser._parse_qe(self) 178 def _parse_qe(self): 179 """parses qe files 180 181 Returns (...) 184 None 185 """--> 187 parser = qe.QEParser( 188 dirpath=self.dirpath, 189 scf_in_filepath="scf.in", 190 bands_in_filepath="bands.in", 191 pdos_in_filepath="pdos.in", 192 kpdos_in_filepath="kpdos.in", 193 atomic_proj_xml_filepath="atomic_proj.xml", 194 ) 196 self.ebs = parser.ebs 197 self.kpath = parser.kpath

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:64, in QEParser.init(self, dirpath, scf_in_filepath, bands_in_filepath, pdos_in_filepath, kpdos_in_filepath, atomic_proj_xml_filepath) 52 self.dirpath = Path(dirpath).resolve() 54 # Handles the pathing to the files 55 ( 56 prefix, 57 xml_root, 58 atomic_proj_xml_filepath, 59 pdos_in_filepath, 60 bands_in_filepath, 61 pdos_out_filepath, 62 projwfc_out_filepath, 63 self.scf_out_filepath,---> 64 ) = self._initialize_filenames( 65 scf_in_filepath=scf_in_filepath, 66 bands_in_filepath=bands_in_filepath, 67 pdos_in_filepath=pdos_in_filepath, 68 ) 69 # Parsing structual and calculation type information 70 self._parse_efermi(main_xml_root=xml_root)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/io/qe.py:593, in QEParser._initialize_filenames(self, scf_in_filepath, bands_in_filepath, pdos_in_filepath) 590 scf_in = f.read() 592 outdir = re.findall("outdir\s*=\s*'\S*?(.)'", scf_in)[0]--> 593 prefix = re.findall("prefix\s=\s*'(.*)'", scf_in)[0] 594 xml_filename = prefix + ".xml" 596 atomic_proj_xml_filepath = ( 597 Path(self.dirpath) / https://portal.eplhpc.carnegiescience.edu/ outdir / https://portal.eplhpc.carnegiescience.edu/ f"{prefix}.save" / https://portal.eplhpc.carnegiescience.edu/ "atomic_proj.xml" 598 ) IndexError: list index out of range


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Wed, Aug 13, 2025 at 2:21 PM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3185011228

Yep! So those are the files are the ones you need.

rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#13(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#1(s_j0.5)' -rw-r--r-- 1 rcohen domain users 261510 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#2(p_j1.5)' -rw-r--r-- 1 rcohen domain users 171616 Jul 28 10:43 'pdos.dat.pdos_atm#14(C)_wfc#3(p_j0.5)' -rw-r--r-- 1 rcohen domain users 126663 Jul 28 10:43 pdos.dat.pdos_tot****

also you need the

projwfc.in projwfc.out

atom_Nd_tot.dat is unfamiliar to me. Did projwfc.x. output these as well?

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3185011228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5N5XBBIAJNAVUS4JA33NN62RAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOBVGAYTCMRSHA . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Aug 14 '25 12:08 recohen

That does not appear to be the new version

pip uninstall pyprocar
pip install --pre pyprocar

the version should be

pyprocar==6.5.1.dev63

lllangWV avatar Aug 14 '25 15:08 lllangWV

I had to restart the Jupyter kernel. Now I have a new error:

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

Version 6.5.1.dev63 created on Mar 6th, 2025

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, 107080 (2020).

  • L. Lang, P. Tavadze, A. Tellez, E. Bousquet, H. Xu, F. Muñoz, N. Vasquez, U. Herath, and A. H. Romero, Expanding PyProcar for new features, maintainability, and reliability., Computer Physics Communications 297, 109063 (2024).

Developers:

  • Francisco Muñoz
  • Aldo Romero
  • Sobhit Singh
  • Uthpala Herath
  • Pedram Tavadze
  • Eric Bousquet
  • Xu He
  • Reese Boucher
  • Logan Lang
  • Freddy Farah

---------------------------------------------------------------------------AttributeError Traceback (most recent call last) Cell In[4], line 12 10 #orbitals=[0] 11 spins=[3]---> 12 dos=pyprocar.dosplot( 13 #items=items, 14 atoms=atoms, 15 dos_limit=[-40,25], 16 spins=spins, 17 code=code, 18 elimit=[-5, 4], 19 mode='stack_orbitals', 20 fermi=FERMI, 21 plot_total=True, 22 dirname=data_dir)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py:344 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-002.eplhpc.carnegiescience.edu/49133/lab/workspaces/auto-y/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py#line=343, in dosplot(code, dirname, mode, orientation, spins, atoms, orbitals, items, normalize_dos_mode, fermi, fermi_shift, elimit, dos_limit, savefig, labels, projection_mask, ax, show, print_plot_opts, export_data_file, export_append_mode, use_cache, verbose, **kwargs) 341 if fermi is not None: 342 logger.info(f"Shifting Fermi energy to zero: {fermi}")--> 344 dos.energies -= fermi 345 dos.energies += fermi_shift 346 fermi_level = fermi_shift AttributeError: 'NoneType' object has no attribute 'energies'


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Thu, Aug 14, 2025 at 11:26 AM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3188865371

That does not appear to be the new version

pip uninstall pyprocarpip install --pre pyprocar

the version should be

pyprocar==6.5.1.dev63

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3188865371, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5NLR2WT2SPACWYLKU33NSTAPAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOBYHA3DKMZXGE . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Aug 14 '25 18:08 recohen

The issue might be how the calculation type is being detected.

The parser infers whether it's a Density of States (DOS) or a band structure calculation by looking for the kresolveddos flag in the projwfc.in file. If the flag is present, it's treated as a DOS calculation.

For it to be parsed correctly as a band structure, the kresolveddos flag must be completely removed from the file, not just commented out.

Here is an example:

&PROJWFC
  prefix= 'pwscf',
  outdir= 'pwscf_out',
  filpdos= 'pdos.dat'
/

If that doesn't resolve the problem, I'll need to see all the relevant files to debug further.

lllangWV avatar Aug 15 '25 11:08 lllangWV

Dearen Logan,

I finally got back to this and have the same problem. Myprowfc.in looks like:

cat projwfc.in &PROJWFC prefix= 'pwscf', outdir= 'pwscf_out', filpdos= 'pdos.dat' /

and I have the correct version, but I get:

import pyprocar, os import matplotlib.pyplot as plt FERMI=16.5248 #eV ode = "qe"

mag_type = ["non-spin-polarized","spin-polarized-colinear","non-colinear"][2]

data_dir = os.path.join('.') print(data_dir) #items={'Nd':[4,5,6,7,8]} HARTREE_TO_EV = 27.211386245988 atoms=[0,1] #orbitals=[0] spins=[3] dos=pyprocar.dosplot( #items=items, atoms=atoms, dos_limit=[-40,25], spins=spins, code=code, elimit=[-5, 4], mode='stack_orbitals', fermi=FERMI, plot_total=True, dirname=data_dir)

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

Version 6.5.1.dev63 created on Mar 6th, 2025

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, 107080 (2020).

  • L. Lang, P. Tavadze, A. Tellez, E. Bousquet, H. Xu, F. Muñoz, N. Vasquez, U. Herath, and A. H. Romero, Expanding PyProcar for new features, maintainability, and reliability., Computer Physics Communications 297, 109063 (2024).

Developers:

  • Francisco Muñoz
  • Aldo Romero
  • Sobhit Singh
  • Uthpala Herath
  • Pedram Tavadze
  • Eric Bousquet
  • Xu He
  • Reese Boucher
  • Logan Lang
  • Freddy Farah

---------------------------------------------------------------------------AttributeError Traceback (most recent call last) Cell In[4], line 12 10 #orbitals=[0] 11 spins=[3]---> 12 dos=pyprocar.dosplot( 13 #items=items, 14 atoms=atoms, 15 dos_limit=[-40,25], 16 spins=spins, 17 code=code, 18 elimit=[-5, 4], 19 mode='stack_orbitals', 20 fermi=FERMI, 21 plot_total=True, 22 dirname=data_dir)

File ~/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py:344 https://portal.eplhpc.carnegiescience.edu/node/memex-2017-003.eplhpc.carnegiescience.edu/41404/lab/tree/python/cohenenv3.11/lib/python3.11/site-packages/pyprocar/scripts/scriptDosplot.py#line=343, in dosplot(code, dirname, mode, orientation, spins, atoms, orbitals, items, normalize_dos_mode, fermi, fermi_shift, elimit, dos_limit, savefig, labels, projection_mask, ax, show, print_plot_opts, export_data_file, export_append_mode, use_cache, verbose, **kwargs) 341 if fermi is not None: 342 logger.info(f"Shifting Fermi energy to zero: {fermi}")--> 344 dos.energies -= fermi 345 dos.energies += fermi_shift 346 fermi_level = fermi_shift AttributeError: 'NoneType' object has no attribute 'energies'

-- Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.***

On Fri, Aug 15, 2025 at 7:46 AM Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3191329019

The issue might be how the calculation type is being detected.

The parser infers whether it's a Density of States (DOS) or a band structure calculation by looking for the kresolveddos flag in the projwfc.in file. If the flag is present, it's treated as a DOS calculation.

For it to be parsed correctly as a band structure, the kresolveddos flag must be completely removed from the file, not just commented out.

Here is an example:

&PROJWFC prefix= 'pwscf', outdir= 'pwscf_out', filpdos= 'pdos.dat' /

If that doesn't resolve the problem, I'll need to see all the relevant files to debug further.

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3191329019, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5M5II5LO3GFY7CJMWL3NXCC5AVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOJRGMZDSMBRHE . You are receiving this because you were mentioned.Message ID: @.***>

recohen avatar Sep 04 '25 17:09 recohen

Can you share the compressed calculation directory?

Can you also provide the debug logging as well?

import logging

logger = logging.getLogger("pyprocar")
logger.setLevel(logging.DEBUG)

lllangWV avatar Sep 06 '25 14:09 lllangWV

I thought I sent everything. What is it you need? Thanks, Ron


Ronald Cohen Extreme Materials Initiative Earth and Planets Laboratory Carnegie Institution for Science 5241 Broad Branch Rd., N.W. Washington, D.C. 20015 @.*** @.***>

On Sep 6, 2025, at 10:08 AM, Logan Lang @.***> wrote:

lllangWV left a comment (romerogroup/pyprocar#202) https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3262243593 Can you share the compressed calculation directory?

Can you also provide the debug logging as well?

import logging

logger = logging.getLogger("pyprocar") logger.setLevel(logging.DEBUG) — Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/202#issuecomment-3262243593, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA2R5O57UKRK44ODU2WYKL3RLTHLAVCNFSM6AAAAACCUT7WSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENRSGI2DGNJZGM. You are receiving this because you were mentioned.

recohen avatar Sep 07 '25 00:09 recohen

So I got the following zip file:

PYPROCAR-20250807T181127Z-1-001.zip:

  • deepseek_latex_20250807_1598c6.pdf
  • deepseek_latex_20250807_c6edcc.pdf
  • FMSOK666nosymHSE06.tar.gz
    • scf.in
    • scf.out
    • projwfc.in
    • projwfc.out
    • dos.in
    • projwfc.out
  • FMSOK666nosymHSE06xml.tar.gz
    • pwcf_out
      • pwscf.xml
      • pwscf.save
        • atomic_proj.xml
        • data-file-schema.xml

What I am missing are the pdos_atm and the pdos_tot files.

These files are rather large because they are plain text encoding with the dos data. I wish they would have wrote these into hdf5 files or some kind of binary format.

lllangWV avatar Sep 07 '25 15:09 lllangWV