Hessian#

class qiskit.opflow.gradients.Hessian(hess_method='param_shift', **kwargs)[소스]#

기반 클래스: HessianBase

Deprecated: Compute the Hessian of an expected value.

버전 0.24.0부터 폐지됨: The class qiskit.opflow.gradients.hessian.Hessian 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.

Attributes

hess_method#

Returns CircuitGradient.

반환:

CircuitGradient.

Methods

convert(operator, params=None)[소스]#
매개변수:
반환:

An operator whose evaluation yields the Hessian

반환 형식:

OperatorBase

get_hessian(operator, params=None)[소스]#

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

매개변수:
반환:

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

예외 발생:
  • ValueError – If params contains a parameter not present in operator.

  • ValueError – If operator is not parameterized.

  • 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

  • TypeError – If the parameters were given in an unsupported format.

  • Exception – Unintended code is reached

  • MissingOptionalLibraryError – jax not installed

반환 형식:

OperatorBase