Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

marginal_counts

marginal_counts(counts, meas_qubits=True, pad_zeros=False) GitHub(opens in a new tab)

Compute marginal counts from a counts dictionary.

Parameters

  • counts (Dict[str, int]) – a counts dictionary.
  • meas_qubits (Union[bool, List[int]]) – (default: True) the qubits to NOT be marinalized over if this is True meas_qubits will be all measured qubits.
  • pad_zeros (bool) – (default: False) Include zero count outcomes in return dict.

Return type

Dict[str, int]

Returns

A counts dictionary for the specified qubits. The returned dictionary will have any whitespace trimmed from the input counts keys. Thus if meas_qubits=True the returned dictionary will have the same values as the input dictionary, but with whitespace trimmed from the keys.

Was this page helpful?