ExecutionStatus

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

ExecutionStatus

class ExecutionStatus

Read-only snapshot of a TensorNetwork’s remaining work.

Obtain this object from network.status. Counts refer to graph structure, not estimated arithmetic cost or memory use; a previously obtained snapshot does not change when the network executes.

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)
progress = network.status
progress.complete
True

Attributes

Name Description
complete Whether one result value remains with no pending work.
contractions Number of remaining internal index connections.
nodes Number of remaining nodes, including values and operations.
operations Number of remaining operation nodes.
ready_operations Operations whose inputs are currently available values.

complete

ExecutionStatus.complete: builtins.bool

Whether one result value remains with no pending work.

Returns

  • bool True when no operations or index contractions remain.

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)
snapshot_value = network.status.complete

contractions

ExecutionStatus.contractions: builtins.int

Number of remaining internal index connections.

Returns

  • int Includes self-traces.

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)
snapshot_value = network.status.contractions

nodes

ExecutionStatus.nodes: builtins.int

Number of remaining nodes, including values and operations.

Returns

  • int Current graph node count.

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)
snapshot_value = network.status.nodes

operations

ExecutionStatus.operations: builtins.int

Number of remaining operation nodes.

Returns

  • int Pending sums, products, broadcasts, and other operation nodes.

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)
snapshot_value = network.status.operations

ready_operations

ExecutionStatus.ready_operations: tuple[str, ...]

Operations whose inputs are currently available values.

Returns

  • tuple of str Operation descriptions in the scheduler’s current traversal order. Preprocessing, including self-traces, can run before these operations.

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)
snapshot_value = network.status.ready_operations

Methods

Name Description
__repr__ Return a readable object description for inspection.

__repr__

ExecutionStatus.__repr__() -> builtins.str

Return a readable object description for inspection.

Examples

from symbolica.community import tensor as sp
r = sp.Representation.euc(2)
A = sp.TensorName("docs::A")(r, r)
tensor = sp.Tensor.dense(A, [1.0, 2.0, 3.0, 4.0])
network = tensor("i", "j") * tensor("j", "k")
status = network.status
text = repr(status)