GradientBase¶
-
class
GradientBase
(grad_method='param_shift', **kwargs)[source]¶ Bases:
qiskit.aqua.operators.gradients.derivative_base.DerivativeBase
Base class for first-order operator gradient.
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 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
.