Skip to content

[wien2k] pure-Python case.ctqmcout correlated-shell projectors - #9

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

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

Conversation

@krystophny

@krystophny krystophny commented Jun 16, 2026 •

Copy link
Copy Markdown

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

Generate case.ctqmcout from the almblm coefficients: assemble the correlated projectors, apply local symmetry and cubic/complex basis rotations, and Loewdin-orthonormalize the stacked shells. This stage supports spin-polarized SO, mode 0, whole shells and identity struct local rotations. Unsupported non-SO, band-index, fromfile and cubic p/f paths are rejected; later PRs extend support.

The rebase retains the current native fixtures and #8's compressed-input handling. Window selection now keeps opened and valid windows separate, checks that SO spin windows coincide, and uses each spin's own band offsets. Empty windows fail explicitly.

The CaOs2 comparison checks integers exactly and finite floats at atol=1e-7, rtol=0. Regressions cover final-band-only windows and mismatched spin windows. Local checks pass: the maximum native residual is 1.3e-8; the generated full 20×50 projector has orthonormality error 3.2e-15. The earlier rank-deficiency claim concerned the superseded narrow window, not this fixture.

The SOC convention issue in dft_tools#148 is distinct from native precision loss; its non-centrosymmetric frame correction remains in #18/#19.

Chris&AI

@krystophny

Copy link
Copy Markdown
Author

Accuracy: reproduces the released dmftproj case.ctqmcout to 4.3e-7. The overlap is rank-deficient (more correlated spin-orbitals than bands), so O^{-1/2} amplifies the last-ULP gfortran-vs-numpy libm difference by ~1e8; even with the precision fix #14 + scipy ZHEEV #12 it floors at ~6.6e-7. dmftproj is byte-identical across BLAS, but no cross-language port matches it below this floor without changing the (preserved) algorithm.

@krystophny

krystophny commented Oct 12, 2026 •

Copy link
Copy Markdown
Author

GPT Sol rebased this onto the corrected #8 and fixed duplicated window flags, mismatched SO spin windows, spin-specific band offsets, and NaN-blind comparisons. Unsupported paths now fail explicitly. The current full-rank fixture matches within 1.3e-8; Python projector orthonormality is 3.2e-15. All four CI jobs pass. The precision claims and PR description are corrected.

Chris&AI

@krystophny
krystophny force-pushed the port/dmftproj-ctqmcout-python branch 2 times, most recently from 7ceca82 to 9bc18c3 Compare October 12, 2026 17:39
@krystophny

Copy link
Copy Markdown
Author

GPT Sol backported the remaining projector fixes into this standalone step: per-shell representation parsing, explicit unsupported-input checks, below-window spin consistency, and scale-relative Loewdin rank detection. Native-reference, tiny full-rank overlap, singular-overlap and parser regressions pass. Restacked on updated #8. Latest-head CI is running/queued.

Chris&AI

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.
@the-hampel
the-hampel force-pushed the port/dmftproj-ctqmcout-python branch from 9bc18c3 to 6d3188c Compare October 13, 2026 14:17
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