from_dict

*static* PauliOperator.from_dict(pauli_dict, dtype=<class 'complex'>)

Construct from a dictionary containing Pauli strings and coefficients.

Parameters

  • pauli_dict (dict [ str , complex ]) – A dictionary specifying the Pauli terms.
  • dtype (type , optional) – The data type to be used for storing the coefficients. Defaults to complex.

Returns

PauliOperator – The constructed Pauli operator.

Return type

PauliOperator

Was this useful?