PAOFLOW.elphon.symmetry#
Symmetry expansion of the electron-phonon derivative (P2, step B).
A single symmetry-reduced displacement gives the Hamiltonian derivative along
one direction d for the displaced atom. The full Cartesian derivative
tensor dH/du_{kappa,alpha} (alpha = x, y, z) is recovered by applying the
site-symmetry operations of the atom: each rotation W maps the measured
response along d to the response along W.d (with the PAO orbitals rotated
by the Wigner-D representation and the lattice vectors permuted). Collecting the
responses along the star {W.d} and solving the linear system
response(n) = sum_alpha (n)_alpha * dH/du_{kappa,alpha}
for every generated direction n yields the three Cartesian derivatives
(exactly as phonopy symmetrises its force constants).
This module provides the convention-free core – the Cartesian least-squares
solve, the site-symmetry selection and the fractional->Cartesian rotation bridge
that feeds PAOFLOW.hamiltonian.pao_sym.get_wigner(). The PAO Wigner-D
rotation of the dV tensor itself is layered on top and validated against
explicitly computed Cartesian displacements.
Functions#
|
Convert a fractional rotation |
|
Indices of the space-group operations that leave |
|
Least-squares Cartesian derivatives from directional responses. |
|
Prepare the crystal-symmetry operator set that rotates a supercell PAO |
|
Rotate a supercell |
|
Symmetry-expand a reduced set of directional |
Module Contents#
- PAOFLOW.elphon.symmetry.frac_to_cartesian_rotation(w_frac, a_vectors)[source]#
Convert a fractional rotation
Wto its Cartesian form.With lattice vectors as the rows of
a_vectors(A), a fractional rotation acting on fractional coordinatesfcorresponds to the Cartesian rotationR = A^T W A^{-T}acting on Cartesian coordinatesr = A^T f.- Parameters:
w_frac (array_like, shape (3, 3)) – Rotation in fractional (crystal) coordinates.
a_vectors (array_like, shape (3, 3)) – Lattice vectors as rows (any consistent length unit).
- Returns:
The Cartesian rotation matrix.
- Return type:
ndarray, shape (3, 3)
- PAOFLOW.elphon.symmetry.site_symmetry_rotations(sym_rot, shifts, frac_positions, atom_index, tol=0.0001)[source]#
Indices of the space-group operations that leave
atom_indexfixed.- Parameters:
sym_rot (array_like, shape (nsym, 3, 3)) – Fractional rotations.
shifts (array_like, shape (nsym, 3)) – Fractional translations (may be
None-> treated as zero).frac_positions (array_like, shape (natom, 3)) – Atomic positions in fractional coordinates.
atom_index (int) – Atom whose site symmetry is requested.
tol (float) – Fractional tolerance for the “maps to itself” test.
- Returns:
Integer indices into
sym_rotof the operations fixing the atom.- Return type:
ndarray
- PAOFLOW.elphon.symmetry.cartesian_derivatives_from_directional(directions, responses, rcond=None)[source]#
Least-squares Cartesian derivatives from directional responses.
Solves
response(n) = sum_alpha n_alpha D_alphafor the three Cartesian derivative tensorsD_alphagiven a set of unit directionsnand their response tensors (all of identical shape). At least three independent directions are required.- Parameters:
directions (array_like, shape (ndir, 3)) – Displacement directions (need not be normalised; the magnitude scales the corresponding response).
responses (array_like, shape (ndir, *tensor_shape)) – Response tensor for each direction.
rcond (float, optional) – Cutoff passed to
numpy.linalg.lstsq().
- Returns:
The Cartesian derivative tensors
[D_x, D_y, D_z].- Return type:
ndarray, shape (3, *tensor_shape)
- PAOFLOW.elphon.symmetry.build_dv_symmetry_operators(a_vectors, tau, alat, sym_rot, equiv_atom, shells_per_atom, atom_labels, ngrid)[source]#
Prepare the crystal-symmetry operator set that rotates a supercell PAO operator (
HordV) exactly asPAOFLOW.hamiltonian.pao_sym.The returned operators act on a supercell-basis operator
M(k)(Bloch transformM(k) = sum_R M(R) exp(+2 pi i k.R)) via\[M(W k) = U_k \, M(k) \, U_k^{\dagger} \;[\times U_{inv}]\]with
U_k = U * exp(-2 pi i (shift[a_index] . k)). This convention has been validated to reproduceH(Wk)to machine precision for every space group operation of the Al 2x2x2 supercell.- Parameters:
a_vectors ((3, 3) array) – Lattice vectors as rows, in
alatunits (supercell cell).tau ((natom, 3) array) – Atomic positions in Cartesian (Bohr) coordinates.
alat (float) – Lattice parameter (Bohr) used to normalise
tau.sym_rot ((nsym, 3, 3) array) – Fractional (crystal) rotation matrices.
equiv_atom ((nsym, natom) int array) –
equiv_atom[isym, i]is the atom that blockidraws from under the operation (themap_equiv_atomsconvention).shells_per_atom (dict) – Mapping
atom_label -> list of orbital l(PAOFLOWarry['shells']).atom_labels (sequence) – Per-atom species labels (
arry['atoms']).ngrid (tuple(int, int, int)) – The supercell
R/kgrid sizes(n1, n2, n3).
- Returns:
{'symop', 'symop_cart', 'U', 'phase', 'a_index', 'inv_flag', 'U_inv', 'equiv_atom', 'ngrid'}.- Return type:
- PAOFLOW.elphon.symmetry.rotate_dV_under_symmetry(dV, isym, ops, chunk_bytes=128 * 1024 * 1024)[source]#
Rotate a supercell
dVoperator by space-group operationisym.dVis the electronic response (a Hermitian-structured PAO operator) to displacing one supercell atomkappaalong a directiond. The result is the response of the image atomequiv_atom[isym, kappa]displaced alongsymop_cart[isym] . d– i.e. the caller relabels the displaced atom and direction accordingly.- Parameters:
dV (ndarray, shape (nawf, nawf, n1, n2, n3, nspin)) – Supercell real-space derivative.
isym (int) – Index of the operation in
ops.ops (dict) – Operator set from
build_dv_symmetry_operators().chunk_bytes (int, optional) – Approximate memory budget (bytes) for the per-chunk working arrays of the change-of-basis step. The
(k, spin)batch is processed in blocks so peak memory stays bounded to roughlydVk+out+ one chunk, rather than severalnawf**2 * N_totcopies (many GB for large supercells). Larger values trade memory for slightly larger GEMMs.
- Returns:
Rotated
dVof identical shape.- Return type:
ndarray
- PAOFLOW.elphon.symmetry.expand_directional_responses(directional, ops, tol=0.0001)[source]#
Symmetry-expand a reduced set of directional
dVresponses.A symmetry-reduced calculation (
displacement_mode='symmetry') measures the Hamiltonian derivative along a single direction per inequivalent atom. For each measured entry the site-symmetry operations of the displaced atom are applied to generate the star{W.d}of directions with their rotateddVtensors, so that every displaced atom acquires at least three linearly independent directions – the input the Cartesian least-squares solve (cartesian_derivatives_from_directional()) requires.- Parameters:
directional (list[dict]) – Measured responses
{sc_atom, displacement, dV}(Cartesiandisplacement; supercell-basisdV).ops (dict) – Operator set from
build_dv_symmetry_operators()(of the reference supercell).tol (float) – Tolerance for treating two (anti-)parallel directions as duplicates.
- Returns:
Expanded list of
{sc_atom, displacement, dV}entries.- Return type: