Skip to content

Commit

Permalink
Merge pull request #169 from Zhaoyilunnn/master
Browse files Browse the repository at this point in the history
docs: update simulate API usage
  • Loading branch information
ScQ-Cloud committed Jun 4, 2024
2 parents 204208d + fcf3168 commit 8b02f0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ provide simple circuit similator
.. code:: python
from quafu import simulate
simu_res = simulate(qc, output="probabilities")
simu_res = simulate(qc)
simu_res.plot_probabilities()
|
Expand Down Expand Up @@ -335,9 +335,9 @@ small-endian instead.

.. code:: python
res = simulate(qc, output='state_vector')
print(res.state_vector[:2])
state_tensor = res.state_vector.reshape(tuple(n*[2])).transpose([-3, -2, -1])
res = simulate(qc)
print(res.get_statevector()[:2])
state_tensor = res.get_statevector().reshape(tuple(n*[2])).transpose([-3, -2, -1])
print(state_tensor[0, 0, 0])
print(state_tensor[0, 0, 1])
print(state_tensor[1, 0, 0])
Expand Down

0 comments on commit 8b02f0f

Please sign in to comment.