In the latest version of PennyLane (0.36.0-dev), new opmath is enabled by default. Observables made with @ will now be instances of Prod instead of Tensor. This will not work:
qml.expval(qml.PauliX(0) @ qml.PauliY(1))
because the pennylane-braket plugin currently do not know how to handle Prod.
Solution
In translation.py, add
@_translate_observable.register
def _(t: qml.ops.Prod):
return reduce(lambda x, y: x @ y, [_translate_observable(factor) for factor in t.operands])
Describe the feature you'd like
In the latest version of PennyLane (0.36.0-dev), new opmath is enabled by default. Observables made with
@
will now be instances ofProd
instead ofTensor
. This will not work:because the pennylane-braket plugin currently do not know how to handle
Prod
.Solution
In
translation.py
, addshould make it work with new opmath.