Physics 307: Science and Computers I, aka Computational Physics


At a glance:

  • Tuesday and Thursday, 5:00-6:20 PM, Physics Building 208
  • Instructors:
    • Walter Freeman, lead instructor: wafreema@syr.edu, office Physics Building 215
    • Jada Garofalo and Nico O’Neill, peer coaches
  • Office hours: Monday 12-3, Wednesday 2-5, or by appointment
  • Course website: https://walterfreeman.gitlab.io/phy307/ (you are likely here now)
  • Email address for homework submissions: suphysics307@gmail.com
  • Slack team for questions and conversation: suphysics.slack.com
  • Discord server for the Physics Department: https://discord.gg/SYuYbz44bp
    • Slack or Discord are the best ways to ask technical questions and get a quick answer from teaching staff

Office hours

  • Wednesday 2-5pm; Monday 12-3pm, in either Physics Buliding room 112 (the Physics Clinic) or my office in room 215; other times by appointment

Learning objectives

After this class, students will be able to:

  • model physical systems in ways suitable for a computational solution
  • make and defend an informed choice of a numerical algorithm to simulate these models
  • implement these algorithms using tools used in professional research, such as C, Python, Linux, and gnuplot
  • visualize the data from their simulations in ways that contribute to “data storytelling”
  • validate and interrogate simulation results, since numerics often involve many approximations
  • synthesize insights about general principles of physics from their simulations
  • explain these insights and the process that led to them in technical prose reports

Course overview:

This course is an introduction to the art of using computers to aid in solving problems in physics and other sciences. You will learn the basics of programming a computer to do computations and physical simulations, as well as the equally important skill of interpreting the results that the computer gives. In this course we will teach you to use the C or Python programming languages on a Linux system, but what you learn here will apply to many other languages and architectures. In fact, any of you who know another serious programming language are welcome to use it instead of C or Python in my class; this list includes Fortran, Rust, Julia, Java, Perl, and many others that I haven’t heard of.

First we’ll study the basics required to get around a Linux environment and learn some simple programming. Then we will learn how to use those skills to accomplish some mathematical tasks, e.g. integrating functions. As part of our study of numerical integration, we will develop the tools required to answer questions like “How well can I trust a numerical calculation?” and “On what things does the numerical result depend?” We will then apply these skills to model various physical situations, picking up new programming and computational skills along the way. One of the most important is knowing how to interpret results from the computer, and when to suspect that your simulation isn’t accurately reproducing what you want it to reproduce. Along the way, you’ll discover how readily you can use computers to uncover insight about physics that aren’t widely known.

While we will study computer programming and the Linux environment, and these things are important aspects of this course, these are only tools; the emphasis in this course will always be on the physics and computational science, even though you will spend a lot of time programming. However, the Unix command-line environment we will be using is the gold standard for scientific computing. The tools you will learn in my class are the same tools used to program ten-thousand-processor supercomputers.

I want to make sure you all know that my door is always (figuratively) open to help you with whatever other issues arise this semester. If you need help in another class or if you just have a question about physics in general, please ask me. I am a teaching professor, so it is my full-time job to help students!


Course requirements:

This class is going to be a significant amount of work; I have high standards for what I want you to accomplish. However, you have a team of people on your side to help you: Nico, Jada, and your classmates. This class is emphatically not a class in which you attend lecture, learn things, go home and work by yourself, and submit a fully-formed clean result. Computational physics, and especially the process of learning it, is messy. You should ask questions – early and often. The teaching staff and I will all be happy to answer your questions in class. Help session hours are a good time to work on your projects, when folks are around to answer your questions.

In our class, we expect you to:

  • Come to class consistently.
    • In the past, students who frequently miss class have had an extremely difficult time, since this is a class where you are intended to “learn by doing” alongside the teaching staff. Class isn’t a lecture you can make up by reading a textbook; it’s a chance to hack on things and ask questions.
  • Work outside class on your projects and ask us questions as they arise.
    • There is no substitute for time spent in front of a computer hacking in learning computational science. You will need to put in substantial time outside of class working on your projects.
  • Finish the code for your project several days before the project due date so that you have plenty of time to spend thinking about what your data mean and writing your report.
    • Remember that this class is not a computer programming class; computer programs are only the tools we are using to do physics. The point is the physics.

Asking for help

Please contact any of us with questions that arise outside of class; you will often get a prompt response. The best way for you to get help is to send a message to the #physics307 channel on the Slack team; otherwise, you can email me Our class emphasizes or stop by my office at Physics Building 215. You can also join the Physics Department Discord server at https://discord.gg/SYuYbz44bp.

