Skip to content

[wien2k] pure-Python case.sympar partial-shell symmetry matrices - #10

Open
krystophny wants to merge 7 commits into
TRIQS:unstablefrom
krystophny:port/dmftproj-sympar-python
Open

krystophny wants to merge 7 commits into
TRIQS:unstablefrom
krystophny:port/dmftproj-sympar-python

Conversation

@krystophny

@krystophny krystophny commented Jun 16, 2026 •

Copy link
Copy Markdown

Part of #7, stacked on the corrected #9.

Generate case.sympar, the symmetry matrices for all included shells. The native CaOs2 partial fixture includes an uncorrelated Ca d shell in addition to the two correlated Os d shells.

The review fixes cubic p normalization and row order to match the native template, and uses iprop for improper-rotation parity. Tests independently check odd-l inversion and p-basis normalization. This stage supports SO; non-SO, fromfile and cubic f inputs are explicitly rejected until their port stages.

The generator test runs in a temporary directory, compares the complete native header exactly, compares finite complex matrices at atol=1e-7, rtol=0, and checks unitarity at 1e-7 to allow the retained native basis rounding. Local checks pass. The CMake registration reads source fixtures directly.

Chris&AI

@krystophny

Copy link
Copy Markdown
Author

Accuracy: reproduces the released dmftproj case.sympar to 4.4e-8; 1.9e-14 (machine precision) with the precision fix #14 + exact Python #12.

Port the dmftproj almblm reader and case.oubwin writer to NumPy. Given
case.almblm{up,dn} and the energy window in case.indmftpr, select the
contiguous band range per k-point and spin and write case.oubwin{up,dn}
in the dmftproj format. Support proj_mode 0; band-index modes remain
explicitly unsupported. Part of TRIQS#7.

Keep window-open and window-valid flags separate, as set_projections.f
does. A window opening only at nbmax remains excluded with zero bounds,
including nbmin == nbmax. Preserve this native behavior on both sides.

Reuse the existing compressed CaOs2 almblm fixtures, decompressing into
a temporary directory. Compare both spin outputs with CaOs2.oubwinup,
ignoring only trailing whitespace stripped from the shipped reference.
Add focused checks for the final-band edge cases, energy boundaries,
Fermi shifts, per-k lowest-band weights and excluded output records.

Validation: the generator test passes locally with NumPy, including both
reviewer reproducers and regeneration of the 43-92 CaOs2 band window.
@krystophny
krystophny force-pushed the port/dmftproj-sympar-python branch from d5eaaa4 to 6f40e15 Compare October 12, 2026 14:18
@krystophny

Copy link
Copy Markdown
Author

GPT Sol rebased this onto the corrected #9 and fixed cubic p normalization/order plus improper-rotation parity. Added independent inversion, normalization and unitarity checks; native headers are exact and finite matrices compare at 1e-7. Unsupported paths fail explicitly, and unused fixture copies are removed. Local tests pass; CI is queued.

Chris&AI

@krystophny
krystophny force-pushed the port/dmftproj-sympar-python branch from 6f40e15 to 62065ff Compare October 12, 2026 17:38
Read the almblm coefficients, assemble and locally rotate correlated
projectors, apply the cubic/complex basis, and Loewdin-orthonormalize the
stacked shells before writing ctqmcout. Part of TRIQS#7, following TRIQS#8.

Keep the native separate window-open/valid flags. Validate matching SO
spin windows and use each spin's own band offsets. Reject unsupported
non-SO, band-index, cubic p/f and non-identity struct rotation paths
instead of producing misleading files; subsequent port stages add them.

Reuse the current full-rank CaOs2 inputs and TRIQS#8 fixture handling. Compare
integer fields exactly and finite float fields at atol=1e-7, rtol=0.
Add regressions for final-band-only windows and mismatched SO spins.
Local validation gives max native residual 1.3e-8 and full 20x50 projector
orthonormality error 3.2e-15. The old rank-deficient-window claims no
longer apply to this fixture.
Generate symmetry matrices for every included shell, including the uncorrelated Ca d shell in the native partial fixture. Rebase onto the corrected projector stack and reuse source fixtures without unused build-directory copies.

Correct the cubic p normalization/order and use the dmftsym iprop parity for improper rotations. Add independent inversion and basis-normalization regressions. Reject the unsupported non-SO and cubic f paths until their port stages. Compare headers exactly, finite complex matrices at atol=1e-7 with rtol=0, and verify unitarity at the native basis precision floor.
@krystophny
krystophny force-pushed the port/dmftproj-sympar-python branch from 62065ff to 6beffcc Compare October 12, 2026 17:39
@krystophny

Copy link
Copy Markdown
Author

GPT Sol fixed per-shell representation parsing and inconsistent SO flags in the standalone sympar implementation, with a multi-angular-momentum regression. Its native-reference test passes. Restacked on updated #9. Latest-head CI is running/queued.

Chris&AI

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.

1 participant