Skip to content

PyProcar QE parser fails for non-collinear calculations without SOC (s_z inst #220

@p20250462-coder

Description

@p20250462-coder

Dear PyProcar Developers,

I am using PyProcar to analyze band projections from a Quantum ESPRESSO calculation with non-collinear magnetism enabled but without spin–orbit coupling.

QE settings:

noncolin = .true.
lspinorb = .false.

When running pyprocar.bandsplot() with the kpdos.out file, the QE parser crashes with the following error:

IndexError: list index out of range

The error originates from the following line in pyprocar/io/qe.py:

j_orbital_type_index = float(re.findall("(?<=j=)\s*([- \d.]*)", wfc)[0])

The parser assumes that the orbital description contains a j= value.

However, in non-collinear calculations without SOC, Quantum ESPRESSO prints the atomic states using s_z instead of j.

Example from kpdos.out:

The atomic states are defined as follows:
state # 1: atom 1 (Cr1), wfc 1 (l=0 m=1 s_z= 0.5)
state # 2: atom 1 (Cr1), wfc 1 (l=0 m=1 s_z=-0.5)
state # 5: atom 1 (Cr1), wfc 3 (l=1 m=1 s_z= 0.5)

Because j= does not appear in these lines, the regex search returns an empty list and causes the crash.

It seems the parser currently assumes SOC-style orbital notation, while QE outputs spin-projection notation (s_z) when lspinorb = .false..


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions