Skip to content

Commit

Permalink
fix: default 0 when outcome is missing from frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Feb 13, 2025
1 parent aff0f19 commit 2066950
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qibocal/protocols/process_tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def calculate_probabilities(samples: npt.NDArray) -> npt.NDArray:
freqs = {"".join([str(x) for x in v]): c for v, c in zip(values, counts)}
assert sum(freqs.values()) == nshots
outcomes = ["{:b}".format(x).zfill(nqubits) for x in range(2**nqubits)]
return np.array([freqs[x] / nshots for x in outcomes])
return np.array([freqs.get(x, 0) / nshots for x in outcomes])


def _acquisition(
Expand Down

0 comments on commit 2066950

Please sign in to comment.