-
Notifications
You must be signed in to change notification settings - Fork 5
backwards differentiation #142
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
Comments
A pull request with a chain rule would be welcome. You'll want to do it as a package extension, similar to how e.g. SpecialFunctions.jl does it. This is a case where a custom ( (What you are calling "numerical" and what you are calling "analytical" in your test looks backwards to me.) |
Hi, Thanks for the quick reply ! I agree that this is indeed surely faster with a custom As for the As for the naming conventions in my test. Thanks for pointing that out. I'll be smarter in my pull request ;) |
|
(Out of curiosity, in what context did you encounter a need to differentiate a Pfaffian?) |
Thanks for your interest :) I'm currently writing code to optimize Gaussian matrix product states so that they approximate groundstates of quantum many body problems. For now I'm just reproducing this work by Norbert Schuch and Bela Bauer , but in the future I plan to go beyond their approach. More specifically, in this context the state is parametrized by a covariance matrix and the expectation value of operators (such as the Hamiltonian=energy) is calculated as the pfaffian of a submatrix of this covariance matrix. For more details I refer to this paper by Brevyi. |
Thank you @smataigne. We've currently got a pull request which implements the desired functionality as a package extension. I'm still testing it but it seems like we will be able to merge soon :) |
Firstly, thanks the developers for the great package !
I tried to use the package with
Zygote.jl
(for automatic differentiation) but sadly this failed due to the usage of=.
in the definition ofpfaffian(A)
.The usual fix for this is to define the backwards derivative manually, in this case I got :
which works well from the test :
would it be desirable if I made a pull request with this code ?
All the best,
Gertian
The text was updated successfully, but these errors were encountered: