chain
symbolica.community.tensor Function
chain(start_slot: Slot, end_slot: Slot, *factors: TensorExpression | Expression | FactorProjector[TensorExpression]) -> TensorExpression Compose an ordered product with explicitly labeled endpoints.
Parameters
start_slot, end_slotSlotExternal input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace.
*factorsTensorExpression, scalar expression, Tensor, TensorNetwork, or FactorProjectorOrdered matrix factors, each with a unique compatible channel. Spectator axes remain external. Supply constituent factors separately when using a factor projector. Scalar factors multiply the whole chain. In the overloads, factor, first, and second name leading entries in this same sequence of positional factors.
Returns
TensorExpression or TensorNetwork
A symbolic chain when all factors are symbolic; a lazy TensorNetwork if any factor or projector contains component data.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import chain
product = chain(space("i"), space("j"), A, A)
product.rankMember details
Overloads
Overload 1 #
chain(start_slot: Slot, end_slot: Slot, *factors: TensorExpression | Expression | FactorProjector[TensorExpression]) -> TensorExpression Compose an ordered product with explicitly labeled endpoints.
Returns
TensorExpression or TensorNetwork
A symbolic chain when all factors are symbolic; a lazy TensorNetwork if any factor or projector contains component data.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import chain
product = chain(space("i"), space("j"), A, A)
product.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
start_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
end_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
factors | TensorExpression | Expression | FactorProjector[ | — | — |
Overload 2 #
chain(start_slot: Slot, end_slot: Slot, factor: Tensor | TensorNetwork | FactorProjector[TensorNetwork], /, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorNetwork Compose an ordered product with explicitly labeled endpoints.
Returns
TensorExpression or TensorNetwork
A symbolic chain when all factors are symbolic; a lazy TensorNetwork if any factor or projector contains component data.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import chain
product = chain(space("i"), space("j"), A, A)
product.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
start_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
end_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
factor | Tensor | TensorNetwork | FactorProjector[ | — | — |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
Overload 3 #
chain(start_slot: Slot, end_slot: Slot, first: _ScalarInput | TensorExpression | TensorNetwork | Tensor | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork], second: Tensor | TensorNetwork | FactorProjector[TensorNetwork], /, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorNetwork Compose an ordered product with explicitly labeled endpoints.
Returns
TensorExpression or TensorNetwork
A symbolic chain when all factors are symbolic; a lazy TensorNetwork if any factor or projector contains component data.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import chain
product = chain(space("i"), space("j"), A, A)
product.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
start_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
end_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
first | _ScalarInput | TensorExpression | TensorNetwork | Tensor | FactorProjector[ | — | — |
second | Tensor | TensorNetwork | FactorProjector[ | — | — |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
Overload 4 #
chain(start_slot: Slot, end_slot: Slot, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorExpression | TensorNetwork Compose an ordered product with explicitly labeled endpoints.
Returns
TensorExpression or TensorNetwork
A symbolic chain when all factors are symbolic; a lazy TensorNetwork if any factor or projector contains component data.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import chain
product = chain(space("i"), space("j"), A, A)
product.rankParameters
| Name | Type | Default | Description |
|---|---|---|---|
start_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
end_slot | Slot | — | External input and output indices, compatible with the factors' matrix channel. Matching endpoint labels close a trace. |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
View generated signature source: docs/api/python/spynso3.pyi:10676