French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.SparsePauliOp.sum

static SparsePauliOp.sum(ops)[source]

Sum of SparsePauliOps.

This is a specialized version of the builtin sum function for SparsePauliOp with smaller overhead.

Paramètres

ops (list[SparsePauliOp]) – a list of SparsePauliOps.

Renvoie

the SparsePauliOp representing the sum of the input list.

Type renvoyé

SparsePauliOp

Lève
  • QiskitError – if the input list is empty.

  • QiskitError – if the input list includes an object that is not SparsePauliOp.

  • QiskitError – if the numbers of qubits of the objects in the input list do not match.