representation_theory

Utility functions for doing linear algebra on symmetric vector spaces, including: least squares solutions, group invariant projections, disentangled/isotypic decompositions, and more.

symm_learning.representation_theory.compute_character_table(G: Group, reps: List[Dict[GroupElement, ndarray] | Representation])[source]

Computes the character table of a group for a given set of representations.

Parameters:
  • G (escnn.group.Group) – The symmetry group.

  • reps (List[Union[Dict[escnn.group.GroupElement, np.ndarray], escnn.group.Representation]]) – The representations to compute the character table for.

symm_learning.representation_theory.cplx_isotypic_decomposition(G: Group, rep: Callable[[GroupElement], ndarray])[source]

Perform the isotypic decomposition of unitary representation, decomposing the rep into complex irreps.

Parameters:
  • G (escnn.group.Group) – Symmetry group of the representation.

  • rep (Union[Dict[escnn.group.GroupElement, np.ndarray], Callable[[escnn.group.GroupElement, np.ndarray]]]) – dict/mapping from group elements to matrices, or a function that takes a group element and returns a matrix.

Returns:

List of complex irreducible representations, sorted in ascending order of dimension. Q (numpy.ndarray): Hermitian matrix such that Q @ rep[g] @ Q^-1 is block diagonal, with blocks sorted_irreps.

Return type:

sorted_irreps (List[Dict[escnn.group.GroupElement, np.ndarray]])

symm_learning.representation_theory.decompose_representation(G: Group, rep: Dict[GroupElement, ndarray] | Callable[[GroupElement], ndarray])[source]

Find the Hermitian matrix Q that block-diagonalizes the representation rep of group G.

Such that

\[\mathbf{Q} \rho(g) \mathbf{Q}^\top = \operatorname{block\_ diag}(\rho_1(g), ..., \rho_m(g)) \quad \forall g \in G\]
Parameters:
  • G (escnn.group.Group) – The symmetry group.

  • rep (Union[Dict[escnn.group.GroupElement, np.ndarray], Callable[[escnn.group.GroupElement], np.ndarray]]) – The representation to decompose.

Returns:

A tuple containing:
  • subreps (List[CallableDict]): A list of irreducible representations.

  • Q (np.ndarray): The change of basis matrix.

Return type:

tuple

symm_learning.representation_theory.escnn_representation_form_mapping(group: Group, rep: Dict[GroupElement, ndarray] | Callable[[GroupElement], ndarray], name: str = 'reconstructed')[source]

Get a ESCNN representation instance from a mapping from group elements to unitary matrices.

Parameters:
  • group (escnn.group.Group) – Symmetry group of the representation.

  • rep (Union[Dict[escnn.group.GroupElement, np.ndarray], Callable[[escnn.group.GroupElement], np.ndarray]]) – Mapping from group elements to unitary matrices.

  • name (str, optional) – Name of the representation. Defaults to ‘reconstructed’.

Returns:

ESCNN representation instance.

Return type:

representation (escnn.group.Representation)

symm_learning.representation_theory.field_type_to_isotypic_basis(field_type: FieldType)[source]

Returns a new field type in a disentangled basis ignoring change of basis.

symm_learning.representation_theory.irreps_stats(irreps_ids)[source]

Compute the unique irreps, their counts and indices in the input list of irreps ids.

symm_learning.representation_theory.is_complex_irreducible(group: Group, rep: Dict[GroupElement, ndarray] | Callable[[GroupElement], ndarray])[source]

Check if a representation is complex irreducible.

We check this by asserting weather non-scalar (no multiple of identity ) Hermitian matrix H exists, such that H commutes with all group elements’ representation. If rho is irreducible, this function returns (True, H=I) where I is the identity matrix. Otherwise, returns (False, H) where H is a non-scalar matrix that commutes with all elements’ representation.

Parameters:
  • group (escnn.group.Group) – Symmetry group of the representation.

  • rep (Union[Dict[escnn.group.GroupElement, np.ndarray], Callable[[escnn.group.GroupElement], np.ndarray]]) – Mapping from group elements to their representation matrices.

symm_learning.representation_theory.isotypic_decomp_rep(rep: Representation) Representation[source]

Return an equivalent representation disentangled into isotypic subspaces.

Given an input Representation, this function computes an equivalent representation by updating the change of basis (and its inverse) and reordering the irreducible representations. The returned representation is guaranteed to be disentangled into its isotypic subspaces.

A representation is considered disentangled if, in its spectral basis, the irreducible representations (irreps) are clustered by type, i.e., all irreps of the same type are consecutive:

\[\rho_{\mathcal{X}} = \mathbf{Q} \left( \bigoplus_{k\in[1,n_{\text{iso}}]} (\mathbf{I}_{m_{k}} \otimes \hat{\rho}_k) \right) \mathbf{Q}^T\]

where \(\hat{\rho}_k\) is the irreducible representation of type \(k\), and \(m_{k}\) is its multiplicity.

The change of basis of the representation returned by this function can be used to decompose the representation space \(\mathcal{X}\) into its orthogonal isotypic subspaces:

\[\mathcal{X} = \bigoplus_{k\in[1,n]} \mathcal{X}^{(k)}\]
Parameters:

rep (escnn.group.Representation) – The input representation.

Returns:

An equivalent, disentangled representation.

Return type:

escnn.group.Representation

symm_learning.representation_theory.map_character_tables(in_table: ndarray, reference_table: ndarray)[source]

Find a representation of a group in the set of irreducible representations.

symm_learning.representation_theory.permutation_matrix(oneline_notation)[source]

Generate a permutation matrix from its oneline notation.

symm_learning.representation_theory.sorted_jordan_canonical_form(group: Group, reps: List[Callable[[GroupElement], ndarray]])[source]

Sorts a list of representations in ascending order of dimension, and returns a permutation matrix P such that.

Parameters:
  • group (escnn.group.Group) – Symmetry group of the representation.

  • reps (List[Union[Callable[[escnn.group.GroupElement], np.ndarray], escnn.group.Representation]]) – List of representations to sort by dimension.

Returns:

Permutation matrix sorting the input reps. reps (List[Callable[escnn.group.GroupElement, numpy.ndarray]]): Sorted list of representations.

Return type:

P (numpy.ndarray)