Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

Hessian

class qiskit.opflow.gradients.Hessian(hess_method='param_shift', **kwargs)

GitHub

Bases: HessianBase

Deprecated: Compute the Hessian of an expected value.

Deprecated since version 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.

Returns

CircuitGradient.


Methods

convert

convert(operator, params=None)

Parameters

Returns

An operator whose evaluation yields the Hessian

Return type

OperatorBase

get_hessian

get_hessian(operator, params=None)

Get the Hessian 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.
  • 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

Return type

OperatorBase

Was this page helpful?
Report a bug or request content on GitHub.