Idenso · latest
On this page

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

NameTypeDefaultDescription
namestr—

Registered representation name.

dimensionint—

Dimension of the index space.

aindint | Expression | str—

Abstract index label accepted by the shared tensor-structure parser, including numeric, symbolic, tagged named, and scoped indices.

dualboolFalse

Whether to use the dual of the named representation.

Member details

index

Property · read-only#
index: Expression

The 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.index

representation

Property · read-only#
representation: Representation

The dimensioned space to which this index belongs.

Returns

Representation

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

No description is available for this member.

Parameters

NameTypeDefaultDescription
otherobject——

__hash__

Method#
__hash__() -> int

Hash 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_() -> str

No 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

NameTypeDefaultDescription
settingsOptional[DisplaySettings]None

Index and tensor presentation choices; defaults to DisplaySettings().

_repr_latex_

Method#
_repr_latex_() -> str

No description is available for this member.

__repr__

Method#
__repr__() -> str

Return 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__() -> str

Return a readable text representation.

Examples

from symbolica.community import tensor as sp
slot = sp.Representation.mink(4)("mu")
text = str(slot)

dual

Method#
dual() -> Slot

Pair 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() -> Expression

Return 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()