ExecutionMode

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

ExecutionMode

class ExecutionMode

Choose how network execution schedules contractions.

All uses the default contraction schedule. Single selects one contraction at a time. Scalar restricts contraction to scalar work. Use execute(n_steps=...) to bound the number of execution rounds; the mode by itself does not bound the total number of rounds.

Examples

from symbolica.community.tensor import Representation, TensorName, TensorExpression
space = Representation.euc(2)
A = TensorName("M")(space, space)
from symbolica.community.tensor import Tensor
tensor = Tensor.dense(A, [1.0, 2.0, 3.0, 4.0])
from symbolica.community.tensor import TensorNetwork
network = TensorNetwork(tensor)
from symbolica.community.tensor import ExecutionMode
network.execute(n_steps=1, mode=ExecutionMode.Single)

Attributes

Name Description
All
Scalar
Single

All

All: typing.ClassVar[ExecutionMode]

Scalar

Scalar: typing.ClassVar[ExecutionMode]

Single

Single: typing.ClassVar[ExecutionMode]

Methods

Name Description
__int__ Return the underlying integer discriminant.

__int__

ExecutionMode.__int__() -> builtins.int

Return the underlying integer discriminant.