Skip to content

feat(dfpt): (k, k+q) response pair representatives over the full mesh - #8433

Merged
Zanthoxylum merged 4 commits into
deepmodeling:developfrom
Zanthoxylum:feat-dfpt-kq-pairs
Nov 28, 2026
Merged

Zanthoxylum merged 4 commits into
deepmodeling:developfrom
Zanthoxylum:feat-dfpt-kq-pairs

Conversation

@Zanthoxylum

Copy link
Copy Markdown
Collaborator

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 = +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 -- 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_nscf embodies by generating the k+k+q list with the
small group of q.

Design

  • 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).
    The production-convention input lat R^T lat^-1 and the test
    convention lat R lat^-1 are genuinely different matrices on
    asymmetric bases (hexagonal: matrix entries differ by O(1)), and both
    reconstruct to valid rotations.
  • The reciprocal map is k_cart = 2pi latvec^-1 k_frac (the columns of
    2pi latvec^-1 are the reciprocal primitive vectors b_i with
    b_i . a_j = 2pi delta_ij, a_j being the latvec rows). The transposed
    variant coincides only for symmetric basis matrices.
  • Orbit membership is compared as wrapped fractional coordinates:
    a rotation image may differ from a mesh point by a reciprocal-lattice
    vector (wrapping orbits), which a raw cartesian comparison silently
    splits.
  • 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.

Latent defects fixed (both invisible on fcc, exposed by hexagonal)

  1. The reciprocal map was 2pi (latvec^-1)^T instead of
    2pi latvec^-1 -- the two coincide only for symmetric basis
    matrices, which made the fcc tests pass accidentally.
  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 splits into
    singletons.

Verification

Unit tests (expectations derived independently by brute force):

fcc (2x2x2 mesh):

  • Gamma, full group: the production IBZ (Gamma + L star + X star,
    orbit sizes 4/3/1).
  • L point, D3d unitary co-group (12 ops): 4 pairs, orbit sizes 3/3/1/1.
  • X point, D4h unitary co-group (16 ops): 4 pairs, orbit sizes 4/2/1/1.
  • Generic q, trivial co-group: the full mesh with unit weights.
  • The k+q wrapping arithmetic is verified per pair; empty-input guards.

hexagonal (3x3x2 mesh, lat != lat^T -- the basis-asymmetry
discriminator):

  • Gamma under C6v: 6 pairs with orbit sizes 6/6/2/2/1/1 -- the
    2-member wrapping orbits only close through the mod-lattice
    membership, locking the fix.
  • K = (1/3, 1/3, 0): 10 pairs with orbit sizes 3/3/3/3 + six
    singletons (6 unitary little-group members).
  • M = (1/2, 0, 0): 10 pairs with orbit sizes 2 x 8 + 1/1 (4 unitary
    members; M is time-reversal invariant).
  • Production-convention input lat R^T lat^-1 reproduces the
    test-convention pair lists exactly (convention robustness on a
    genuinely asymmetric basis).
  • The little-group union at the hexagonal Gamma/K/M is 12/12/4 (K
    doubled by the antiunitary branch).

All fcc tests unchanged; 11/11 module tests pass.

…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.
@Zanthoxylum Zanthoxylum added Refactor Refactor ABACUS codes DFPT Density Functional Perturbation Theory labels 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.
@Zanthoxylum
Zanthoxylum merged commit d3b36eb into deepmodeling:develop Nov 28, 2026
18 checks passed
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