[wien2k] Pure-Python case.symqmc generator (first dmftproj port step)#5
Open
krystophny wants to merge 2 commits into
Open
[wien2k] Pure-Python case.symqmc generator (first dmftproj port step)#5krystophny wants to merge 2 commits into
krystophny wants to merge 2 commits into
Conversation
…CaOs2) dftkit's Wien2k converter is only covered by the non-SOC SrVO3 case. This adds a SOC + spin-polarized golden test: CaOs2, a cubic fluorite cell with two symmetry-equivalent correlated Os atoms whose magnetic point group has 16 operations, 8 of them time-reversal. It exercises the combined-spin 'ud' block and the time-reversal symmetry path of dmftproj + the converter on a small 8-k-point fixture, validated by h5diff against a reference produced by this converter.
triqs_dftkit.wien2k.symqmc.write_symqmc builds the correlated-shell spinor symmetry matrices (case.symqmc) from case.dmftsym + case.indmftpr + case.struct, reproducing the dmftproj Fortran construction (Wigner D, orbital and spinor time-reversal operators, angular-harmonics basis transform, spin-1/2 phase blocks). It is a full replacement of the symqmc-writing, covering every path: - non-mixing spin-diagonal bases (complex, cubic): the up/up block scaled by the +-(a+g)/2 phase, with the orbital time-reversal operator on the magnetic operations; - mixing fromfile bases that couple spin (the |j,m_j> basis): the full 2(2l+1) spinor representation P spinrot P^dag with the spinor time-reversal -i sigma_y (x) T on the magnetic operations; - l=0 (s) shells: the 2x2 spin phase block. Verified against the dmftproj Fortran output for all three paths on CaOs2 (16 operations, 8 time-reversal): the cubic converter HDF5 is identical (h5diff) and every matrix matches to machine precision. The mixing fromfile path is the one dft_tools #148 singles out; dmftproj reads that basis with a single-precision CMPLX cast and a 250-column line cap (set_ang_trans.f), so its case.symqmc carries a ~1e-7 error there while this generator is full double precision. Tests: the cubic path reuses the SOC golden h5; the mixing and l=0 paths compare to the dmftproj matrix data (single precision, ~26 kB) and assert unitarity.
3aecab1 to
7d21b9c
Compare
This was referenced Jun 15, 2026
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #7 (dmftproj Fortran-to-Python port).
First step of porting the
dmftprojFortran to Python: a pure-Python generator forcase.symqmc(the correlated-shell symmetry matrices).triqs_dftkit.wien2k.symqmc.write_symqmc(case)readscase.dmftsym+case.indmftpr+case.structand writescase.symqmc, reproducing the dmftproj Fortran construction (Wigner D, orbital and spinor time-reversal operators, angular-harmonics basis transform, spin-1/2 phase blocks). It is a full replacement of the symqmc-writing, covering every path dmftproj emits:+-(a+g)/2phase, with the orbital time-reversal operator on the magnetic operations;fromfilebases (the|j,m_j>basis): the full2(2l+1)spinor representationP spinrot P^dagwith the spinor time-reversal-i sigma_y (x) Ton the magnetic operations;l=0(s) shells: the2x2spin phase block.This is the first of the "tail-backward" series that incrementally replaces
fortran/dmftprojwith Python, each step proven against the Fortran output via the SOC golden test (#4).While validating the mixing path I found dmftproj reads the
fromfilebasis in single precision (aCMPLXcast withoutKIND=8) and through a 250-column line cap, so itscase.symqmcthere carries a ~1e-7 error; the Python generator is full double precision. That dmftproj bug is fixed separately in #6.Verification
Validated against the dmftproj Fortran output on CaOs2 (16 operations, 8 time-reversal) for all three paths:
The residuals are dmftproj's own limited precision (8-digit cubic templates, single-precision
fromfile); the Python construction is exact (machine-precision unitarity). With #6 applied, the mixing path matches dmftproj to 1.9e-14.End to end, the cubic converter HDF5 is identical (
h5diff). Tests: the cubic path reuses the SOC golden h5; the mixing andl=0paths compare to the dmftproj matrix data (single precision, ~26 kB) and assert unitarity. Built against TRIQS withBuild_Tests=ON:4/4wien2k tests pass.