qiskit.aqua.operators.gradients.CircuitGradient¶
-
class
CircuitGradient
[ソース]¶ Circuit to gradient operator converter.
Converter for changing parameterized circuits into operators whose evaluation yields the gradient with respect to the circuit parameters.
This is distinct from DerivativeBase converters which take gradients of composite operators and handle things like differentiating combo_fn’s and enforcing product rules when operator coefficients are parameterized.
CircuitGradient - uses quantum techniques to get derivatives of circuits DerivativeBase - uses classical techniques to differentiate operator flow data structures
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
()Initialize self.
convert
(operator[, params])- type operator
OperatorBase
-
abstract
convert
(operator, params=None)[ソース]¶ - パラメータ
operator (
OperatorBase
) – The operator we are taking the gradient ofparams (
Union
[ParameterExpression
,ParameterVector
,List
[ParameterExpression
],Tuple
[ParameterExpression
,ParameterExpression
],List
[Tuple
[ParameterExpression
,ParameterExpression
]],None
]) – The parameters we are taking the gradient wrt: ω If a ParameterExpression, ParameterVector or List[ParameterExpression] is given, then the 1st order derivative of the operator is calculated. If a Tuple[ParameterExpression, ParameterExpression] or List[Tuple[ParameterExpression, ParameterExpression]] is given, then the 2nd order derivative of the operator is calculated.
- 戻り値の型
OperatorBase
- 戻り値
An operator whose evaluation yields the Gradient.
- 例外
ValueError – If
params
contains a parameter not present inoperator
.
-