[gradients] Add adjoint differentiation for simulator backends

Open
#4,119 1 comment 0 reactions 0 assignees View on GitHub

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
Tech stack
cpp, python

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

enhancement needs triage stale-notified
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 AdjointGradient option 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 gradient
  • adjoint differentiation
  • autodiff

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 observe evaluation
  • #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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/cuda-quantum

All issues in NVIDIA/cuda-quantum

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.