qiskit.result.marginal_distribution¶
- marginal_distribution(counts, indices=None, format_marginal=False)[소스]¶
Marginalize counts from an experiment over some indices of interest.
Unlike
marginal_counts()
this function respects the order of the inputindices
. If the inputindices
list is specified then the order the bit indices are specified will be the output order of the bitstrings in the marginalized output.- 매개변수
counts (dict) – result to be marginalized
indices (Optional[Sequence[int]]) – The bit positions of interest to marginalize over. If
None
(default), do not marginalize at all.format_marginal (bool) – Default: False. If True, takes the output of marginalize and formats it with placeholders between cregs and for non-indices.
- 반환
A marginalized dictionary
- 반환 형식
dict(str, int)
- 예외 발생
QiskitError – If any value in
indices
is invalid or thecounts
dictis invalid. –