pyjuice.nodes.foldup_aggregate

pyjuice.nodes.foldup_aggregate(func: Callable, root_ns: CircuitNodes, cache: Dict | None = None, **kwargs)

Traverse all nodes of a PC bottom-up and aggregate a per-node object.

Parameters:
  • func (Callable) – the function to compute the per-node object

  • root_ns (CircuitNodes) – the root PC node

  • cache (Dict) – an optional dictionary to store the per-node object for all nodes