German
Sprachen
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.algorithms.VQD.construct_expectation

VQD.construct_expectation(parameter, operator, return_expectation=False)[Quellcode]

Generate the ansatz circuit and expectation value measurement, and return their runnable composition.

Parameter
  • parameter (list[float] | list[Parameter] | np.ndarray) – Parameters for the ansatz circuit.

  • operator (OperatorBase) – Qubit operator of the Observable

  • return_expectation (bool) – If True, return the ExpectationBase expectation converter used in the construction of the expectation value. Useful e.g. to compute the standard deviation of the expectation value.

Rückgabe

The Operator equalling the measurement of the ansatz StateFn by the Observable’s expectation StateFn, and, optionally, the expectation converter.

Verursacht
  • AlgorithmError – If no operator has been provided.

  • AlgorithmError – If no expectation is passed and None could be inferred via the ExpectationFactory.

Rückgabetyp

OperatorBase | tuple[OperatorBase, ExpectationBase]