Simple Gradient Descent with Python This is a simple polynomial gradient descent. It is a naive implmentation that is not optimized or vectorized. It is meant to be a simple demo on how gradient descent can be accomplished. To keep it simple, it uses base Python. I don’t intend for it to be used for anything important!
Some Equations The “target” polynomial that will be fitted is defined as Eqn. 1:
Lennard-Jones Potential Equation $$ V(r) = 4 \epsilon \biggl[ \biggl (\frac{\sigma}{r}\biggr)^{12} - \biggl (\frac{\sigma}{r}\biggr)^6 \biggr] $$
$$ \sigma = \frac{r_m}{2^{1/6}} $$
Here, epsilon is the energy minimum and r_m is the distance of the energy minimum.
Note the part of the equation inside the square brackets. Recall that negative energies represent a more favorable interaction. The attractive term (raised to the power of 6) is subtracted from the repulsive term (raised to the power of 12).
In this post, I define a class to model the behavior of a hydrogen atom. In the process, I get to solve integrals like the following numerically to test my code:
\[ \int_0^{\pi} \int_0^{2\pi} \lvert Y_{l, m_l} \rvert ^2 \sin \theta d \theta d \phi = 1 \]
This post consists of a arge block of Python code up front, and then explanations and plots below. Let’s get started!
Hydrogen spectra using Rydberg Formula The Rydberg formula is used to predict emission spectrum lines from hydrogen. The significance of the Rydberg formula is that it was one of the first studies of quantum effects of energy transitions in atoms. Furthermore, it demonstrates that energy emitted is in specific wavelengths, corresponding to a particular energy level transition.
\[ \tilde\nu = R_H\Biggl(\frac{1}{n_{1}^2} + \frac{1}{n_{2}^2}\Biggr)\]
Where \(\) is the wavenumber in \(cm^{-1}\) and \(R_H = 109,677 cm^{-1}\).
Introduction In this post, I will define Python code that models the quantum harmonic oscillator. This page follows page 290 to 297 in Physical Chemistry, 8th Ed. by Peter Atkins and Julio de Paula for the math to create and examples to test the code in this post.
The following equations describe its energy levels:
\[ \omega = \sqrt{\frac{k}{m}} \]
\[ E_{\nu} = \Bigl(\nu + \frac{1}{2}\Bigr) \hbar \omega \]
This code and these plots explore Molecular Modelling for Beginners, 2nd Ed. by Alan Hinchliffe Section 12.6, pages 181 to 184. In this Section, the author explores the concepts of particle indistinguishability, symmetric, and antisymmetric wavefunctions. I recommend you read the text for a complete treatment of these concepts. However, I cover the essentials here.
We can write a wavefunction and total energy for two non-interacting particles in a one-dimensional box as:
This post explores the simplest quatnum mechanical system: the particle in a one-dimensioanl infinite potential well, also known as the one-dimensional particle in a box.
\[ \psi_{n}(x) = \sqrt{\frac{2}{L}} \sin\Bigl(\frac{n \pi x}{L}\Bigr) \]
\[ E_n = U_0 + \frac{n^2 h^2}{8 m L^2} \]
\[ n = 1, 2, 3, \dots \]
Particle in a one-dimensional box This Python code on this page explores Section 11.3.1 in Molecular Modeling for Beginners, 2nd Ed.