Support all operations with `param_shift_hessian()`
See original GitHub issueFeature details
It should be possible to support operations with arbitrary grad_recipes in param_shift_hessian() by computing the applicable grad recipe for each entry in the hessian from the grad_recipess of the operations instead of using fixed diag_recipe and off_diag_recipes.
A first and easier improvement would be to at least replace the hard coded list of “supported operations” by code that inspects the grad_recipes of the occuring operations so that newly added operations that are also differentiable according to the standard rule are supported automatically.
Implementation
No response
How important would you say this feature is?
2: Somewhat important. Needed this quarter.
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:30 (22 by maintainers)
Top Results From Across the Web
pennylane [python]: Datasheet - Package Galaxy
Need information about pennylane? Check download stats, version history, popularity, recent code changes and more.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Setting
requires_grad = Falsefor the Hamiltonian coefficients seems to solve the issue:Not sure why
hamiltonian.coeffs.requires_grad = Truedoes not do the same thing.I don’t know yet what will be useful, so I would say it generalizes 😃
Maybe the user can pass in a “mask” of the same shape as the hessian with boolean entries and then get a hessian with only those entries back?