Python 量子運算(二):量子位元符號
2022/11/22
-----
Outline
一、使用 google drive
二、figure 與 axes
三、量子位元符號
四、代碼 2.1
-----
Fig. 2.1. Classical bit and quantum bit.
-----
一、使用 google drive
「
from google.colab import drive
drive.mount('/content/drive/')
!ls '/content/drive/My Drive/'
」[1]。
-----
二、figure 與 axes
「fig, ax = plt.subplots()
is more concise than this:
fig = plt.figure()
ax = fig.add_subplot(111)」[3]。
-----
三、量子位元符號
-----
四、代碼 2.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Program 2.1:cbit(classical bit) and qubit(quantum bit) import matplotlib.pyplot as plt fig = plt.figure(figsize=(16, 16)) ax = fig.add_subplot(111) ax.text(0.05, 0.6, "Classical Bit:", fontsize=60) ax.text(0.05, 0.4, "Quantum Bit:", fontsize=60, color="red") ax.text(0.65, 0.6, "0, 1", fontsize=60) ax.text(0.65, 0.4, r"$\vert0\rangle,\vert1\rangle$", fontsize=60, color="red") # Remove axis planes, ticks and labels ax.set_axis_off() # plt.savefig('/content/drive/My Drive/pqc/0002_001.png') plt.show() |
解說:
-----
References
# Colab
[1] 玩具烏托邦: 貴哥的 colab 初學筆記
https://newtoypia.blogspot.com/2019/07/colab.html
# fig ax plt
[2] matplotlib:先搞明白plt. /ax./ fig再畫- 知乎
https://zhuanlan.zhihu.com/p/93423829
# figure.add_subplot()
[3] Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python - Stack Overflow
# quantum bit
[4] 何為“量子”
http://www.quantum-sd.com/index.php?m=content&c=index&f=show&catid=5&l=1&id=19
# quantum bit
[5] 量子電腦設計原理
https://blog.heron.me/quantum-computing-c7633efa9030
# 狄拉克符號(Dirac notation)
[6] 02 - 量子狀態 (Quantum State) | Maojui
https://maojui.me/QuantumComputer/02-Quantum_State/
# 括量(ket)及包量(bra)
[7] 量子世界的基本數學 - 白話文量子演算法
https://chiwei955201314.gitbook.io/quantum/
# text
[8] python matplotlib中顯示latex數學公式 - 台部落
https://www.twblogs.net/a/5cc5a04cbd9eee1ac2ed43cd
# Delimiters ⟨ \langle
[9] Writing mathematical expressions — Matplotlib 3.6.0 documentation
https://matplotlib.org/stable/tutorials/text/mathtext.html
# axes
[10] Depicting a helix
https://scipython.com/book/chapter-7-matplotlib/examples/depicting-a-helix/
-----
Python 量子運算(目錄)
https://mandhistory.blogspot.com/2022/01/quantum-computing.html
-----
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。