Python 量子運算(五):布洛赫球面
2022/11/14
-----
Fig. 5.1. The Bloch sphere.
-----
代碼 5.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Program 5.1:Bloch sphere import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from qiskit.visualization import plot_bloch_vector mpl.rcParams['text.usetex'] = True mpl.rcParams['text.latex.preamble'] = r'\usepackage{{amsmath}}' mpl.rcParams['font.size'] = 80 fig = plt.figure(figsize=(16, 16)) ax1 = fig.add_subplot(111, projection='3d') plot_bloch_vector([0, 0, 1], ax=ax1) ax1.text(0, -1.8, 0, r"$x$") ax1.text(1.4, 0, 0, r"$y$") ax1.text(0, 0, 1.4, r"$\vert0\rangle$") ax1.text(0, 0, -1.8, r"$\vert1\rangle$") # plt.savefig('/content/drive/My Drive/pqc/0005_001.png') |
解說:
-----
References
[1] qiskit.visualization.plot_bloch_vector — Qiskit 0.39.2 documentation
https://qiskit.org/documentation/stubs/qiskit.visualization.plot_bloch_vector.html
[2] 發現自然之美:諾貝爾物理獎1952 - 發現自然之美:諾貝爾物理獎 - 新聞訊息 - 物理雙月刊
https://pb.ps-taiwan.org/modules/news/article.php?storyid=571
-----
Python 量子運算(目錄)
https://mandhistory.blogspot.com/2022/01/quantum-computing.html
-----
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。