quri_parts.core.operator.grouping package#

PauliGrouping#

PauliGrouping represents a function that converts either an Operator or an Iterable of PauliLabel into groups of commutable Pauli operators (Iterable[CommutablePauliSet]).

alias of Callable[[Union[Operator, Iterable[PauliLabel]]], Iterable[Set[PauliLabel]]]

individual_pauli_grouping(paulis)#

An implementation of PauliGrouping, which creates a group for each of the PauliLabel’s (i.e. no grouping).

Parameters:

paulis (Operator | Iterable[PauliLabel]) –

Return type:

Iterable[core.operator.pauli.CommutablePauliSet]

bitwise_pauli_grouping(paulis)#

An implementation of PauliGrouping, which groups the PauliLabel’s based on bitwise commutability.

In this implementation, first the PauliLabel’s with only X, Y or Z are assigned to special groups (all X group, all Y group and all Z group). After that each PauliLabel is assigned to a group with greedy algorithm, meaning that it assigned to the first compatible group, i.e. all PauliLabel’s in the group bitwise-commute with the given PauliLabel.

Parameters:

paulis (Operator | Iterable[PauliLabel]) –

Return type:

Iterable[core.operator.pauli.CommutablePauliSet]

sorted_injection_grouping(paulis)#

An implementation of PauliGrouping, which groups the PauliLabel’s based on the sorted injection algorithm.

For more details refer https://arxiv.org/abs/1908.06942.

The core of the algorithm is to start grouping after sorting the operator list by the descending order of absolute value of their coefficients. The grouping is of operators that bitwise-commute with all the other operators in the group.

Parameters:

paulis (Operator | Iterable[PauliLabel]) –

Return type:

Iterable[core.operator.pauli.CommutablePauliSet]

Submodules#