plot_expectation_value

SimulationResult.plot_expectation_value(operator, shot='avg', basis='product', frame='rotating', title=None, ax=None, in_qubit_subspace=True)

Plot the expectation values of the operators corresponding the time evolved states from an initial state.

Parameters:
  • operator (Operator | ndarray | Array | str | List[Operator | ndarray | Array | str]) – Operator or input of Operator. Could be a list.

  • shot (str | int) – Specify the shot by its index, or use 'avg'.

  • basis (str) – Specify the basis, must be either 'product' or 'eigen'.

  • frame (str) – Specify the frame, must be either 'lab' or 'rotating'.

  • title (str | None) – Title of the plot (optional)

  • ax (axis | None) – Matplotlib axis for customization (optional)

  • in_qubit_subspace (bool) – Specify whether the operator defined in the qubit subspace.

Note

If the operator is given as Pauli string, in_qubit_subspace must be True.