Skip to content

[wien2k] pure-Python case.parproj partial projectors - #11

Merged
the-hampel merged 3 commits into
TRIQS:unstablefrom
krystophny:port/dmftproj-parproj-python
Oct 23, 2026
Merged

the-hampel merged 3 commits into
TRIQS:unstablefrom
krystophny:port/dmftproj-parproj-python

Conversation

@krystophny

@krystophny krystophny commented Jun 16, 2026 •

Copy link
Copy Markdown

Part of #7; stacks on #10. Adds the raw radial-normalized partial projectors, density matrices and local spinor rotations written to case.parproj for the non-mixing SP+SO path.

The generator keeps separate data for every (atom, l) shell, validates matching spin windows and uses each spin's own band offset. Unsupported projection modes, non-SO inputs, cubic p/f bases and nonidentity struct rotations fail explicitly pending their later port steps.

Validation: native CaOs2 partial-projector fixture agrees within 1e-7 with exact integer fields and finite floating-point comparisons. An independent identity-symmetry regression preserves distinct s and p density blocks on the same atom. Local NumPy tests pass; full TRIQS integration runs in CI. The tighter double-precision comparison belongs to #12 with #14.

Chris&AI

@krystophny

Copy link
Copy Markdown
Author

Accuracy: reproduces the released dmftproj case.parproj to 1.2e-8; 1.5e-14 (machine precision) with the precision fix #14 + exact Python #12 (well-conditioned radial sqrt, no amplification).

@krystophny

Copy link
Copy Markdown
Author

GPT Sol rebased this onto the reviewed #10 and completed the remaining fixes: shell-specific projector/density tables, native window selection, spin-window validation and per-spin offsets. Added a two-shell identity-symmetry regression and tightened the native comparison to finite values within 1e-7. Local tests pass; CI is running.

Chris&AI

@krystophny

Copy link
Copy Markdown
Author

GPT Sol fixed local-rotation parsing when atomic sorts outnumber symmetry operations, corrected per-shell representation parsing, and rejected unsupported multiple local orbitals. The P1 regression and all four preceding generator tests pass. Restacked on updated #10. Latest-head CI is running/queued.

Chris&AI

@the-hampel
the-hampel force-pushed the port/dmftproj-parproj-python branch from 0037b6d to 7926555 Compare October 22, 2026 12:21
@the-hampel

Copy link
Copy Markdown
Member

Rebased onto unstable now that #10 is in. Your two commits are unchanged (range-diff identical); new head 7926555.

Checked locally:

  • full ctest 27/27
  • CaOs2_partial.parproj.gz matches native dmftproj -so -sp on the same inputs (max diff 2.2e-16, last-digit noise)
  • Python generator vs native: max abs diff 1.2e-8 (test tolerance 1e-7); perturbing a reference value by 1e-6 in the projector or the density-matrix block makes the test fail

Looks good to us. Non-blocking points:

  1. _euler is never called.
  2. Unreachable non-SO paths, as in [wien2k] pure-Python case.sympar partial-shell symmetry matrices #10: write_parproj requires SO and both almblm spin files, so the single-file branch, ns = 2 if ifSP else 1 and the non-SO branch of _srot_rotrep_nonmixing cannot run. _symmetrize_densmat takes info, ns, ifSO without using them.
  3. The module docstring calls the density matrix "tetrahedron-weighted", but the code point-integrates with tetr[0] as k-weight. Line 347 has an empty section header.
  4. Coverage gaps, just noting: for all three CaOs2 shells the first op mapping the representative atom is unitary, so the time-reversal branches of the Rloc / rot_projectmat path are not exercised; and the single k-point fixture does not test the k-weighting.
  5. The Wigner-D / indmftpr / dmftsym / cubic-basis helpers are now duplicated across symqmc, ctqmcout, sympar and parproj; best consolidated in [wien2k] complete the port to machine precision: shared module, fromfile, proj_mode, outband #12.

If you don't get to 1-3, we'll add a small cleanup commit ourselves and squash-merge once CI is green.


Attribution: this comment was produced by Claude (Opus 5.5) running in Claude Code, driven by @the-hampel.

@krystophny

Copy link
Copy Markdown
Author

Thank you for the rebase and for the careful checks. You are welcome to do the small cleanup for the first three points yourselves and to squash-merge once CI is green. The coverage gaps are noted as well. The consolidation of the duplicated Wigner-D, indmftpr, dmftsym and cubic-basis helpers will be handled in #12.

Chris&AI

write_parproj requires the spin-orbit flag and both almblm spin files, so
the single-file branch, the ifSP/ifSO switches in the symmetry
representation and density symmetrization, and the conditional timeinv flag
write could never take their alternative path. _euler was never called.
The density matrix is point-integrated with the per-k weight, not
tetrahedron-weighted as the module docstring said.
@the-hampel
the-hampel merged commit 800d66b into TRIQS:unstable Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants