qiskit.opflow.converters.AbelianGrouper¶

class
AbelianGrouper
(traverse=True)[código fonte]¶ The AbelianGrouper converts SummedOps into a sum of Abelian sums.
Meaning, it will traverse the Operator, and when it finds a SummedOp, it will evaluate which of the summed subOperators commute with one another. It will then convert each of the groups of commuting Operators into their own SummedOps, and return the sumofcommutingSummedOps. This is particularly useful for cases where mutually commuting groups can be handled similarly, as in the case of Pauli Expectations, where commuting Paulis have the same diagonalizing circuit rotation, or Pauli Evolutions, where commuting Paulis can be diagonalized together.
 Parâmetros
traverse (
bool
) – Whether to convert only the Operator passed toconvert
, or traverse down that Operator.

__init__
(traverse=True)[código fonte]¶  Parâmetros
traverse (
bool
) – Whether to convert only the Operator passed toconvert
, or traverse down that Operator.
Methods
__init__
([traverse]) type traverse
bool
convert
(operator)Check if operator is a SummedOp, in which case covert it into a sum of mutually commuting sums, or if the Operator contains subOperators and
traverse
is True, attempt to convert any subOperators.group_subops
(list_op)Given a ListOp, attempt to group into Abelian ListOps of the same type.

convert
(operator)[código fonte]¶ Check if operator is a SummedOp, in which case covert it into a sum of mutually commuting sums, or if the Operator contains subOperators and
traverse
is True, attempt to convert any subOperators. Parâmetros
operator (
OperatorBase
) – The Operator to attempt to convert. Tipo de retorno
OperatorBase
 Retorna
The converted Operator.

classmethod
group_subops
(list_op)[código fonte]¶ Given a ListOp, attempt to group into Abelian ListOps of the same type.
 Parâmetros
list_op (
Union
[ListOp
,PauliSumOp
]) – The Operator to group into Abelian groups Tipo de retorno
ListOp
 Retorna
The grouped Operator.
 Levanta
OpflowError – If any of list_op’s subops is not
PauliOp
.