﻿ Schrodinger Equation Simulator

# Schrodinger Equation Simulator

### Quickstart

This is a one-dimensional Schrodinger equation simulator with customizable initial state and potential. The simulator numerically evolves the wavefunction forward in time, following the Schrodinger equation. The wavefunction's amplitude $$| \psi (x) |$$ is shown as the moving graph and the colors correspond to the phase. Press the Run/Pause button to start/pause the simulation, and the Reset to restart the simulator. The Download button allows you to obtain the data from the simulation.

### Introduction

The time dependent Schrodinger equation is perhaps the most fundamental equation in quantum mechanics. This page is designed so that you get a feel for how it works.

First let's write down the equation in one dimension:

### $$i \hbar \frac{d \psi}{dt} = - \frac{\hbar^2}{2m} \frac{d^2 \psi}{dx^2} + V(x) \psi(x)$$

Here, the variables are:

• $$\psi(x)$$ is the quantum wavefunction
• $$\hbar = h/2 \pi$$ is Planck's constant divided by $$2 \pi$$
• $$h$$ is Planck's constant $$= 6.3 \times 10^{-34}$$ Js
• $$t$$ is time
• $$m$$ is the mass of the particle
• $$x$$ is space
• $$V(x)$$ is the potential energy

What the Schrodinger equation does is to take the wavefunction $$\psi(x)$$ at some initial time (let's say $$t=0$$ ) and evolve it forward in time. By solving the Schrodinger equation, you are able to find what the wavefunction will be at some other time $$t$$ later.

The "inputs" of the Schrodinger function are the potential energy $$V(x)$$, the mass of the particle $$m$$, and the initial wavefunction $$\psi(x)$$. From just this information, the Schrodinger equation can predict how the wavefunction will change over time.

Schrodinger equation is the most central equation of quantum mechanics and is used to understand any kind of time-dependent quantum phenomenon. It's status in quantum physics is a lot like Newton's laws of motion for classical physics. From this equation we can work out how things will behave over time.

The best way to understand this is to get your hands dirty and play with the equation, which you can do below:

### The simulator

The above code does a numerical evolution of the time-dependent Schrodinger equation in one dimension.

There are various combinations of the potential $$V(x)$$ and initial state $$\psi(x)$$ that you can choose. After choosing which combination of potential and initial state you would like, press Reset and Run/Pause to run the simulator. If you would like to download the data of the simulation, you can also do that by pressing the Download button.

What you see as the colours in the output above is a plot is the wavefunction. The height of the wavefunction is the magnitude of the wavefunction $$| \psi (x) |$$, and the colours correspond to the phase of the wavefunction $$arg( \psi(x) )$$. The shape of the potential $$V(x)$$ is shown as the grey plot in the background.

The spatial region of the solver is actually limited to the region that that you see, and is in the range of $$0< x < 1$$. At $$x=0$$ and $$x=1$$ there is a hard wall (infinite potential) so that the wavefunction cannot go outside this region. This is why if you choose "Infinite square well" you just see a flat potential. It's because the edges of the simulation are actually the infinite potential walls.

In addition to the wavefunction output, the code also outputs a few other quantities. In the position space output we have

• $$P(x < .5 )=\int_0^{1/2} | \psi(x) |^2$$ is probability that the particle is in the left half of the simulated region.
• $$\langle x \rangle = \int_0^{1} x | \psi(x) |^2$$ is the average position.
• $$RMS(x) = \sqrt{\int_0^{1} x^2 | \psi(x) |^2 }$$ is the root mean square position.
• $$t$$ is the current time.

In the momentum space region, the Fourier transform of the wavefunction is plotted. This is

$$\psi(p) = \int \psi(x) e^{i px} dx$$

This tells you what frequencies (or momenta) the wavefunction is made of. Again, some basic parameters:

• $$P(p < .5 )=\int_{-\infty}^{0} | \psi(p) |^2$$ is probability that the particle is moving towards the left.
• $$\langle p \rangle = \int_{-\infty}^\infty p | \psi(p) |^2$$ is the average momentum.
• $$RMS(p) = \sqrt{\int_{-\infty}^\infty p^2 | \psi(p) |^2 }$$ is the root mean square momentum.

The definitions of the potentials are as follows.

• Harmonic: $$V(x) = \frac{1}{2} x^2$$
• Double well: $$V(x) = ((x-x_0)(x+x_0))^2$$. The value $$x_0$$ represents the center of the double well potential for which the default value is 0.5.
• Infinite square well: $$V(x) = 0$$ for $$0 < x < 1$$.
• Barrier: $$V(x) = V_0$$ for $$x_0-a < x < x_0+a$$; $$V(x)=0$$ otherwise. $$V_0$$ set by slider. The value $$a=0.1$$ represents the width of the barrier.
• Step: $$V(x) = V_0$$ for $$x > 1/2$$; $$V(x) =0$$ for $$x < 1/2$$. $$V_0$$ set by slider.

Keep in mind that $$V(x) = \infty$$ for any region outside of $$0 < x < 1$$.

### Things to try

#### 1. Eigenstates

First start by initializing the wavefunction as a Gaussian pulse and choosing the harmonic . When you press run, what you should see is that the wavefunction starts to move around, and after some time it becomes extremely messy. At $$x = 0, 1$$ there are hard walls (infinite potentials) so that the wavefunction will always bounce off these, which will produce a rather chaotic distribution of states. Try this with a few different Gaussian pulse parameters and see if adjusting the parameters makes any difference.

Now change the initial state to the Harmonic ground state and run the simulator. Try this also with the harmonic first excited state. What you see is that the wavefunction is completely unchanging in shape, and only the colours change with time. This is because this is an eigenstate of the Hamiltonian. The colours change with time because the effect of the Schrodinger equation is to only apply a phase to the state.

$$\psi(x,t) = e^{-i E_n t } \psi(x)$$

The argument of the state is just $$E_n t$$ which changes over time.

You can see from this example that eigenstate are very special states and are actually quite rare, even though this is the first thing that you tend to learn in a quantum mechanics course. A typical state turns into a messy jumble of states.

#### 2. Gaussian wavepacket

This time make the potential an inifite well and the initial state a Gaussian pulse again. Adjust the parameters so that you make a Gaussian wavepacket. Observe the diffusion of the wavepacket, where it spreads out as it moves.

#### 3. Barriers and steps

This time make the potential a barrier and the initial state a Gaussian pulse again. Adjust the parameters so that you send a Gaussian pulse towards the barrier, as if you are lauching a particle at a wall. Play with the parameters to see when you can penetrate the barrier and observe quantum tunneling.

### Credits

Original version implemented by CodingPhysics. Adapted by Marek Narożniak and Tim Byrnes.

CodingPhysics
The author of the original implementation of the above simulation. Visit the GitHub profile under github.com/CodingPhysics
Marek Narożniak
Visit mareknarozniak.com to know of other Marek's projects!
Tim Byrnes
Visit nyu.timbyrnes.net to know more!

Visit this project on GitHub and contribute!