Repository navigation
feat(dfpt): project the q=0 response tensors onto the point-group form - #8432
Merged
mohanchen merged 1 commit intoNov 28, 2026
Merged
Conversation
QE applies two output-level tensor symmetrizations to the electric-field
response: dielec.f90 calls symmatrix on the dielectric tensor and
zstar_eu.f90 calls symtensor on the Born charges (both guarded by
IF (nsym == 1) RETURN). ABACUS had neither, so under symmetry=1 the
printed tensors kept their raw numerical anisotropy and off-diagonal
pollution, and the LO-TO term plus the Z* sum rule consumed them raw.
This adds the parity projection after compute_born and before the ASR
family: epsilon_inf <- (1/n) sum_g R_g eps R_g^T and
Z'_iat <- (1/n) sum_g R_g Z_{image_g(iat)} R_g^T, with the cartesian
rotation images built as latvec^-1 gmatrix latvec (the symmetrize_mat3
construction) and the atom images from Symmetry::get_rotated_atom.
The QE guard semantics are kept: the projection runs only under
symmetry=1 with a nontrivial group; under nosym the raw tensors stay
visible (the audit channel for cross-code comparisons), and the run log
prints the unsymmetrized Born charges before the projection when it
runs. Verification: Si 2x2x2 sym collapses to 54.6344 x3 with
machine-zero off-diagonals (the isotropic component equals the
diagonal mean of the raw tensor) while the nosym run is bit-identical.
Tests: five free-function tests on the synthetic cubic operation set
(invariance of isotropic input, projection of anisotropic input, the
no-op guards, atom-image bookkeeping, trace and per-component sum
preservation).
mohanchen
approved these changes
Nov 28, 2026
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.
Summary
QE applies two output-level tensor symmetrizations to the electric-field
response:
dielec.f90callssymmatrixon the dielectric tensor andzstar_eu.f90callssymtensoron the Born charges (both guarded byIF (nsym == 1) RETURN). ABACUS had neither, so undersymmetry 1theprinted tensors kept their raw numerical anisotropy and off-diagonal
pollution, and the LO-TO term plus the Z* sum rule consumed them raw.
This adds the parity projection after
compute_bornand before the ASRfamily:
epsilon_inf <- (1/n) sum_g R_g eps R_g^TZ'_iat <- (1/n) sum_g R_g Z_{image_g(iat)} R_g^Twith the cartesian rotation images built as
latvec^-1 gmatrix latvec(the
symmetrize_mat3construction) and the atom images fromSymmetry::get_rotated_atom.Semantics
The QE guard semantics are kept: the projection runs only under
symmetry 1with a nontrivial group. Under nosym the raw tensors stayvisible (the audit channel for cross-code comparisons), and the run log
prints the unsymmetrized Born charges before the projection when it
runs.
Note: the projected values under
symmetry 1still carry thesymmetry-reduced k-response issue being fixed in a separate work stream;
this PR is about the output form and the downstream consumers receiving
clean tensors.
Verification
machine-zero off-diagonals (the isotropic component equals the
diagonal mean of the raw tensor, as the projection guarantees).
is untouched).
invariance of isotropic input, projection of anisotropic input, the
no-op guards, atom-image bookkeeping, trace and per-component sum
preservation (the Z* sum-rule input).