operator_from_string

Model.operator_from_string(string, in_qubit_subspace=False)

Return tensor product operator from an extended operator string.

Uppercase I/X/Y/Z refer to Pauli operators in qubit subspace, while lowercase x/y/z refer to full-space spin operators Sx/Sy/Sz. M denotes the full-space projector onto the m_s = 0 state.

Parameters:
  • string (str) – Operator string with one character per spin.

  • in_qubit_subspace (bool) – If True, interpret the string in the qubit subspace.

Raises:

SimphonyError – If the string contains an unsupported character or has the wrong length.

Return type:

ndarray | Array