Skip to main content
IBM Quantum Platform
이 페이지는 Qiskit SDK 의 이전 버전에서 가져온 것으로, 최신 버전에는 존재하지 않습니다. 최신 버전으로 업데이트하시기를 권장합니다. 자세한 정보는 릴리스 정보를 참조하십시오.

Gradient

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

GitHub

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 in the Qiskit 1.0 release. For code migration guidelines, visit https://qisk.it/opflow_migration.


Attributes

grad_method

Returns CircuitGradient.

Returns

CircuitGradient.


Methods

convert

convert(operator, params=None)

Parameters

Returns

An operator whose evaluation yields the Gradient.

Raises

  • ValueError – If params contains a parameter not present in operator.
  • ValueError – If operator is not parameterized.

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

  • ValueError – If params contains a parameter not present in operator.
  • OpflowError – If the coefficient of the operator could not be reduced to 1.
  • OpflowError – If the differentiation of a combo_fn requires JAX but the package is not installed.
  • TypeError – If the operator does not include a StateFn given by a quantum circuit
  • Exception – Unintended code is reached
  • MissingOptionalLibraryError – jax not installed

Return type

OperatorBase

이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.