Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catalyst.cond does not accept MeasurementValue type as input conditional #1237

Open
willjmax opened this issue Oct 28, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@willjmax
Copy link
Contributor

In PennyLane qml.cond(conditional, true_fn) can take either a MeasurementValue or a boolean for the conditional argument. However, catalyst.cond only accepts a boolean for the conditional argument. This prevents some PennyLane operations, such as iterative_qpe, from being compatible with QJIT.

@josh146
Copy link
Member

josh146 commented Oct 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants