Repository navigation
feat(dfpt): (k, k+q) response pair representatives over the full mesh - #8433
Merged
Zanthoxylum merged 4 commits intoNov 28, 2026
Merged
Conversation
…on basis First building block of the symmetry-reduced response path (design doc DESIGN_symmetry_response.md, PR B1): the enumeration of the space-group operations that preserve a wave vector modulo a reciprocal-lattice vector, R q = s q + G with s = +-1, where the s = -1 branch admits the rotations that preserve q when composed with time reversal. The reciprocal test is the dot-product integrality (R q - s q) . a_i / 2pi in Z over the direct primitive vectors. The cartesian-integrality alternative is wrong for non-primitive lattices: at the fcc L point it would admit C2y because the cartesian difference (1, 0, -1) 2pi/a is integral but not a reciprocal-lattice vector. The function takes the lattice and the operation array explicitly (the symmetry module's gmatrix convention, reconstructed as latvec^-1 G latvec following symmetrize_mat3) and returns the union of the two branches: for a time-reversal-invariant q they coincide (L -> D3d of 12, X -> D4h of 16), while for a generic q the antiunitary branch still contributes inversion (theta*i fixes every q). Membership is convention-immune (an operation and its inverse qualify together), and the module is inert infrastructure: nothing consumes it yet, the response k-list generation and the G_q projection land in later steps. Tests: Gamma keeps all 48 Oh operations, the fcc L/X/D3d/D4h counts (12/16) against the independently derived groups, the generic-q identity+inversion pair, and the empty-input guard.
Second building block of the symmetry-reduced response path (design doc
DESIGN_symmetry_response.md, PR B1): for a given q, reduce the full k
mesh to orbit representatives of the UNITARY little co-group (the
s = +1 branch, QE's nsymq) and return one (k, k+q) pair per orbit with
the orbit size as weight. The plain weighted sum over these
representatives is the input the later G_q projection closes on: the
projection identity P(A) = F requires the list to be reduced with
respect to the same group the projector runs over.
The orbit partition is generated in cartesian k space through the
rotation images R = latvec^-1 G latvec, which makes it immune to the
forward/backward gmatrix conventions ({R} and {R^T} generate the same
orbits because the cartesian images of a point group are orthogonal),
and the Gamma case reproduces the standard k-mesh IBZ reduction as the
convention anchor.
Inert infrastructure: nothing consumes it yet; the response driver and
the G_q projection land in later steps.
Tests: Gamma reproduces the production 2x2x2 fcc IBZ (Gamma + L star +
X star with orbit sizes 4/3/1), the L and X points reduce under their
D3d/D4h unitary co-groups to 4 pairs (3/3/1/1 and 4/2/1/1, brute-force
derived), a generic q keeps the full mesh with unit weights, the k+q
wrapping arithmetic is verified per pair, and the empty-input guards.
…ction Two latent defects in kq_pair_reps, both invisible on the fcc test lattice and both exposed by the hexagonal discriminator (lat != lat^T): 1. The reciprocal map was 2pi (latvec^-1)^T instead of 2pi latvec^-1. The columns of 2pi latvec^-1 are the reciprocal primitive vectors (b_i . a_j = 2pi delta_ij with a_j the latvec rows); the transposed variant coincides only for symmetric basis matrices, which is the third appearance of the accidental fcc equivalence (after the G/G^T convention collapse and the frac->cart map). 2. The orbit membership compared raw cartesian coordinates, missing pairs whose rotation image differs from a mesh point by a reciprocal-lattice vector: the fcc 2x2x2 star images land exactly on mesh points, but the hexagonal 3x3x2 mesh has wrapping orbits ((1/3,1/3) <-> (2/3,2/3) under C6) that a raw comparison silently splits into singletons. Membership is now compared as wrapped fractional coordinates. Tests: the hexagonal C6v suite -- Gamma reduces with wrapping orbit sizes 6/6/2/2/1/1 (locking the mod-lattice fix), K and M reduce under their little groups (6 and 4 unitary members, orbit multisets brute-force derived), the little-group union at the hexagonal Gamma/K/M is 12/12/4 (K doubled by the antiunitary branch, M time-reversal-invariant), and the production-convention input lat R^T lat^-1 reproduces the test-convention pair lists exactly (convention robustness on a genuinely asymmetric basis). All fcc tests unchanged; 11/11 module tests pass.
mohanchen
approved these changes
Nov 28, 2026
…) into feat-dfpt-kq-pairs The three dfpt_symm files conflicted add/add because deepmodeling#8431 was squash-merged: develop's copies are byte-identical to this branch's base commit 386bd03, so the resolution takes this branch's side (base + the k+q pair reduction and its fixes). After this merge the PR diff shrinks to the two kq-pairs commits.
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
Second building block of the symmetry-reduced DFPT response path: for a
given q, reduce the full k mesh to orbit representatives of the
unitary little co-group of q (the
s = +1branch, QE'snsymq) andreturn one
(k, k+q)pair per orbit with the orbit size as weight.The plain weighted sum over these representatives is the input the later
G_q projection closes on: the projection identity P(A) = F requires the
list to be reduced with respect to the same group the projector runs
over -- a G-reduced list with a G_q projector does not close (the
Q-even G-odd noise survives), which is the mathematical prerequisite
QE's
setup_nscfembodies by generating the k+k+q list with thesmall group of q.
Design
rotation images
R = latvec^-1 G latvec, which makes it immune to theforward/backward gmatrix conventions ({R} and {R^T} generate the same
orbits because the cartesian images of a point group are orthogonal).
The production-convention input
lat R^T lat^-1and the testconvention
lat R lat^-1are genuinely different matrices onasymmetric bases (hexagonal: matrix entries differ by O(1)), and both
reconstruct to valid rotations.
k_cart = 2pi latvec^-1 k_frac(the columns of2pi latvec^-1are the reciprocal primitive vectors b_i withb_i . a_j = 2pi delta_ij, a_j being the latvec rows). The transposedvariant coincides only for symmetric basis matrices.
a rotation image may differ from a mesh point by a reciprocal-lattice
vector (wrapping orbits), which a raw cartesian comparison silently
splits.
convention anchor.
the G_q projection land in later steps.
Latent defects fixed (both invisible on fcc, exposed by hexagonal)
2pi (latvec^-1)^Tinstead of2pi latvec^-1-- the two coincide only for symmetric basismatrices, which made the fcc tests pass accidentally.
pairs whose rotation image differs from a mesh point by a
reciprocal-lattice vector: the fcc 2x2x2 star images land exactly on
mesh points, but the hexagonal 3x3x2 mesh has wrapping orbits
((1/3,1/3) <-> (2/3,2/3) under C6) that a raw comparison splits into
singletons.
Verification
Unit tests (expectations derived independently by brute force):
fcc (2x2x2 mesh):
orbit sizes 4/3/1).
hexagonal (3x3x2 mesh, lat != lat^T -- the basis-asymmetry
discriminator):
2-member wrapping orbits only close through the mod-lattice
membership, locking the fix.
singletons (6 unitary little-group members).
members; M is time-reversal invariant).
lat R^T lat^-1reproduces thetest-convention pair lists exactly (convention robustness on a
genuinely asymmetric basis).
doubled by the antiunitary branch).
All fcc tests unchanged; 11/11 module tests pass.