catalyst
catalyst copied to clipboard
ZNE works with dynamic one shot
trafficstars
Context:
ZNE is not working with dynamic one shot, because it does not support to be applied on a classical function containing QNodes.
Description of the Change:
- Add
Functionondynamic_one_shotfor a correct tracing. - Add the case of boolean constant of a JaxPrs in the lowering.
- Remove the only QNode restriction.
- Update the MLIR lowering to handle the case of ZNE on classical function containing QNodes calls. When folding the classical functions, the folding is applied individually on each qnode. Later when looping over scale factor we call the folded classical function containing calls to the folded qnodes.
Benefits:
- ZNE is can be applied on any classical functions calling QNodes.
- ZNE can be run with dynamic one shot.