qml.pauli.partition_pauli_group

partition_pauli_group(n_qubits: int)List[List[str]][source]

Partitions the \(n\)-qubit Pauli group into qubit-wise commuting terms.

The \(n\)-qubit Pauli group is composed of \(4^{n}\) terms that can be partitioned into \(3^{n}\) qubit-wise commuting groups.

Parameters

n_qubits (int) – number of qubits

Returns

A collection of qubit-wise commuting groups containing Pauli words as strings

Return type

List[List[str]]

Example

>>> qml.pauli.partition_pauli_group(3)
[['III', 'IIZ', 'IZI', 'IZZ', 'ZII', 'ZIZ', 'ZZI', 'ZZZ'],
 ['IIX', 'IZX', 'ZIX', 'ZZX'],
 ['IIY', 'IZY', 'ZIY', 'ZZY'],
 ['IXI', 'IXZ', 'ZXI', 'ZXZ'],
 ['IXX', 'ZXX'],
 ['IXY', 'ZXY'],
 ['IYI', 'IYZ', 'ZYI', 'ZYZ'],
 ['IYX', 'ZYX'],
 ['IYY', 'ZYY'],
 ['XII', 'XIZ', 'XZI', 'XZZ'],
 ['XIX', 'XZX'],
 ['XIY', 'XZY'],
 ['XXI', 'XXZ'],
 ['XXX'],
 ['XXY'],
 ['XYI', 'XYZ'],
 ['XYX'],
 ['XYY'],
 ['YII', 'YIZ', 'YZI', 'YZZ'],
 ['YIX', 'YZX'],
 ['YIY', 'YZY'],
 ['YXI', 'YXZ'],
 ['YXX'],
 ['YXY'],
 ['YYI', 'YYZ'],
 ['YYX'],
 ['YYY']]