Spanish
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.SparsePauliOp.group_commuting

SparsePauliOp.group_commuting(qubit_wise=False)[fuente]

Partition a SparsePauliOp into sets of commuting Pauli strings.

Parámetros

qubit_wise (bool) –

whether the commutation rule is applied to the whole operator, or on a per-qubit basis. For example:

>>> op = SparsePauliOp.from_list([("XX", 2), ("YY", 1), ("IZ",2j), ("ZZ",1j)])
>>> op.group_commuting()
[SparsePauliOp(["IZ", "ZZ"], coeffs=[0.+2.j, 0.+1j]),
 SparsePauliOp(["XX", "YY"], coeffs=[2.+0.j, 1.+0.j])]
>>> op.group_commuting(qubit_wise=True)
[SparsePauliOp(['XX'], coeffs=[2.+0.j]),
 SparsePauliOp(['YY'], coeffs=[1.+0.j]),
 SparsePauliOp(['IZ', 'ZZ'], coeffs=[0.+2.j, 0.+1.j])]

Devuelve

List of SparsePauliOp where each SparsePauliOp contains

commuting Pauli operators.

Tipo del valor devuelto

List[SparsePauliOp]