catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

ZNE works with dynamic one shot

Open rmoyard opened this issue 1 year ago • 3 comments
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:

  1. Add Function on dynamic_one_shot for a correct tracing.
  2. Add the case of boolean constant of a JaxPrs in the lowering.
  3. Remove the only QNode restriction.
  4. 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:

  1. ZNE is can be applied on any classical functions calling QNodes.
  2. ZNE can be run with dynamic one shot.

rmoyard avatar Oct 01 '24 21:10 rmoyard