pyjuice.summate

pyjuice.summate(nodes1: SumNodesChs, *args, num_node_blocks: int = 0, num_nodes: int = 0, edge_ids: Tensor | None = None, block_size: int = 0, **kwargs) SumNodes

Construct a vector of sum nodes given a list of children PCs defined on the same sets of variables.

Note:

It requires all children to have the same block size.

Note:

If edge_ids is not set, summate defines a set of sum nodes fully connected to the input nodes.

Parameters:
  • nodes1 (Union[ProdNodes,InputNodes]) – the first child node

  • args (Union[ProdNodes,InputNodes]) – the remaining child nodes

  • num_node_blocks (int) – number of node blocks each of size block_size. I.e., the total number of nodes is num_node_blocks * block_size

  • num_nodes (int) – an alternative of num_node_blocks; if set, it should be divicible by block_size

  • edge_ids (Optional[Tensor]) – a matrix of size [2, # edges] - every size-2 column vector [i,j] defines a set of edges that fully connect the ith sum node block and the jth child node block

  • block_size (int) – block size of the nodes; it does not change the semantics of the nodes, but will affect the speed of the compiled PC

Returns:

an SumNodes object (a subclass of CircuitNodes)