Spenso · latest
On this page

ExecutionStatus

symbolica.community.tensor 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

Member details

nodes

Property · read-only#
nodes: 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

Property · read-only#
operations: 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

contractions

Property · read-only#
contractions: 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

complete

Property · read-only#
complete: 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

ready_operations

Property · read-only#
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

__repr__

Method#
__repr__() -> 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)