Skip to content

[vasp] run DMFT on the irreducible BZ with symmetrization#17

Open
the-hampel wants to merge 18 commits into
unstablefrom
vasp_ibz
Open

[vasp] run DMFT on the irreducible BZ with symmetrization#17
the-hampel wants to merge 18 commits into
unstablefrom
vasp_ibz

Conversation

@the-hampel

Copy link
Copy Markdown
Member

Add an IBZ mode to the VASP converter so DMFT can run on the irreducible Brillouin zone (with space-group symmetrization) instead of unfolding to the full k-grid. On a dense NiO mesh this is ~10x fewer k-points and ~9x faster Gloc for an identical result.

New module triqs_dftkit.vasp.symmetry:

  • real cubic-harmonic rotation matrices D^l(R) for l=1,2 (tensor method, basis orders matching VASP: d=[xy,yz,z2,xz,x2-y2], p=[y,z,x])
  • read VASP symmetry from vaspout.h5; convert the reciprocal-fractional symops to Cartesian and close them into the full point group (VASP only stores one coset representative per k-point, which is incomplete on coarse/special meshes)
  • atom permutations under the space group (with translation detection)
  • build the dft_symmcorr_input payload (mat/perm/time_inv) consumed by triqs_modest / dft_tools to restore the full-BZ average

converter.convert_dft_input gains use_ibz (auto-detect from vaspout.h5), vasp_h5 and plo_cfg arguments: in IBZ mode it slices the data to the irreducible k-points, sets bz_weights to the IBZ multiplicities and symm_op=1, and writes the real symmetry matrices. Without symmetry data (text mode) it falls back to the full grid and suggests the h5 interface.

Tests: converter IBZ tests for SrVO3 (t2g, cubic) and AFM NiO (full d + O p, non-cubic, two equivalent Ni); ignore generated test artifacts.

@harrisonlabollita

Copy link
Copy Markdown
Collaborator

Hi @the-hampel, now that we have the IBZ symmetry operations are they in the same format as the Wien2k IBZ symmetry ops? Then the DFTtools and ModEST symmetrizers can consume the same data and apply the symmetrization to k-summed quantities.

band_energy_and_write_charge_update only stored delta_N in the seedname
h5 (dft_update group), which VASP's ADD_GAMMA_FROM_FILE does not read, so
the CSC loop aborted with 'no GAMMA or vaspgamma.h5 file found'. Also write
the correction to vaspgamma.h5 in the layout VASP expects (top-level
band_window + deltaN/{up,down}, one nb x nb block per IBZ k-point), mirroring
triqs_dft_tools SumkDFT.calc_density_correction(dm_type='vasp').

Handles the non-magnetic / spin-averaged case (up == down); SP!=0 and SOC
are not written by this h5 path (SO needs the legacy GAMMA text file).
band_energy_and_write_charge_update now branches on the SO flag in the
seedname h5: for spin-orbit it writes the single spinor-band channel to
deltaN/ud (no spin average); otherwise the spin-averaged collinear blocks
to deltaN/up and deltaN/down. This matches what VASP's ADD_GAMMA_FROM_FILE
reads and mirrors triqs_dft_tools calc_density_correction(dm_type='vasp').

Add test/python/vasp/charge_update with collinear, spin-orbit and IBZ-slicing
cases: the expected correction is built independently in numpy, written to a
reference vaspgamma.h5, and compared to the writer output with triqs h5diff;
the band-energy correction value is checked separately.
Report the global DFT+DMFT iteration, each inner DMFT iteration, and the
point just before the VASP charge update / DFT driver is triggered.
vasp.Driver landed on this branch; link it in the interface table
instead of marking it as in development.
The upstream ctseg fix (real(...) in work_data.cpp mu extraction) means
solve_generic now accepts the complex-flagged Hermitian impurity levels
directly; no need to strip the imaginary noise with h.real.copy().
Skip the final VASP charge update so the run always terminates on a DMFT
step instead of a now-unused DFT charge update, and add a header comment
plus inline comments explaining the setup and the outer/inner loops.
Call mpi.barrier with poll_msec=100 in the vasp, qe and abinit drivers
(and the plovasp sc_dmft loop) so idle ranks sleep instead of busy-
polling every 1 ms while the external DFT code occupies the CPUs.
Remove a leftover vasp.lock (in addition to STOPCAR) at the start of
run_initial_stage: a stale lock would make the driver believe VASP is
already running. Also clarify in run_update_stage that running several
VASP steps per DMFT iteration is left to the caller.
Add an IBZ mode to the VASP converter so DMFT can run on the irreducible
Brillouin zone (with space-group symmetrization) instead of unfolding to
the full k-grid. On a dense NiO mesh this is ~10x fewer k-points and ~9x
faster Gloc for an identical result.

