On this page

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

NameTypeDefaultDescription
namestr

String name for the representation

dimensionint | Expression | str

Size of the representation (int or symbolic)

is_self_dualboolTrue

If True, creates self-dual representation; if False, creates dualizable pair

Member details

__call__

Method
#

Overloads

Overload 1 #
__call__(aind: int | Expression | str) -> Slot

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

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'))
Parameters
NameTypeDefaultDescription
aindint | Expression | str

The index specification

Overload 2 #
__call__(aind: Expression) -> Expression | Slot

Create 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
NameTypeDefaultDescription
aindExpression

The index specification (Expression creates symbolic representation)

dual

Method
#
dual() -> Representation

No description is available for this member.

g

Method
#
g(i: int | Expression | str, j: int | Expression | str) -> TensorIndices

Create a metric tensor for this representation.

Examples

rep = Representation.mink(4)
metric = rep.g('mu', 'nu')  # Minkowski metric g_μν

Parameters

NameTypeDefaultDescription
iint | Expression | str

First index

jint | Expression | str

Second index

flat

Method
#
flat(i: int | Expression | str, j: int | Expression | str) -> TensorIndices

Create a musical isomorphism tensor for this representation.

Examples

rep = Representation.mink(4)
flat = rep.flat('mu', 'nu')  # Flat isomorphism ♭_μν

Parameters

NameTypeDefaultDescription
iint | Expression | str

First index

jint | Expression | str

Second index

id

Method
#
id(i: int | Expression | str, j: int | Expression | str) -> TensorIndices

Create an identity tensor for this representation.

Examples

rep = Representation.cof(3)
identity = rep.id('a', 'b')  # Color identity δ_ab

Parameters

NameTypeDefaultDescription
iint | Expression | str

First index

jint | Expression | str

Second index

__repr__

Method
#
__repr__() -> str

No description is available for this member.

__str__

Method
#
__str__() -> str

No description is available for this member.

to_expression

Method
#
to_expression() -> Expression

Convert the representation to a symbolic expression.

bis

Static method
#
bis(dimension: int | Expression | str) -> Representation

Create a bispinor representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

The dimension of the bispinor space

euc

Static method
#
euc(dimension: int | Expression | str) -> Representation

Create a Euclidean space representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

The dimension of the Euclidean space

mink

Static method
#
mink(dimension: int | Expression | str) -> Representation

Create a Minkowski space representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

The dimension of the Minkowski space

cof

Static method
#
cof(dimension: int | Expression | str) -> Representation

Create a color fundamental representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

The dimension of the color group (e.g., 3 for SU(3))

coad

Static method
#
coad(dimension: int | Expression | str) -> Representation

Create a color adjoint representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

The dimension of the adjoint representation (e.g., 8 for SU(3))

cos

Static method
#
cos(dimension: int | Expression | str) -> Representation

Create a color sextet representation.

Parameters

NameTypeDefaultDescription
dimensionint | Expression | str

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