Gradient¶
-
class
Gradient
(grad_method='param_shift', **kwargs)[source]¶ Bases:
qiskit.aqua.operators.gradients.gradient_base.GradientBase
Convert an operator expression to the first-order gradient.
- Parameters
grad_method (
Union
[str
,CircuitGradient
]) – The method used to compute the state/probability gradient. Can be either'param_shift'
or'lin_comb'
or'fin_diff'
. Ignored for gradients w.r.t observable parameters.kwargs (dict) – Optional parameters for a CircuitGradient
- Raises
ValueError – If method !=
fin_diff
andepsilon
is not None.
Methods
- type operator
OperatorBase
Get the gradient for the given operator w.r.t.
Get a callable function which provides the respective gradient, Hessian or QFI for given parameter values.
Get the derivative of a parameter expression w.r.t.
Attributes
-
grad_method
¶ Returns
CircuitGradient
.- Return type
CircuitGradient
- Returns
CircuitGradient
.