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

ExpectationFactory

class qiskit.opflow.expectations.ExpectationFactory

GitHub

Bases: object

Deprecated: factory class for convenient automatic selection of an Expectation based on the Operator to be converted and backend used to sample the expectation value.


Methods

build

static build(operator, backend=None, include_custom=True)

A factory method for convenient automatic selection of an Expectation based on the Operator to be converted and backend used to sample the expectation value.

Deprecated since version 0.24.0

The method qiskit.opflow.expectations.expectation_factory.ExpectationFactory.build() 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

  • operator (OperatorBase) – The Operator whose expectation value will be taken.
  • backend (Backend |QuantumInstance | None) – The backend which will be used to sample the expectation value.
  • include_custom (bool) – Whether the factory will include the (Aer) specific custom expectations if their behavior against the backend might not be as expected. For instance when using Aer qasm_simulator with paulis the Aer snapshot can be used but the outcome lacks shot noise and hence does not intuitively behave overall as people might expect when choosing a qasm_simulator. It is however fast as long as the more state vector like behavior is acceptable.

Returns

The expectation algorithm which best fits the Operator and backend.

Raises

ValueError – If operator is not of a composition for which we know the best Expectation method.

Return type

ExpectationBase

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