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) -> Slot

Create a slot from this representation, by specifying an index.

Parameters

  • aind (int, str, or Symbol) The index specification

Returns

  • Slot 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'))

__call__ returning Expression | Slot

Representation.__call__(aind: Expression) -> Expression | Slot

Create a slot or symbolic expression from this representation.

Parameters

  • aind (Expression) The index specification (Expression creates symbolic 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)"))

__new__

Representation.__new__(
    name: builtins.str,
    dimension: builtins.int | Expression | str,
    is_self_dual: builtins.bool = ...,
) -> Representation

Create 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.str

bis

Representation.bis(dimension: builtins.int | Expression | str) -> Representation

Create a bispinor representation.

Parameters

  • - dimension: The dimension of the bispinor space

coad

Representation.coad(dimension: builtins.int | Expression | str) -> Representation

Create 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) -> Representation

Create 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) -> Representation

Create a color sextet representation.

Parameters

  • - dimension: The dimension of the sextet representation (e.g., 6 for SU(3))

dual

Representation.dual() -> Representation

euc

Representation.euc(dimension: builtins.int | Expression | str) -> Representation

Create 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,
) -> TensorIndices

Create 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,
) -> TensorIndices

Create 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,
) -> TensorIndices

Create 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 δ_ab

mink

Representation.mink(dimension: builtins.int | Expression | str) -> Representation

Create a Minkowski space representation.

Parameters

  • - dimension: The dimension of the Minkowski space

to_expression

Representation.to_expression() -> Expression

Convert the representation to a symbolic expression.