Skip to content

Parser, spin and phase defects found during the #283-#305 round #51

Closed

Description

@lllangWV

Copied from romerogroup/pyprocar#307, opened by lllangWV on 2026-10-04, closed upstream. Its 1 comment(s) follow as replies.

Found by owners and verifiers during #46, romerogroup/pyprocar#299, romerogroup/pyprocar#304 and romerogroup/pyprocar#305. All of these exist on dev at 499b1bc. None was introduced by those PRs.

Spin and orbital layout:

  • QE non-collinear DOS still has 1 j-resolved spin channel (7435, 1, 5, 32). The non-collinear contract is 4 channels.
  • DensityOfStates.is_non_collinear treats any 32-orbital DOS as non-collinear, so the QE spin-orbit DOS (1 channel) reports non-collinear with spin names it cannot index. QE non-collinear DOS without spin-orbit is probably read as collinear: ProjwfcDOS.is_non_colinear checks only j. (Inferred, not run.)
  • Core AZIMUTHAL_ORBITAL_ORDER spells dzx/dzy and wrong f names, and the index groups t2g (4, 5, 7) and eg (5, 6, 8) assume VASP column order, which mislabels QE and Elk selections. Reorder columns into one core order at the parser boundary.
  • VASP DOS orbital names still come from a fixed list, while VASP bands read the PROCAR header.
  • Elk task-10 DOS columns are in the irrep basis when lmirep is on, but keep Y{l}{m} names (romerogroup/pyprocar#304 named the task-22 band characters only).
  • Lobster DOS is probably all zeros on real files: DoscarLobster.projected_dos matches labels like s exactly, while real headers likely carry principal numbers (4s 3d_xy). (Inferred, not run.)

Phases and unfolding:

  • QEParser.spd_phase (parser.py ~688) adds the complex amplitudes of radial channels that share (l, m) on one atom (semicore Sr 4s+5s, La 5p+6p), so spd = |sum c|^2 includes cross terms. Against projwfc.x's own weights: Sr s off by up to 0.48, Sr p by 0.36, V s by 0.24.
  • ebs.unfold crashes on a spin-polarized QE path (norm[:, :, None] at pyprocar/utils/unfolder.py:61). Translations that match no atom fall back to basis 0, so a structure that is not a supercell silently gets wrong weights.
  • Abinit PROCAR phases are passed to the core without a check of Abinit's real-harmonic sign convention against the core's (romerogroup/pyprocar#305 did this for QE). No Abinit fixture has phases.
  • pyprocar.filter(atoms=...) fails on a PROCAR with phase blocks (inhomogeneous shape), and an orbital-filtered phase PROCAR fails to reshape in unfold, so no filtered file can reach unfold.
  • VASP spin-polarized phase parsing concatenates along the band axis, giving shape (k, 2b, 2, ...).
  • expand_kpoints_to_supercell_by_axes copies phases to k+G without exp(-2 pi i G.tau), and ElectronicBandStructureMesh.interpolate FFT-interpolates projected_phase, which is gauge-dependent and not periodic. Neither has an in-repo caller.

Meshes and surfaces:

  • Mesh.is_fbz, is_ibz and kgrid still infer the grid from histogram peaks (math.get_grid_dims).
  • QE ebs.fermi comes from the scf, not the nscf XML (12.549 against 12.465 eV on SrVO3).
  • clip_surface aborts the whole Fermi surface when a single band clips to empty. A [0,1) grid on a hexagonal lattice with NK > 30 misses part of the Wigner-Seitz cell.
  • The shared data/codes/qe/... fixtures contain old ebs.pkl caches from before romerogroup/pyprocar#299/fix(qe): unfold QE phases and f orbitals with the core's harmonics romerogroup/pyprocar#305. With use_cache=True they load the old projections and phases.

Activity

  1. lllangWV commented on Oct 10, 2026

    @lllangWV
    OwnerAuthor

    lllangWV commented upstream on 2026-10-06:

    Superseded by #49, #56, #57 (items moved per triage)

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions