iqm.error_reduction_tools.rem.rem_processors.estimate_counts_entropy

iqm.error_reduction_tools.rem.rem_processors.estimate_counts_entropy#

iqm.error_reduction_tools.rem.rem_processors.estimate_counts_entropy(counts)#

Estimate the Shannon entropy of the measurement probability distribution.

Computes \(H = -\\sum_i p_i \\log_2(p_i)\) from the observed counts which quantifies the spread of the distribution. Higher entropy means more unique outcomes with similar probabilities, making mitigation more expensive.

Parameters:

counts (dict[str, int]) – Dictionary mapping bitstrings to their measured counts.

Returns:

Shannon entropy in bits. Ranges from 0 (single outcome) to \(\\log_2(N)\) where N is the number of unique bitstrings.

Return type:

float