German
Sprachen
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.PauliList.group_commuting

PauliList.group_commuting(qubit_wise=False)[Quellcode]

Partition a PauliList into sets of commuting Pauli strings.

Parameter

qubit_wise (bool) –

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

>>> from qiskit.quantum_info import PauliList
>>> op = PauliList(["XX", "YY", "IZ", "ZZ"])
>>> op.group_commuting()
[PauliList(['XX', 'YY']), PauliList(['IZ', 'ZZ'])]
>>> op.group_commuting(qubit_wise=True)
[PauliList(['XX']), PauliList(['YY']), PauliList(['IZ', 'ZZ'])]

Rückgabe

List of PauliLists where each PauliList contains commuting Pauli operators.

Rückgabetyp

List[PauliList]