【第20話】【はやくち解説】共鳴透過現象ってなに?【Pythonコピペで量子力学完全攻略マニュアル】

#################################################################
## 透過率と反射率の入射角依存性のグラフ描画(E = 2.0[eV])
#################################################################
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mat
import matplotlib.animation as animation

#図全体
fig = plt.figure(figsize=(15, 8))
#全体設定
plt.rcParams['font.family'] = 'Times New Roman' #フォント
plt.rcParams['font.size'] = 24 #フォントサイズ
plt.rcParams["mathtext.fontset"] = 'cm' #数式用フォント
#カラーリストの取得
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']

#虚数単位
I = 0.0 + 1.0j

######################################
# 物理定数
######################################
#プランク定数
h = 6.6260896 * 10**-34
hbar = h / (2.0 * np.pi)
#電子の質量
me = 9.10938215 * 10**-31
#電子ボルト
eV = 1.60217733 * 10**-19

######################################
# 物理系の設定
######################################
#電子のエネルギー
E = 2.0 * eV
#波数
k = np.sqrt(2.0 * me * E / hbar**2 )
#空間刻み間隔
nm = 1E-9
#壁の高さ
V1 = 0.0 * eV
V2 = 1.0 * eV
V3 = 0.0 * eV
#壁の幅
d = 2.0 * nm
#波数の計算
k1 = np.sqrt(np.complex128( 2.0 * me * (E - V1) / hbar**2 ))
k2 = np.sqrt(np.complex128( 2.0 * me * (E - V2) / hbar**2 ))
k3 = np.sqrt(np.complex128( 2.0 * me * (E - V3) / hbar**2 ))

######################################
# 反射係数と透過係数を計算する関数定義
######################################
def ReflectionCoefficient( MM ):
    return - MM[1][0] / MM[1][1] 
def TransmissionCoefficient(MM):
    return (MM[0][0] * MM[1][1] - MM[0][1] * MM[1][0] ) / MM[1][1]
def calculateCoefficient( k1, k2, k3, cos1, cos2, cos3, d):
    # 転送行列の定義
    M21 = np.zeros((2,2), dtype=np.complex)
    T2  = np.zeros((2,2), dtype=np.complex)
    M32 = np.zeros((2,2), dtype=np.complex)
    # 境界
    M21[0][0] = (1.0 + 0.0j + ( k1 * cos1 ) / ( k2 * cos2 ) ) / 2.0
    M21[0][1] = (1.0 + 0.0j - ( k1 * cos1 ) / ( k2 * cos2 ) ) / 2.0
    M21[1][0] = (1.0 + 0.0j - ( k1 * cos1 ) / ( k2 * cos2 ) ) / 2.0
    M21[1][1] = (1.0 + 0.0j + ( k1 * cos1 ) / ( k2 * cos2 ) ) / 2.0
    M32[0][0] = (1.0 + 0.0j + ( k2 * cos2 ) / ( k3 * cos3 ) ) / 2.0
    M32[0][1] = (1.0 + 0.0j - ( k2 * cos2 ) / ( k3 * cos3 ) ) / 2.0
    M32[1][0] = (1.0 + 0.0j - ( k2 * cos2 ) / ( k3 * cos3 ) ) / 2.0
    M32[1][1] = (1.0 + 0.0j + ( k2 * cos2 ) / ( k3 * cos3 ) ) / 2.0
    T2[0][0] = np.exp( I * k2 * cos2 * d )
    T2[0][1] = 0
    T2[1][0] = 0
    T2[1][1] = np.exp( - I * k2 * cos2 * d )
    #転送行列の計算
    M31 = M32 @ T2 @ M21
    #反射係数と透過係数の計算
    rc = ReflectionCoefficient(M31)
    tc = TransmissionCoefficient(M31)
    return rc, tc

#################################################################
## 透過率と反射率の壁の厚さ依存性のグラフ描画
#################################################################

#角度の計算範囲
theta_min = 0
theta_max = 89
#計算点数
NK = 891

#壁の厚さの行列
thetas = np.linspace(theta_min, theta_max, NK)
#
Rs = []
Ts = []
for theta in thetas:
    theta = theta / 180 * np.pi

    sin1 = np.sin(theta) * k / k1
    sin2 = np.sin(theta) * k / k2
    sin3 = np.sin(theta) * k / k3
    cos1 = np.sqrt(np.complex128( 1.0 - sin1**2 ))
    cos2 = np.sqrt(np.complex128( 1.0 - sin2**2 ))
    cos3 = np.sqrt(np.complex128( 1.0 - sin3**2 ))

    rc, tc = calculateCoefficient( k1, k2, k3, cos1, cos2, cos3, d )
    print( round( theta / np.pi * 180, 2 ) , abs(tc)**2 )
    Rs.append( abs(rc)**2 )
    Ts.append( abs(tc)**2 )

#グラフの描画(固有関数)
plt.title( u"透過率と反射率の入射角依存性(" + r"$E=2.0[{\rm eV}]$" + ", " + r"$V=1.0[{\rm eV}]$" + ", " + r"$d=2.0[{\rm nm}]$" + u")", fontsize=20, fontname="Yu Gothic", fontweight=1000)
plt.xlabel(u"入射角" + r"$[{}^{\circ}]$"  ,  fontname="Yu Gothic", fontsize=20, fontweight=1000)
plt.ylabel(u"反射率と透過率", fontname="Yu Gothic", fontsize=20, fontweight=1000)

#罫線の描画
plt.grid(which = "major", axis = "x", alpha = 0.8, linestyle = "-", linewidth = 1)
plt.grid(which = "major", axis = "y", alpha = 0.8, linestyle = "-", linewidth = 1)

#描画範囲を設定
plt.xlim([0, 90])
plt.ylim([0, 1])

#波数分布グラフの描画
plt.plot(thetas, Rs, linestyle='solid', linewidth = 5)
plt.plot(thetas, Ts, linestyle='solid', linewidth = 5)

#グラフの表示
plt.show()

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です