Closed loreloc closed 4 months ago
Why is this useful: 2. Omni-compatible circuits cannot be represented in the current RG structure, which is useful in circuit multiplication.
You can always reshape an omni-compatible circuit to have any region graph.
You can always reshape an omni-compatible circuit to have any region graph.
Then I can only have an omni-compatible circuit when I know the shape. I think the better solution is to directly construct an omni-compatible circuit and then put it into any functional transforms (e.g. in multiplication, it's reshaped based on the opposite side).
That would be the ideal solution, but to start with your projects, just reshape it (you always know in advance the shape of the other circuit).
NOTE We already support multi-partition in RG data structure. https://github.com/april-tools/cirkit/blob/e013eefb63dbfaf149e6dfe92ab5162f0fc2fb89/cirkit/region_graph/rg_node.py#L60-L61
What's missing is the code making use of it.
Generalize region graphs such that partition nodes are not necessarily binary. Implementing this requires reviewing the file format, as we assumed only "left" and right" regions until now.
Why is this useful? To support sparse region graphs such as those derived from the Chow-Liu algorithm.