Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download

lab 7

Views: 261
Kernel: Python 3 (Ubuntu Linux)

PHYS201 PHYSICS IIA Python Lab 7 Exercises

Mike Steel, 2017, modification by James Tocknell 2018


Your Name:Nicholas Arico

(Double-click cell above and fill out your name)


N.B. Generally it's a really good idea to make each of your answers self contained so that all the code necessary for the answer is in cells under the exercise heading. Use comments or text cells to document your work as necessary.

Exercise 1

A narrow wave packet in space must be composed of a broad range of momenta.

How does this explain the spreading of a wave packet in empty space?

Write your answer here

Using the heisengberg uncertainty principle, having a small uncertainty in relation to the position of the particle, implies a large uncertainty in relation the momentum of the particle. In this instance, having a narrow wave packet in space implies a larger spread of momentum of the wave. Since momentum is mv, therefore, the larger the spread of momenta, the larger the velocity of the spread

Exercise 2

By slight alteration of the code above, solve and plot the evolution of a wave packet with a smaller initial width of w=0.25w=0.25.

Comment on your result: is the wave packet spreading faster or slower for the smaller width initial wave packet? Explain this physically.

# write your code here from math import * import numpy as np import matplotlib.pyplot as plt import phys201quantum as phys201q %matplotlib inline psi0 = phys201q.make_psi0([-8, 8], 250, 'gaussian', .25, 0, 0) V = phys201q.make_piecewise_potential([[-8, 0], [8, 0]]) psi_evol = phys201q.schro_evolve(psi0, V, tmax=1.5) phys201q.plot_psi_at(psi_evol)
Doing 363 steps of size 0.004129 with sigma=dt/(4dx^2)=0.250000 Outputting 100 time slices separated by 3 dt=0.012387
(<Figure size 432x288 with 2 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x7f46b104dc50>)
Image in a Jupyter notebook

Exercise 3

Now perform the same evolution but with a supergaussian input wave function. (Here 'super-gaussian') means the form exp(x4)\exp(-x^4). Choose a tmax of at least 5.

How is the result different? Can you explain this behaviour at all?

# write your code here psi0 = phys201q.make_psi0([-8, 8], 250, 'supergaussian', .25, 0, 0) V = phys201q.make_piecewise_potential([[-8, 0], [8, 0]]) psi_evol = phys201q.schro_evolve(psi0, V, tmax=7) phys201q.plot_psi_at(psi_evol) fig, axs = plt.subplots(1, 2) phys201q.plot_psi_pcolor(psi_evol, ax=axs[0]) phys201q.plot_psi_pcolor(psi_evol, show_phase=1, ax=axs[1]) phys201q.animate_psi(psi_evol) #This is because the domain of the simulation acts as an infinite well/barrier. So the waveform is perfectly reflected off the boundaries, and interferes with itself, creating an interference pattern, which is what can be seen different
Doing 1695 steps of size 0.004129 with sigma=dt/(4dx^2)=0.250000 Outputting 100 time slices separated by 16 dt=0.066063
(<Figure size 432x288 with 2 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x7f46b03017f0>)
Image in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebook

Exercise 4

Now excite a Gaussian wave packet of width 2 but initial momentum p0=2.

You may wish to shift the starting point on the xx axis to keep the beam in the simulation domain.

Do the results make sense? Explain.

# write your code here psi0 = phys201q.make_psi0([-8, 8], 250, 'gaussian', 2, 0, 2) V = phys201q.make_piecewise_potential([[-8, 0], [8, 0]]) psi_evol = phys201q.schro_evolve(psi0, V, tmax=1.5) phys201q.plot_psi_at(psi_evol) phys201q.animate_psi(psi_evol) #Since we increased the momentum from 0 to 2, the particle now has a veloicty, so the wave packet also has a velocity, and hence moves over time.
Doing 363 steps of size 0.004129 with sigma=dt/(4dx^2)=0.250000 Outputting 100 time slices separated by 3 dt=0.012387
(<Figure size 432x288 with 2 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x7f46abd5b828>)
Image in a Jupyter notebookImage in a Jupyter notebook

Exercise 5

Return to a simulation of a wave packet with initial width 0.25, zero momentum and a domain width of 20, but this time let the evolution run until t=8t=8.

Display the result with an animation.

Explain what is going on here? Is the behaviour physical? How can it be fixed?

# write your code here psi0 = phys201q.make_psi0([-10,10], 250, 'gaussian', .5, 0, 0) V = phys201q.make_piecewise_potential([[-8, 0], [8, 0]]) psi_evol = phys201q.schro_evolve(psi0, V, tmax=8) phys201q.animate_psi(psi_evol) # print('Once again, the wave function spreads until reaching the boundaries,then hitting the boundaries and being reflected back and causing an interference pattern. This is not a physical phenomenon, and can be fixed by extending the boundaries"domain" to larger numbers')
Doing 1240 steps of size 0.006452 with sigma=dt/(4dx^2)=0.250000 Outputting 100 time slices separated by 12 dt=0.077418
Once again, the wave function spreads until reaching the boundaries,then hitting the boundaries and being reflected back and causing an interference pattern. This is not a physical phenomenon, and can be fixed by extending the boundaries"domain" to larger numbers
Image in a Jupyter notebook

