plot_expectation_value

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

Plot operator expectation values over the time evolution.

Parameters:
  • operator (Operator | ndarray | Array | str | List[Operator | ndarray | Array | str]) – Operator, square matrix, Pauli string, or list of these. Strings may include I, X, Y, Z (qubit subspace), x, y, z, 1, M symbols (full Hilbert space).

  • 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) – Title of the plot (optional)

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

  • in_qubit_subspace (bool) – If True plots in the qubit subspace; ignored when any operator string contains 1 or M.

  • source (str | None) – Explicit expectation-value source forwarded to expectation_value().

Note

X, Y and Z denote the Pauli operators in the qubit subspace. x, y and z denote the full-spin operators \(S_x\), \(S_y\) and \(S_z\). I denotes the qubit-subspace identity while 1 denotes the full-spin identity. M denotes the full-spin \(S_z^2\) operator (corresponding to the photoluminescence signal for the NV center).