![]() |
QPMS
Electromagnetic multiple scattering library and toolkit.
|
Affine space-group operations and k-dependent symmetry-adapted decomposition for periodic systems. More...


Go to the source code of this file.
Data Structures | |
| struct | qpms_affop_t |
| An affine space-group operation (Cartesian): r ↦ R·r + t. More... | |
| struct | qpms_pergroup_block_id_t |
| Identification result of one numerical isotypic block. More... | |
Functions | |
| static qpms_affop_t | qpms_affop_compose (qpms_affop_t g, qpms_affop_t h) |
| Composes two affine operations: returns g∘h. | |
| static cart3_t | qpms_affop_apply (qpms_affop_t g, cart3_t r) |
| Applies an affine operation to a point. | |
| int | qpms_pergroup_little_ops (size_t *out, const qpms_affop_t *ops, size_t nops, cart3_t k, const cart3_t *recip_basis, int latdim, double atol) |
| int | qpms_pergroup_kcosets (cart3_t *outT, _Complex double *outphase, const cart3_t *lattice_basis, int latdim, cart3_t k, double atol, int nmax) |
| Finds the translation cosets of B modulo T_k = {T in B: k·T in 2pi·Z}. | |
| qpms_errno_t | qpms_pergroup_build_Dk (_Complex double *D, const qpms_scatsys_t *ss, const qpms_affop_t *ops, size_t nops, cart3_t k, const cart3_t *lattice_basis, int latdim, double atol) |
| qpms_errno_t | qpms_pergroup_incell_translation (cart3_t *out, cart3_t t, const cart3_t *lattice_basis, int latdim, double atol) |
In-cell (fractional) part of a translation: t minus its lattice part. | |
| qpms_errno_t | qpms_pergroup_decompose (size_t *nblocks, size_t *blockdims, _Complex double *U, const _Complex double *D, size_t nmat, size_t b) |
| qpms_errno_t | qpms_pergroup_identify_blocks (qpms_pergroup_block_id_t *out, const qpms_scatsys_t *ss, const qpms_finite_group_t *known, const qpms_affop_t *ops, size_t nops, const _Complex double *D, size_t nmat, size_t b, const _Complex double *U, const size_t *blockdims, size_t nblocks, cart3_t k, const cart3_t *lattice_basis, int latdim, double atol, double tol) |
| qpms_errno_t | qpms_pergroup_int_rotations (int(*out)[3][3], const qpms_affop_t *ops, size_t nops, const cart3_t *lattice_basis, int latdim, double atol) |
| qpms_errno_t | qpms_pergroup_band_contour (_Complex double *centre, double *ar, double *ai, const cart3_t *lattice_basis, int latdim, cart3_t beta, double n_b, long band_index, double interval_factor, double aspect_ratio, double atol, int nmax) |
Affine space-group operations and k-dependent symmetry-adapted decomposition for periodic systems.
This module generalises the point-group block diagonalisation (scatsystem.c orbit machinery, usable only for operations that fix the cell origin) to affine operations with nonvanishing translations: nonsymmorphic groups (glides, screws), off-origin cells, and their little groups at general Bloch vectors.
The central object is the k-dependent representation of the affine operations on the cell excitation-coefficient space,
D_k(g)_{p'←p} = δ(g·r_p ≡ r_{p'} mod B) · e^{-i k·T_g,p} · W_g ,
where T_g,p is the lattice-translation residual of the affine mapping (g·r_p = r_{p'} + T_g,p) and W_g is the COEFFICIENT transformation of the point part: the matrix that maps the expansion coefficients of a VSWF to those of the VSWF rotated by g (the matrix returned by qpms_irot3_uvswfi_dense(); see the notes there); the placement transforms of the particles are assumed to be the identity (v1). The phase convention e^{-i k·T} matches the cell-phase convention of the Ewald lattice sums (periodic in k): with it D_k commutes with the lattice-sum matrix, D(g)D(h) = e^{-i k·T(g,h)} D(g∘h) for the lattice translation T(g,h) between g∘h and its representative, and the operation set extended by the k-trivial translation cosets (the "extended little group" of Bradley–Cracknell) gives an honest, untwisted representation — this holds for nonsymmorphic groups and zone-boundary k exactly as for symmorphic Gamma.
The block-diagonalisation itself is numerical (no character tables): the simultaneous irreducible invariant subspaces of the matrices D_k(g) are found through the commutant/algebra-intersection pipeline (qpms_pergroup_decompose), and the acceptance criterion remains the commutation gate — the packed blocks must reconstruct the mode problem matrix M(ω, k).
Limitations (v1): placement transforms of the particles must be the identity (spheres and axially symmetric kinds at canonical orientation); mixed kinds are supported as long as the operations map kinds onto the same kinds.
| qpms_errno_t qpms_pergroup_band_contour | ( | _Complex double * | centre, |
| double * | ar, | ||
| double * | ai, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| cart3_t | beta, | ||
| double | n_b, | ||
| long | band_index, | ||
| double | interval_factor, | ||
| double | aspect_ratio, | ||
| double | atol, | ||
| int | nmax | ||
| ) |
Computes the Beyn ellipse for a diffracted-order-specified resonance search (the "band sugar"; the legacy lat2d_modes.py -d/-f/-i flags). The empty-lattice frequencies at the Bloch vector beta, omega_i = |beta + G_i| c / n_b over the reciprocal lattice vectors G_i (sorted ascending, deduplicated; omega_{-1} := 0), define the gaps; the signed band_index selects the gap and the hugging edge: index > 0 hugs the empty-lattice band number |index| from above (the ellipse is placed in the gap to the next order), and index < 0 hugs band |index| from below (the gap below; omega_{-1} := 0). The real half-axis r = (gap width)/2 . interval_factor (clipped below the gap width), the imaginary half-axis = r . aspect_ratio; the centre is anchored at the band edge with the unshrunk radius so that BOTH contour edges sit strictly inside the gap (a branch point of the periodic Green's function at the band edge must stay off the integration path). The lattice vectors are pre-scaled internally (the enumeration uses an integer-coefficient scan of |n_i| <= nmax around beta; pick nmax comfortably above the band index). n_b is the background phase index (constant or evaluated at the band edge; for dispersive backgrounds evaluate it at the vacuum estimate of the centre — a two-pass call). Returns QPMS_SUCCESS or an error code. */
| qpms_errno_t qpms_pergroup_build_Dk | ( | _Complex double * | D, |
| const qpms_scatsys_t * | ss, | ||
| const qpms_affop_t * | ops, | ||
| size_t | nops, | ||
| cart3_t | k, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| double | atol | ||
| ) |
Builds the k-dependent representation matrices D_k of the affine operations on the full excitation-coefficient space of ss. \p D receives \p nops matrices of size b×b row-major (b = ss->fecv_size). For every operation g and every particle p the code locates the image particle p' of the affine map g·r_p modulo the lattice (the residual lattice translation supplies the Bloch phase factor e^{-i k·T}); the kinds must match. The VSWF blocks are the coefficient transformations of the point operations (the matrices returned by qpms_irot3_uvswfi_dense()); the particles' placement transforms must be the identity (v1).
The operation set must be closed under composition modulo the k-trivial translations (e.g. the little-group operations extended by the translation cosets of qpms_pergroup_kcosets); then D_k is an honest representation, which the caller is expected to verify with the commutation gate.
| qpms_errno_t qpms_pergroup_decompose | ( | size_t * | nblocks, |
| size_t * | blockdims, | ||
| _Complex double * | U, | ||
| const _Complex double * | D, | ||
| size_t | nmat, | ||
| size_t | b | ||
| ) |
Simultaneously decomposes a representation into its irreducible invariant subspaces (numerically, without character tables). \p D holds \p nmat matrices of size b×b row-major forming an honest representation of a finite group (the closure is not checked here; use the commutation gate on the application side). The routine finds the simultaneous invariant subspaces through the commutant/algebra pipeline: the commutant C = {X: XD_g = D_g X}, the span A of the representation matrices, their intersection Z = A∩C (the centre of the algebra), whose joint eigenspaces are the isotypic components.
\p U receives the b×b change-of-basis matrix with the basis vectors of the consecutive blocks in its rows (orthonormal rows; the blocks are the groups of consecutive rows). \p blockdims receives the dimensions of the blocks (at most b; the pointer may be NULL if only \p nblocks is wanted). \p nblocks receives the number of the blocks.
The blocks are the isotypic components: a multidimensional irrep with multiplicity m yields a block of dimension d·m whose singular spectrum is that of the d-dimensional irreducible block repeated m times — sufficient for the spectrum identity and the packing. Scaling: the pipeline solves dense null-space problems of size b²·nmat × b²; keep b·sqrt(nmat) in the low hundreds.
Returns QPMS_SUCCESS or an error code.
| qpms_errno_t qpms_pergroup_identify_blocks | ( | qpms_pergroup_block_id_t * | out, |
| const qpms_scatsys_t * | ss, | ||
| const qpms_finite_group_t * | known, | ||
| const qpms_affop_t * | ops, | ||
| size_t | nops, | ||
| const _Complex double * | D, | ||
| size_t | nmat, | ||
| size_t | b, | ||
| const _Complex double * | U, | ||
| const size_t * | blockdims, | ||
| size_t | nblocks, | ||
| cart3_t | k, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| double | atol, | ||
| double | tol | ||
| ) |
Identifies the numerical isotypic blocks with the irreps of the little group of k via their characters. The blocks come from qpms_pergroup_decompose (U rows = the SA basis, grouped by block). Two identification branches exist, selected by the factor system of the little group of k:
known (whose element order must match ops — as produced by qpms_spg_match_pointgroup_ops()), and tau_g = exp(-i k.T_g) the Bloch twist phase of the operation.known. These are constructed numerically: the factor system omega(g, h) = (D_g D_h) / D_gh (a well-defined scalar, the Bloch phase of the composition mismatch) defines the twisted group algebra, whose left regular representation (built and decomposed via qpms_pergroup_decompose) yields the projective irreps and their characters; the block characters are then matched against them. The matched blocks get synthetic labels <k-symbol><number> (e.g. "K1", ordered by irrep dimension, then characters; <k-symbol> is the qpms_ksym_path name of the high-symmetry point nearest to k, or "P" for a generic k).In both branches a block is matched when exactly one candidate representation reaches a residual below tol.
ss supplies the particle positions for the residual extraction (the first particle is used as the representative). ops are the extended generator set in the D-matrix order; known must be the group matched from their POINT parts (with its multiplication table).
Returns QPMS_SUCCESS or an error code. The identification is purely diagnostic: unmatched blocks keep their structural labels.
| out | nblocks entries (caller-allocated). |
| qpms_errno_t qpms_pergroup_incell_translation | ( | cart3_t * | out, |
| cart3_t | t, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| double | atol | ||
| ) |
In-cell (fractional) part of a translation: t minus its lattice part.
The lattice part is subtracted along the latdim basis directions (rounding to the nearest integer coefficients with tolerance atol); the components along the aperiodic direction(s) of a latdim < 3 system are kept verbatim (e.g. the t_z of a horizontal mirror about a stack plane in a 2D-periodic system).
| qpms_errno_t qpms_pergroup_int_rotations | ( | int(*) | out[3][3], |
| const qpms_affop_t * | ops, | ||
| size_t | nops, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| double | atol | ||
| ) |
Derives the integer lattice-basis rotation matrices of the point parts of the operations (spglib convention x'_i = sum_j R_ij x_j). The matrices act on the lattice fractional coordinates (R_ij is the coefficient of a_i in the image of a_j); they are exactly what spglib's reciprocal-space routines (qpms_ksym_irmesh_init) expect. Every entry is verified integral within atol (a non-integral entry means the operation set is not a subgroup of the lattice space group). Supported lattice dimensionalities: 2 (xy-planar bases only, the normal completed with z) and 3. Returns QPMS_SUCCESS or an error code.
| int qpms_pergroup_kcosets | ( | cart3_t * | outT, |
| _Complex double * | outphase, | ||
| const cart3_t * | lattice_basis, | ||
| int | latdim, | ||
| cart3_t | k, | ||
| double | atol, | ||
| int | nmax | ||
| ) |
Finds the translation cosets of B modulo T_k = {T in B: k·T in 2pi·Z}.
The distinct values of exp(i k·T) over the lattice vectors classify the cosets; outT receives one representative Cartesian translation per coset (outT[0] = 0) and outphase the corresponding exp(i k·T). The enumeration scans lattice combinations n with |n_i| <= nmax (choose it comfortably above the denominators of k·a_i / 2pi; 8 is plenty for standard Brillouin-zone points). Returns the number of the cosets d (= |B/T_k|), or a negative value if the scan was exhausted before all phases settled (increase nmax).
| int qpms_pergroup_little_ops | ( | size_t * | out, |
| const qpms_affop_t * | ops, | ||
| size_t | nops, | ||
| cart3_t | k, | ||
| const cart3_t * | recip_basis, | ||
| int | latdim, | ||
| double | atol | ||
| ) |
Selects the operations whose point parts keep k invariant modulo the reciprocal lattice (the little group of k). recip_basis are the 2pi-included reciprocal basis vectors (latdim of them); the selection criterion is R^T k = k + G with G a reciprocal-lattice vector, tested by integer reduction (cf. qpms_ksym_little_group_cart()). The indices of the selected operations are written to out (room for nops entries). Returns the number of the selected operations.