PAOFLOW.utils.point_groups#

Point-group operations, third-rank tensor symmetrisation and k-grid reduction.

A third-rank polar tensor \(T^{abc}\) of a crystal with point group \(G\) satisfies \(T^{abc} = \sum_{a'b'c'} R_{aa'}R_{bb'}R_{cc'}T^{a'b'c'}\) for every operation \(R\) (the same law for proper and improper operations). Two uses:

  • Audit of a computed tensor: its projection on the invariant subspace (symmetrize()), the part removed by the projection (symmetry_error()), the components that must vanish (forbidden_components()) and the relations between the others (independent_relations()). The groups of the common crystal classes are closed from a few Cartesian generators (GENERATORS; the polar axis of mm2 / C2v along x or z as named, the threefold axis along z, a mirror m_x perpendicular to x).

  • Reduction of a uniform k-grid to its irreducible wedge (reduce_k_grid()) with the orbit sizes as weights, and the symmetrisation of the wedge sums: since the symmetrisation is linear, \(\sum_{\mathbf k \in BZ} T(\mathbf k) = \mathrm{Sym}_G[\sum_{\mathbf k \in IBZ} w_{\mathbf k} T(\mathbf k)]\) for a covariant integrand. The operations act on fractional k as integer matrices (fractional_k_from_cartesian(), cartesian_from_fractional_k()), the convention of Quantum ESPRESSO’s sym_rot as stored by PAOFLOW.

Attributes#

Functions#

close_group(generators[, limit])

All products of the generators (the identity included).

point_group_operations(name)

All Cartesian matrices of a crystal class, closed from its generators.

symmetrize(tensor, operations)

Projection of a third-rank tensor on the invariant subspace of the operations.

forbidden_components(operations[, tol])

Components that vanish for the group (labels such as 'xxx').

independent_relations(operations[, tol])

Each allowed component expressed through the symmetrised unit tensors: {'yxx': {'yyy': -1.0, ...}}.

symmetry_error(tensor, operations)

Norm of the part of a tensor removed by the symmetrisation, relative to the tensor norm.

kleinman_error(tensor)

Deviation from full permutation symmetry (Kleinman): |T - sym_perm(T)| / |T|.

tensor_from_components(values[, fill])

(3, 3, 3) array from {'xyz': value, ...} (missing components fill).

cartesian_from_fractional_k(w_frac, b_vectors)

Cartesian rotation R of an operation W acting on fractional k-coordinates.

fractional_k_from_cartesian(r_cart, b_vectors)

Inverse of cartesian_from_fractional_k() (W = B^{-T} R B^T).

grid_indices(nk)

Integer indices (i1, i2, i3) of a uniform grid in the order of meshgrid(indexing='ij').

reduce_k_grid(nk, operations_cryst)

Irreducible wedge of a Gamma-centred uniform grid under integer k-space operations.

component_closure(components, operations_cart[, tol])

Components that feed the symmetrised values of the requested ones.

symmetrize_components(values, components, ...)

Group average of component spectra: (ncomp, ...) on components -> (nreq, ...).

Module Contents#

PAOFLOW.utils.point_groups.LABELS = 'xyz'[source]#
PAOFLOW.utils.point_groups.GENERATORS: dict[str, list[numpy.typing.NDArray[numpy.float64]]][source]#
PAOFLOW.utils.point_groups.ALIASES[source]#
PAOFLOW.utils.point_groups.close_group(generators, limit=96)[source]#

All products of the generators (the identity included).

Parameters:
  • generators (array_like (ngen, 3, 3))

  • limit (int, optional) – Largest group accepted (raises above it).

Return type:

ndarray (nops, 3, 3)

PAOFLOW.utils.point_groups.point_group_operations(name)[source]#

All Cartesian matrices of a crystal class, closed from its generators.

Parameters:

name (str) – A key of GENERATORS (Hermann-Mauguin with the axis convention, e.g. 'mm2_x', '3m_x', '-43m') or a Schoenflies alias of ALIASES.

Return type:

ndarray (nops, 3, 3)

PAOFLOW.utils.point_groups.symmetrize(tensor, operations)[source]#

Projection of a third-rank tensor on the invariant subspace of the operations.

PAOFLOW.utils.point_groups.forbidden_components(operations, tol=1e-10)[source]#

Components that vanish for the group (labels such as 'xxx').

PAOFLOW.utils.point_groups.independent_relations(operations, tol=1e-10)[source]#

Each allowed component expressed through the symmetrised unit tensors: {'yxx': {'yyy': -1.0, ...}}.

The projection of the unit tensor e_abc gives the linear relations that the symmetry imposes; the dictionary lists, for every allowed component, the components it is tied to and the coefficients (yxx -> yyy: -1 means T^yxx = -T^yyy in 3m with the mirror perpendicular to x).

PAOFLOW.utils.point_groups.symmetry_error(tensor, operations)[source]#

Norm of the part of a tensor removed by the symmetrisation, relative to the tensor norm.

PAOFLOW.utils.point_groups.kleinman_error(tensor)[source]#

Deviation from full permutation symmetry (Kleinman): |T - sym_perm(T)| / |T|.

PAOFLOW.utils.point_groups.tensor_from_components(values, fill=np.nan)[source]#

(3, 3, 3) array from {'xyz': value, ...} (missing components fill).

PAOFLOW.utils.point_groups.cartesian_from_fractional_k(w_frac, b_vectors)[source]#

Cartesian rotation R of an operation W acting on fractional k-coordinates.

Parameters:
  • w_frac (array_like (3, 3) or (nops, 3, 3)) – k'_frac = W k_frac (Quantum ESPRESSO’s sym_rot as stored by PAOFLOW).

  • b_vectors (array_like (3, 3)) – Reciprocal lattice vectors as rows (any unit).

Returns:

R = B^T W B^{-T} with k_cart = B^T k_frac; orthogonal for a lattice symmetry.

Return type:

ndarray, same leading shape

PAOFLOW.utils.point_groups.fractional_k_from_cartesian(r_cart, b_vectors)[source]#

Inverse of cartesian_from_fractional_k() (W = B^{-T} R B^T).

PAOFLOW.utils.point_groups.grid_indices(nk)[source]#

Integer indices (i1, i2, i3) of a uniform grid in the order of meshgrid(indexing='ij').

PAOFLOW.utils.point_groups.reduce_k_grid(nk, operations_cryst)[source]#

Irreducible wedge of a Gamma-centred uniform grid under integer k-space operations.

Parameters:
  • nk (sequence of 3 int)

  • operations_cryst (array_like (nops, 3, 3)) – Integer matrices acting on fractional k (k' = W k); the identity may be omitted.

Returns:

  • k_irr (ndarray (nirr, 3)) – Fractional coordinates of the representatives (i / nk).

  • weights (ndarray (nirr,)) – Orbit sizes (they sum to prod(nk)).

  • representative (ndarray (prod(nk),), int) – Index into k_irr of the representative of every full-grid point.

Raises:

ValueError – If an operation is not integer (it would not map the grid onto itself).

PAOFLOW.utils.point_groups.component_closure(components, operations_cart, tol=1e-10)[source]#

Components that feed the symmetrised values of the requested ones.

T_sym^{abc} = (1/|G|) sum_R R_{aa'} R_{bb'} R_{cc'} T^{a'b'c'}: the closure is the set of (a', b', c') with a non-zero coefficient for at least one requested (a, b, c).

PAOFLOW.utils.point_groups.symmetrize_components(values, components, operations_cart, requested)[source]#

Group average of component spectra: (ncomp, ...) on components -> (nreq, ...).

components must contain the closure of requested (component_closure()); components outside the closure would carry zero weight anyway.