ExecutionMode
Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.
ExecutionMode
class ExecutionModeChoose 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 |
Use the default contraction schedule. |
Scalar |
Restrict each execution step to scalar work. |
Single |
Select one smallest-degree rewrite per step; without n_steps, continue until no work remains. |
All
All: typing.ClassVar[ExecutionMode]Use the default contraction schedule.
Scalar
Scalar: typing.ClassVar[ExecutionMode]Restrict each execution step to scalar work.
Single
Single: typing.ClassVar[ExecutionMode]Select one smallest-degree rewrite per step; without n_steps, continue until no work remains
Methods
| Name | Description |
|---|---|
__int__ |
Return the underlying integer discriminant. |
__int__
ExecutionMode.__int__() -> builtins.intReturn the underlying integer discriminant.