Skip to content

feat(dfpt): project the q=0 response tensors onto the point-group form - #8432

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Zanthoxylum:feat-dfpt-tensor-symmetrize
Nov 28, 2026
Merged

mohanchen merged 1 commit into
deepmodeling:developfrom
Zanthoxylum:feat-dfpt-tensor-symmetrize

Conversation

@Zanthoxylum

Copy link
Copy Markdown
Collaborator

Summary

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
  • 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.

Semantics

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.

Note: the projected values under symmetry 1 still carry the
symmetry-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

  • Si 2x2x2 sym: the dielectric tensor collapses to 54.6344 x3 with
    machine-zero off-diagonals (the isotropic component equals the
    diagonal mean of the raw tensor, as the projection guarantees).
  • Si 2x2x2 nosym: bit-identical output (the guard skips; the nosym path
    is untouched).
  • Five free-function unit 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 (the Z* sum-rule input).
  • 10/10 module_dfpt unit tests pass.

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).
@Zanthoxylum Zanthoxylum added Refactor Refactor ABACUS codes DFPT Density Functional Perturbation Theory labels Nov 28, 2026
@mohanchen
mohanchen merged commit 6512547 into deepmodeling:develop Nov 28, 2026
20 checks passed
@Zanthoxylum
Zanthoxylum deleted the feat-dfpt-tensor-symmetrize branch November 28, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DFPT Density Functional Perturbation Theory Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants