Closed rupof closed 2 months ago
Thanks for the report! Complex numbers are not supported in both, the PennyLane and the Qiskit implementation. I wouldn't trust the numbers of the Qiskit Implementation. I will add some checks to raise errors for complex numbers.
I will also take care about the dfop issue.
The second issue is due to integer values, if converted to floating point values, it works. PR #255 resolves both errors.
Hi! I came around two bugs in the QNN pennylane executor implementation.
Describe the bug
dfdx
,dfdxdx
,dfdop
) with complex observable coefficients (params_obs
) return an error, whereas: Qiskit QNNs do not and Pennylane QNNs derivatives with real observables also work fine.dfdop
is different than Qiskit QNNsdfdop
, at least in the example below.To Reproduce
The above code returns a ValueError when evaluating
dfdx
anddfdop
(the last two lines).Expected behavior
We should obtain the same results as the QNNs using qiskit, or the QNNs using pennylane with real coefficients:
Returns
I ran this code using 0.7.1
Thank you very much! Hopefully it is a quick fix. If there is anything I can do, I am happy to help :)