Representation
symbolica.community.tensor Class
Representation(name: str, dimension: int | Expression | str, is_self_dual: bool = True) An index space with a dimension and a rule for pairing indices.
Use representations to distinguish axes that have the same size but different mathematical meanings. A self-dual space pairs with itself; a dualizable space pairs with its dual(). Calling a representation assigns an index label. Built-in spaces include Euclidean and Minkowski vectors, Dirac spinors, and color representations; custom spaces work with the same tensor operations.
Examples
from symbolica.community.tensor import Representation, TensorName
space = Representation.euc(3)
vector = TensorName.vector("v")(space)
vector("i").rankConstructor
#Create or reuse a named index space.
Returns
Representation
The requested space, ready to use as an unresolved tensor axis.
Examples
from symbolica.community.tensor import Representation
space = Representation("Flavor", 5, is_self_dual=False)
space.dual().dual() == spaceParameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Registered name distinguishing this space from other representations. |
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
is_self_dual | bool | True | Whether indices pair with the same space. False creates a space with a distinct dual; use |
Member details
name
Property · read-only#name: RepresentationNameThe registered space identity and duality, without its dimension.
Returns
Metadata shared by this representation at different dimensions.
Examples
from symbolica.community.tensor import Representation
Representation.euc(3).name == Representation.euc(5).namedimension
Property · read-only#dimension: ExpressionThe dimension of this index space as a Symbolica expression.
Returns
Expression
An integer-valued expression or a dimension symbol.
Examples
from symbolica.community.tensor import Representation
Representation.euc(3).dimension == 3__eq__
Method#__eq__(other: object) -> boolNo description is available for this member.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
other | object | — | — |
__call__
Method#Overloads
Overload 1 #
__call__(aind: int | str) -> SlotAttach an abstract index label to this space.
Returns
Slot or Expression
A typed index, or symbolic syntax for a compound index payload.
Examples
from symbolica import S
from symbolica.community.tensor import Representation, Slot
space = Representation.euc(3)
isinstance(space(S("i")), Slot)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
aind | int | str | — | An index label, not a component coordinate. A string, Python integer, or single symbol creates a Slot. Other Expressions retain raw representation syntax: supported numeric, tagged named, and scoped labels can be admitted directly; other compound payloads require |
Overload 2 #
__call__(aind: Expression) -> Expression | SlotAttach an abstract index label to this space.
Returns
Slot or Expression
A typed index, or symbolic syntax for a compound index payload.
Examples
from symbolica import S
from symbolica.community.tensor import Representation, Slot
space = Representation.euc(3)
isinstance(space(S("i")), Slot)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
aind | Expression | — | An index label, not a component coordinate. A string, Python integer, or single symbol creates a Slot. Other Expressions retain raw representation syntax: supported numeric, tagged named, and scoped labels can be admitted directly; other compound payloads require |
_repr_html_
Method#_repr_html_() -> strNo description is available for this member.
to_html
Method#to_html() -> strRender a compact HTML view of this tensor metadata.
Returns
str
HTML fragment for display in a notebook or page.
Examples
from symbolica.community.tensor import Representation
value = Representation.euc(3)
html = value.to_html()_repr_latex_
Method#_repr_latex_() -> strNo description is available for this member.
dual
Method#dual() -> RepresentationReturn the space that pairs with this one under contraction.
Returns
Representation
The same space for a self-dual representation; its partner otherwise.
Examples
from symbolica.community.tensor import Representation
Representation.euc(3).dual() == Representation.euc(3)
Representation.cof(3).dual().dual() == Representation.cof(3)casimir
Method#casimir(degree: _ScalarInput = 2) -> ExpressionConstruct the degree-dependent Casimir eigenvalue.
Returns
Expression
A symbolic scalar invariant; constructing it does not evaluate a group-specific formula.
Examples
from symbolica.community.tensor import Representation
invariant = Representation.cof(3).casimir()Parameters
| Name | Type | Default | Description |
|---|---|---|---|
degree | _ScalarInput | 2 | Degree of the invariant. The default is the quadratic invariant. |
dynkin_index
Method#dynkin_index(degree: _ScalarInput = 2) -> ExpressionConstruct the degree-dependent Dynkin index.
Returns
Expression
A symbolic scalar invariant; constructing it does not evaluate a group-specific formula.
Examples
from symbolica.community.tensor import Representation
invariant = Representation.cof(3).dynkin_index()Parameters
| Name | Type | Default | Description |
|---|---|---|---|
degree | _ScalarInput | 2 | Degree of the invariant. The default is the quadratic invariant. |
gram
Method#gram(degree: _ScalarInput, other: Optional[Representation] = None) -> Expression Construct a Gram invariant for two representations.
Returns
Expression
A symbolic Gram invariant, without evaluating a group-specific formula.
Examples
from symbolica.community.tensor import Representation
invariant = Representation.cof(3).gram(2)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
degree | _ScalarInput | — | Degree of the invariant. |
other | Optional[ | None | Second representation. Defaults to this representation. |
g
Method#g(i: int | Expression | str, j: int | Expression | str) -> TensorExpression Create the metric with two explicit index labels.
Returns
The indexed rank-two tensor, or its contraction when the labels pair.
Notes
Both ports belong to this representation. For a pairing between a space and its dual, use id or TensorExpression.g(rep, rep.dual()).
Examples
from symbolica.community.tensor import Representation
tensor = Representation.euc(3).g("i", "j")
tensor.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
j | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
flat
Method#flat(i: int | Expression | str, j: int | Expression | str) -> TensorExpression Create the metric map used to lower or raise an index.
Returns
The indexed rank-two tensor, or its contraction when the labels pair.
Notes
Both ports belong to this representation. The flat map accounts for the metric signs when identifying vectors and covectors.
Examples
from symbolica.community.tensor import Representation
tensor = Representation.euc(3).flat("i", "j")
tensor.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
j | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
id
Method#id(i: int | Expression | str, j: int | Expression | str) -> TensorExpression Create the identity pairing between this space and its dual.
Returns
The indexed rank-two tensor, or its contraction when the labels pair.
Notes
The first port is in self.dual() and the second in self.
Examples
from symbolica.community.tensor import Representation
tensor = Representation.euc(3).id("i", "j")
tensor.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
i | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
j | int | Expression | str | — | Abstract index labels accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
__repr__
Method#__repr__() -> strReturn a readable object description for inspection.
Examples
from symbolica.community import tensor as sp
r = sp.Representation.mink(4)
text = repr(r)__str__
Method#__str__() -> strReturn a readable text representation.
Examples
from symbolica.community import tensor as sp
r = sp.Representation.mink(4)
text = str(r)to_expression
Method#to_expression() -> ExpressionReturn the symbolic encoding of the space and its dimension.
Returns
Expression
Representation syntax without an index label. Use the Representation itself when constructing tensor axes.
Examples
from symbolica.community.tensor import Representation
encoded = Representation.euc(3).to_expression()bis
Static method#bis(dimension: int | Expression | str) -> RepresentationCreate the Dirac bispinor space.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
This is the self-dual spinor index space used by the Dirac-matrix helpers. Its dimension counts spinor components, not space-time coordinates.
Examples
from symbolica.community.tensor import Representation
space = Representation.bis(4)
space.dimension == 4Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
euc
Static method#euc(dimension: int | Expression | str) -> RepresentationCreate the Euclidean vector space.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
The space is self-dual, with positive metric signs on every component.
Examples
from symbolica.community.tensor import Representation
space = Representation.euc(3)
space.dimension == 3Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
mink
Static method#mink(dimension: int | Expression | str) -> RepresentationCreate the Minkowski vector space.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
The space is self-dual, with metric signature (+, -, ..., -). Component zero is the time coordinate.
Examples
from symbolica.community.tensor import Representation
space = Representation.mink(4)
space.dimension == 4Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
cof
Static method#cof(dimension: int | Expression | str) -> RepresentationCreate the fundamental color representation.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
For SU(N), the dimension is N. This space pairs with its distinct dual, the antifundamental representation.
Examples
from symbolica.community.tensor import Representation
space = Representation.cof(3)
space.dimension == 3Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
coad
Static method#coad(dimension: int | Expression | str) -> RepresentationCreate the adjoint color representation.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
For SU(N), pass N**2 - 1 (for example 8 for SU(3)). This space is self-dual.
Examples
from symbolica.community.tensor import Representation
space = Representation.coad(8)
space.dimension == 8Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
cos
Static method#cos(dimension: int | Expression | str) -> RepresentationCreate the sextet color representation.
Returns
Representation
The built-in index space with the supplied dimension.
Notes
The SU(3) sextet has dimension 6 and a distinct dual representation.
Examples
from symbolica.community.tensor import Representation
space = Representation.cos(6)
space.dimension == 6Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dimension | int | Expression | str | — | Number of components in this index space, or a symbol naming that number. An Expression must be a single symbol, not a sum or product. |
View generated signature source: docs/api/python/spynso3.pyi:1467