Representation
Representation
Representation()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_μνMethods
| Name | Description |
|---|---|
__call__ |
Create a slot from this representation, by specifying an index. |
__new__ |
Create and register a new representation with specified properties. |
__repr__ |
|
__str__ |
|
bis |
Create a bispinor representation. |
coad |
Create a color adjoint representation. |
cof |
Create a color fundamental representation. |
cos |
Create a color sextet representation. |
dual |
|
euc |
Create a Euclidean space representation. |
flat |
Create a musical isomorphism tensor for this representation. |
g |
Create a metric tensor for this representation. |
id |
Create an identity tensor for this representation. |
mink |
Create a Minkowski space representation. |
to_expression |
Convert the representation to a symbolic expression. |
__call__
__call__ has 2 variants:
__call__ returning Slot
Representation.__call__(aind: builtins.int | Expression | str) -> SlotCreate a slot from this representation, by specifying an index.
Parameters
aind(int, str, or Symbol) The index specification
Returns
SlotA 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'))__call__ returning Expression | Slot
Representation.__call__(aind: Expression) -> Expression | SlotCreate a slot or symbolic expression from this representation.
Parameters
aind(Expression) The index specification (Expression creates symbolic representation)
Returns
ExpressionA 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)"))__new__
Representation.__new__(
name: builtins.str,
dimension: builtins.int | Expression | str,
is_self_dual: builtins.bool = ...,
) -> RepresentationCreate and register a new representation with specified properties.
Parameters
- name: String name for the representation- dimension: Size of the representation (int or symbolic) - is_self_dual: If True, creates self-dual representation; if False, creates dualizable pair
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)__repr__
Representation.__repr__() -> builtins.str__str__
Representation.__str__() -> builtins.strbis
Representation.bis(dimension: builtins.int | Expression | str) -> RepresentationCreate a bispinor representation.
Parameters
- dimension: The dimension of the bispinor space
coad
Representation.coad(dimension: builtins.int | Expression | str) -> RepresentationCreate a color adjoint representation.
Parameters
- dimension: The dimension of the adjoint representation (e.g., 8 for SU(3))
cof
Representation.cof(dimension: builtins.int | Expression | str) -> RepresentationCreate a color fundamental representation.
Parameters
- dimension: The dimension of the color group (e.g., 3 for SU(3))
cos
Representation.cos(dimension: builtins.int | Expression | str) -> RepresentationCreate a color sextet representation.
Parameters
- dimension: The dimension of the sextet representation (e.g., 6 for SU(3))
dual
Representation.dual() -> Representationeuc
Representation.euc(dimension: builtins.int | Expression | str) -> RepresentationCreate a Euclidean space representation.
Parameters
- dimension: The dimension of the Euclidean space
flat
Representation.flat(
i: builtins.int | Expression | str,
j: builtins.int | Expression | str,
) -> TensorIndicesCreate a musical isomorphism tensor for this representation.
Parameters
- i: First index- j: Second index
Examples
rep = Representation.mink(4)
flat = rep.flat('mu', 'nu') # Flat isomorphism ♭_μνg
Representation.g(
i: builtins.int | Expression | str,
j: builtins.int | Expression | str,
) -> TensorIndicesCreate a metric tensor for this representation.
Parameters
- i: First index- j: Second index
Examples
rep = Representation.mink(4)
metric = rep.g('mu', 'nu') # Minkowski metric g_μνid
Representation.id(
i: builtins.int | Expression | str,
j: builtins.int | Expression | str,
) -> TensorIndicesCreate an identity tensor for this representation.
Parameters
- i: First index- j: Second index
Examples
rep = Representation.cof(3)
identity = rep.id('a', 'b') # Color identity δ_abmink
Representation.mink(dimension: builtins.int | Expression | str) -> RepresentationCreate a Minkowski space representation.
Parameters
- dimension: The dimension of the Minkowski space
to_expression
Representation.to_expression() -> ExpressionConvert the representation to a symbolic expression.