Repository navigation
Open
Labels
agent-queueAgent follow-up; worked through by a backlog sweepAgent follow-up; worked through by a backlog sweep
Description
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):
-
fill_between_imageputs parametric DOS colours at the wrong energies (Plotting and script defects found during the #284-#305 round #50).pyprocar/plotter/dos_plot.py:568-571mixes the baseline into the energy-axis image extent, and:587-588into the clip polygon. Wrong when the window does not contain 0; in vertical mode (bandsdosplot) the polygon is wrong. - VASP
autobandsplot()withoutfermiuses 0 (Plotting and script defects found during the #284-#305 round #50).pyprocar/scripts/scriptAutoBandsplot.py:40-41. -
bandsdosplotdraws its Fermi line at y=0 when the energies are not shifted (Plotting and script defects found during the #284-#305 round #50).pyprocar/scripts/scriptBandsDosplot.py:88. -
BandStructurePlotter.plot_overlaycrashes onebs.bands, a Property (Plotting and script defects found during the #284-#305 round #50).pyprocar/plotter/bs_plot.py:986callsbands.ndimin_validate_data.examples/general/new_bands_examples.pypasses exactly that.plot(vectors_mode=...)also crashes. -
bandsplot(atoms=[])andunfold(atoms=[])raiseIndexErrorfromatoms[0](Plotting and script defects found during the #284-#305 round #50) instead of the core's "names no atoms" error.pyprocar/scripts/scriptBandsplot.py:234,pyprocar/scripts/scriptUnfold.py:185. -
orbitals=[]still selects every orbital (Plotting and script defects found during the #284-#305 round #50), while empty atoms and spins now raise. -
FermiSlicePlotter.plot(scalars_data=<Property>)draws uncoloured lines (Plotting and script defects found during the #284-#305 round #50). It looks the Property up by name in point data thatget_propertynever sets (pyprocar/plotter/fs_slice_plot.py:184). -
procar.py generate2dkmeshraisesTypeError(Plotting and script defects found during the #284-#305 round #50).scripts/procar.py:71-75callspyprocar.generate2dkmesh(pyprocar/scripts/scriptKmesh2D.py:6). - Three copies of the
BandStructureModeenum have diverged (Plotting and script defects found during the #284-#305 round #50):pyprocar/cfg/band_structure.py:7,pyprocar/scripts/scriptBandsplot.py:35, and the copy inpyprocar/cfg/unfold.pynamed by Plotting and script defects found during the #284-#305 round #50. Make them one.
QE phases and unfolding (from #51):
-
QEParser.spd_phaseadds radial channels that share (l, m) (Parser, spin and phase defects found during the #283-#305 round #51). Fixed by fix(qe): add the weights of shells that share (l, m), not their amplitudes #90 forspd; the phases still share one (l, m) slot by design.pyprocar/io/qe/parser.py:652sums the complex amplitudes of semicore channels on one atom (Sr 4s+5s, La 5p+6p), sospd = |sum c|^2has cross terms. Against projwfc.x's weights: Sr s off by up to 0.48, Sr p by 0.36, V s by 0.24. -
ebs.unfoldcrashes on a spin-polarized QE path (Parser, spin and phase defects found during the #283-#305 round #51).self.eigenvectors /= norm[:, :, None]atpyprocar/utils/unfolder.py:61. Fixed by fix(vasp): unfold a spin-polarized PROCAR with phases (#28) #89. - Unfolding silently falls back to basis 0 (Parser, spin and phase defects found during the #283-#305 round #51). Translations that match no atom keep index 0 (
pyprocar/utils/unfolder.py:100-105), so a structure that is not a supercell gets wrong weights with no error. - Abinit PROCAR phases skip the sign-convention check (Parser, spin and phase defects found during the #283-#305 round #51). Abinit's real-harmonic signs are not checked against the core's (
romerogroup/pyprocar#305did this for QE). No Abinit fixture has phases. - No filtered phase PROCAR can reach unfold (Parser, spin and phase defects found during the #283-#305 round #51).
pyprocar.filter(atoms=...)fails on a PROCAR with phase blocks (inhomogeneous shape), and an orbital-filtered phase PROCAR fails to reshape in unfold. - VASP spin-polarized phase parsing concatenates along the band axis (Parser, spin and phase defects found during the #283-#305 round #51), giving shape (k, 2b, 2, ...).
pyprocar/io/vasp/procar.py:345-349. Fixed by fix(vasp): unfold a spin-polarized PROCAR with phases (#28) #89. - Phases are copied or interpolated without their gauge (Parser, spin and phase defects found during the #283-#305 round #51).
expand_kpoints_to_supercell_by_axes(pyprocar/core/ebs.py:1857) copies phases to k+G without exp(-2 pi i G.tau), andinterpolate(pyprocar/core/ebs.py:1893) FFT-interpolatesprojected_phase, which is gauge-dependent and not periodic. Neither has an in-repo caller. - QE
ebs.fermicomes from the scf, not the nscf XML (Parser, spin and phase defects found during the #283-#305 round #51).pyprocar/io/qe/parser.py:614-619prefersscf_out.fermi_energy_ev: 12.549 against 12.465 eV on SrVO3. Decide which one the bands should use. - Stale
ebs.pklcaches in the shared QE fixtures (Parser, spin and phase defects found during the #283-#305 round #51).data/codes/qe/...holds caches from beforeromerogroup/pyprocar#299/fix(qe): unfold QE phases and f orbitals with the core's harmonics romerogroup/pyprocar#305; withuse_cache=Truethey load the old projections and phases.
Added from the #89 comment (#57 (comment)):
- A band whose printed phases are all
0.000gets 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) testshasattr(procar, 'spd_phase'), which the VASPProcarnever has; useprocar.projected_phase.
Metadata
Metadata
Assignees
Labels
agent-queueAgent follow-up; worked through by a backlog sweepAgent follow-up; worked through by a backlog sweep
Activity
lllangWV commentedon Oct 14, 2026
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-349on 5834a2e) andebs.unfoldcrashes ...norm[:, :, None](pyprocar/utils/unfolder.py:61). Fix them together and close #28 with them.lllangWV commentedon Oct 28, 2026
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.unfoldcrashes on a spin-polarized QE path (norm[:, :, None]). Tick both when #89 merges.#89 found two more defects and did not fix them:
0.000gets 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 referencereferences/unfold.pygives NaN in the same cells. The bug does not depend on spin. Decide whether such a band gets weight 0, or whetherunfoldwarns and masks it.AbinitParser.ebs(pyprocar/io/abinit/parser.py:214) testshasattr(procar, 'spd_phase'). The VASPProcarit wraps has nospd_phaseattribute; it hasprojected_phase. Soprojected_phaseis always None for Abinit. Wire it toprocar.projected_phasetogether with the sign-convention item above. No Abinit fixture has phases.lllangWV commentedon Oct 28, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of lllangWV
Two plotting findings from the LOBSTER projection fix, on
mainat ca9e634, 2026-10-28:dosplot(code="lobster", mode="overlay_orbitals")withoutdos_limitclamps the DOS axis to ±0.05. This shows on a real LOBSTER 5.1.1DOSCAR.lobster(QE diamond, nspin 1). The curves run off the axis, so the plot looks empty. The same call ondata/examples/dos/non-spin-polarized(VASP) givesylim = (0, 12.3). Main and the fix both show it, so the cause is in the plotting path, not the parser. Passingdos_limit=[0, 0.8]works around it. Not yet traced.fill_between_imageitem above. Lines 587 and 588 ofpyprocar/plotter/dos_plot.pyoverwrite 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.