I encourage you to ask us to help you debug your programs once you’ve made an effort to figure it out yourself; while learning to debug code is important, I don’t want you to waste six hours trying to track down a missing minus sign or curly brace. We are here to help you! As a general rule, if your program isn’t compiling, write to us after five to ten minutes of trying to figure out what is wrong; if there is a bug of another sort, email us after fifteen to thirty minutes of trying to figure it out on your own. To encourage you to ask for help, there’s a participation component for the class – and asking questions out of class will earn you points as well as helping you learn things!

Some tips for asking questions:

  • Send us your code. (Paste it into a message – don’t send us a cellphone picture!) We will want to run it to see what it does.
  • Send any error messages you get.
  • Describe what you want the code to do, how you think it should work, and what it does instead of what you want it to do
  • Describe what you have tried already

We will be covering a lot of ground in this course, so if you don’t understand something or fall behind, ask for help; that’s what we am for. Learning computational physics often involves a lot of personal coaching and messy practice – it is more like learning to play the guitar than learning geography. (We will learn something about guitars in our class, in fact!)


A project-based course?

This course has no textbook, as few lectures as I can get away with, and a nonstandard/optional final exam. Instead, the bulk of your opportunity to learn computational physics and to demonstrate what you’ve learned will come from the computational projects you will complete throughout the semester. You will have time during class to begin your projects, but you will also work on them outside.

After completing each project, you will write a report (in prose, not in code) describing what you did. This report should focus on computational science, algorithms, and physics – not mostly on programming nuts and bolts. (A little discussion of programming is okay.) Your report should address questions like:

  • What are you trying to study? What questions are you trying to answer?
  • What algorithms are you using? How are you modeling the system in question?
  • Were there any particularly thorny issues in writing your simulation? How did you address them?
  • What data did you generate? (Graphs, animation captures, and the like…)
  • What do your data mean? Why do they look the way they do, and how do you interpret them?
  • What’s the answer to the question you posed in the beginning?
  • What insights into computational science and physics did you develop along the way?

You should invest a substantial amount of time into writing your report. In general, your work for your projects will fall in three categories:

  1. Write some code that calculates or simulates something
  2. Use that code to calculate or simulate the thing, study its behavior, and interpret your results
  3. Write the report that describes your findings.

Don’t underestimate the effort it will take to do (2) and (3) well; in this class, writing your code is only the first step.

We will grade the project reports and give you a grade, and give them back to you with comments. If you submit a complete report by the due date, but one that contains errors that result in it earning a low grade, you will have the opportunity to meet with the teaching staff, figure out your mistakes, and revise and resubmit your report for a higher grade. You may only do this if your original submission was on time.


Grading philosophy:

Many classes have the following pattern:

  • There are lectures and homework, where you spend a lot of time learning stuff (we hope)
  • There are exams, where you have a little time to do sutff
  • If you are able to do the stuff, you get a high grade; if not, you get a low grade
  • The difficulty of the exams is set so that some students, but not all, can do the stuff well

This class, instead, has a different pattern:

  • There are short lectures, where I introduce some stuff
  • You spend a lot of time doing stuff, and we help you along the way
  • You write about the stuff and what you learned from it
  • Your grade is based on the stuff you did and the insight you get from it

Your grade will be based on the things that you learn and achieve, not a high-stakes exam that you either pass or fail. Instead, if at any point you haven’t learned something yet – no sweat: we will help you learn it.

This means that we will support you as you progress through our course. If you feel like you’re getting behind, please come talk to me; in the past, we’ve had multiple students fall behind and catch up. —

Grading

Most of your grade will come from the project reports.

If you will be late turning in a project, let us know in advance and request an extension. Otherwise, late reports may receive a 10% penalty per day. This is just to encourage you all to stay current with what we’re introducing in class.

The following percentages are approximate and subject to change based on how the semester unfolds.

  • Projects: 55%
  • Participation: 15%
  • In-class exercises: 15%
  • In-class short quizzes: 15%

The in-class quizzes will be brief and will be designed so that if you’re keeping up (coming to class, etc.), they should not pose a problem.

Your participation grade will be based on your in-class work on your projects, in particular your interaction with teaching staff and your peers. Anyone who is regularly in class, asking questions, and/or discussing projects with their peers will earn the full 15% here.

There is no scheduled final exam for this course. Instead, your final project submission will be due at the time that your final exam would be held.

Incompletes: A grade of “incomplete” is a provisional grade given to any student who is unable to complete the coursework during the semester due to unavoidable personal problems. In general, a student is eligible for an incomplete if they are substantially unable to come to class or study for a period of two weeks or more, or for one week in the last month of class, due to personal illness or injury, illness or injury in the family (including close friends and significant others), legal involvement, or international issues. Please contact me if you feel that you might need to take an incomplete in my class, and we can discuss your options.


Computing environment

As you might expect, you will be using computers quite extensively in my class. Since we don’t have a computer lab available, you will need to use your own laptops, and you will need a Unix environment on them to work in.

