quri_parts.algo.mitigation.post_selection.post_selection module#

quri_parts.algo.mitigation.post_selection.post_selection.PostSelectionFilterFunction#

Represents a filter function for post-selection.

alias of Callable[[int], bool]

quri_parts.algo.mitigation.post_selection.post_selection.post_selection(filter_fn: Callable[[int], bool], meas_counts: Mapping[int, int | float]) Mapping[int, int | float]#

Functions that filter out unwanted measurement results from given meas_counts.

quri_parts.algo.mitigation.post_selection.post_selection.create_general_post_selection_sampler(sampler: Callable[[NonParametricQuantumCircuit, int], Mapping[int, int | float]], filter_fn: Callable[[int], bool]) Callable[[NonParametricQuantumCircuit, int], Mapping[int, int | float]]#

Returns `class`:Sampler: that performs post-selection after sampling.

Note that the effective shots might decrease by discarding the measurement results which do not pass filter_fn.