truncate_binary_search¶
- truncate_binary_search(observable, budget, *, p_norm=1)[source]¶
Perform binary search to find an optimal observable truncation threshold.
Removes the Pauli terms from a
SparsePauliOp
whose sum of their absolute coefficients values does not exceed the provided errorbudget
.- Parameters:
observable (SparsePauliOp) – the
SparsePauliOp
to truncate terms from.budget (float) – the maximum permissable truncation error.
p_norm (int) – an integer specifying what p-norm to use.
- Returns:
The truncated observable and a bound on the incurred truncation error.
Note
The incurred truncation error bound, \(E\), is calculated as the
p-norm
of the truncated terms’ coefficient magnitudes, \(c\), such that \(E = \|c\|_p\).- Return type: