trace
symbolica.community.tensor Function
trace(representation: Representation, *factors: TensorExpression | Expression | FactorProjector[TensorExpression]) -> TensorExpression Close an ordered product along a representation channel.
Parameters
representationRepresentationSpace over which the matrix indices are traced.
*factorsTensorExpression, scalar expression, Tensor, TensorNetwork, or FactorProjectorOrdered factors with compatible matrix channels. Additional axes are retained as spectator axes. Scalar factors multiply the whole trace. In the overloads, factor, first, and second name leading entries in this same sequence of positional factors.
Returns
TensorExpression or TensorNetwork
Symbolic operands produce a symbolic trace. Any component-bearing factor produces a lazy TensorNetwork.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import trace
trace(space, A, A).is_scalarMember details
Overloads
Overload 1 #
trace(representation: Representation, *factors: TensorExpression | Expression | FactorProjector[TensorExpression]) -> TensorExpression Close an ordered product along a representation channel.
Returns
TensorExpression or TensorNetwork
Symbolic operands produce a symbolic trace. Any component-bearing factor produces a lazy TensorNetwork.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import trace
trace(space, A, A).is_scalarParameters
| Name | Type | Default | Description |
|---|---|---|---|
representation | Representation | — | Space over which the matrix indices are traced. |
factors | TensorExpression | Expression | FactorProjector[ | — | — |
Overload 2 #
trace(representation: Representation, factor: Tensor | TensorNetwork | FactorProjector[TensorNetwork], /, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorNetwork Close an ordered product along a representation channel.
Returns
TensorExpression or TensorNetwork
Symbolic operands produce a symbolic trace. Any component-bearing factor produces a lazy TensorNetwork.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import trace
trace(space, A, A).is_scalarParameters
| Name | Type | Default | Description |
|---|---|---|---|
representation | Representation | — | Space over which the matrix indices are traced. |
factor | Tensor | TensorNetwork | FactorProjector[ | — | — |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
Overload 3 #
trace(representation: Representation, first: _ScalarInput | TensorExpression | TensorNetwork | Tensor | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork], second: Tensor | TensorNetwork | FactorProjector[TensorNetwork], /, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorNetwork Close an ordered product along a representation channel.
Returns
TensorExpression or TensorNetwork
Symbolic operands produce a symbolic trace. Any component-bearing factor produces a lazy TensorNetwork.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import trace
trace(space, A, A).is_scalarParameters
| Name | Type | Default | Description |
|---|---|---|---|
representation | Representation | — | Space over which the matrix indices are traced. |
first | _ScalarInput | TensorExpression | TensorNetwork | Tensor | FactorProjector[ | — | — |
second | Tensor | TensorNetwork | FactorProjector[ | — | — |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
Overload 4 #
trace(representation: Representation, *factors: TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[TensorExpression] | FactorProjector[TensorNetwork]) -> TensorExpression | TensorNetwork Close an ordered product along a representation channel.
Returns
TensorExpression or TensorNetwork
Symbolic operands produce a symbolic trace. Any component-bearing factor produces a lazy TensorNetwork.
Examples
from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import trace
trace(space, A, A).is_scalarParameters
| Name | Type | Default | Description |
|---|---|---|---|
representation | Representation | — | Space over which the matrix indices are traced. |
factors | TensorExpression | _ScalarInput | Tensor | TensorNetwork | FactorProjector[ | — | — |
View generated signature source: docs/api/python/spynso3.pyi:11188