Skip to content

[gradients] Add adjoint differentiation for simulator backends #4119

@masa-whitestone

Description

@masa-whitestone

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions