WeightedPauliOperator.chop¶
- WeightedPauliOperator.chop(threshold=None, copy=False)[source]¶
Eliminate the real and imagine part of weight in each pauli by threshold. If pauli’s weight is less then threshold in both real and imaginary parts, the pauli is removed.
Note
If weight is real-only, the imaginary part is skipped.
- Parameters
threshold (float) – the threshold is used to remove the paulis
copy (bool) – chop on a copy or self
- Returns
- if copy is True, the original operator is unchanged; otherwise,
the operator is mutated.
- Return type