Exercise 6

  1. Generate an animation of the previous example in the notes to show the 'breathing' in time.

  2. In general, a superposition of energy eigenstates will not show periodic evolution but a continually evolving appearance. Explain why we see perfect periodicity in the harmonic oscillator case?

# write your code here psisho = phys201q.make_psi0([-10, 10], 250, 'hermitegaussian', w0=0.5, x0=0, p0=0, mode=0) Vsho = phys201q.make_sho_potential(1) psi_evolsho = phys201q.schro_evolve(psisho, Vsho, tmax=8) fig, axs = plt.subplots(1, 3, figsize=(10, 4)) plt.subplots_adjust(wspace=.4) phys201q.plot_psi_at(psi_evolsho, ax=axs[0]) phys201q.plot_psi_pcolor(psi_evolsho, show_phase=0, ax=axs[1]) phys201q.plot_psi_pcolor(psi_evolsho, show_phase=1, ax=axs[2]) phys201q.animate_psi(psi_evolsho) #Each eigenstate has a phase, which is governed by 'n' in the wave equation. For harmonic oscillators only, each eigenstate and phase is an addition of others, so in time, each one will line up and constructively interfere
Doing 1240 steps of size 0.006452 with sigma=dt/(4dx^2)=0.250000 Outputting 100 time slices separated by 12 dt=0.077418

Exercise 7

  1. Excite the ground state solution with width w=1w=1 of the harmonic potential, but displaced in starting position a little way from the origin. What behaviour do you observe?
  2. Confirm this by viewing the evolution as an animation.
# write your code here psisho3 = phys201q.make_psi0([-15, 15], 500, 'hermitegaussian', w0=1, x0=1, p0=0, mode=0) Vsho = phys201q.make_sho_potential(1) psi_evolsho3 = phys201q.schro_evolve(psisho3, Vsho, tmax=20) fig, axs = plt.subplots(1, 3, figsize=(10, 4)) plt.subplots_adjust(wspace=.4) phys201q.plot_psi_at(psi_evolsho3, ax=axs[0], skip=10) phys201q.plot_psi_pcolor(psi_evolsho3, show_phase=0, ax=axs[1]) phys201q.plot_psi_pcolor(psi_evolsho3, show_phase=1, ax=axs[2]) phys201q.animate_psi(psi_evolsho3, asprobdens=False); # It oscillates back and forth from the origin to 1 and -1
Image in a Jupyter notebookImage in a Jupyter notebook

Exercise 8

We saw similar rapid oscillations earlier when a pulse encountered the edge of the simulation domain.

Do you think the oscillations in the present case should be considered as physical or not? Explain your answer.

Write your answer here

Since we intentionally placed the particle in a box with real edges, we should consider this system to be physical

Exercise 9 (this is a harder problem worth double marks)

  1. We still see considerable reflection. Why is that? Think about the spread of energies contained in a single pulse.
  2. How can you estimate the energy spread?
  3. How wide a pulse do you think is needed to have small energy dispersion and high transmission?
  4. Test your ideas by running some calculations with different pulse widths. Can you increase the transmission?
# write your code here #1 #since E = p^2/2, choosing a value for p which relates to a energy level of a transmission maximum, we still see some reflection. This is because the position of the particle is relatively certain, so the moment spread is large, meaning that some of the values of the momentum are below teh requirement for transmission, and are therefore reflected #2 # Since the momentum is directly related to energy in the equation above, knowing the uncertainty of the momentum will give an estimate of the spread of energy #3 # around 10 #4 psi0bar3 = phys201q.make_psi0([-60, 40], 500, 'gaussian', 10, -20, p0=3.5299) Vbar3 = phys201q.make_piecewise_potential([[-2, 5], [2, 5]]) psi_evolbar3 = phys201q.schro_evolve(psi0bar3, Vbar3, tmax=20) psi0bar4 = phys201q.make_psi0([-60, 40], 500, 'gaussian', 5, -20, p0=3.5299) Vbar4 = phys201q.make_piecewise_potential([[-2, 5], [2, 5]]) psi_evolbar4 = phys201q.schro_evolve(psi0bar4, Vbar4, tmax=20) psi0bar5 = phys201q.make_psi0([-60, 40], 500, 'gaussian', 25, -20, p0=3.5299) Vbar5 = phys201q.make_piecewise_potential([[-2, 5], [2, 5]]) psi_evolbar5 = phys201q.schro_evolve(psi0bar5, Vbar5, tmax=20) psi0bar6 = phys201q.make_psi0([-60, 40], 500, 'gaussian', 30, -20, p0=3.5299) Vbar6 = phys201q.make_piecewise_potential([[-2, 5], [2, 5]]) psi_evolbar6 = phys201q.schro_evolve(psi0bar6, Vbar6, tmax=20) phys201q.animate_psi(psi_evolbar3, Vbar3) phys201q.animate_psi(psi_evolbar4, Vbar4) phys201q.animate_psi(psi_evolbar4, Vbar5) phys201q.animate_psi(psi_evolbar4, Vbar6)

Submitting the lab file

  • Make sure you've entered your name at the top of this notebook.

  • Once you're happy with your responses, simply ensure this notebook is saved.

  • Scripts will take a copy of this folder for marking after the deadline.