[BUG] Second-oder derivatives fail with shots enabled for product of input variables #5824
Open
1 task done
Labels
bug 🐛
Something isn't working
Expected behavior
I'm calculating second-order derivatives of a parameterized circuit with shots. The rotation gates depend on a product of two different input variables, which causes the computation of the higher-order derivative to fail if shots are enabled. The code example works without shots and it works without the product of the two variables.
If I comment out the raising of the
NonDifferentiableError
in tensor.py (see traceback), it returns the correct value. I assume the raising of theNonDifferentiableError
is unnecessary in this case.Actual behavior
Error
NonDifferentiableError
is unneccessarily thrown.Additional information
PennyLane version 0.36.0
Source code
Tracebacks
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: