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

qiskit.quantum_info.SparsePauliOp.group_commuting

SparsePauliOp.group_commuting(qubit_wise=False)[소스]

Partition a SparsePauliOp into sets of commuting Pauli strings.

매개변수

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])]

반환

List of SparsePauliOp where each SparsePauliOp contains

commuting Pauli operators.

반환 형식

List[SparsePauliOp]