Open willjmax opened 2 days ago
Thanks for opening this issue @willjmax!
I would say that this is less an issue re: allowing catalyst.cond
to take MeasurementValue
objects --- MeaurementValue
's are not supported with catalyst or the new program capture.
Instead, the root of the issue here is that qml.measure
(which returns a MeasurementValue
) does not (yet) dispatch to catalyst.measure
(which returns a tracer).
As soon as we are able to make qml.measure
dispatch to catalyst.measure
, this will be resolved. In the meantime, the best way around this is to use qml.compiler.active
to branch between qml.measure
and catalyst.measure
as needed.
In PennyLane
qml.cond(conditional, true_fn)
can take either aMeasurementValue
or a boolean for theconditional
argument. However,catalyst.cond
only accepts a boolean for the conditional argument. This prevents some PennyLane operations, such asiterative_qpe
, from being compatible with QJIT.