Foundations of Modern Scientific Programming
McMaster University, Fall 2022
Prof. Barak Shoshany
Table of contents
CSE 701 is intended to give the students a good understanding of computing, solid programming skills in C and C++, experience with debugging, optimization, algorithm design, and numerical calculations, and the ability to produce high-quality and well-organized scientific software, both on their own and in collaboration with others. Please see the table of contents of the lecture notes for a detailed outline of the course.
This is an advanced graduate-level course, and is not intended to be a first introduction to programming. Therefore, students must possess basic prior knowledge of some programming language (any language will do) in order to take this course.
About the professor
The professor for this course is Dr. Barak Shoshany (ħe/ħim). I did my BSc in mathematics and physics at Tel Aviv University in Israel and my MSc and PhD at Perimeter Institute for Theoretical Physics in Waterloo, Ontario. I then taught at the University of Toronto for a short time. I joined Brock University as Assistant Professor in September 2020, and I also teach scientific computing at McMaster University.
I am a theoretical, mathematical, and computational physicist. My research focuses on the nature of time and causality in general relativity and quantum mechanics, as well as symbolic and high-performance scientific computing.
I am particularly interested in time travel; I wrote a popular article about my research on The Conversation and was even interviewed about it on the TV show The Agenda. I'm always happy to talk about my research, and theoretical physics in general, so please feel free to ask me about it, both in and out of class!
When I'm not teaching or doing research, I love composing music (look for my album Travel Music About Time on all music streaming services!), playing video games, board games, and tabletop role-playing games, and posting science jokes and puns on my Twitter account.
I will only physically be at the university on Tuesdays, and will hold my office hours immediately after every lecture. You are strongly encouraged to attend the office hours if you want to talk about anything related to the course.
The best way to ask questions about the material outside of class and office hours is to post them on Microsoft Teams so that other students can also see the question and add their own answers. I will answer any question posted on Teams as soon as I can.
For personal matters, please do not hesitate to email me directly at email@example.com. If you need to meet outside of class and office hours, please let me know and we can schedule a video chat on Teams.
Schedule and logistics
The course will take place during the Fall 2022 term, from September 6 to December 8, 2022. There will be one 3-hour lecture every week:
There will be no lectures during the mid-term recess, October 10-16, 2022. Thus we will have 13 weeks of 1 lecture each, for a total of 13 lectures and 39 hours.
The lectures will be delivered in person, at room 312 in Hamilton Hall. Important: Students must adhere to the COVID-19 guidelines listed below.
Students should bring their laptops to class, in order to run code examples during the lectures by copying and pasting from the lecture notes. However, this is not mandatory, as some students may prefer to focus on listening to the lecture itself and run the code examples on their own time later.
Please make sure to bring your laptops to the first lecture, as we will be installing the software required to take the course (IDE and compiler), and I would like to make sure every student is able to install the software successfully during the lecture.
There is no textbook for this course. The official course lecture notes, written by the professor, contain everything you need to know. They are available to view directly on this website in HTML format.
View the lecture notes
I originally wrote these notes while teaching this course in 2020, and they were updated and expanded in 2021. I will continue to update them as needed this year as well. The lectures in this course will follow the notes very closely. If you choose to download the notes for offline use, please make sure to always have the most up-to-date version.
IDE and compiler
Throughout the course, we will exclusively use the 64-bit versions of:
Both are cross-platform and work on Windows, Linux, and macOS. Instructions for installing and using them can be found in the lecture notes, and will also be given in the lectures.
All student projects will be evaluated by the professor using the 64-bit version of GCC, so the students must use the latest version of this compiler when writing their code, to ensure compatibility. This compiler is cross-platform, so all of the students should be able to use it regardless of their OS or CPU architecture of choice.
Using Visual Studio Code is mandatory as well. Advanced students may ask the professor for permission to use a different IDE, but please note that I will not be able to provide technical support in that case.
Assignments and grading
There will be 3 course projects, roughly one per month. The topics for the first 2 projects will be determined by the professor, and all students will submit the same project. For the final project, each student will choose a different topic based on their personal and/or research interests, subject to approval by the professor.
The final grade in the course will be composed of the project grades, with the following weights:
For the final project, the students will first submit a draft version. The professor will provide the students with feedback on their drafts, without grading. Each student will have 1 week from the time they received the feedback to submit the final version, with all the issues outlined by the professor fixed. The grade will be determined by the final submission.
Mandatory guidelines (automatic zero if not satisfied):
If any of the above guidelines are not satisfied, I will notify you by email, and you will get 24 hours to fix your submission. If it is not fixed by then, your grade will be an automatic zero. The reason is that if you program does not satisfy these guidelines, then grading it would be either impossible (e.g. if your program does not compile, then I cannot test that it runs properly) or just extremely time consuming (e.g. if your program takes input during runtime, then I would have to sit down and type the input all over again single every time I run it).
The program itself:
Additional guidelines only for the final project:
Appropriate final project topics
First of all, and most importantly, since all students in this course are graduate students, a natural choice is to prepare projects directly related to computational aspects of your research. You may want to consult with your supervisor and/or fellow grad students and figure out a suitable project together.
Another option, in case you have not yet started to perform research or your research does not involve any computational component, is to write your own implementation of a known algorithm of sufficient complexity. For this you can consult, for example, the list of algorithms on Wikipedia.
Some suitable examples include differential equation solving, Monte Carlo methods, numerical integration, various computational physics algorithms, statistical analysis, computer graphics, cryptography, machine learning, parsing, error correction, compression, signal processing, and image processing.
It is preferable that the entire project is self-contained consists only of code that you wrote yourself. If necessary, with my permission, you may use third-party code to, for example, read or write image files for computer graphics or image processing algorithms, perform arbitrary-precision integer arithmetic for cryptography algorithms, and so on. However, you must still implement the actual algorithms yourself.
Simple algorithms like searching, sorting, integer factorization, and so on are not complicated enough to constitute a project on their own. However, you could, for example, write a program which implements the same task using several different algorithms and performs comprehensive performance tests to see which algorithm performs best. Note that a performance test must involve not just measuring time but also performing statistical analysis (e.g. perform the same test several times and calculate the mean and standard deviation).
Your health and safety is very important to me! Since this course is delivered in person, all students are encouraged to adhere to the following COVID-19 guidelines:
If you have any questions, comments, or concerns, please do not hesitate to post them on Teams, send me a direct message on Teams, or email me.