CircBox option to prevent compiler modifications inside the box
Often users want to write precise target-aware circuits and want the compiler to not modify them, it would be useful to offer this functionality in a composable way.
Inspired by braket's "verbatim box" I propose adding an option to circbox which signals to passes to skip the internals.
This seems a nice thing to be able to do. But it would need special-casing in the predicates system; e.g. a rebase pass would no longer guarantee that the circuit was in a specific gate set afterwards.
This seems a nice thing to be able to do. But it would need special-casing in the predicates system; e.g. a rebase pass would no longer guarantee that the circuit was in a specific gate set afterwards.
To avoid that problem, would it be enough to just have the rebase pass check that the "untouchable" box only contains allowed gates. If it doesn't, fail compilation?
To avoid that problem, would it be enough to just have the rebase pass check that the "untouchable" box only contains allowed gates. If it doesn't, fail compilation?
Yes that would work.
Actually, isn't the description here the wrong way round? Because right now, compilation passes don't go inside boxes: if you want to run a pass on the contents of a CircBox you have to do DecomposeBoxes() first. What is missing is a way to allow the internals of a CircBox to be modified by a compilation pass -- while retaining it as a box.
This issue has been automatically marked as stale.