Skip to content

Commit

Permalink
add example of function usage
Browse files Browse the repository at this point in the history
  • Loading branch information
natestemen committed Aug 13, 2024
1 parent 7570704 commit f8725eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mitiq/rem/inverse_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def sample_probability_vector(
Returns:
A list of sampled bitstrings.
Example:
>>> sample_probability_vector([0, 1/2, 1/4, 1/4], 4)
['01', '10', '11', '11']
"""
num_values = len(probability_vector)
if not np.log2(num_values).is_integer():
Expand Down

0 comments on commit f8725eb

Please sign in to comment.