Peeping in Python, not scary quantum mechanics 1: Infinite particle potential

Target

I think the content is suitable for those who have learned quantum mechanics in class or who have learned it by themselves. Is it about undergraduate students in science? It is better if you like programming! It's not for people who don't know quantum mechanics at all, so don't be afraid ...

Summary

When it comes to quantum mechanics classes, I think there are many people who say, "I ended up with a lot of terrible calculations and I couldn't understand the concept."

There are two types of quantum mechanics, the "conceptual wall" and the "mathematical wall", Professor Maeno's book 81% 8F% E3% 82% 8F% E3% 81% 8B% E3% 82% 8B% E9% 87% 8F% E5% AD% 90% E5% 8A% 9B% E5% AD% A6-% E5% 89 % 8D% E9% 87% 8E-% E6% 98% 8C% E5% BC% 98 / dp / 4489020961) I think that's right. Certainly it's hard to get used to the concept of quantum mechanics. I think it's like reading a lot of textbooks and finally understanding it. However, in the process, the "math wall" gets in the way. This is very troublesome for beginners. So, in many cases, the "concept" is blown out of my head while trying to go beyond "math". Conversely, if only either "math" or "concept" is used, it is insanely troublesome. No [^ 1]. ** Moreover, the basics of mathematics in quantum mechanics are linear algebra as learned in the undergraduate school. **

So how that simple linear algebra turns into that horrifying calculation is because "** I'm trying to solve the Schroedinger equation analytically **". But this calculation is not the essence of physics after all. The important thing is

  1. The equations handled in quantum mechanics are the "stationary Schroedinger equation" and the "time-dependent Schroedinger equation" [^ 2]

  2. The former is an "eigenvalue equation" and the latter is a "linear differential equation"

If you know that it is an "eigenvalue equation" or a "linear differential equation", you do not need to learn how to solve it (if it is not a test). Look at the "result of solving the eigenvalue equation" and it is physical. It is more important to consider. If you can understand physics, if you can grasp the scenario, you will be able to understand the process of mathematics.

Let's borrow the power of Python to understand this physics. "Equation of eigenvalue" and "Linear differential equation" do not depend on the form. ** Numerical calculation can be solved by the same algorithm. ** "Equation of eigenvalue" Uses numpy (scipy) .linalg.eigh," linear differential equations "uses scipy.integrate.odeint, scipy.fftpack.fft, ifft, etc." How to solve this problem analytically? Let's put it off. Let's solve it numerically first, and then think about it physically.

Even if you don't understand Python, I think it's okay if you can understand C language reasonably. About the numerical calculation method in Python

Speeding up numerical calculation using NumPy: Basics Speeding up numerical calculation using NumPy / SciPy: Application 1 Speeding up numerical calculation using NumPy / SciPy: Application 2

If you look at such things, you may be able to grasp the nuances.

Where to aim

  1. What is the equation to solve
  2. Try to solve by numerical calculation
  3. Consider by looking at the value / graph
  4. Comparison with analytical solution

I will proceed in the order of. I will not go into the analysis method so deeply. Please refer to the textbook. ** Quantum mechanics should be advanced by advocating a mere linear algebra ** [^ 3].

Infinite well type potential

Consider the energy of a particle confined in a one-dimensional space. What we need to solve is the stationary Schroedinger equation, the eigenvalue equation:

H\psi_\ell(x) = \left(-\frac{\hbar^2}{2m}\frac{d^2}{dx^2} + V(x)\right)\psi_\ell(x) = E_\ell\psi_\ell(x)\\
V(x) = \begin{cases}
0 & 0 < x < L\\
\infty & otherwise
\end{cases}

Since $ x = 0, L $ has an infinitely high wall, the particle is a system that can exist only in $ 0 <x <L $. At $ 0 <x <L $, it behaves as a free particle. The potential is like this. Ne:

figure15.png

Anyway, let's solve this numerically.

Differentiation

(Details of differentiation can be found in Speeding up numerical calculation using NumPy / SciPy: Application 1)

Let's set the size of the system to $ \ left [0, L \ right] $. There can be no wave function outside of it.

H\psi = (K + V)\psi = \frac12
\begin{pmatrix}
\frac{2}{\Delta q^2} + V(0)&\frac{-1}{\Delta q^2}&0&\cdots&0\\ 
\frac{-1}{\Delta q^2}&\frac{2}{\Delta q^2} + V(\Delta q) &\frac{-1}{\Delta q^2}&&0\\
0 & \frac{-1}{\Delta q^2}&\frac{2}{\Delta q^2} + V(2\Delta q)&& \vdots\\
\vdots&&&\ddots&\frac{-1}{\Delta q^2}\\
0& \cdots& 0 &\frac{-1}{\Delta q^2}& \frac{2}{\Delta q^2} + V(L)
\end{pmatrix}
\begin{pmatrix}
\psi_0\\
\psi_1\\
\vdots\\
\psi_{n-1}\\
\psi_n
\end{pmatrix} = E_\ell\psi

You can get eigenvalues and eigenfunctions by throwing this at numpy.linalg.eigh.

Implementation

import numpy as np
from scipy.integrate import simps
import matplotlib.pyplot as plt
import seaborn

