Skip to content

Plotting and QE-phase defects (tracker) #57

Open

Description

@lllangWV

Copied from romerogroup/pyprocar#313, opened by lllangWV on 2026-10-06. Its 0 comment(s) follow as replies.

Tracker for plotting, script, QE-phase and unfolding defects, moved here from #50 and #51 during triage. Each line is one item for the backlog sweep. Line numbers are on origin/dev at ce6a550 unless the line says it quotes the source issue (those were found on dev at 499b1bc).

Plotting and scripts (from #50):

QE phases and unfolding (from #51):

Added from the #89 comment (#57 (comment)):

  • A band whose printed phases are all 0.000 gets a NaN unfolding weight. Unfolder._prepare_unfold_basis (pyprocar/utils/unfolder.py) divides by a zero norm: 65 of 3840 weights in a spin-polarized bcc V supercell, all bands at 27 to 30 eV. Not spin-specific.
  • Abinit phases never reach the core. AbinitParser.ebs (pyprocar/io/abinit/parser.py:214) tests hasattr(procar, 'spd_phase'), which the VASP Procar never has; use procar.projected_phase.

Activity

  1. added
    agent-queueAgent follow-up; worked through by a backlog sweep
    on Oct 10, 2026
  2. lllangWV commented on Oct 14, 2026

    @lllangWV
    OwnerAuthor

    Two items here are the two causes of user report #28 (ISPIN=2 unfolding): VASP spin-polarized phase parsing concatenates along the band axis (pyprocar/io/vasp/procar.py:345-349 on 5834a2e) and ebs.unfold crashes ... norm[:, :, None] (pyprocar/utils/unfolder.py:61). Fix them together and close #28 with them.

  3. lllangWV commented on Oct 28, 2026

    @lllangWV
    OwnerAuthor

    Note

    🤖 Claude Opus 5.5 responding on behalf of lllangWV

    #89 fixes two items here, the two causes of #28: VASP spin-polarized phase parsing concatenates along the band axis and ebs.unfold crashes on a spin-polarized QE path (norm[:, :, None]). Tick both when #89 merges.

    #89 found two more defects and did not fix them:

    • A band whose printed phases are all 0.000 gets a NaN unfolding weight. Unfolder._prepare_unfold_basis (pyprocar/utils/unfolder.py) divides by a zero norm. In a ferromagnetic bcc V supercell (VASP 6.5, ISPIN = 2, LORBIT = 12, 24 bands), 65 of 3840 (k, band, spin) weights are NaN. All are high bands at 27 to 30 eV with no projection on s, p or d. The numpy reference references/unfold.py gives NaN in the same cells. The bug does not depend on spin. Decide whether such a band gets weight 0, or whether unfold warns and masks it.
    • Abinit phases never reach the core. AbinitParser.ebs (pyprocar/io/abinit/parser.py:214) tests hasattr(procar, 'spd_phase'). The VASP Procar it wraps has no spd_phase attribute; it has projected_phase. So projected_phase is always None for Abinit. Wire it to procar.projected_phase together with the sign-convention item above. No Abinit fixture has phases.
  4. lllangWV commented on Oct 28, 2026

    @lllangWV
    OwnerAuthor

    Note

    🤖 Claude Opus 5.5 responding on behalf of lllangWV

    Two plotting findings from the LOBSTER projection fix, on main at ca9e634, 2026-10-28:

    • dosplot(code="lobster", mode="overlay_orbitals") without dos_limit clamps the DOS axis to ±0.05. This shows on a real LOBSTER 5.1.1 DOSCAR.lobster (QE diamond, nspin 1). The curves run off the axis, so the plot looks empty. The same call on data/examples/dos/non-spin-polarized (VASP) gives ylim = (0, 12.3). Main and the fix both show it, so the cause is in the plotting path, not the parser. Passing dos_limit=[0, 0.8] works around it. Not yet traced.
    • Note on the fill_between_image item above. Lines 587 and 588 of pyprocar/plotter/dos_plot.py overwrite the clip polygon computed at 557 to 566. The overwritten polygon closes at the origin, not along the energy axis. On the VASP SrVO3 DOS, the parametric fill still looks right in both orientations, because the DOS is near zero at both ends of the grid. The fix is to delete lines 587 and 588, and to take the image extent along the energy axis from the energies alone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-queueAgent follow-up; worked through by a backlog sweep

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions