Closed isaacdevlugt closed 3 months ago
The issue is that in split_non_commuting
we assume that all observables are Pauli words: https://github.com/PennyLaneAI/pennylane/blob/3f7bbd682d3be11728cdefd1e85ad20c320cf485/pennylane/transforms/split_non_commuting.py#L163
Of course, the fact that Projector
isn't itself a Pauli word is where the error comes from.
Not sure what we want to do in this case @albi3ro @Jaybsoni. Was this being handled correctly by the old grouping module? Is the Pauli grouping module meant to support these cases as well?
Note that this issue is no longer present in default.qubit
or lightning.qubit
, but it will still occur on any device that relies on split_non_commuting
.
Expected behavior
Returning multiple projector expectation values in a QNode should work.
Actual behavior
Additional information
Discovered while trying to propose a workaround for this: https://discuss.pennylane.ai/t/mid-circuit-measurement-in-pennylane/3187/3
Source code
Tracebacks
System information
Existing GitHub issues