Skip to content

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

Merged
the-hampel merged 5 commits into
unstablefrom
vasp_ibz
Sep 25, 2026
Merged

the-hampel merged 5 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.

@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

@the-hampel

Copy link
Copy Markdown
Member Author

Note after seeing all these comments on Wien2k with SOC: I did not think or test this with SOC. I am not sure if I have to be careful with anything in that case. TBD next week as well.

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.
…e it

DFTTools' Symmetry finds the image of a correlated shell by comparing the
whole orbit dict, 'sort' included, while the VASP converter gives every
site its own sort. Any operation that exchanges correlated atoms (the two
O in the NiO test) therefore made SumkDFT fail with "list.index(x): x not
in list". Shells mapped onto each other by the space group now share one
sort in dft_symmcorr_input/orbits. ModEST does not look at the sort, which
is why its IBZ test did not see this.

Further changes to the symmetry construction:
- refuse, instead of assuming the identity, when the atom permutation of
  an operation cannot be determined
- refuse when a symmetry image of a correlated shell is not itself a
  correlated shell (e.g. only one of two equivalent atoms projected)
- refuse spin-orbit coupling, where the operations would have to act on
  the spinors as well
- check that the first n_k_ibz points of the full grid are the IBZ points,
  which the slicing in the converter relies on

Converter:
- drop the unused plo_cfg argument of convert_dft_input()
- look up vaspout.h5 next to the basename by default, as the KPOINTS_OPT
  conversion already does, instead of in the working directory
- in automatic mode (use_ibz=None) fall back to the full grid with a note
  when the projector set cannot be symmetrized, so that setups that worked
  on the full grid keep working; use_ibz=True still raises
- the VASP Driver passes use_ibz through for CSC runs

Tests: the IBZ test now also checks the physics. The DFT occupation
matrices on the IBZ, symmetrized the way DFTTools does it, must agree with
the symmetrized full-grid ones (1e-8) and with the raw full-grid ones to
the symmetry of the VASP projectors (1e-10 SrVO3, 1e-4 NiO). The NiO
reference changes only in dft_symmcorr_input/orbits[3]/sort. The SrVO3
full-grid regression test now asks for use_ibz=False, since the default
would otherwise pick up its vaspout.h5 and switch to the IBZ.
…e known to work

The automatic IBZ mode is on by default, so it must switch itself on only
for correlated shells the symmetry operations are correct for:

- rotation matrices exist for l = 0, 1, 2 only (l = 0 is new and trivial);
  f shells are refused up front with a clear message instead of failing
  deep inside real_harmonic_rotation
- the TRANSFORM of every correlated shell must have orthonormal rows,
  otherwise T D T^dag is not unitary
- the symmetry operations are checked on the data themselves: the full grid
  is still at hand in the converter, and the symmetrized IBZ occupation and
  local Hamiltonian of the correlated shells must reproduce the full-grid
  ones within ibz_tol (default 1e-3). Correct operations leave only the
  symmetry error of the VASP projectors (1e-12 SrVO3, 7e-5 NiO); swapping
  z^2 and x^2-y^2 in the d matrices, which passes every structural check,
  gives 6e-3 (occupation) and 3e-2 eV (local levels)

As before, use_ibz=None falls back to the full grid with a note when any
check fails, and use_ibz=True raises.

Tests: D^l is orthogonal and a representation; f shells, non-orthonormal
transforms and SO are refused; projecting only one of two equivalent O and
wrong d matrices (mocked) both fall back in auto mode and raise with
use_ibz=True.
@the-hampel
the-hampel merged commit 43435dc into unstable Sep 25, 2026
4 checks passed
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