Irreps#
- class cuequivariance.Irreps(*args)#
Direct sum of irreducible representations with multiplicities.
For more information, see Groups and Representations.
- Parameters:
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,
Return a representation with all scalar representations.
Examples
>>> Irreps("SO3", "32x1").new_scalars(2) 2x0
- count( ) 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,
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,
Filter the representation.
- Parameters:
Examples
>>> Irreps("SO3", "4x0 + 4x1 + 2x2").filter(keep="0 + 1") 4x0+4x1
>>> Irreps("SO3", "4x0 + 4x1 + 2x2").filter(drop="0 + 1") 2x2