Closed zaqqwerty closed 2 years ago
Added some new tests confirming that VQT accepts Hamiltonian
as an input, and that derivatives can be taken with respect to both the model and the target hamiltonian.
Related to #71, I found that adding persistent=True
to the gradient tape on line 144 of vqt_loss_test.py
causes the error LookupError: No gradient defined for operation'TfqAdjointGradient'
to happen. Can just leave it out, so seems we won't have to deal with https://github.com/tensorflow/quantum/issues/667 quite yet.
Adds VQT loss.
This implementation takes advantage of the new
EnergyInference.expectation
method, to simplify the structure. See appendix B of the updated paper for the derivation. Part of #139