Representation
symbolica.community.spenso Class
Representation(name: str, dimension: int | Expression | str, is_self_dual: bool = True)A representation in the sense of group representation theory for tensor indices.
Representations define the transformation properties of tensor indices under group operations. They specify the dimension and duality structure, determining which indices can contract.
Key concepts:
- Self-dual: Indices can contract with other indices of the same representation
- Dualizable: Indices can only contract with their dual representation
- Dimension: Size of the representation space
Predefined representations are available as class methods:
Representation.euc(d): Euclidean space (self-dual)Representation.mink(d): Minkowski space (self-dual)Representation.bis(d): Bispinor (self-dual)Representation.cof(d): Color fundamental (dualizable)Representation.coad(d): Color adjoint (self-dual)Representation.cos(d): Color sextet (dualizable)
Examples
from symbolica.community.spenso import Representation
# Standard representations
euclidean = Representation.euc(4) # 4D Euclidean
lorentz = Representation.mink(4) # 4D Minkowski
color = Representation.cof(3) # SU(3) fundamental
adjoint = Representation.coad(8) # SU(3) adjoint
# Custom representation
custom = Representation("MyRep", 5, is_self_dual=True)
# Create slots with indices
mu_slot = euclidean('mu') # Euclidean index μ
a_slot = color('a') # Color index a
# Generate metric tensors
metric = euclidean.g('mu', 'nu') # g_μνConstructor
#Create and register a new representation with specified properties.
Examples
from symbolica.community.spenso import Representation
import symbolica as sp
# Self-dual representation (indices contract with themselves)
euclidean = Representation("Euclidean", 4, is_self_dual=True)
# Dualizable representation (needs dual partner for contraction)
vector_up = Representation("VectorUp", 4, is_self_dual=False)
# Symbolic dimension
n = sp.S('n')
general = Representation("General", n, is_self_dual=True)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | String name for the representation |
dimension | int | Expression | str | — | Size of the representation (int or symbolic) |
is_self_dual | bool | True | If True, creates self-dual representation; if False, creates dualizable pair |
Member details
__call__
MethodOverloads
Overload 1 #
__call__(aind: int | Expression | str) -> SlotCreate a slot from this representation, by specifying an index.
Returns
A new Slot object with the specified index
Examples
from symbolica.community.spenso import Representation
import symbolica as sp
rep = Representation.euc(3)
slot1 = rep('mu')
slot2 = rep(1)
slot3 = rep(sp.S('nu'))Parameters
| Name | Type | Default | Description |
|---|---|---|---|
aind | int | Expression | str | — | The index specification |
Overload 2 #
__call__(aind: Expression) -> Expression | SlotCreate a slot or symbolic expression from this representation.
Returns
Expression
A symbolic expression representing this representation
Examples
from symbolica.community.spenso import Representation
import symbolica as sp
rep = Representation.euc(3)
expr = rep(sp.E("cos(x)"))Parameters
| Name | Type | Default | Description |
|---|---|---|---|
aind | Expression | — | The index specification (Expression creates symbolic representation) |
dual
Methodg
Methodg(i: int | Expression | str, j: int | Expression | str) -> TensorIndicesCreate a metric tensor for this representation.
Examples
rep = Representation.mink(4)
metric = rep.g('mu', 'nu') # Minkowski metric g_μνParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | First index |
j | int | Expression | str | — | Second index |
flat
Methodflat(i: int | Expression | str, j: int | Expression | str) -> TensorIndicesCreate a musical isomorphism tensor for this representation.
Examples
rep = Representation.mink(4)
flat = rep.flat('mu', 'nu') # Flat isomorphism ♭_μνParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | First index |
j | int | Expression | str | — | Second index |
id
Methodid(i: int | Expression | str, j: int | Expression | str) -> TensorIndicesCreate an identity tensor for this representation.
Examples
rep = Representation.cof(3)
identity = rep.id('a', 'b') # Color identity δ_abParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | First index |
j | int | Expression | str | — | Second index |
__repr__
Method__str__
Methodto_expression
Methodbis
Static methodbis(dimension: int | Expression | str) -> RepresentationCreate a bispinor representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the bispinor space |
euc
Static methodeuc(dimension: int | Expression | str) -> RepresentationCreate a Euclidean space representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the Euclidean space |
mink
Static methodmink(dimension: int | Expression | str) -> RepresentationCreate a Minkowski space representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the Minkowski space |
cof
Static methodcof(dimension: int | Expression | str) -> RepresentationCreate a color fundamental representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the color group (e.g., 3 for SU(3)) |
coad
Static methodcoad(dimension: int | Expression | str) -> RepresentationCreate a color adjoint representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the adjoint representation (e.g., 8 for SU(3)) |
cos
Static methodcos(dimension: int | Expression | str) -> RepresentationCreate a color sextet representation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | The dimension of the sextet representation (e.g., 6 for SU(3)) |
View generated signature source: docs/api/python/spynso3.pyi:314