CQCL/tket

Add pass to combine conditionals to circbox

Opened this issue · 2 comments

Think about how to add a pass that gates with the same conditional dependency can be combined to one conditional circbox with the same dependency.

This would be useful for the block generation in the qir conversion.

(see https://github.com/CQCL/pytket-qir/blob/7716b822e1fb61c9c477c8f9852cc13cfa54478d/tests/conditional_test.py#L209 )

My immediate reaction is that this is the wrong direction, and we should preserve CircBoxes in the pytket circuit up to the point of QIR conversion. (I know we don't do that at the moment.) Reconstructing the box after decomposition is a lot more complicated.

Currently it is possible to preserve the boxes if they are already in the right gate set and the user is not applying the default compilation. Besides that we still would like to construct new boxes when converting from qasm or when the user is providing individual gates with conditional dependencies. I think it would be good to have this.