[gradients] Add adjoint differentiation for simulator backends
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Domain
- quantum-computing
Research direction
Start by reading CUDA-Q’s existing C++ gradient abstraction and the documented CentralDifference, ForwardDifference, and ParameterShift strategies, then trace how Python exposes them. Compare the proposed scope with simulator-backend support and expectation-value objectives such as observe; done would mean a defined adjoint strategy for first-order continuous-parameter gradients, with the API shape and supported simulator scope agreed.
Written by the indexing model from the issue text.
Description
Required prerequisites
- Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature
Describe the feature
I would like to request support for adjoint differentiation as a gradient strategy in CUDA-Q, with an initial focus on simulator backends.
CUDA-Q currently documents the following gradient strategies:
- CentralDifference
- ForwardDifference
- ParameterShift
For simulator-based workflows, especially VQE / QAOA / QML workloads with many parameters, an adjoint / reverse-mode gradient method could substantially reduce gradient-evaluation cost compared with parameter-shift.
Motivation
This would be useful for:
- large parameterized circuits evaluated on simulators
- variational workloads where gradient cost dominates runtime
- training and optimization loops that currently require many shifted circuit evaluations
CUDA-Q already exposes a gradient abstraction in C++, so this seems like a natural extension point for adding another gradient strategy.
Proposed initial scope
To keep the request realistic, I am not asking for hardware-backend support in the first step.
A good initial scope might be:
- simulator backends only
- first-order gradients
- expectation-value objectives (e.g.
observe) - continuous gate parameters
A narrower first implementation (for example, statevector simulation first) would also be perfectly reasonable.
Possible API direction
One possible direction could be:
- C++: a new
cudaq::gradients::adjoint(or similar) strategy - Python: an
AdjointGradientoption alongside the existing gradient strategies
I am not attached to the exact API shape; this is only a suggestion.
Prior search / why this is not a duplicate
Before opening this issue, I searched the public issue tracker and discussions for:
adjoint gradientadjoint differentiationautodiff
I found related issues around broadcasting / vectorization / tensor inputs, but I did not find a dedicated feature request for adjoint differentiation as a CUDA-Q gradient strategy.
Related but not duplicate:
- #62 discusses batched / broadcasted
observeevaluation - #3664 requests native vectorized batch evaluation for parameterized circuits
This request is instead about adding adjoint differentiation as a gradient strategy for simulator backends.
Why this would help CUDA-Q
CUDA-Q is already strong for simulator-heavy hybrid quantum-classical workflows. Adding adjoint differentiation would make it more attractive for variational optimization and training workloads where simulator performance matters.
Contribution
I would be happy to help discuss scope and contribute an implementation if this direction aligns with the maintainers’ roadmap.
I am happy to start with a simulator-only implementation if that is the preferred first step.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 455
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-quantum
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/cuda-quantum#5424 ·
-
[python] Kernel with a return only inside a dynamic-bound loop compiles without a return-type check Openstale-notified
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NVIDIA/cuda-quantum#5369 · 2 comments ·
-
bug Exalate stale-notified
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NVIDIA/cuda-quantum#5361 ·
-
bug Exalate stale-notified
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
NVIDIA/cuda-quantum#5356 ·
-
stale-notified
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NVIDIA/cuda-quantum#5353 ·
All issues in NVIDIA/cuda-quantum
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·