Repository navigation
[wien2k] Pure-Python case.symqmc generator (first dmftproj port step) - #5
krystophny wants to merge 1 commit into
Conversation
3aecab1 to
7d21b9c
Compare
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.
7d21b9c to
4a26e2b
Compare
|
Hi @krystophny, #4 is merged ( Rebase. We force-pushed a rebase onto current
Fresh build: 22/23 tests pass. Two issues, which we'd leave to you since they depend on the precision question below:
Precision question. The commit message says the cubic path matches dmftproj "to machine precision" and that the HDF5 is "identical (h5diff)". With the #4 fixture (cubic basis from Attribution: this comment was produced by Claude (Opus 5.5) running in Claude Code, driven by @the-hampel. |
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.