Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

python - How to numerically normalize the wave function of the Schroedinger Equation?

I implemented the Shooting Method to numerically solve the 1D stationary Schroedinger Equation for the infinite potential pot with walls located at 0 and 1. Now I want my numerical solution for the wavefunction psi(x) to be normalized. This means that the integral from 0 to 1 of the probability of residence density rho(x)= |psi(x)|^2 has to equal 1, since there is a 100 percent chance to find the particle within the interval 0 to 1. So I have the normalization condition int(0,1) rho(x) dx = 1. I tried to implement a normalization function using the numeric integration simpson rule, but it doesn't work appropriately for higher energy states. Has anyone got an idea how to improve?

So I have psi(x) and x as numpy arrays.

def normalize_psi(psi, x):
   int_psi = scipy.integrate.simps(psi,x)
   return psi/int_psi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like you're normalizing the integral of the (complex) wavefunction, when you should be normalizing its probability density:

def normalize_psi(psi, x):
   int_psi_square = scipy.integrate.simps(abs(psi) ** 2, x)
   return psi/np.sqrt(int_psi_square)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...