Physics 411: Computational Physics
Winter 2012

Time:Tuesday and Thursday, 10-11:30am
Room:1250 USB
Instructor:Mark Newman
Office:322 West Hall
Office hours:Mondays 1:30-3:30pm

Quick links:


The use of computers in physics has grown enormously in the twentieth and twenty-first centuries, to the point where computers play a central role in virtually every new physics discovery. From particle physics and astrophysics to quantum computing and biophysics, calculations on computers have become one of the most indispensable tools of scientists today.

This course will give participants an introduction to the solution of physics problems using computers. Assuming no previous computer programming experience, the course will introduce the basic ideas and programming skills of computational physics and students will develop their own computer software to solve problems in quantum physics, electromagnetism, biophysics, mechanics, chaos, nonlinear dynamics, and other areas.


Calculus, linear algebra, and physics up to 390 will be required to understand the material. No previous programming experience is required. The course will make use of the Python programming language, and will begin with an introduction to programming in Python.

The course will require you to do a fair amount of programming work on your own time. One of the advantages of the Python programming language is that it is available for free, which means that if you have a computer of your own you can download a copy of Python and work on your own computer. You can find instructions for installing Python here. As we discussed in class, you should install version 2 of Python (probably version 2.7 in fact), for compatibility with some of the other software we need to use. Then, also for compatibility, you need to include the following line at the start of each program you write:

from __future__ import division,print_function
Note that there are two underscore symbols before the word future and another two after it.

If you do not own your own computer or you do but you prefer not to use it, computers are available in the Physics Department's Physics Authorized Users Lab (PAUL) on the second floor of Randall Lab (vertically above the Physics Help Room, which is on the first floor, and next to the Computing and Technology Support office). Both Mac and Windows computers are available in PAUL, and all of them have the Python programming language already installed. PAUL also provides printers that you can use to print out material to be handed in. And even if you use your own computer for doing homework you can still use the PAUL printers for printing out the end results.


There will be weekly graded problem sets consisting mainly of programming challenges. Classroom time will be spent primarily on learning the principles and techniques behind computational physics methods; the homeworks are your chance to put those principles into action. A typical exercise will describe a physics problem that can be solved using a method studied in class and ask you to write a program to solve it and present your results.

Collaboration is allowed when solving exercises, but you must write your own programs and turn in your own work. Direct copying from other students is not allowed. Copying from any other source, including books or the Internet, is also not allowed.

There will be four take-home midterms during the semester which will consist of programming challenges similar to those on the homeworks. The exams differ from the homeworks in that collaboration is not allowed. All exam problems must be solved without consulting others or copying from any source. You will have 48 hours to complete each of the take-home exams. There will be no other homework in the weeks when there are midterms. There will be no final exam for this course.

The course grade will be 40% on the homeworks and 15% on each of the midterms.

There will be reading assignments for each lecture. The assignments are listed on the schedule below. Students are expected to do the reading for each lecture in a timely manner.

Course-packs and books

There is no textbook for this course. Instead there are two required course-packs, available from Dollar Bill Copying on Church Street. Ask for Physics 411, Professor Newman, Bin 6059 (course-pack 1) or Bin 6174 (course-pack 2).

I know of no current textbooks on computational physics using Python, but there are several good books that make use of other languages. If you want a second opinion on a particular topic you might like to consult one of the following:

As a general reference for numerical methods I can also recommend the following:


Here are some appendices to the course-packs that contain additional information you may find useful. Note that Appendix A is written with Version 3 of Python in mind, whereas we are using Version 2, so not all of the information it contains is correct for us.

Problem sets:

Programs and data files


DateTopicReadingOn-line resourcesNotes
Thursday, Jan. 5Orientation and Introduction to PythonChapter 1
Tuesday, Jan. 10Basic programming2.1, 2.2Homework 1Homework 1 handed out
Thursday, Jan. 12Loops and lists2.3, 2.4
Tuesday, Jan. 17For loops and functions2.5-2.7Homework 2Homework 1 due, Homework 2 handed out
Thursday, Jan. 19Speed and accuracyChapter 3
Tuesday, Jan. 24GraphicsChapter 4Homework 3Homework 2 due, Homework 3 handed out
Thursday, Jan. 26Integrals5.1, 5.2
Tuesday, Jan. 31Adaptive methods and Romberg integration5.3, 5.4Homework 4Homework 3 due, Homework 4 handed out
Thursday, Feb. 2Gaussian and multidimensional integration5.5-5.7
Tuesday, Feb. 7Differentiation and interpolation5.8, 5.9Midterm 1Homework 4 due, First midterm handed out
Thursday, Feb. 9Simultaneous equations6.1, 6.2First midterm due
Tuesday, Feb. 14Nonlinear equations6.3Homework 5Homework 5 handed out
Thursday, Feb. 16Maxima and minima6.4
Tuesday, Feb. 21Fourier transforms7.1-7.4Homework 6Homework 5 due, Homework 6 handed out
Thursday, Feb. 23The fast Fourier transform7.5
Feb. 28, Mar. 1No classWinter Break
Tuesday, Mar. 6Ordinary differential equations8.1Midterm 2Homework 6 due, Second midterm handed out
Thursday, Mar. 8Higher order equations8.2, 8.3Second midterm due
Tuesday, Mar. 13Adaptive methods8.4Homework 7Homework 7 handed out, Due March 27
Thursday, Mar. 15Boundary value problems8.5
Tuesday, Mar. 20No class
Thursday, Mar. 22Partial differential equations9.1
Tuesday, Mar. 27Relaxation methods9.2Midterm 3Homework 7 due, Third midterm handed out
Thursday, Mar. 29Forward time methods9.3Third midterm due
Tuesday, Apr. 3Spectral methods9.3Homework 8Homework 8 handed out
Thursday, Apr. 5Random processes10.1
Tuesday, Apr. 10Monte Carlo integration10.2Homework 8 due
Thursday, Apr. 12Monte Carlo simulation10.3Midterm 4Fourth midterm handed out
Tuesday, Apr. 17Simulated annealingFourth midterm due

Mark Newman