Something went wrong in the 2nd derivative (qml.grad)

Please find attached summary.

Something went wrong in the 2nd derivative (qml.grad) as compared to the results obtained from Mathematica

Results of the 1st derivative from Pennylane and Mathematica are the same

As you can see -0.14016 is correct answer since it is bounded between -0.146411 and -0.147617 while -0.10293857 is wrong.

I always got wrong answer when taking the 2nd derivative of any function evaluated at x=0.25 using qml.grad.

Thanks,
HYW

Hey @HYW! Welcome to the forum :slight_smile:

Are you able to share your code? If so, that would help us get down to the bottom of what’s going on :+1: