Slot
symbolica.community.tensor Class
Slot(name: str, dimension: int, aind: int | Expression | str, dual: bool = False) One abstract tensor index together with its representation.
An index label identifies a possible contraction; it is not a component coordinate. Prefer space("i") to construct a slot for an existing space.
Examples
from symbolica.community.tensor import Representation
slot = Representation.euc(3)("i")
slot.representation == Representation.euc(3)Constructor
#Create a labeled index in a registered representation.
Returns
Slot
The representation and index label together.
Notes
Use Representation.euc(3)("i") when working with representation objects.
Examples
from symbolica.community.tensor import Representation, Slot
space = Representation.euc(3)
slot = Slot(space.name.name, 3, "i")
slot == space("i")Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Registered representation name. |
dimension | int | — | Dimension of the index space. |
aind | int | Expression | str | — | Abstract index label accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices. |
dual | bool | False | Whether to use the dual of the named representation. |
Member details
index
Property · read-only#index: ExpressionThe abstract label carried by this slot.
Returns
Expression
Symbolic label or integer; not a component coordinate.
Examples
from symbolica.community.tensor import Representation
slot = Representation.euc(3)("i")
label = slot.indexrepresentation
Property · read-only#representation: RepresentationThe dimensioned space to which this index belongs.
Returns
Includes the duality of the slot.
Examples
from symbolica.community.tensor import Representation
slot = Representation.euc(3)("i")
space = slot.representation__eq__
Method#__eq__(other: object) -> boolNo description is available for this member.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
other | object | — | — |
__hash__
Method#__hash__() -> intHash the immutable representation and index label for dictionaries and sets.
Examples
from symbolica.community import tensor as sp
r = sp.Representation.euc(2)
labels = {r("i"): "free index"}
assert labels[r("i")] == "free index"_repr_html_
Method#_repr_html_() -> strNo description is available for this member.
to_html
Method#to_html(*, settings: Optional[DisplaySettings] = None) -> str Render 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)("i")
html = value.to_html()Parameters
| Name | Type | Default | Description |
|---|---|---|---|
settings | Optional[ | None | Index and tensor presentation choices; defaults to DisplaySettings(). |
_repr_latex_
Method#_repr_latex_() -> strNo description is available for this member.
__repr__
Method#__repr__() -> strReturn a readable object description for inspection.
Examples
from symbolica.community import tensor as sp
slot = sp.Representation.mink(4)("mu")
text = repr(slot)__str__
Method#__str__() -> strReturn a readable text representation.
Examples
from symbolica.community import tensor as sp
slot = sp.Representation.mink(4)("mu")
text = str(slot)dual
Method#dual() -> SlotPair this index label with the dual representation.
Returns
Slot
A new slot with the same label.
Examples
from symbolica.community.tensor import Representation
slot = Representation.euc(3)("i")
paired = slot.dual()to_expression
Method#to_expression() -> ExpressionReturn symbolic syntax for the representation and index.
Returns
Expression
The encoded slot, for use in raw Symbolica expressions.
Examples
from symbolica.community.tensor import Representation
slot = Representation.euc(3)("i")
encoded = slot.to_expression()View generated signature source: docs/api/python/spynso3.pyi:2100