## set parameters
L, N = 1, 200
x, dx = np.linspace(0, L, N), L / N

## set kinetic matrix
K = np.eye(N, N)
K_sub = np.vstack((K[1:], np.array([0] * N)))
K = dx**-2 * (2 * K - K_sub - K_sub.T)

V = np.diag([0] * N)

## set Hamiltonian
H = (K + V) / 2

## solve igenvalue equation
w, v = np.linalg.eigh(H)

## plot
plt.plot(x, v.T[0] / simps(v.T[0]**2, x)**0.5, label="ground state")
plt.plot(x, v.T[1] / simps(v.T[1]**2, x)**0.5, label="1st excited state")
plt.plot(x, v.T[2] / simps(v.T[2]**2, x)**0.5, label="2nd excited state")
plt.plot(x, 2 * np.sin(np.pi * x /L) / np.sqrt(2 * L), '--', label="analytic(ground)")
plt.plot(x, -2 * np.sin(2 * np.pi * x /L) / np.sqrt(2 * L), '--', label="analytic(1st)")
plt.plot(x, -2 * np.sin(3 * np.pi * x /L) / np.sqrt(2 * L), '--', label="analytic(2nd)")
plt.show()

** We will continue to solve the eigenvalue equations in the same way as above. Only the potential depends on the system. ** We made the plot dimensionless by $ m = \ hbar = L = 1 $. Standardized at the time.

figure16.png

Let's also look at the energy eigenvalues

n = np.arange(1, 11)
plt.plot(w[:10], label='numerical')
plt.plot(n**2 * np.pi**2 / (2 * L**2), '--', label='analytic')
plt.show()

figure17.png

I connected them with a curve, but the horizontal axis is the quantum number $ n $, so it is a discrete graph. Again, ** Although it is differentiated, I just solved the Hamiltonian eigenvalue equation. ** Just It's a linear algebra.

Interpretation

Thinking of the wave function as "wave", what is the wave function and energy allowed when the hajiko is fixed (fixed end)? And I calculated that. And the energy became discontinuous. This was one of the characteristics of quantum mechanics [^ 4]. If you think of $ \ psi $ as just a particle (that is, classical mechanics) ) It is a conclusion that never comes out.

Analytical solution

The analytical solution of the wave function and the intrinsic energy


\psi(x) = \sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right), \hspace{1cm} E_n = \frac{n^2 \pi^2 \hbar^2}{2mL^2}

It was. I already got on the graph above, but the dashed line is the analytical solution. It matches very well.

To find this, set the boundary condition $ \ psi (0) = \ psi (L) = 0 $ and solve the differential equation. Thanks to this boundary condition, the quantum number $ n $ appears and excites. The state can be considered. Then, the reason why the eigenvalue equation is replaced with the differential equation is that it is difficult to solve it analytically with the eigenvalue equation as it is [^ 5].

** Please think that this is the root of the complicated calculation that will come out in the future. Since it is difficult to solve analytically with the eigenvalue equation as it is, it is replaced with a differential equation. And it changes to difficult mathematics. * *

However, numerical calculations do not have this difficulty. You can simply solve the eigenvalue problem. That is the original form of quantum mechanics [^ 6]. Isn't it easy to think so?

in conclusion

The mathematics barrier in quantum mechanics is due to the efforts of our predecessors who managed to solve the problem analytically. However, the calculation can be done by looking at the formulas. "I just want to solve the eigenvalue equation. If you understand that, then you know that mathematics is not the essence of physics. And you should try to understand mathematics as mathematics. Thus, the "wall of concepts" and "mathematical wall" The "wall" can be separated. Congratulations, but continue next.

Peeking in Python, not scary quantum mechanics 2: Finite well-type potential

[^ 1]: I think some people think that "quantum mechanics can only be understood by linking mathematics and concepts!" I think so, but understanding both at the same time. Would be difficult.

[^ 2]: "There is also a Heisenberg equation" is passed through. Because it is equivalent.

[^ 3]: Some people may get angry, but I'd be happy if you could overlook it.

[^ 4]: The energy becomes discrete when it is in a bound state, and it is like being continuous. For example, a uniform free particle.

[^ 5]: One of the reasons is that the matrix and the operator are different concepts. The eigenvalue equation can be solved as it is only by the harmonic oscillator.

[^ 6]: I'm not downplaying analytical calculations. Numerical calculations are meaningless without analytical calculations (including approximate calculations).

Recommended Posts

Peeping in Python, not scary quantum mechanics 1: Infinite particle potential
Peeping in Python, not scary quantum mechanics 2: Finite well-type potential
First Computational Physics: Quantum mechanics and linear algebra in python.
Quantum chemistry calculation in Python (Psi4)
Infinite prime number generator in Python3
Infinite product in Python (using functools)
[Scientific / technical calculation by Python] Solving one-dimensional Schrodinger equation in stationary state by shooting method (1), well-type potential, quantum mechanics
Python / dictionary> setdefault ()> Add if not in dictionary
Tkinter could not be imported in Python
[Scientific / technical calculation by Python] Solving one-dimensional Schrodinger equation in stationary state by shooting method (2), harmonic oscillator potential, quantum mechanics