adjoint#

Adjoint differentiation

Classes

AdjointExpectation(*args, **kwargs)

Adjoint differentiation

class AdjointExpectation(*args, **kwargs)[source]#

Bases: Function

Adjoint differentiation

See https://arxiv.org/pdf/2009.02823

Parameters:
  • state – The final quantum state.

  • operators – The quantum operations.

  • observable – The observable.

  • *parameters – The parameters of the quantum circuit.

static backward(ctx, grad_out: Tensor) tuple[None, ...][source]#
static forward(ctx, state: DistributedQubitState, operators: Sequential, observable: Observable, *parameters: Tensor) Tensor[source]#