51 lines
5.6 KiB
Plaintext
51 lines
5.6 KiB
Plaintext
---
|
||
title: gradients
|
||
description: API reference for qiskit.algorithms.gradients
|
||
in_page_toc_min_heading_level: 2
|
||
python_api_type: module
|
||
python_api_name: qiskit.algorithms.gradients
|
||
---
|
||
|
||
<span id="qiskit-algorithms-gradients" />
|
||
|
||
# qiskit.algorithms.gradients
|
||
|
||
## Gradients
|
||
|
||
<span id="module-qiskit.algorithms.gradients" />
|
||
|
||
`qiskit.algorithms.gradients`
|
||
|
||
### Base Classes
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||
| [`BaseSamplerGradient`](qiskit.algorithms.gradients.BaseSamplerGradient "qiskit.algorithms.gradients.BaseSamplerGradient")(sampler\[, options]) | Base class for a `SamplerGradient` to compute the gradients of the sampling probability. |
|
||
| [`BaseEstimatorGradient`](qiskit.algorithms.gradients.BaseEstimatorGradient "qiskit.algorithms.gradients.BaseEstimatorGradient")(estimator\[, options]) | Base class for an `EstimatorGradient` to compute the gradients of the expectation value. |
|
||
|
||
### Estimator Gradients
|
||
|
||
| | |
|
||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||
| [`FiniteDiffEstimatorGradient`](qiskit.algorithms.gradients.FiniteDiffEstimatorGradient "qiskit.algorithms.gradients.FiniteDiffEstimatorGradient")(estimator, ...) | Compute the gradients of the expectation values by finite difference method. |
|
||
| [`LinCombEstimatorGradient`](qiskit.algorithms.gradients.LinCombEstimatorGradient "qiskit.algorithms.gradients.LinCombEstimatorGradient")(estimator, \*\*options) | Compute the gradients of the expectation values. |
|
||
| [`ParamShiftEstimatorGradient`](qiskit.algorithms.gradients.ParamShiftEstimatorGradient "qiskit.algorithms.gradients.ParamShiftEstimatorGradient")(estimator, \*\*options) | Compute the gradients of the expectation values by the parameter shift rule |
|
||
| [`SPSAEstimatorGradient`](qiskit.algorithms.gradients.SPSAEstimatorGradient "qiskit.algorithms.gradients.SPSAEstimatorGradient")(estimator, epsilon\[, ...]) | Compute the gradients of the expectation value by the Simultaneous Perturbation Stochastic Approximation (SPSA). |
|
||
|
||
### Sampler Gradients
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||
| [`FiniteDiffSamplerGradient`](qiskit.algorithms.gradients.FiniteDiffSamplerGradient "qiskit.algorithms.gradients.FiniteDiffSamplerGradient")(sampler, epsilon, ...) | Compute the gradients of the sampling probability by finite difference method. |
|
||
| [`LinCombSamplerGradient`](qiskit.algorithms.gradients.LinCombSamplerGradient "qiskit.algorithms.gradients.LinCombSamplerGradient")(sampler, \*\*options) | Compute the gradients of the sampling probability. |
|
||
| [`ParamShiftSamplerGradient`](qiskit.algorithms.gradients.ParamShiftSamplerGradient "qiskit.algorithms.gradients.ParamShiftSamplerGradient")(sampler, \*\*options) | Compute the gradients of the sampling probability by the parameter shift rule. |
|
||
| [`SPSASamplerGradient`](qiskit.algorithms.gradients.SPSASamplerGradient "qiskit.algorithms.gradients.SPSASamplerGradient")(sampler, epsilon\[, ...]) | Compute the gradients of the sampling probability by the Simultaneous Perturbation Stochastic Approximation (SPSA). |
|
||
|
||
### Results
|
||
|
||
| | |
|
||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
|
||
| [`EstimatorGradientResult`](qiskit.algorithms.gradients.EstimatorGradientResult "qiskit.algorithms.gradients.EstimatorGradientResult")(gradients, metadata, ...) | Result of EstimatorGradient. |
|
||
| [`SamplerGradientResult`](qiskit.algorithms.gradients.SamplerGradientResult "qiskit.algorithms.gradients.SamplerGradientResult")(gradients, metadata, ...) | Result of SamplerGradient. |
|
||
|