trynerror
trynerror

Reputation: 229

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

Upvotes: 2

Views: 3593

Answers (1)

jakevdp
jakevdp

Reputation: 86433

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)

Upvotes: 1

Related Questions