Repository navigation
[wien2k] pure-Python case.oubwin band-window generator - #8
Conversation
|
Accuracy: |
334a8a7 to
517c014
Compare
|
Hi @krystophny, #5 is merged ( Rebase. We force-pushed a rebase onto current Fresh build: 23/24 tests pass.
Review: one blocking finding in _select_window(10, 13, np.array([-3., -2., -1., 0.5]), 0., 0., 1.) # -> (True, 13, 0)
_select_window(5, 5, np.array([0.5]), 0., 0., 1.) # -> (True, 5, 0)Please track the two flags separately, as the Fortran does. If you think dropping that k-point is a Fortran bug worth fixing, change both sides together and say so in the commit message. Non-blocking:
Attribution: this comment was produced by Claude (Opus 5.5) running in Claude Code, driven by @the-hampel. |
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.
517c014 to
2dd14bf
Compare
|
GPT Sol did the remaining updates in 2dd14bf. Window-open and window-valid flags now preserve the Fortran final-band behavior. Focused regressions cover both reported cases, energy boundaries, Fermi shifts, per-k weights and excluded records. Both generated spin files are compared against 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.
|
GPT Sol completed another adversarial review against the linked port context. Fixed reading multiple correlated-shell representation records before the SO flag, rejected inconsistent per-sort SO flags, and accepted inline window comments. The native window fixture and focused parser regressions pass; the dependent stack has been restacked. 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.
Part of #7 (dmftproj Fortran-to-Python port), following the merged #5.
triqs_dftkit.wien2k.oubwin.write_oubwin(case)readscase.almblm{up,dn}(or the non-spin-polarizedcase.almblm) and the energy window incase.indmftpr. It selects the contiguous band range per k-point and spin and writescase.oubwin{up,dn}in the dmftproj format. This step supports energy-window projection mode 0; band-index modes raiseNotImplementedError.Window selection preserves
set_projections.f's separate window-open and window-valid flags. A window that opens only at the final band remains excluded with zero bounds, including whennbmin == nbmax.The CaOs2 test decompresses the existing
.almblm{up,dn}.gzfixtures into a temporary directory and compares both generated spin outputs against the shippedCaOs2.oubwinup, ignoring only trailing whitespace removed from that reference. The selected bands are 43–92. No duplicate truncated inputs are added.The existing test also checks the reported final-band cases, strict lower/inclusive upper energy boundaries, Fermi shifts, distinct per-k-point lowest-band weights, and output records for excluded points. It passes locally with NumPy; full package integration is checked by the PR's CI matrix.
Chris&AI