Professional Documents
Culture Documents
Homework 2
h̄2 ∂ 2
" #
− + V ψ = Eψ (1)
2m ∂x2
1) Solve for harmonic and quartic potential and calculate the spacing between
various energy levels. Choose −1 < x < 1 Angstrom where x denotes the magni-
tude K3 distortion in Angstrom. The effective mass m of mode is m = 266.10
amu. [50 points]
2) For both harmonic and quartic potential, plot the first four eigenvectors.
Discuss the results. [50 points]
import numpy as np
import m a t p l o t l i b . p y p l o t as p l t
h b a r = 6 . 5 8 2 1 1 9 5 6 9 e −16 # eV . s
m = 266.10 # amu
K2 = 1 . 4 4 9 4 # eV/ Angstrom ˆ2
K4 = 1 . 0 3 4 2 # eV/ Angstrom ˆ4
n = 1001
# n e q u a l l y spaced g r i d p o i n t s i n c l u d i n g −1 & 1
x = np . l i n s p a c e ( −1 ,1 , num=n ) # Angstrom
Dx = x [ 1 ] − x [ 0 ] # s p a c i n g between two g r i d p o i n t s
V harmonic = K2 ∗ x ∗∗2 # eV
V q u a r t i c = (−K2 ∗ x ∗∗2 + K4 ∗ x ∗∗ 4) # eV
p l t . p l o t ( x , V harmonic )
plt . plot (x , V quartic )
a = h b a r ∗∗2 / ( 2 ∗m∗Dx∗∗2 ∗ f a c t o r )
H = []
f o r i i n range ( 1 , l e n ( x ) −1):
h = np . z e r o s ( l e n ( x) −2)
i f i == 1 :
h [ i −1] = 2∗ a + V harmonic [ i ]
h [ i ] = −a
e l i f i == l e n ( x ) −2:
h [ i −1] = 2∗ a + V harmonic [ i ]
h [ i −2] = −a
else :
h [ i −2] = −a
h [ i −1] = 2∗ a + V harmonic [ i ]
h [ i ] = −a
H. append ( h )
H = np . t r a n s p o s e (H)
H = np . a r r a y (H)
#p r i n t (H)
# c a l c u l a t i n g e i g e n e n e r g i e s and c o r r e s p o n d i n g e i g e n s t a t e s
E , v = np . l i n a l g . e i g h (H)
E = E∗1000 # c o n v e r t i n g Eigen e n e r g y v a l u e s i n meV
# p r i n t i n g e n e r g i e s o f f i r s t 10 e i g e n s t a t e s
p r i n t (E [ : 1 0 ] )
#p r i n t ( v )
f o r i i n range ( 1 0 ) :
p r i n t ( ”dE =”, E [ i +1] − E [ i ] )
# u s i n g an a p p r o p r i a t e s c a l i n g f a c t o r f o r p l o t t i n g t he e i g e n s t a t e s
f o r t h e phonon mode
#norm = np . l i n a l g . norm ( v )
v = v ∗10
p l t . f i g u r e ( f i g s i z e =(10 ,6))
p l t . p l o t ( x , V harmonic ∗ 1000)
f o r i i n range ( 6 ) :
c = np . random . rand ( 3 , )
p l t . p l o t ( x [ 1 : − 1 ] , v [ : , i ]+E [ i ] ∗ 1 0 0 0 , c o l o r = c )
p l t . a x h l i n e ( y = E [ i ] ∗ 1 0 0 0 , c o l o r = c , l i n e s t y l e = ’−−’)
p l t . xlim ( [ − 0 . 2 5 , 0 . 2 5 ] )
p l t . ylim ( [ 0 , 5 0 ] )
p l t . x l a b e l ( ” x ( Angstrom ) ” )
p l t . y l a b e l ( ” Energy (meV) ” )
p l t . show ( )
V q u a r t i c = (−K2 ∗ x ∗∗2 + K4 ∗ x ∗∗ 4) # eV
#p l t . p l o t ( x , V q u a r t i c ∗1000)
a = h b a r ∗∗2 / ( 2 ∗m∗Dx∗∗2 ∗ f a c t o r )
H2 = [ ]
f o r i i n range ( 1 , l e n ( x ) −1):
h = np . z e r o s ( l e n ( x) −2)
i f i == 1 :
h [ i −1] = 2∗ a + V q u a r t i c [ i ]
h [ i ] = −a
e l i f i == l e n ( x ) −2:
h [ i −1] = 2∗ a + V q u a r t i c [ i ]
h [ i −2] = −a
else :
h [ i −2] = −a
h [ i −1] = 2∗ a + V q u a r t i c [ i ]
h [ i ] = −a
H2 . append ( h )
#H = np . t r a n s p o s e (H)
H2 = np . a r r a y (H2)
p r i n t (H2)
p r i n t ( np . shape (H2 ) )
E2 , v2 = np . l i n a l g . e i g h (H2)
E2 = E2∗1000 # c o n v e r t i n g Eigen e n e r g y v a l u e s i n meV
p r i n t ( E2 [ : 1 0 ] )
#p r i n t ( v2 )
f o r i i n range ( 1 0 ) :
p r i n t ( ”dE =”, E2 [ i +1] − E2 [ i ] )
# u s i n g an a p p r o p r i a t e s c a l i n g f a c t o r f o r p l o t t i n g t he e i g e n s t a t e s
f o r t h e phonon mode
norm = np . l i n a l g . norm ( v2 )
v2 = v2 ∗10
p l t . f i g u r e ( f i g s i z e =(10 ,10))
p l t . p l o t ( x , V q u a r t i c ∗1000)
f o r i i n range ( 4 ) :
c = np . random . rand ( 3 , )
p l t . p l o t ( x [ 1 : − 1 ] , v2 [ : , i ]+E2 [ i ] , c o l o r = c )
p l t . a x h l i n e ( y = E2 [ i ] , c o l o r = c , l i n e s t y l e = ’−−’)
For the case of phonon mode in a quartic potential it can be seen that two eigenstates
have the same energies because of the symmetric potential well with two minimas. The
degenerate eigenstates fall in the left and the right hand side of the potential well. These
eigenstates/eigenvectors are confined in the potential well at the corresponding energy but
it also spills out of the well a bit in contrast to a classical particle in a potential well which
can never go out of the well if it starts with a certain potential inside the well.
NOTE
1) In the above problem the value of the eigenstate/eigenvector at the end points x = -
1 & 1 was considered to be zero. The Hamiltonian matrix was solved only for the internal
grid points i.e. 999 points.