pyjuice.multiply

pyjuice.multiply(nodes1: ProdNodesChs, *args, edge_ids: Tensor | None = None, sparse_edges: bool = False, **kwargs) ProdNodes

Construct a vector of product nodes given a list of children PCs defined on disjoint sets of variables.

Note:

It requires all children to have the same block size.

Note:

If all children have the same num_node_blocks, if edge_ids is not specified, multiply outputs a vector of num_node_blocks * block_size nodes, where the ith (product) node is connected to the ith node in every child.

Note:

By default every edge specified by edge_ids denotes a block of block_size edges, unless sparse_edge is set to True, where the block size is assumed to be 1.

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

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

  • edge_ids (Optional[Tensor]) – a matrix of size [# product node blocks, # children] - the ith product node block is connected to the `edge_ids[i,j]`th node block in the jth child

  • sparse_edges (bool) – if set to True, the size of edge_ids becomes [# product nodes, # children] (i.e., we assume the block size of every child is 1)

Returns:

an ProdNodes object (a subclass of CircuitNodes)