Hello,I am using CnC in my PhD research, as a compilation-target for a dataflow quantum simulator.During this work it is common to create the 'cross join' product of two (gigantic) sets, representing the tensor- or kronecker product of two vectors.What would be the recommended way to do this efficiently, given that each set is a simple item collection with an associated tag collection? Currently I can think of two ways, each of which seems to suspend or depend too much.a) a generator step (prescribed by a single tag element) that generates all pairs as tags. A compute step prescribed by the pairs will get the two items and multiply.
(gen_pairs) -> ;[vec1] -> (product) -> [vec_result];[vec2] -> (product);(gen_pairs) :: ;(product) :: ;
cons: Possibly suspends the product step size(v1) * size(v2) times.This could perhaps be mitigated by using the Tuner to declare a dependency for (product) to [vec1] and [vec2], as sizes are known beforehand. But I'm not sure of queuing up size(v1) * sive(v2) dependencies up front is a good idea.
b) similar to a), but letting the pair generated be prescribed by a tag collection associated with one of the two vectors
cons: still suspends in the worst case (size(v1) - 1) * size(v2) steps. By using the tuner again for (product) we can perhaps lower the number of suspended steps by depending on v2 elements. This queues up size(v2) dependencies, which is lot better but can still be large.Is there an elegant solution to this cross-join pattern? One that retains the inherit parallelism, but stays efficient.Thanks in advance!-Yves VandriesscheSoftware Languages LabVrije Universiteit Brussel