Skip to content

Commit

Permalink
Merge pull request #154 from BoxiLi/doc_update
Browse files Browse the repository at this point in the history
Limit the precision of the probability in doc
  • Loading branch information
BoxiLi committed Jun 23, 2022
2 parents 73c4a9b + c49d565 commit daed76a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/source/qip-simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ outputs, we can use the :meth:`.QubitCircuit.run_statistics` function:
probabilities = result.get_probabilities()

for state, probability in zip(states, probabilities):
print("State:\n{}\nwith probability {}".format(state, probability))
print("State:\n{}\nwith probability {:.5f}".format(state, probability))

**Output**:

Expand All @@ -105,7 +105,7 @@ outputs, we can use the :meth:`.QubitCircuit.run_statistics` function:
[0.]
[0.]
[0.]]
with probability 0.3333325705416881
with probability 0.33333
State:
Quantum object: dims = [[2, 2, 2], [1, 1, 1]], shape = (8, 1), type = ket
Qobj data =
Expand All @@ -117,7 +117,7 @@ outputs, we can use the :meth:`.QubitCircuit.run_statistics` function:
[0.]
[0.]
[0.]]
with probability 0.3333325705416881
with probability 0.33333
State:
Quantum object: dims = [[2, 2, 2], [1, 1, 1]], shape = (8, 1), type = ket
Qobj data =
Expand All @@ -129,7 +129,7 @@ outputs, we can use the :meth:`.QubitCircuit.run_statistics` function:
[0.]
[0.]
[0.]]
with probability 0.33333485891662384
with probability 0.33333

The function returns a :class:`~.Result` object which contains
the output states.
Expand Down

0 comments on commit daed76a

Please sign in to comment.