Korean
언어
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.SparsePauliOp.from_list

static SparsePauliOp.from_list(obj, dtype=<class 'complex'>)[소스]

Construct from a list of Pauli strings and coefficients.

For example, the 5-qubit Hamiltonian

\[H = Z_1 X_4 + 2 Y_0 Y_3\]

can be constructed as

# via tuples and the full Pauli string
op = SparsePauliOp.from_list([("XIIZI", 1), ("IYIIY", 2)])
매개변수
  • obj (Iterable[Tuple[str, complex]]) – The list of 2-tuples specifying the Pauli terms.

  • dtype (type) – The dtype of coeffs (Default complex).

반환

The SparsePauliOp representation of the Pauli terms.

반환 형식

SparsePauliOp

예외 발생

QiskitError – If the list of Paulis is empty.