Computational Hydrogen: exp (− c α r Hc = Esc
Computational Hydrogen: exp (− c α r Hc = Esc
Summary. This notebook solves the ground state for the hydrogen atom computationally using four
Gaussian functions as the basis set. Given this expression for the wavefunction, the Schrodinger equation
reduces to a generalized eigenvalue problem that we solve numerically.
You can change the width of each gaussian and explore how the description changes. Compare the energy
and wave function with the exact solution.
Use. Feel free to download the improve on it, add features and re-deploy it in nanoHUB for the community to
use.
Plugging this anzats into the Schrodinger equation results a generalized eigenvalue problem:
H C = ES C
where C is a column vector with the unknown linear coefficients in the wave function, H is the Hamiltonian
matrix, S is the overlap matrix and E is the energy.
The advantage of using Gaussian functions is that the integrals in the Hamiltonian and overlap matrix can be
evaluated analytically. The eigenvalue problem can then be easily solved using linear algebra.
In [1]:
%pylab inline
In [2]:
#alpha=np.random.rand(4)
print(alpha)
In [3]:
S = empty((4,4))
T = empty((4,4))
V = empty((4,4))
3/2
2 2
3 −α i r −α j r π
Sij = ∫ d re e = ( )
α i +α j
3/2
2 2 αi αj π
3 −α i r 2 −α j r
Tij = ∫ d re ∇ e = 3
5/2
(α i +α j )
2 2
3 −α i r 1 −α j r 2
Vij = ∫ d re e = −
r α i +α j
In [4]:
for i in range(alpha.size):
for j in range(alpha.size):
S[i,j] = (math.pi/(alpha[i]+alpha[j]))**(3./2.)
T[i,j] = 3.*(alpha[i]*alpha[j]*math.pi**(3./2.))/(alpha[i]+alpha[j])**(5./2.
)
V[i,j] = -2.*math.pi/(alpha[i]+alpha[j])
In [5]:
print("Overlap matrix")
print(S)
print("Hamiltonia matrix")
H = T+V
print(H)
Overlap matrix
Hamiltonia matrix
In [6]:
e,w = linalg.eig(H,S)
In [7]:
imin = e.real.argmin()
# Ground state eigenvector, i.e. the gaussian coefficients of the ground state w
avefunction
psi = np.atleast_1d(w[:,imin])
Wave functional normalization. We need to scale the coefficients in order for the wave function to be
properly normalized:
⋆ 3 2 2 3
∫ Ψ Ψd r = 1 = ∫ ∑ ci exp(−αi r ) ∑ cj exp(−αj r )d r
i j
∑ ci cj Sij = 1
i,j
In [8]:
norm = 0.0
for i in range(alpha.size):
for j in range(alpha.size):
print(norm)
13.212757071
In [9]:
x = np.linspace(0, 5, 100)
plt.xlabel('r (bohr)')
plt.ylabel('1/bohr^3')
plt.legend(loc='upper right')
plt.show()
In [ ]: