Skip to main contentIBM Quantum Documentation

Gradient

qiskit.opflow.gradients.Gradient(grad_method='param_shift', **kwargs)

Bases: GradientBase

Deprecated: Convert an operator expression to the first-order gradient.

Deprecated since version 0.24.0

The class qiskit.opflow.gradients.gradient.Gradient is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/opflow_migration (opens in a new tab).


Attributes

grad_method

Returns CircuitGradient.

Returns

CircuitGradient.


Methods

convert

convert(operator, params=None)

Parameters

Returns

An operator whose evaluation yields the Gradient.

Raises

Return type

OperatorBase

get_gradient

get_gradient(operator, params)

Get the gradient for the given operator w.r.t. the given parameters

Parameters

Returns

Operator which represents the gradient w.r.t. the given params.

Raises

Return type

OperatorBase

Was this page helpful?