Irreps#

class cuequivariance.Irreps(*args)#

Direct sum of irreducible representations with multiplicities.

For more information, see Groups and Representations.

Parameters:
  • irrep_class – Class of the irreducible representations (e.g., SU2, SO3, O3).

  • input – A description of multiplicities of each irreducible representation.

Examples

>>> Irreps("SO3", "16x0 + 4x1")
16x0+4x1
>>> Irreps(cue.SO3, "16x0 + 4x1")
16x0+4x1
>>> Irreps(cue.SO3, [(16, 0), (4, 1)])
16x0+4x1
>>> with cue.assume("SO3"):
...     Irreps("16x0 + 4x1")
16x0+4x1

Methods

new_scalars(
mul: int,
) Irreps#

Return a representation with all scalar representations.

Examples

>>> Irreps("SO3", "32x1").new_scalars(2)
2x0
count(
rep: str | Irrep,
) int#

Count the total multiplicity of a representation.

Examples

>>> Irreps("SO3", "100x0 + 20x1 + 10x0").count("0")
110
property dim: int#

Total dimension of the representation.

Examples

>>> Irreps("SO3", "100x0 + 10x1").dim
130
property num_irreps: int#

Return the number of irreducible representations.

Examples

>>> Irreps("SO3", "100x0 + 10x1").num_irreps
110
property muls: list[int]#

List of multiplicities.

Examples

>>> Irreps("SO3", "100x0 + 10x1").muls
[100, 10]
slices() list[slice]#

List of slices for each segment of the representation.

Examples

>>> Irreps("SO3", "100x0 + 10x1").slices()
[slice(0, 100, None), slice(100, 130, None)]
is_scalar() bool#

All representations are scalar.

Note

This function does not check the multiplicity of the representation.

Examples

>>> Irreps("SO3", "100x0 + 0x1").is_scalar()
False
>>> Irreps("SO3", "100x0").is_scalar()
True
merge_consecutive() Irreps#

Merge consecutive segments with the same representation.

Examples

>>> Irreps("SO3", "1 + 1 + 0 + 1").merge_consecutive()
2x1+0+1
remove_zero_multiplicities() Irreps#

Remove zero multiplicities.

Examples

>>> Irreps("SO3", "1 + 0x2 + 1").remove_zero_multiplicities()
1+1
simplify() Irreps#

Simplify the representation by removing zero multiplicities and merging consecutive tuples.

Examples

>>> Irreps("SO3", "1 + 0x2 + 1").simplify()
2x1
sort() SortResult#

Sort the representation.

Returns:

The sorted representation and associated permutations.

Return type:

SortResult

Examples

>>> Irreps("SO3", "1 + 2 + 0 + 1").sort()
SortResult(irreps=0+1+1+2, perm=(1, 3, 0, 2), inv=(2, 0, 3, 1))
regroup() Irreps#

Regroup the representation by sorting and simplifying.

Examples

>>> Irreps("SO3", "1 + 2 + 0 + 1").regroup()
0+2x1+2
set_mul(
mul: int,
) Irreps#

Set the multiplicity of all segments.

Examples

>>> Irreps("SO3", "3x0 + 2x0 + 4x1").set_mul(2)
2x0+2x0+2x1
filter(
*,
keep: str | Sequence[Irrep] | Callable[[MulIrrep], bool] | None = None,
drop: str | Sequence[Irrep] | Callable[[MulIrrep], bool] | None = None,
mask: Sequence[bool] | None = None,
) Irreps#

Filter the representation.

Parameters:
  • keep (str, list of Irrep, callable, optional) – Keep only the specified representations.

  • drop (str, list of Irrep, callable, optional) – Drop the specified representations.

Examples

>>> Irreps("SO3", "4x0 + 4x1 + 2x2").filter(keep="0 + 1")
4x0+4x1
>>> Irreps("SO3", "4x0 + 4x1 + 2x2").filter(drop="0 + 1")
2x2
layout_insensitive() bool#

True if the representation is layout insensitive.

Examples

>>> Irreps("SO3", "100x0 + 1x1 + 1x2").layout_insensitive()
True
>>> Irreps("SO3", "100x0 + 2x1").layout_insensitive()
False