pasqal-io / qadence

Digital-analog quantum programming interface
https://pasqal-io.github.io/qadence/latest/
Apache License 2.0
69 stars 22 forks source link

[Bug] Horqrux GPSR for 2nd order derivatives #468

Closed dominikandreasseitz closed 2 months ago

dominikandreasseitz commented 3 months ago

cc @atiyo

rajaiitp commented 3 months ago

Random question/thought. In GPSR we compute the coefficients that scale the eigenvalue spectrum differences using a set of random shifts. It seems like these are the same coefficients used for higher order derivatives, with higher powers of shifts. Does it mean that we get all the higher order derivatives for free once we compute these coefficients. Am I missing out something

atiyo commented 2 months ago

This should come relatively easily with the correct jacobinan-vector product implementation, which I think is already in qadence. We can bring it over.

Random question/thought. In GPSR we compute the coefficients that scale the eigenvalue spectrum differences using a set of random shifts. It seems like these are the same coefficients used for higher order derivatives, with higher powers of shifts. Does it mean that we get all the higher order derivatives for free once we compute these coefficients. Am I missing out something

We should chat about this! Probably internally so we can back and forth about it a bit easier.

Roland-djee commented 2 months ago

Hiya @atiyo would you be able to take that on ? (Also tagging @gvelikova)

atiyo commented 2 months ago

Happy to take this on. Not sure what the bug is, though 🤷.

The plan is to take the GPSR implementation out of qadence and put it directly in horqrux---qadence doesn't feel like the right place to implement horqrux functionality. AFAICT, moving it horqrux will also be seamless from the perspective of an end user since it hooks directly into jax's AD either way.

Are we happy to close this issue and raise a corresponding one in horqrux?

Roland-djee commented 2 months ago

Happy to take this on. Not sure what the bug is, though 🤷.

The plan is to take the GPSR implementation out of qadence and put it directly in horqrux---qadence doesn't feel like the right place to implement horqrux functionality. AFAICT, moving it horqrux will also be seamless from the perspective of an end user since it hooks directly into jax's AD either way.

Are we happy to close this issue and raise a corresponding one in horqrux?

Indeed. I don't think this is a bug rather than a feature (but aren't they the same ? 😬 ) and agreed it can move to Horqrux board. Thanks @atiyo.

atiyo commented 2 months ago

Nice. In that case I'm closing this issue since it's covered by this one: https://github.com/pasqal-io/horqrux/issues/22