qml.devices.qubit.adjoint_jvp

adjoint_jvp(tape, tangents, state=None)[source]

The jacobian vector product used in forward mode calculation of derivatives.

Implements the adjoint method outlined in Jones and Gacon to differentiate an input tape.

After a forward pass, the circuit is reversed by iteratively applying adjoint gates to scan backwards through the circuit.

Note

The adjoint differentiation method has the following restrictions:

  • Cannot differentiate with respect to observables.

  • Observable being measured must have a matrix.

Parameters
  • tape (QuantumTape) – circuit that the function takes the gradient of

  • tangents (Tuple[Number]) – gradient vector for input parameters.

  • state (TensorLike) – the final state of the circuit; if not provided, the final state will be computed by executing the tape

Returns

gradient vector for output parameters

Return type

Tuple[Number]

Contents

Using PennyLane

Release news

Development

API

Internals