I'm not sure what the best way to do this is, because there are a lot of design choices one could make and it might be hard to have sensible defaults, but I found myself wanting a version of StatePreparationViaRotations that uses SelectSwapQROM instead of QROM.
Some random thoughts about what makes this tricky:
Dirty vs clean ancilla is application dependent and should be configurable
In some applications one might be happy choosing the number of ancilla used automatically, but sometimes one might want to configure this
QROM might be more efficient than the SelectSwapQROM for small data sizes and the user would obviously prefer to make the right choice each time QROM is used.
In general it is an open problem of how we can modify decompositions to replace bloqs which perform the same operation and have the same signature.
For QROM vs SelectSwap I imagine there are cases where some sensible factory method / builder could be cooked up which would perhaps decide on the optimal method to use given some considerations (ancilla count etc..), and would then potentially use 1.
I'm not sure what the best way to do this is, because there are a lot of design choices one could make and it might be hard to have sensible defaults, but I found myself wanting a version of StatePreparationViaRotations that uses SelectSwapQROM instead of QROM.
Some random thoughts about what makes this tricky: