PauliBasisChange.convert¶
- PauliBasisChange.convert(operator)[source]¶
Given a
PauliOp
, or an Operator containingPauliOps
if_traverse
is True, converts each Pauli into the basis specified by self._destination and a basis-change-circuit, callsreplacement_fn
with these two Operators, and replaces thePauliOps
with the output ofreplacement_fn
. For example, for the built-inoperator_replacement_fn
below, each PauliOp p will be replaced by the composition of the basis-change CliffordCircuitOp
c with the destination PauliOp d and c†, such that p = c·d·c†, up to global phase.- Parameters
operator (
OperatorBase
) – The Operator to convert.- Return type
- Returns
The converted Operator.