Physics 420/580 – Fall 2011
Previous iterations of this course: [ Fall 2008 : Fall 2009 : Fall 2010 ]
Course outline
Computational Physics / Advanced Topics in Computational Physics
Lecture: CCIS 4-285 MWF 13:00-13:50
Lab: CCIS L1-207 R 14:00-16:50
Syllabus: pdf
Schedule: pdf
Final Exam
Wednesday, December 14, 2011
14:00–15:30 (written) + 15:30–17:00 (programming)
CCIS L1-207
The exam will consist of both a written component and a programming component. One and a half hours will be apportioned for each. The emphasis will be on algorithms and numerical problem-solving strategies, with material drawn from the Lectures, Labs, and Assignments. Students will be expected to read and write programs in C++ but will not be asked to implement sophisticated class features.
I've posted previous years' exams as a study aid. The format and general style of this years' will be very similar.
-
Fall 2008
exam paper [ pdf ], solutions [ pdf ]
source code [ tar.gz ], solutions [ tar.gz ] -
Fall 2009
exam paper [ pdf ], solutions [ pdf ]
source code [ tar.gz ], solutions [ tar.gz ] -
Fall 2010
exam paper [ pdf ]
source code [ tar.gz ]
Learning resources
- As you're getting started, I recommend that you work your way through these introductory notes and that you try solving some of the simple programming exercises.
- Check out these online tutorials for C++ and UNIX.
- Many of the lecture topics are covered in greater detail in various textbooks. I encourage you to at least peruse items 6–8 of this book list. You can find them on reserve in Cameron library.
- An old version of Numerical Recipes, is available for free online. The newest edition (somewhat expensive) makes the jump from C to C++.
- A rather famous article: David Goldberg, “What Every Computer Scientist Should Know About Floating-Point Arithmetic,” ACM Computing Surveys 23, 5 (1991). [ pdf : html ]
- A short guide to 2D OpenGL graphics using the GLUT library [ pdf ]
Lectures
Class starts on Wednesday, September 7.
- Wednesday, September 7 — Computational physics
- Friday, September 9 — C++ language review
- Monday, September 12 — Discretization
- Wednesday, September 14 — Cellular automata
- Friday, September 16 — Self-organized criticality
- Monday, September 19 — Floating-point numbers
- Wednesday, September 21 — Integration, differentiation, and root finding
- Friday, September 23 — Ordinary differential equations
- Monday, September 26 — Boundary-value problems
- Wednesday, September 28 — Chaotic motion
- Friday, September 30 — N-body simulations
- Monday, October 3 — Multiple time scales
- Wednesday, October 5 — Holonomic constraints and the SHAKE algorithm
see also:- SHAKE: J. Comput. Phys. 23, 327–341 (1977)
- RATTLE: J. Comput. Phys. 52, 24–34 (1983)
- SETTLE: J. Comput. Chem. 13, 952–962 (1992)
- MILC SHAKE: J. Comput. Phys. 227, 8949–8959 (2008)
- Friday, October 7 — Wave motion and spectral methods
- Wednesday, October 12 — Finite difference methods for PDEs
relevant Wikipedia entries: - Wednesday, October 19 — Quantum mechanics
- Thursday, October 20 — Solving for eigenfunctions in one dimension, stability of finite difference schemes for the time-dependent Schrödinger equation
- Friday, October 21 — Schrödinger equation in higher dimensions, many-body quantum problems, matrix mechanics, ground state projection via the power method, variational principle
- Monday, October 24 — Matrices, linking to the BLAS and LAPACK libraries
see also: Linking to the LAPACK libraries from C++ - Wednesday, October 26 — Random processes, probability distributions
- Friday, October 28 — Random walks, enumeration of self-avoiding random walks
see also:- this tutorial courtesy of the Boston University Center for Polymer Studies
- Monday, October 31 — Monte Carlo integration, Markov chains, equilibration, detailed balance
- Wednesday, November 2 — Monte Carlo practicalities: measurement taking, thermalization and autocorrelation times
- Friday, November 4 — Ising model
Labs
The first lab is on Thursday, September 15 at 14:00 in CCIS L1-207. The TA is Burkhard Ritter. You can contact him at . Burkhard has prepared a lab website with notes and tutorials that students may find useful.
- Lissajous figures, Mandelbrot set
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Cellular automata
instructions [ pdf ], source [ tar.gz ], solutions [ tar.gz ] - Numerical integration, particle dynamics
instructions [ pdf ], source [ tar.gz ], solutions [ tar.gz ] - Lorentz attractor, chaos
instructions [ pdf ], source code [ tar.gz ] - Laplace and Poisson equations, relaxation methods
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Wave equation, stability of finite-difference methods for PDEs
instructions [ pdf ], source code [ tar.gz ] - Matrix mechanics with LAPACK
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Enumeration of self-avoiding walks
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Percolation
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Monte Carlo simulation of the Ising model
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ]
Lab Access
Detailed instructions can be found here.
Assignments
There will be five assignments (three for students who undertake a term project) with one due roughly every two weeks.
- Lattice gas automata: due Wednesday, September 29
instructions [ pdf ], source [ tar.gz ], solutions [ tar.gz ] - Classical N-body simulations: due Wednesday, October 19
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Dynamics of a quantum wave packet: due Friday, November 4
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Monte Carlo simulation of a polymer chain: due Friday, November 18
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ] - Optimal packing of granular material: due Friday, December 2
instructions [ pdf ], source code [ tar.gz ], solutions [ tar.gz ]
I would appreciate having your work for assignment n ∈ {1,2,…,5} submitted as a single tarball named studentLastName_n.tar.gz, sent to as an email attachment. When unpacked, your directory should contain your source code, compilation instructions in the form of a makefile, and a pdf document containing a concise written explanation of what you have done.
$ WEBPATH=http://www.ualberta.ca/~kbeach/phys420_580/src $ curl $WEBPATH/Assignment1.tar.gz -O $ tar xzf Assignment1.tar.gz $ ls -F Assignment1/ $ cd Assignment1 [edit / compile / test] $ cd .. $ mv Assignment1 beach_1 $ ls -F mycode.cpp makefile writeup.pdf LaTeX/ $ tar czf beach_1.tar.gz beach_1 $ ls -F beach_1/ beach_1.tar.gz
I encourage students to compose the written portion of their assignments in LaTeX. I have provided a template file for that purpose. (If you are not already familiar with it, LaTeX is a typesetting language that is widely used in the mathematics and physics communities. There is a brief introduction in the notes.)
Term project
Choosing a topic
You are welcome to develop a project idea on your own, but please consult with me to see if I think it's appropriate and feasible. I'll want to know that you've identified (i) an interesting physical phenemonon, (ii) the model you'll use to study it, (iii) the simulation algorithm you intend to implement, and (iv) the numerical experiment and particular measurements you intend to perform. Keep in mind that the project must be challenging but at the same time well-defined and something that can realistically be completed in three months.
If you're having trouble coming up with a good direction. I suggest that you take a look at these books, both of which contain many interesting project ideas:
- Computational Physics, T. Pang, 2nd Ed., Cambridge University Press (2006) ISBN-10:0521825695
- An Introduction to Computer Simulation Methods: Applications to Physical Systems, H. Gould, J. Tobochnik, W. Christian, 3rd Ed., Addison Wesley (2006) ISBN-10:0805377581
Or just come talk to me. I can suggest something.
Project proposal
Two or three typed page shoulds be sufficient. Commit to a particular topic, and flesh out how you intend to proceed. I want to get a sense of the scope of your project and what numerical techniques you intend to employ. Be sure to discuss what scientific question(s) your numerical study will attempt to answer.
Oral presentations
The final oral presentation should last no more than 20 minutes. Outline the problem of interest, the goals for the project, and the numerical strategies you've employed. Show us some of your numerical results, even if they are prelimary. Try to give the audience a meaningful interpretation of the data and a sense of how your results do or do not resolve the physics propblem you set out to investigate.
Final report
The final report should be type-written (in LaTeX, prefereably) and 15 to 25 pages in length, including figures and references. I have provided a template file that lays out the following structure:
- Introduction
- Model
- Numerical Method
- Implementation
- Benchmark Calculations
- Results
- Discussion
- References
These section headings are just a suggestion. You are free to organize your report as you see fit, so long as it adequately addresses each of these key areas: the motivation and background to the problem, the assumptions underlying the physical modelling, the choice and suitability of the numerical technique(s), the details of the C++ implementation, what tests were carried out to verify the code, and what the final results mean.
The report will be judged in part on the clarity of writing and presentation of data. I will also be looking for evidence that the numerical work was carried out carefully and that the reported results are reliable. In other words, I expect to see something along these lines: benchmark results matched against solvable cases, a systematic characterization of the errors, a stability analysis, etc.
The report and the program(s) you've written should be made available to me
in the public_html directory of your AICT-provided storage space.
(The projects are generally too big to send as an email attachment.)
Please bundle everything in a single archive named project580.tar.gz.
Along with the report (in pdf format), be sure to submit your C++
code (either well-commented or accompanied by an explanatory document).
And be absolutely certain that I will be able to compile and run it.
If you haven't yet activated your AICT home page, follow the instructions
below, replacing kbeach with your own CCID.
$ ssh kbeach@gpu.srv.ualberta.ca > mkdir public_html > fs setacl ~kbeach system:anyuser l > fs setacl public_html system:anyuser read > exit Connection to gpu.srv.ualberta.ca closed. $ scp project580.tar.gz kbeach@gpu.srv.ualberta.ca:public_html/
The last step, copying your file to public_html, can also be
accomplished via sambda or ftp. See here
for details. Simply notify me when the file is online.