Symmetry operation#

Symmetry operation matrices (sympy).

Ported from MultiPie Ver.2 (others/tools/utils/util_symmetry_operation.py and util_symmetry_operation_spherical.py). The matrices of the point-group part are cached, because the same operations appear in many groups. group_symmetry_operation gives the symmetry operations of a PG or SG from the group information tables (data_group_pg/sg) alone, so that the table generators in others/creation do not depend on other data.

simplify_value(x)[source]#

Bring a sympy value into a simple canonical form.

Parameters:

x (sympy or int) – value, a number or an expression with symbols.

Returns:

  • (sympy) – expanded value with rationalized denominators (e.g. sqrt(3)/3 instead of 1/sqrt(3)).

simplify_array(a)[source]#

Apply simplify_value to all elements of an array.

Parameters:

a (array-like) – array of sympy values.

Returns:

  • (ndarray) – array of simplified values (dtype=object).

representation_matrix(l, n, axis, inversion=False, mirror=False, axial=False, tesseral=False)[source]#

Representation matrix of symmetry operation for spherical harmonics, l.

Parameters:
  • l (int) – rank.

  • n (int) – n-fold rotation.

  • axis (list) – rotation or mirror axis (cartesian coordinate, no need for normalization).

  • inversion (bool, optional) – with inversion ?

  • mirror (bool, optional) – with mirror ?

  • axial (bool, optional) – for axial quantity ?

  • tesseral (bool, optional) – tesseral basis ?

Returns:

  • (ndarray) – representation matrix, <lm|g|lm’> or <alpha|g|beta> (tesseral=True) [alpha, beta=cl,sl,cl-1, …, c0].

point_tag(tag)[source]#

Point-group part of symmetry operation tag.

Parameters:

tag (str) – symmetry operation tag, e.g. “2[001]:[0,0,1/2]” or “2’[100]”.

Returns:

  • (str) – tag without translation and time reversal, e.g. “2[001]”.

symmetry_operation_matrix(tag, hexagonal=False, axial=False)[source]#

Symmetry operation matrix (cartesian coordinate, conventional cell).

Parameters:
  • tag (str) – symmetry operation tag (time-reversal “’” is ignored).

  • hexagonal (bool, optional) – hexagonal systems ?

  • axial (bool, optional) – SO matrix for axial quantity ?

Returns:

  • (ndarray) – symmetry operation matrix in cartesian basis (3x3 or 4x4 with translation).

symmetry_operation_matrix_multipole(s, tag, hexagonal=False, axial=False, tesseral=False)[source]#

Symmetry operation matrix for multipole (lm or tesseral basis).

Parameters:
  • s (int) – internal rank.

  • tag (str) – symmetry operation tag.

  • hexagonal (bool, optional) – hexagonal systems ?

  • axial (bool, optional) – SO matrix for axial quantity ?

  • tesseral (bool, optional) – tesseral basis ?

Returns:

  • (ndarray) – symmetry operation matrix in lm or tesseral basis, (2s+1 x 2s+1).

Note

  • translation and time reversal are ignored.

symmetry_operation_matrices(so, hexagonal)[source]#

Cartesian and fractional symmetry operation matrices of a list of operations.

Parameters:
  • so (list) – symmetry operation tags.

  • hexagonal (bool) – hexagonal systems ?

Returns:

  • (ndarray) – cartesian SO matrices (3x3, or 4x4 with translation).

  • (ndarray) – fractional SO matrices (3x3, or 4x4 with translation).

  • (ndarray) – determinants.

group_symmetry_operation(tag)[source]#

Symmetry operations of a PG or SG from the group information tables (data_group_pg/sg).

Parameters:

tag (str) – PG tag (e.g. “Oh”, “D3-1”, “C3-c”) or SG tag (e.g. “Oh^1”).

Returns:

  • (dict) – “tag” (list of SO tags), “cartesian” and “fractional” (ndarray of SO matrices, 4x4 for SG), “lattice” (“0” for PG, centering such as “P”, “F” for SG).