0

I have been following the tutorial in the following url to set up a VQC:

https://qiskit.org/ecosystem/machine-learning/tutorials/02_neural_network_classifier_and_regressor.html

However, it is not obvious to me if one could compute the gradients and the hessian. Is there any shortcut to use existing libraries to compute the gradients and hessians?

qiskit.algorithms.gradients does not seem to work with the VQC setup. And the hessian computation appears to have been deprecated now.

  • The gradient calculation should be compatible with a VQC-type circuit. Depending on whether you want to compute the gradients with respect to the model parameters or the data, you have to bind the values to the VQC circuit and derive with respect to the others. The Hessian computation is deprecated due to lack of usage, but you can always use the version of Qiskit that still supports it. – Cryoris Jul 13 '23 at 18:34
  • @Cryoris Thank you for reply! I am wondering if you have an example of how the gradient calculation could be performed on VQC-type circuit. I constructed the VQC using this class: https://qiskit.org/documentation/stable/0.32/stubs/qiskit.aqua.algorithms.VQC.html But it seems that the gradient calculation requires operators as indicated here: https://qiskit.org/documentation/tutorials/operators/02_gradients_framework.html I am slightly confused about how to make the two compatible. – Zhelun Li Jul 14 '23 at 20:11

0 Answers0