From f8725ebffde52a493b91876057d914f0773fb539 Mon Sep 17 00:00:00 2001 From: nate stemen Date: Tue, 13 Aug 2024 16:04:49 -0400 Subject: [PATCH] add example of function usage --- mitiq/rem/inverse_confusion_matrix.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitiq/rem/inverse_confusion_matrix.py b/mitiq/rem/inverse_confusion_matrix.py index 8ab2fae32..b9e125ba8 100644 --- a/mitiq/rem/inverse_confusion_matrix.py +++ b/mitiq/rem/inverse_confusion_matrix.py @@ -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():