Skip to content

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

Open
krystophny wants to merge 2 commits into
TRIQS:unstablefrom
krystophny:port/dmftproj-parproj-python
Open

krystophny wants to merge 2 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.

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