Skip to content

opto.trace.propagators

SumPropagator

SumPropagator()

Bases: Propagator

init_feedback

init_feedback(feedback: Any)

Propagator

Propagator()

Bases: AbstractPropagator

override instance-attribute

override = dict()

register

register(operator_name, propagate_function)

propagate

propagate(child: MessageNode) -> Dict[Node, Any]

init_feedback

init_feedback(node: Node, feedback: Any)

Given raw feedback, create the feedback object that will be propagated recursively.

GraphPropagator

GraphPropagator()

Bases: Propagator

A propagator that collects all the nodes seen in the path.

init_feedback

init_feedback(node, feedback: Any)

aggregate

aggregate(feedback: Dict[Node, List[TraceGraph]])

Aggregate feedback from multiple children

TraceGraph dataclass

TraceGraph(
    graph: List[Tuple[int, Node]], user_feedback: Any
)

Bases: AbstractFeedback

Feedback container used by GraphPropagator.

graph instance-attribute

graph: List[Tuple[int, Node]]

user_feedback instance-attribute

user_feedback: Any

empty

empty()

expand classmethod

expand(node: MessageNode)

Return the subgraph within a MessageNode.

visualize

visualize(
    simple_visualization=True,
    reverse_plot=False,
    print_limit=100,
)