Repository navigation
[wien2k] fix dmftproj port for non-centrosymmetric cells - #19
krystophny wants to merge 6 commits into
Conversation
cef9678 to
7009111
Compare
|
GPT Sol rebased this onto the reviewed odd-l stack and completed the local-frame fix across ctqmcout, parproj and outband. Preserved the p-basis and antiunitary corrections, removed the struct guard only after every projector writer used the composed frame, and added an independent Te rotation regression. Seven affected local tests pass; CI is running. Chris&AI |
c69074b to
132dd4e
Compare
|
GPT Sol re-reviewed the non-centrosymmetric changes using the linked Te discussion and restacked them on updated #16. The Te symmetry, shared-parser, partial-projector and non-SO regressions pass. Generator and converter frame fixes remain distinct; this PR is ready for review. Latest-head CI is running/queued. Chris&AI |
132dd4e to
0901c14
Compare
4a54328 to
ad27f97
Compare
The port was validated only on centrosymmetric, trivial-rotloc, d-shell fixtures (CaOs2, SrVO3). Non-centrosymmetric spin-orbit cells (the dft_tools#148 regime) hit three convention bugs in the p-shell and local-frame paths: - _CUBIC[1]: the cubic l=1 (p) transform was un-normalized and row-ordered pz,py,px instead of the Fortran px,py,pz, so P P^dag != I. _CUBIC[2] (d) was correct, so the d-shell tests never caught it. - The non-mixing magnetic (time-inversion) operations used conj(P.T) where the antiunitary basis change needs P.T (symqmc and sympar shell matrices, and the ctqmcout Rloc rotrep). The mixing path already used P.T; the non-mixing path was inconsistent. It is a no-op for real bases (complex-identity, cubic-d), so only the p-shell with its imaginary p_y row was affected. - The non-mixing ctqmcout path dropped the struct reference local rotation rotloc_ref (beta=pi/2 for Te) that the mixing path composes via rotloc_rotl_so. Both the Rloc rotrep and the projector rotation now compose it; the projector uses dmat(R[isym]) @ dmat(rotloc_ref), the orbital dmat of the full rotloc (rot_projectmat.f), no spin part, no time reversal. Verified against the dmftproj Fortran on the identical lapw2 -almd output (tellurium, P3_1 21, SP+SO): case.symqmc and case.sympar match to 6e-8 and case.ctqmcout (Rloc rotrep + all projectors) to 2e-8, the float32 cubic-template floor; the only larger field is elecn (36 vs 35.999998, a float32 almblm value). Centrosymmetric CaOs2 is byte-identical. Adds a non-centrosymmetric tellurium case.symqmc regression test (small symmetry inputs, no almblm) and a cubic l=1 unitarity check.
Native dmftproj symmetrizes a paramagnetic density matrix also under time reversal (symmetrize_mat.f calls add_timeinv when not spin-polarized), since the magnetic group of a paramagnet is a grey group. The Python port skipped that step. For centrosymmetric cells the space-group average alone already makes the density real, so the CaOs2 references did not notice; for a non-centrosymmetric cell such as Te the p-shell density kept an imaginary part of order 0.6 where native has ~1e-17. Apply D <- (D + U conj(D) U^H)/2 with the shell time-reversal operator after the symmetry average.
set_rotloc.f fills the spinor rotloc only for l >= 1. For an s shell, outputqmc.f instead builds the 2x2 spinor directly from the Euler angles of the composed proper rotation krotm(isym) krotm(rotloc), with the time-reversal column swap for a magnetic op. The port reused the l >= 1 composition (phase-only spinor of the symmetry op times the representative spinor), which differs from native in two ways: - for a non-magnetic mapping op, by an overall SU(2) sign; - for a magnetic mapping op (b = pi), by more than a sign, so the rotated s-shell density matrix in parproj was wrong. Port euler() from set_rotloc.f and build the l = 0 spinor as native does. Checked against native dmftproj on Te with a correlated s shell, including a reordered dmftsym where a magnetic op maps the atoms: ctqmcout and parproj agree to 6e-14.
|
Rebased onto
Checked locally (clang++ 22.1 / gfortran 15.2): ctest 33/33. Without your 193 MB Te almblm we generated a synthetic one: the real A question on test data: the composed frame in Also, the commit message still lists the cubic-p normalisation and the antiunitary transpose, which already came in with #12. We will adjust it when squash-merging. Attribution: this comment was produced by Claude (Opus 5.5) running in Claude Code, driven by @the-hampel. |
ad27f97 to
3f9c03d
Compare
Wien2k 19.1 lapw2 -almd output for trigonal Te (spin-polarized, spin-orbit) at one general k-point with 34 bands, produced on the converged density of the calculation that Te.struct and Te.dmftsym come from. Te.README.md records the provenance and the native dmftproj commands for references.
|
Thanks for the time-reversal and s-shell fixes; I prefer the real file, so b2e4ffb adds Chris&AI |
The composed local frame of a non-centrosymmetric cell, the SO s-shell Rloc and the paramagnetic time-reversal average in parproj had no CI coverage: the Te test checked only symqmc, at single precision, and the CaOs2 fixtures never reach these paths. With the reduced real Te almblm pair, compare ctqmcout, symqmc, sympar and parproj against native dmftproj at 1e-11 for p with SO, s and p with SO, s and p with SO under a dmftsym whose mapping operation is magnetic, and the non-SO path both spin-polarized and paramagnetic. The included d shell is left out to keep parproj references small (about 175 kB gzipped in total). The pre-fix generators fail the s-shell cases by 1.4 and the paramagnetic parproj by 1.8e-4. Te.README.md records the native dmftproj recipe per reference; it regenerates all references byte for byte (gzip -n).
|
Thanks for the real Te files. On top of
We left out the included d shell to keep the Checked locally:
With Attribution: this comment was produced by Claude (Opus 5.5) running in Claude Code, driven by @the-hampel. |
|
Thanks for adding the native references. I removed the redundant |
Fixes the non-centrosymmetric generator paths; rebased directly onto #16. This is separate from the converter-frame correction in #18.
The tellurium context from dft_tools#148 exposes three conventions hidden by centrosymmetric d-shell fixtures: normalized
px,py,pzcubic p harmonics, transpose basis changes for antiunitary operations, and composition of the representative local frame with the atom-mapping symmetry operation.The composed local rotation is now shared by ctqmcout, parproj and outband, including the non-SO local matrix path. Symqmc and sympar use the antiunitary transpose. The earlier nonidentity-struct rejection is removed because every affected projector writer now applies the reference frame.
Validation: the small Te symmetry reference agrees with native dmftproj at
1e-7and all matrices are unitary. An independent test checks that Te's composed p-shell rotation is unitary and differs from the mapping operation alone. The common, Te, odd-l, non-SO, ctqmcout, parproj and outband tests pass locally. The out-of-tree full Te comparison remains limited by the retained 193 MB almblm input and is documented in the discussion.Cubic-p normalization and the shared antiunitary correction are inherited from #12. This layer keeps the composed local-frame correction and tellurium regression without duplicating those fixes. Eleven focused generator regressions pass.
Review this layer. The PR continues to target
unstablebecause its head is in a fork.Full TRIQS integration is checked by GitHub CI; it was not run locally.
Chris&AI