Phys3274 Computational Physics


E.S. Swanson
404 Allen Hall

class meets Tuesday and Thursday, 2:30-3:45, 106 Allen Hall.

Office Hours: Tuesday and Thursday, 3:45 - 5:00. You can stop by anytime, but it might be safer to make an appointment.

Course Description:

Physics 3274 is a graduate course on computational physics. It aims to develop or reinforce programming skills, numerical analysis skills, familiarity with some important problems in computational physics, and their methods of solution. The course will employ the C++ language, hence some familiarity with C (or better, C++) is recommended. Primary topics to be discussed are (1) C++, including the concepts of object-oriented programming; (2) numerical techniques, including essential methods of integration, discretization, Monte Carlo, and diagonalization; (3) physics, including percolation, chaos, classical dynamics, many-body systems, spin systems, continuum mechanics, quantum mechanics, and data modelling. Additional topics such as parallel computing and sockets will also be covered.

Course Objectives:

By the end of PY3274 the student will be able to:


A standard reference in the field that I recommend buying is

This book used to be acquired for its code, but these days it will be more valuable for the discussion of techniques and algorithms. The third edition uses C++.

Supplementary Texts:

Marking Scheme:

0.7 assignments + 0.3 final project


depending on time and interest, we may cover some of the following:



This course covers a lot of material, so, while it is self-contained, it is best to come prepared. This means Don't panic: help will be available for the latter two; we will discuss C++ in class (but you should do more reading out of class); and I will provide physics reminders as we go.

Things to do before class begins:






Academic Integrity:

Students in this course will be expected to comply with the University of Pittsburgh's Policy on Academic Integrity. Any student suspected of violating this obligation for any reason during the semester will be required to participate in the procedural process, initiated at the instructor level, as outlined in the University Guidelines on Academic Integrity. This may include, but is not limited to, the confiscation of the examination of any individual suspected of violating University Policy. Furthermore, no student may bring any unauthorized materials to an exam, including dictionaries and programmable calculators.

Disability Services:

If you have a disability for which you are or may be requesting an accommodation, you are encouraged to contact both your instructor and Disability Resources and Services (DRS), 140 William Pitt Union, (412) 648-7890,, (412) 228-5347 for P3 ASL users, as early as possible in the term. DRS will verify your disability and determine reasonable accommodations for this course.

Images from the Course

Affine Map
Logistic Map Bifurcation Plot
Damped, Driven Oscillator Phase Map
Exponential Function with the
Quotient-Difference Algorithm and
Pade Approximants
Argon gas Molecular Dynamics, low temp
Argon gas Molecular Dynamics, high temp
Magnus Force and Golf Balls
1+1 D Advection-Diffusion
Argon Molecular Dynamics
pair correlation function.
Argon Molecular Dynamics,
Emergent Disorder
Logistic Map Invariant Density (mu=3.8)
1-d anisotropic Heisenberg Antiferromagnet
spin chain, L=24, g=-1
Accuracy in S-wave SHO eigenvalues
Magnetisation in the Ising Model
Spin-Spin Correlation Function
in the Ising Model
Ising Spins at kT = 2.5
Z2 Gauged Spin Model
average plaquette
1d aHAF extrapolation