-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just a Question: why not use quatnum AD in some examples? #17
Comments
Thanks for your question. Unfortunately, we have poor tutorials at this moment. VQE is using AD to get the gradient. not sure why you think it's not. if you check the date of QAOA example, it is written in pre-AD era (17 months ago). @GiggleLiu might have some other comments. |
ADAM requires gradients and we have already used the gradient here. QuAlgorithmZoo.jl/examples/VQE/VQE.jl Line 59 in 8fdef4c
It should be possible to train QAOA with gradient as well, however, the parameters are shared in QAOA. One can combine Zygote and Yao to achieve parameter sharing. |
The QAOA example requires some polish though. I will look into it later. |
Yep..I noticed ADAM. By the way I just tried VQE on 4 qubits H2 (under Jordan-Weiger transformation) with Yao and OpenFermion. (Has given a PR) Also I tried AD on QAOA, it's so fast. (毕设看到了希望:pray: .. 感激不尽) Think this issue can be closed now, thanks for answer. |
Great, 希望毕业顺利! BTW: In our example, we used the time evolution in QAOA, which is not nesseary in that case. One can use We didn't use this trick for that in real experiment, the Hamiltonian can be different and such decomposition is not always possible. |
Still shocked by the first example given in Yao.jl paper (which got 300,000 parameters)...
😃. I am just wondering why don't you use automatic differentiation in the examples like QAOA or VQE...(I mean, something like
expect'
, and!dispatch
maybe).Actually
COBYLA
is used in QAOA and VQE usesADAM
as optimizer, it seems like there is no calculation for gradient...I consider AD one of the most powerful features of Yao, so confusing..
The text was updated successfully, but these errors were encountered: