iqm.benchmarks.utils.marginal_distribution#
- iqm.benchmarks.utils.marginal_distribution(prob_dist_or_counts: Dict[str, float | int], indices: Iterable[int]) Dict[str, float] #
Compute the marginal distribution over specified bits (indices).
Params: - prob_dist (Dict[str, float | int]): A dictionary with keys being bitstrings and values are either probabilities or counts - indices (Iterable[int]): List of bit indices to marginalize over
Returns: - dict: A dictionary representing the marginal distribution over the specified bits.