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

CVaRExpectation

class qiskit.opflow.expectations.CVaRExpectation(alpha, expectation=None)

GitHub

Bases: ExpectationBase

Deprecated: Compute the Conditional Value at Risk (CVaR) expectation value.

The standard approach to calculating the expectation value of a Hamiltonian w.r.t. a state is to take the sample mean of the measurement outcomes. This corresponds to an estimator of the energy. However in several problem settings with a diagonal Hamiltonian, e.g. in combinatorial optimization where the Hamiltonian encodes a cost function, we are not interested in calculating the energy but in the lowest possible value we can find.

To this end, we might consider using the best observed sample as a cost function during variational optimization. The issue here, is that this can result in a non-smooth optimization surface. To resolve this issue, we can smooth the optimization surface by using not just the best observed sample, but instead average over some fraction of best observed samples. This is exactly what the CVaR estimator accomplishes [1].

It is empirically shown, that this can lead to faster convergence for combinatorial optimization problems.

Let α\alpha be a real number in [0,1][0,1] which specifies the fraction of best observed samples which are used to compute the objective function. Observe that if α=1\alpha = 1, CVaR is equivalent to a standard expectation value. Similarly, if α=0\alpha = 0, then CVaR corresponds to using the best observed sample. Intermediate values of α\alpha interpolate between these two objective functions.

References

[1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S.,

“Improving Variational Quantum Optimization using CVaR” arXiv:1907.04769

Deprecated since version 0.24.0

The class qiskit.opflow.expectations.cvar_expectation.CVaRExpectation 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.

Parameters

  • alpha (float) – The alpha value describing the quantile considered in the expectation value.
  • expectation (ExpectationBase | None) – An expectation object to compute the expectation value. Defaults to the PauliExpectation calculation.

Raises

NotImplementedError – If the expectation is an AerPauliExpecation.


Methods

compute_variance

compute_variance(exp_op)

Returns the variance of the CVaR calculation

Parameters

exp_op (OperatorBase) – The operator whose evaluation yields an expectation of some StateFn against a diagonal observable.

Returns

The variance of the CVaR estimate corresponding to the converted

exp_op.

Raises

ValueError – If the exp_op does not correspond to an expectation value.

Return type

list | float

convert

convert(operator)

Return an expression that computes the CVaR expectation upon calling eval. :param operator: The operator to convert.

Returns

The converted operator.

Return type

OperatorBase

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