Two Lines Of Python To Solve The Schrödinger Equation
In one of my recent posts, I stated that all of science is just matrix multiplication. Today I will demonstrate that with an application to quantum mechanics. Quantum mechanics and its weird predictions have the reputation of being hard. I think it was Niels Bohr who said that nobody understands quantum mechanics. But I think he meant that nobody understands it based on one’s intuition and everyday experience. Given its founding axioms or postulates, one can rather easily understand the mathematical machinery. Today I will show you, how you can use Python to easily compute the solution to quantum mechanics’ most famous equation, the Schrödinger equation. And the challenge is, do it in just 2 lines of Python (not counting imports).
The Schrödinger equation
Basically, there are two versions of the Schrödinger equation. Well, actually, one is contained in the other, but that’s not today’s topic. Let’s focus on the stationary Schrödinger equation here, which determines what energy levels a physical system can have and what the corresponding stationary wave functions are. The stationary Schrödinger equation reads