[PYTHON] Read "Quantum computer made in 14 days". Third day

Introduction

This time, we will summarize the principle of superposition and electron wave packets.

3 Observation of electron wave packet

Superposition principle

The principle of superposition is that the function obtained by adding multiple solutions that satisfy the Schrodinger equation is also the solution of the Schrodinger equation. For example, according to the following distribution, prepare a wave function in which $ \ psi_k $ is superposed.

\psi(x,t)=\int_{-\infty}^{\infty}a(k)\varphi_k(x)e^{-i\omega(k)t}dk=\int_{-\infty}^{\infty}a(k)e^{ikx-i\omega(k)t}dk

Substituting this into the Schrodinger equation, the potential is 0 because it is a free space at this time.

i\hbar\frac{\partial}{\partial t}\int_{-\infty}^{\infty}a(k) e^{ikx-i\omega(k)t}dk=\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2}\int_{-\infty}^{\infty}a(k)e^{ikx-i\omega(k)t}dk
\int_{-\infty}^{\infty}a(k)\hbar \omega(k) e^{ikx-i\omega(k)t}dk=\int_{-\infty}^{\infty}a(k)\frac{\hbar^2k^2}{2m}e^{ikx-i\omega(k)t}dk
\int_{-\infty}^{\infty}a(k)\left[\hbar \omega(k)-\frac{\hbar^2 k^2}{2m}\right] e^{ikx-i\omega(k)t}dk=0

When the left side becomes zero regardless of all positions and times, the principle of superposition holds, so if you investigate the condition that the contents of parentheses become zero

\omega(k)=\frac{\hbar k^2}{2m}

This is the same as the definition of $ \ omega $ itself, so it always holds. In other words, it was shown that the principle of superposition always holds.

3.2 Observation of electron wave packets

Since $ a (k) $ can have any distribution, a (k) is a Gaussian distribution centered on an appropriate constant $ k_0 $.

a(k)=e^{-(\frac{k-k_0}{2\sigma})^2}

Let's plot the wave function at this time.

3.2.1 Constant

The new constants required here are

#Number of divisions in space
NX = 500
#Spatial division size
dx = 1.0e-9
#Calculation interval
x_min = -10.0 * dx
x_max = 10.0 * dx
#Number to overlap
NK = 200
#deviation of k
sigma = math.sqrt(math.log(2.0)) * 1.0e9
#Split k
dk = 20.0 / NK
#Central energy of wave packet
E0 = 10.0 * eV
#Center of wave packet
k0 = math.sqrt(2.0 * me * E0 / hbar ** 2)
omega0 = hbar / (2.0 * me) * k0 ** 2
#Width of calculation time
ts = -50
te = 50
#Time interval
dt = 1.0e-16
#Imaginary unit
I = 1.0j

3.2.2 Function definition

To make a plot, we need a function that outputs an array of graphs at a certain point in time t.

def dist_t(xl, t):
    psi_real = []
    psi_imag = []
    psi_abs = []
    for x in xl:
        #scaling
        psi_c = psi(x, t) * dx * dk / 10.0
        psi_real.append(psi_c.real)
        psi_imag.append(psi_c.imag)
        psi_abs.append(abs(psi_c))
    return psi_real, psi_imag, psi_abs

Then, we define a function psi that outputs the probability distribution when (x, t) is given.

def psi(x, t):
    psi_sum = 0.0 + 0.0j
    for kn in range(NK):
        #Get a constant
        k = k0 + dk * (kn - NK/2)
        omega = hbar / (2.0 * me) * k ** 2
        #Overlay
        psi_sum += cmath.exp(I * (k * x - omega * t)) * cmath.exp(-((k - k0) / (2.0 * sigma)) ** 2)
    return psi_sum

3.2.3 Animation plot

Plot is performed using these.

xl = np.linspace(x_min, x_max, NX)
#Array for animation creation
ims = []
fig1 = plt.figure(figsize=(10, 6))

for t in range(ts, te + 1):
    t_real = t * dt
    psi_real, psi_imag, psi_abs = dist_t(xl * dx, t)
    #Depiction of top
    img = plt.plot(xl, psi_real, 'red')
    img += plt.plot(xl, psi_imag, 'green')
    img += plt.plot(xl, psi_abs, 'blue')
    #Add a frame
    ims.append(img)

#Drawing a graph
plt.title("Gaussian wave packet(Spatial distribution)")
plt.xlabel("Position[nm]", fontsize=16)
plt.ylabel("Probability amplitude", fontsize=16)
#Drawing range
plt.xlim([-10.0, 10.0])
plt.ylim([-0.3, 0.3])
#Animation generation
ani = animation.ArtistAnimation(fig1, ims, fontsize=16)
ani.save("g_wave_packet.html", writer=animation.HTMLWriter())

plt.show()

3.3 The finished animation

↓ is the completed video. It can be observed that the width of the distribution widens as time goes by. g_wave_packet.gif

Recommended Posts

Read "Quantum computer made in 14 days". Third day
Read "Quantum computer made in 14 days". First day
Read "Quantum computer made in 14 days". the 2nd day
Read "Quantum computer made in 14 days". Day 5 Quantum well improvement / addition of barriers
Read "Basics of Quantum Annealing" Day 5
Read "Basics of Quantum Annealing" Day 6
Differentiation in computer
pickle To read what was made in 2 series with 3 series