iqm.benchmarks.coherence.coherence.calculate_probabilities

iqm.benchmarks.coherence.coherence.calculate_probabilities#

iqm.benchmarks.coherence.coherence.calculate_probabilities(counts: dict[str, int], nqubits: int, coherence_exp: str) Tuple[List[float], int]#

Calculate the number of times ‘0’ was measured for each qubit based on the provided counts.

Parameters:
  • counts (dict[str, int]) – A dictionary where keys are bitstrings representing measurement outcomes and values are the counts of those outcomes.

  • nqubits (int) – The number of qubits being measured.

  • coherence_exp (str) – A string indicating the coherence experiment type (‘t1’ or other).

Returns:

A tuple containing:
  • A list of occurrences of measuring ‘0’ for each qubit.

  • The total number of shots (measurements).

Return type:

tuple