An Introduction to Modern Computational Physics#

  • Physics 246, Fall 2023

  • Thursday 4:00-5:50pm CST

  • Room: Loomis 222

  • 2 credit hours

  • Course Texts: This one!

Welcome! Computation is powerful. In this course, you are going to learn how to use computation to do amazing simulations: compute how general relativity changes the orbit of Mercury; simulate turbulence; compute the effect of predator and preys on an ecosystem; run a quantum algorithm; and more! We’ve searched and distilled from the world some of the coolest physics we know for you to learn to simulate. Our primary goal in this class will be to help you make these simulations.

Here is an overview presentation of what you will learn in this class.


Course Logistics#

  • Lectures: R 4:00-5:50

  • Professor: Bryan Clark

  • TA: Siddharth Mansingh

    • email: sm38@illinois.edu

    • Office Hours: Thursday 9:00-10:00 am CST, Engineering Sciences Building, Room 3117

Online Tools#

  • Campuswire: We will use campuswire as a class forum; a way to message the course staff and each other; and to submit your attendance question. <<<<<<< HEAD

  • Google Colab: On Google Colab you will be able to program your code in a jupyter notebook and submit it for us to grade. Please sign in to your Illinois account. While working on the assignment, you will share each of your colab assignments with hte professor and the TA (but no one else). You can load it into google colab by just hitting the button on the jupyter book. Please make sure you then immediately save a copy to your drive! =======

  • Google Colab: On Google Colab you will be able to program your code in a jupyter notebook and submit it for us to grade. Please sign in to your Illinois account. While working on the assignment, you will share each of your colab assignments with the professor and the TA (but no one else). You can load things in google colab just by clicking on the relevant button in the notebook (looks like a shuttle). You must then save to your google drive and it will e there later when you go to google colab!

208840534ba0a7332abe03a2bdbb0552b157f66d

  • my.physics gradebook: You will find your grades here and your returned assignments.


Calendar#

Date

Assignment

August 24

N Ways to Measure PI

August 31

Dynamics

September 7

Orbital Dynamics

September 14

Exoplanets

September 21

Chaos

September 28

Many-Body Simulations

October 5

Particle Physics

October 12

Random Walks

October 19

Markov Chains

October 26

Predator-Prey

November 2

Fluid Dynamics

November 9

Classifying Galaxies

November 16

Fluxonium Qubits

November 30

Quantum Computing


Coursework#

Computational Assignments#

The heart of this course will be a series of computational assignments.

  • You will work on the assignments both during class and as homework.

  • Each assignment is due at the beginning of the next class unless otherwise noted. You may turn assignment in up to one week late for 50% credit (except that all assignments are strictly due the day before reading day).

  • Solutions to the homeworks will not be given.

  • The assignments consist of 95% of your grade.

  • Partial credit exists but will be limited.

  • You may collaborate on assignments but must submit your own work.

  • Homework will be returned through the my physics gradebook

Take-Home Final#

The take-home final is 5% of your grade will involve demonstrating and extending your work in class by doing something cool and interesting. You must work alone on this (i.e. without collaboration). The list of possible cool and interesting extensions are in the left-bar under “cool extensions for final.” Many of these are projects that are scheduled for future versions of this course but just aren’t written yet (and so are at the difficulty level of the other course projects). If you have a good idea that you would like to do, please let me know and I may approve it. Each option can only be taken by one person on a first-come first-serve basis. You can sign up on the google sheet at any point and also may change your project at any point. Projects may be added as the semester goes on. The projects are not all equally easy (but there are plenty of easy ones if that is your goal.) The projects are graded on a very coarse-grained 5 point scale:

  • 0 points: didn’t submit anything

  • 1 point: submitted something but nothing really works

  • 4 points: most of the project works but it is not complete

  • 5 points: everything works correctly.

  • 2 and 3 points will interpolate between 1-4 points.

For the take-home final you will put together a jupyter notebook that demonstrates your extension project. The should have code and demonstrate the task but also be written in an expository way that other students could read and learn from. We will post these projects in the the passworded area of the course website during the final period for your classmates to learn from.

Extra Credit#

There will be occassional opportunities to get extra credit. To zeroth order these exist because I think they are cool and useful for understanding computational physics but I can’t justify within the 2 credit hours of the course.

