qiskit.quantum_info.SparsePauliOp.to_list¶
- SparsePauliOp.to_list(array=False)[source]¶
Convert to a list Pauli string labels and coefficients.
For operators with a lot of terms converting using the
array=True
kwarg will be more efficient since it allocates memory for the full Numpy array of labels in advance.- Paramètres
array (bool) – return a Numpy array if True, otherwise return a list (Default: False).
- Renvoie
List of pairs (label, coeff) for rows of the PauliList.
- Type renvoyé
list or array