Any of the following will work:

  • A computer running Linux
    • If you want to set up a Linux dual-boot on your laptop, ask me and I’ll help you with that
  • A computer running Windows 10 or Windows 11 with Windows Subsystem for Linux installed
  • A computer running macOS (x86 or Arm) – there will be a few glitches here and there but it will work
  • A computer running any operating system with a Linux virtual machine

If you don’t have a laptop, if for whatever reason you can’t run the needed software on your laptop, or your laptop breaks, we can loan you one. Please talk to me if you need this option.


Students with disabilities:

If you believe that you need accommodations for a disability, please contact the Center for Disability Resources, located in Room 309 of 804 University Avenue, or call (315) 443- 4498 for an appointment to discuss your needs and the process for requesting accommodations. CDR is responsible for coordinating disability-related accommodations and will issue students with documented disabilities Accommodation Authorization Letters, as appropriate. Since accommodations may require early planning and generally are not provided retroactively, please contact CDR as soon as possible.

More informally, if there is anything I can do for you, please ask me. I am around to help you, whether that is with a disability, disruption due to illness, personal issues, or anything else. I have an excellent working relationship with CDR, and am willing to do anything in my capability to ensure that my class is accessible and welcoming to all.


Academic Integrity:

I encourage you to work on your projects in groups, and to receive help from and offer help to your peers. You must write your own code, with the exception of “pair programming” exercises in which you will collaborate with another student to get started on projects. I encourage you to get assistance from your peers with your work, although substituting someone else’s understanding for your own constitutes academic dishonesty. In the event that you receive substantial help from another student in writing your code, please acknowledge their help in the code comments. If you actually copy-and-paste code from another source, you must

  • understand how it works and what every piece of it does
  • tell me explicitly which code you copied and where you copied it from

Some of your projects may be group projects. In this case, obviously, you will share code/data/etc. and write your report jointly, but everyone in the group is responsible for understanding everything the group submits.

The complete Syracuse University code of academic integrity can be found online, and its requirements are incorporated by reference.

Use of generative AI and large language models

(The following is required text from the University)

Based on the specific learning outcomes and assignments in this course, artificial intelligence is permitted only as outlined here. See the following text for more information about what artificial intelligence tools are permitted and to what extent, as well as citation requirements. If no instructions are provided for a specific assignment, then no use of any artificial intelligence tool is permitted. Any AI use beyond that which is detailed in course assignments is explicitly prohibited except when documented permission is granted.

(The following is my text that clarifies the preceding)

The authors of ChatGPT and other models like it are working toward developing “artificial general intelligence” – computing platforms that can converse much like a human would. They are not there yet, and often provide hilariously incorrect responses to simple questions. However, for purposes of academic integrity, we are treating these tools just like we are treating a real human you might ask for help.

This means that if you ask ChatGPT a question so you can better understand physics or computer science, this is perfectly fine; we encourage you to work with your classmates in our course!

However, if you ask ChatGPT to tell you how to do your homework for you – thus substituting its understanding for your own – this constitutes academic dishonesty in the same way that asking someone else to write your code for you would be.

Since we are interested in how students use generative AI, we are requiring you to document and cite your use of these tools. If you have used generative AI to help you complete your homework, you must cite the specific tool you have used and provide a brief description of how you used it. You must also keep a record of any “conversation” you had with ChatGPT or similar (including your prompts and its responses) and attach this record along with your project submission.

You may not copy code produced by any generative AI tool into your own code. Likewise, you may not copy text from any generative AI tool into your reports; they must be composed solely by you.


Religious observances:

(The following is common to all SU classes)

SU’s religious observances notification and policy recognizes the diversity of faiths represented among the campus community and protects the rights of students, faculty, and staff to observe religious holidays according to their tradition. Under the policy, students are provided an opportunity to make up any examination, study, or work requirements that may be missed due to a religious observance provided they notify their instructors before the end of the second week of classes. An online notification process is available for students in My Slice / StudentServices / Enrollment / MyReligiousObservances / Add a Notification.

(The following is specific to this class)

I believe SU’s religious observance policy excludes nonreligious people by privileging religious observances over secular events of equal importance. Thus, events of equal solemnity to major religious observances, occurring on inflexible dates, will be given the same deference as religious observances. This includes weddings and commitment ceremonies of immediate family members, funerals, caregiving duties for sick family members, other family emergencies or singularly-important events, job interviews, and the like. Close friends and romantic partners are considered family.

Additionally, participation in political activity or the democratic process – attending a demonstration, canvassing for a campaign, serving as a poll worker, or the like – will be given this same deference, regardless of affiliation.

If you need to miss class for such a reason, please notify Dr. Freeman as far in advance as practical to discuss arrangements.