qiskit.quantum_info.SparsePauliOp.to_list¶
- SparsePauliOp.to_list(array=False)[Quellcode]¶
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.- Parameter
array (bool) – return a Numpy array if True, otherwise return a list (Default: False).
- Rückgabe
List of pairs (label, coeff) for rows of the PauliList.
- Rückgabetyp
list or array