Professional Documents
Culture Documents
11
#
#
#
#
f u n c : f u n c t i o n A Python f u n c t i o n o r method t o i n t e g r a t e .
a : Lower l i m i t o f i n t e g r a t i o n ( u s e numpy . i n f f o r i n f i n i t y ) .
b : Upper l i m i t o f i n t e g r a t i o n ( u s e numpy . i n f f o r +i n f i n i t y ) .
a r g s : t u p l e , o p t i o n a l e x t r a arguments t o p a s s
d e f f u n c ( x , n , w) :
r e t u r n nx w
i p r o d , e r r = quad ( func , 0 , 1 , a r g s =(2 ,3) )
16
p r i n t v a l u e = %.3 f % i p r o d , # t h e e v a l u a t i o n o f t h e i n t e g r a l o f 2 x 3
between x=0 and x=1
p r i n t e r r o r= {} . format ( e r r ) # t h e n u m e r i c a l u n c e r t a i n t y i n t h e i n t e g r a l
#E v a l u a t i n g i n t e g r a l g i v e s 0 . 5 x 4
p r i n t Exact s o l u t i o n = {} . format ( 0 . 5 1 . 0 4 . )
quadsyntax.py
1
from s c i p y . s p e c i a l import h e r m i t e
# This s p e c i a l f u n c t i o n r e t u r n s t h e nth h e r m i t e p o l y n o m i a l h n ( x ) , o r t h o g o n a l
o v e r ( i n f , i n f ) with w e i g t h i n g f u n c t i o n ( exp(x 2 )
s c i p y . s p e c i a l . h e r m i t e ( n ) # r e t u r n s t h e nth p o l y n o m i a l
hermitesyntax.py
(1)
~2 k 2
~2 n2 2
=
(2)
2m
2m L2
We are going to demonstrate various properties of the square well; to numerically calculate
the different integrals (orthogonalities, expectation values, etc.) you will need to set L = 1.
En =
1. Plot separately 3 (x), 4 (x) and the product 3 (x) 4 (x). Show that you would
expect the latter to integrate to zero.
2. Integrate the product 3 (x) 4 (x) between 0 and L to show that 3 and 4 are
orthogonal.
3. Choose four different values of n and m to demonstrate that the wavefunctions are
orthogonal and normalised:
Z L
m
(x) n (x) dx = n,m
0
RL
4. Show that the expectation value hxi = 0 n (x) xn (x) dx = L/2 for states with
quantum number n = 4, 7, and 9.
p
5. Calculate hx2 i and x = hx2 i hxi2 for n = 4, 7, and 100.
6. Demonstrate that as n large, x L/ 12. How does this result compare to the
classical result?
+
.
L
7 L
7 L
1. Plot A(x) and confirm that it satisfies the boundary conditions at x = 0 and L.
4. Show that
i=
X
|ci |2 = 1.
i=1
5. Show that
i=
X
|ci |2 i2 = 3.849.
i=1
Therefore show that the expectation value for the energy is hEi = 3.849E0 , where E0
is the energy of the ground state.
2n n! a2
where
qHn (x) are the Hermite polynomials encountered in PH2130 and a is a length given by
~
a = m
. The energy of the nth quantum state is En = (n + 12 )~. Note that for the QHO
the ground state is n = 0, whereas in the infinite square well it is n = 1.
1. In Python write the code to generate the Hermite polynomials for arbitrary n. Generate
the normalised wavefunctions tabulated below for n = 0, 1, 2, 3 and 4; you will need to
take a=1.
n
n (x)
2
0
1
2
3
4
x2
1
2a
e
4
2
a
2
2 (x/a) x 2
2a
1 (x) =
e
4
a2
2
[4(x/a)2 2] x 2
2a
2 (x) = 22
e
4
a2
2
[8(x/a)3 12(x/a)] x 2
2a
3 (x) =
e
4
4 3 a2
2
[16(x/a)4 48(x/a)2 +12] x 2
2a
4 (x) =
e
4
8 6 a2
0 (x) =
m
(x) n (x) dx = n,m .
Write a simple program to check this integral for the five states above. You will not
be able to integrate to , and you will have to make approximations.
3. Plot the wavefunction n (x) and the probability densities pn (x) = |n (x)|2 for n = 0
to 10, see Figure 1. For clarity the individual traces need to be vertically offset in an
appropriate manner.
Figure 1: The wave functions n (x) and probability densities pn (x) = |n (x)|2 for the lowest energy
states in a quantum harmonic oscillator
RL
4. Demonstrate that the expectation value for the displacement, hxi = L n (x) x n (x) dx,
is zero for a selection of quantum numbers n.
p
5. Calculate hx2 i and x = hx2 i hxi2 for n = 4, 7, and 10. Hence deduce for general
n that hx2 i = 2n+1
. Hence show that the uncertainty in position for the state n (x) is
2
q
x = 2n+1
.
2
6. In a classical description of oscillations in a harmonic potential, x =x0 sin(t), the
average amplitude is hxi = 0 and the rms amplitude is x = x0 / 2. Assuming
that the
classical and quantum calculations yield the same result for x, show that
x0 = 2n + 1.
4
7. Plot the quantum probability densities pn (x) = |n (x)|2 for large n (try 10, 30 and
50). On the same graph, plot the classical probability density pcl (x) derived in lectures
(see below). Comment on your results.
1
pcl (x) = p 2
x0 x2