amazon-braket / BraketSimulator.jl

Apache License 2.0
10 stars 4 forks source link

Support for the `AdjointGradient` result type #13

Open kshyatt-aws opened 4 months ago

kshyatt-aws commented 4 months ago

Describe the feature you'd like Native Julia implementation of the adjoint gradient differentiation method for the StateVectorSimulator. Amazon Braket's on-demand state vector simulator SV1 currently supports this differentiation method, but the Python local state vector simulator does not.

How would this feature be used? Please describe. This differentiation method would allow efficient computation of gradients of parameterized circuits locally and in parallel for exact state vector simulations.

Describe alternatives you've considered N/A

Additional context See the Amazon Braket/Pennylane Adjoint Gradient blog for an example of how this might be used. Since the simulator doesn't currently support arbitrary functions for elements of quantum gates, a fallback to finite differences (for applying the chain rule to functions which aren't continuously differentiable) isn't needed.

For smaller circuits, using Julia's dynamic/nested threading capabilities (being careful to avoid running out of memory) would be useful.

DhairyaLGandhi commented 4 months ago

I understand that the differentiation would still be performed locally? We could use libraries like Zygote/ Diffractor or ForwardDiff.jl depending on whether forward or reverse mode is suitable for your needs.