Extra credit assignments will often be described poorly (maybe even something like, `get a full solar system simulation working’). If you have questions about it, please ask before you spend too much time on it. Also, we have no obligation to make extra credit typo-free. Please try to answer the question we mean to be asking.

For the extra credit, per exercise, the grading is all or nothing. We aren’t going to hunt for typos and give partial credit for sortof working code. The amount of extra credit per exercise/etc is listed on the assignment.


Grading#

  • Computational Assignments: 95%

  • Take-home final: 5%

Your final numerical score is computed as 100 x (0.95 x (Homework Points + Extra Credit Ponts)/(Total Homework Points) + 0.05 x Final

The final breakdown of how your grade depends on your numerical score goes as:

  • 100+: A+

  • 90-100: A

  • 80-90: A-

  • 70-80: B+

  • 60-70: B

  • 50-60: B-

  • 40-50: C+

  • 30-40: C-

  • 20-30: D

  • 10-20: D-

  • 0-10: F

Scores are inclusive of the bottom number - i.e. a 90 gets an A not an A-. All problem sets count for the same amount. Unless otherwise noted, every exercise in a problem set counts an equal fraction of the assignment and every part (a,b,c,…) of an exercise counts as an equal fraction of the exercise. 5 points of the problem set will be for mandatory questions (e.g. time spent on assignment, references, collaborators).

Sometimes there are typos in the assignment (although we are working hard to remove them). Please ask when confused! Don’t spin your wheels a long time on something that might be a typo. These aren’t trick questions - we are trying to ask reasonable things.


Policies#

Attendance#

There is no attendance required for class (although we believe that coming to class will be helpful!) That said, please do not attend class if you are sick. In such a case, we will work with you to make sure you get caught up. No notes for sickness, etc are required.

About using code you find on the web#

The quickest way to deal with the arcana of programing is to ask Google for examples of what you are seeking to accomplish. But you will need to use your judgment in doing this: the Google search “how do I use color maps in python?” is fine, while “show me a script that calculates pi” is not. And you should always credit the original source of code that you paste into your own programs in a comment that includes the URL for the original code. If an author says that his/her code is not to be copied or incorporated into your programs, then DON’T.

The goal of this course is for you to deeply understand this material. For this to work, you’ll need to write your own code.

About Large Langauge Models#

In a similar vein, you aren’t allowed to use LLM for help. This includes chatGPT, google bard, claude, etc.

Academic Integrity#

You must never submit the work of someone else as your own. We understand that many of you will find it helpful to work with other students to master Physics 246. But when you collaborate with your study group on homework assignments, you must be a full, active participant in developing the solutions that you submit for credit.

It is cheating to receive answers from another student and then use them as your own. It is cheating to submit as your own work solutions that you find by searching on the worldwide web (though see “About using code you find on the web”), or by subscribing to an online service that suborns cheating. It is cheating—and a violation of U.S. copyright law—to give (or sell) course material to someone else who intends to redistribute and/or sell it.

All activities in this course, are subject to the Academic Integrity rules as described in Article 1, Part 4, Academic Integrity, of the Student Code.


Useful Python#

Why this course?#

As the needs of our students evolve—there is, for example, increasing focus on early readiness for research—the Physics faculty are obliged to adjust both what we teach, and how we teach.

There is a rich tradition of innovation in engineering pedagogy at Illinois. Fifty years ago UIUC became the first school to teach its undergraduates to design computers. More recently, our colleagues have become national leaders in successful efforts to improve instructional outcomes in elementary physics. We intend to continue this Illinois tradition by incorporating computational literacy into the set of core competencies to be mastered by our students.

Just as we require physics majors to enroll in courses taught by Mathematics, but teach the applications of mathematics to physics in our own courses, we hope to do the same with programming. We will continue to require that our students take an introductory course in Computer Science, while incorporating into our own courses machine-based approaches to problems that cannot be solved analytically. Examples include chaos and nonlinear phenomena; fluid dynamics; real-world electrodynamics; quantum mechanics of multi-electron atoms.

This course is a first step. From it, we expect that students will come away with a better grasp of complex phenomena and will be prepared to engage with research experiences that would otherwise have been inaccessible. This will bring to the department’s scientific efforts the collateral benefit of an enlarged pool of competent research assistants. If we are successful, our methods should generalize to other disciplines in science and engineering.

Background: The technical foundation for physics majors includes material in physics, mathematics, computer science, and chemistry. But though the courses taught outside the Physics Department provide an excellent introduction to important subjects, they are insufficiently dense in application to specific physics topics to stand on their own. We find this to be especially true in mathematics and computer science. Consequently, the Physics Department offers undergraduate and graduate courses on mathematical methods for physics, as well as a graduate course in computation.

Recently we have now added two new undergraduate courses in computational physics: this course and 446. By simulating physical systems and observing their (simulated) behaviors, students can more efficiently grasp concepts that might be otherwise obscured by mathematical equations. By developing their computational skills, students are better prepared to assist in data acquisition and analysis tasks in a research setting. In addition, about half of our graduating majors choose employment over graduate study; they often report that prospective employers are seeking to hire employees with computational skills.

Acknowledgements#

The current version of this course is developed by Bryan Clark. An earlier version of this course was developed and run by George Gollin and this current version has non-trival overlapping units and problems. The classifying galaxy assignment closely follows a tutorial at the Galaxy Zoo. The fluid dynamics assignment was originally inspired to get you to develop lattice Boltzmann code similar to that from flowkit.com. The jupyter-ization of the course was done by Ryan Levy and Bryan Clark.