Skip to content

Commit

Permalink
add instatiation example
Browse files Browse the repository at this point in the history
  • Loading branch information
natestemen committed Oct 7, 2024
1 parent 8515dab commit 71a0a63
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mitiq/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ class MeasurementResult:
``tuple(range(self.nqubits))``, where ``self.nqubits``
is the bitstring length deduced from ``result``.
Example:
>>> mr = MeasurementResult(["001", "010", "001"])
>>> mr.get_counts()
{'001': 2, '010': 1}
Note:
Use caution when selecting the default option for ``qubit_indices``,
especially when estimating an :class:`.Observable`
Expand Down

0 comments on commit 71a0a63

Please sign in to comment.