virtual_phases_operator

Model.virtual_phases_operator(only_diag=False, in_qubit_subspace=False, inverse=False)

Return the operator corresponding the virtual z-phases:

\[U_\text{z-phase} = \prod_{i\in\text{spins}}e^{i \phi_i \sigma_{z,i}/2},\]

where \(\phi_i\) are the virtual z-phases of the spins and \(\sigma_{z,i}\) are the Pauli z-operators. Phases are specified in the Spin.virtual_phase attribute.

Parameters:
  • only_diag (bool) – If True, return only the diagonal of the operator.

  • in_qubit_subspace (bool) – If True, return only the operator projected to the qubit subspace.

  • inverse (bool) – If True, return the inverse of the operator.

Return type:

ndarray | Array

Returns:

Operator corresponding the virtual z-phases. Shape depends on the only_diag parameter.