New module triqs_dftkit.vasp.symmetry:
- real cubic-harmonic rotation matrices D^l(R) for l=1,2 (tensor method,
  basis orders matching VASP: d=[xy,yz,z2,xz,x2-y2], p=[y,z,x])
- read VASP symmetry from vaspout.h5; convert the reciprocal-fractional
  symops to Cartesian and close them into the full point group (VASP only
  stores one coset representative per k-point, which is incomplete on
  coarse/special meshes)
- atom permutations under the space group (with translation detection)
- build the dft_symmcorr_input payload (mat/perm/time_inv) consumed by
  triqs_modest / dft_tools to restore the full-BZ average

converter.convert_dft_input gains use_ibz (auto-detect from vaspout.h5),
vasp_h5 and plo_cfg arguments: in IBZ mode it slices the data to the
irreducible k-points, sets bz_weights to the IBZ multiplicities and
symm_op=1, and writes the real symmetry matrices. Without symmetry data
(text mode) it falls back to the full grid and suggests the h5 interface.

Tests: converter IBZ tests for SrVO3 (t2g, cubic) and AFM NiO (full d +
O p, non-cubic, two equivalent Ni); ignore generated test artifacts.
… subspaces

Two fixes for the IBZ symmetrization path:

1. Source the per-shell TRANSFORM from the PLOVASP output instead of
   re-parsing plo.cfg. PLOVASP now serializes each shell's transform
   matrices (real harmonics -> correlated orbitals) into the .pg header
   (completing the long-standing TODO), and the converter reads them back
   per ion. This guarantees the matrices used to build the correlated-shell
   symmetry operations are exactly the ones used to build the projectors,
   and removes the fragile re-parse (which silently mishandled TRANSFILE,
   complex transforms, and fell back to a wrong identity slice). The plo_cfg
   argument to convert_dft_input is now unused (kept for back-compat) and
   read_transforms_from_plo_cfg is removed.

2. Reject correlated orbital sets that are not symmetry-closed. Q = T D(R) T^dag
   is a representation only if the orbital subspace (row span of T) is invariant
   under every point-group operation. build_symmcorr now checks this per shell
   (gauge-free, via the subspace projector) and raises with a clear message
   otherwise. Full shells and complete irreps (t2g, eg) pass; an arbitrary
   LOCPROJ subset that splits a multiplet (e.g. dxy,dz2,dx2-y2) is caught
   instead of silently producing a wrong full-BZ average.

Tests: existing converter IBZ refs (SrVO3 t2g, AFM NiO full d + O p) reproduce
unchanged via the header transform; non-IBZ converter tests unaffected.
Complements the subspace-invariance guard. A partial LOCPROJ selection
(fewer than 2l+1 real harmonics) without a TRANSFORM leaves the absent
orbitals zero-filled in proj_mat; with an identity transform the invariance
check passes (identity is trivially invariant) but symmetrization on the IBZ
would leak the kept orbitals into the dead partners. Detect zero-weight
correlated orbitals before building the symmetry operations and raise a clear
error pointing at the full-shell / complete-irrep / full-grid alternatives.

Existing IBZ tests (SrVO3 t2g, AFM NiO full d + O p) have no zero-weight
orbitals and are unaffected.
@the-hampel

Copy link
Copy Markdown
Member Author

Hi @harrisonlabollita ,
yes i think wien2k and VASP work similar here. For example for this to work I did not have to change anything in triqs/dft_tools . In modest I have a branch: https://github.com/TRIQS/modest/tree/vasp_ibz that just adds a test to modest (+ an important bug fix in the p-orbital oder modest assumes for VASP!) . Is this answering your question? I must admit I let Claude code the symm ops of the orbitals (I was too lazy for this since years - otherwise this would have not taken so long ^^) . I designed the tests where I knew it would only pass if the symm ops are correct, so I hope the implementation is along the same lines as Wien2k. I just fixed some minor things here for non complete projector sets. Happy also discuss this next week. This has lower prio than the other PRs for me - or is more experimental.

@harrisonlabollita

Copy link
Copy Markdown
Collaborator

That answers my question! Thank you

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.

2 participants