2023年1月2日 星期一

Python 量子運算(一三):狄拉克標記

Python 量子運算(一三):狄拉克標記

2022/12/07

-----


Fig. 13.1. Dirac notation (p. 62) [1].

-----

代碼 13.1


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Program 13.1:Dirac notation
import matplotlib as mpl
import matplotlib.pyplot as plt

# figure setting
mpl.rcParams['text.usetex'] = True
mpl.rcParams['text.latex.preamble'] = r'\usepackage{{amsmath}}'
mpl.rcParams['font.size'] = 40
fig, ax = plt.subplots(figsize=(16, 16))

# Notation
nttn = ['Notation',
        r'$z^*$',
        r'$\vert\psi\rangle$',
        r'$\langle\psi\vert$',
        r'$\langle\phi\vert\psi\rangle$',
        r'$\vert\phi\rangle\bigotimes\vert\psi\rangle$',
        r'$\vert\phi\rangle\vert\psi\rangle$',
        r'$A^*$',
        r'$A^T$',
        r'$A^\dag$',
        r'$\langle\phi\vert A\vert\psi\rangle$'
        ]

# Description
dctn = ['Description',
        r'${\rm Complex\ conjugate\ of\ the\ complex\ number}\ z.$',  # 1
        r'${\rm Vector.\ Also\ known\ as\ a\ }ket.$',                 # 2
        r'${\rm Vector\ dual\ to\ \vert\psi\rangle.'                  # 3
        r'\ Also\ known\ as\ a\ }bra.$',                              # 3
        r'${\rm Inner\ product\ between\ '                            # 4
        r'\vert\phi\rangle\ and\ \vert\psi\rangle.}$',                # 4
        r'${\rm Tensor\ product\ of\ '                                # 5
        r'\vert\phi\rangle\ and\ \vert\psi\rangle.}$',                # 5
        r'${\rm Tensor\ product\ of\ '                                # 6
        r'\vert\phi\rangle\ and\ \vert\psi\rangle.}$',                # 6
        r'${\rm Complex\ conjugate\ of\ the\ }A\ {\rm matrix}.$',     # 7
        r'${\rm Transpose\ of\ the\ }A\ {\rm matrix}.$',              # 8
        r'${\rm Hermitian\ conjugate\ or\ adjoint,\ }$'               # 9
        r'$A^\dag=(A^T)^*.$',                                         # 9
        r'${\rm Inner\ product\ between\ '                            # 10
        r'\vert\phi\rangle\ and\ }A\vert\psi\rangle.$']               # 10

for i in range(11):
    ax.text(0.05, 1-0.1*i, nttn[i])
    ax.text(0.25, 1-0.1*i, dctn[i])

ax.set_axis_off()

# plt.savefig('/content/drive/My Drive/pqc/0013_001.png')
plt.show()

解說:

-----

References


[1] Quantum Computation and Quantum Information

https://www.amazon.com/Quantum-Computation-Information-10th-Anniversary/dp/1107002176


[2] Dirac notation - Azure Quantum | Microsoft Learn

https://learn.microsoft.com/en-us/azure/quantum/concepts-dirac-notation


[3] 量子世界的基本數學 - 白話文量子演算法

https://chiwei955201314.gitbook.io/quantum/

-----

Python 量子運算(目錄)

https://mandhistory.blogspot.com/2022/01/quantum-computing.html

-----

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。