Physics 405: Advanced Computational Physics

This page gives my homework advice and hints. You'll probably also want to check out the main course website.

Homework

You'll be submitting your homework to me via email at wking (at) drexel (dot) edu. I've got pygrader reading my email, looking for messages with the [phys405:submit] tag in the subject, so make sure you include that when you mail in your submissions. The remainder of the subject should be the assignment title. For example:

Subject: [phys405:submit] assignment 1

You should get an automatic response acknowledging your submission. If you're concerned about the authenticity of the messages sent by pygrader, the OpenPGP key used by the robot is here.

Homework is due before class starts each Friday, so we will be able to discuss solutions in class.

Packaging

In order to practice good coding hygiene, you should package your submissions in gzipped tarballs with the following auxiliary files:

README
A plain text file describing the purpose of your package, explaining how to install and use your package, and providing information for users to contact you.
Makefile
A list of instructions that tell the make how to compile your program.
COPYING
The license under which you distribute your code. There are many possible options. Choosing an explicit license for your code makes it easy for others to know if and how they are allowed to use your code in their own projects.

This is an common format for distributing software, and it will make people who need to compile and use your code (e.g. me) more comfortable. The benefit of such a format is that I can unpack, build, and run your package using something along the lines of

$ tar -xzf whatsit-1.0.tar.gz
$ cd whatsit-1.0
$ make run

without having to dig to deeply into the gory details of your submission. Of course, I may dig in anyway, but at least I'll have a standardized starting point.

I've put together an example homework submission (with extensive comments) which you can use as a template (see also the more specific git template).

Graphs

All graphs and plots must have a title and properly labeled axes.

Office hours

I'll be hosting virtual office hours via IRC on newton (official times to be determined). To connect, SSH into newton and use irssi.

student@home$ ssh newton.physics.drexel.edu
student@newton$ irssi -c localhost

Useful tools

Version control

One tool that makes software development much easier is version control, even if you're the only one using your code. Version control lets you keep track of your history, so it is easy for you to decide if the version your foo project that you found on your laptop is more recent than the version you just discovered on the department server. If you've made well-commented commits, it will also tell you what you were thinking when you wrote a particular line of code or fixed a particular bug.

Using a version control system is really easy with distributed version control systems like Git and Mercurial. For example, using Git can be as simple as:

$ cd (project-directory)
$ git init
$ (add some files)
$ git add .
$ git commit -m 'Initial commit'
$ (edit files)
$ git commit -am 'Add contact information to README'

For a more detailed introduction to Git, take a look at the Git Book.

If you want to use Git for the assignments, checkout my template repository.

$ git clone ssh://newton.physics.drexel.edu/~wking/phys405-2012.fall/assignment
$ cd assignment
$ git checkout sudoku

stackoverflow

When you have a coding problem, you are probably lucky enough that someone else has already come across that same problem and solved it. You can try and find those people using a general search engine, but you can also use stackoverflow, which is an excellent repository of questions, which usually have high quality answers like this one.