|
Home > Courses > 5P10
|
PHYS 5P10
- Introduction to Scientific Computing
Course outline
What Brock calendar entry says (slightly revised for the current calendar):
-
Survey of computational methods and techniques commonly used in condensed matter physics research; graphing and visualization of data; elements of programming and programming style; use of subroutine libraries; common numerical tasks; symbolic computing systems. Case studies from various areas of computational physics. Discipline-specific scientific writing and preparation of documents and presentations.
What do I need to bring into the course?
- This course is a core course of the MSMP program, and is recommended to all Physics graduate students. Basic familiarity with Linux is assumed, and will be reviewed briefly.
Course Goals
- to develop a working knowledge of interactions with Linux OS
- to become proficient in experimental data graphing and numerical analysis
- to gain working knowledge of program development
- to become familiar with one or several interpreted programming environments, and to acquire basic scripting skills
- to become proficient in LaTeX and use it for scientific papers and presentations
Textbook
There is no formal textbook for the course. A number of online resources are available and can be used as reference material for the lectures. Some of these are:
This list will grow as the course progresses.
This is an approximate outline. Topics not on this list may get covered as time permits.
- A common toolbox
- interacting with the OS; CLI vs GUI
- Linux as a collection of small tools + pipes between them
- the basics of programming: shell, C, scripting languages
- code development: edit, compile, run, make and Makefile structure, elementary debugging, linking to program libraries
- visualization with gnuplot and other graphing tools
- Numerical methods
- Numerical differentiation: finite differences, interpolation, root finding
- Numerical integration: special functions and quadrature
- Solution of Ordinary Differential Equations: Euler-Cromer, Runge-Kutta
- Linear algebra: methods of solving systems of equations and eigenvalue problems
- Stochastic Methods:Random number generators, importance sampling, Molecular dynamics, Monte-Carlo techniques
- Case Studies/Projects
- Least-squares problem: experimental noisy data, noise distribution and filtering, importance of baseline, assumption of Gaussian noise, chi-squared; classification of LS problems, regularization and selection of lambda. Test case: a spectrum of exponential relaxation rates
- Molecular modeling: protein database data, force fields, GROMACS simulation package. Test case: a lipid bilayer with cholesterol guests (T.Harroun)
- Models of solids: Ising model, magnetic moment, temperature, heat capacity, Metropolis' algorithm. Test case: magnetic transitions in an Ising lattice
- Image Analysis: filtering to remove noise, segmentation to isolate regions and objects of interest, regional and spectral analysis to extract statistical data. Test case: spatial frequency distribution of a line image
Component |
% of the final mark |
Notes |
Projects |
70% |
Six (or seven, time permitting) extended projects. Project submissions should be made in the form of a jupyter notebook file, via email to the instructor. |
Final presentation |
30% |
One of the projects (selected at random) submitted in the form of a scientific journal submission,
using Phys. Rev. or Can. J. Phys. format, and presented in-class as a research seminar. |
Here is a summary of our expectations of you, which are your responsibilities. You are expected to:
- Attend each scheduled lecture and laboratory session;
- Do your work honestly and maintain academic integrity (see a separate section below for details);
-
Take responsibility for your own learning.
The lectures/tutorials are there to guide you and assist you, but only you can actually do
the hard work of learning the course material. To get the most out of the
course, work on it a little bit every day. Daily work is key for placing your
learning in long-term memory, where it will be readily available to help you to
advance your knowledge in subsequent years.
It is way too late to start working on a homework assignment the night before it is due.
-
Take pride in your work. After completing the computational tasks, take a look at the
presentation: is it neat? is it clear? can it be made more efficient/effective?
does it tell an interesting story to the reader?
Effectively communicating your results to others is an important aspect of being a physicist,
aim to hone your communications skills.
-
Use your time effectively. Study smart, instead of hard. Ask questions in
class. Your instructor has an open-door policy, so outside of a few restricted
hours, you are always welcome to come and ask a question one-on-one. Do not
wait until you have a "worthy" pageful of questions - that's too long to let
them fester unanswered. It is better to come three times with one or two
questions than once with a list accumulated over the past several weeks, when
things get too desperate.
-
Week 1. Due Thursday Sept.12
-
- Cover all sections until the "Advanced Unix/Linux", but including the "File System Basics" from www.tutorialspoint.com/unix/.
- Develop a personal "cheat sheet" of useful commands.
- Choose an editor (vi or gedit) and learn its basics
- Learn to use "jupyter notebook" to keep notes in this class; see /work/5P10/Lectures.
-
Week 2. Due Thursday Sep 19
-
- Familiarize yourself with the "Advanced Unix/Linux" from
www.tutorialspoint.com/unix/.
- Complete a bash script for your choice of a task, involving file operations,
searching for textual information inside files, etc.
- Review and revise the skeleton Makefile distributed in the lecture;
adapt it to the needs of your version of packet.c.
- Modify and extend the functionality of packet.c to accept additional
command-line switches, with and without parameters. Add error checking against
invalid parameter values as needed.
- Read through packet.f and reconcile its code to the derivation
of the solution for the Schrödinger equation developed in class.
Convert the solution into a dimensionless form.
-
Week 3. Due Thursday Sep 26
-
- Complete the packet project. With the help of the existing Fortran code,
develop packet.c that calculates a Gaussian packet, at a moment
in time specified as a parameter at run time. Ample comments throughout your
code must make its logic and its overall structure clear to any reader.
- Develop a gnuplot script that runs your program repeatedly and demonstrates
the evolution of the packet encountering a square-well potential.
- Embed your code and your plots in a jupyter notebook, add markup cells that describe
what your project has achieved, and what you learned along the way. Make sure your name
is included in the top (header) markup cell of the project file.
- Your jupyter notebook must be submitted via email to the instructor.
-
Week 4. Due Thursday Oct 3
-
- Complete a plot and analysis of/work/5P10/Cavendish.dat,
extract the value of \( G \) and its error estimate, and produce a publication-quality plot.
Use one of eXtrema, gnuplot, octave, or python for plotting,
provide detailed comments in the script, and ensure that a different data set could easily
be analyzed using the same script, by changing only the data file name.
The distance to the board on which the position of the laser dot was recorded is \(L=10.31\)m.
-
Week 5. Introduction to MATLAB/octave
-
- Complete the introductory tutorial: basics, 2D and 3D plotting, loops, functions.
- Explore at least two advanced topics: ODEs, integration, least-squares fits, linear algebra methods (e.g. svd).
- Convert one of previously obtained graphing/fitting exercises (VI.dat, Cavendish.dat) to octave.
-
Week 6. Reading Week.
-
Week 7. MATLAB/octave analysis of global temperature trends. Due Thursday Oct 24
-
- Follow the skeleton of the project as posted in Lectures to learn how to
read in the data from remote sites, parse and plot it, bring into a common data structure with a
common time base.
- Perform regression analysis to determine the role played by the two obvious major influencers.
- Analyse trends in the adjusted data, with influencers removed.
-
Weeks 8-9. Inverse theory methods (to be submitted Nov.7)
-
- Review the concept of SVD decomposition.
- Analyze the skeleton code of regularize(); make sure you understand every line.
- Modify the main code by adding appropriate loops, etc. to reproduce the results
presented for the exponential example, including the L-curves, on the sample data
provided in /work/5P10/test.dat
- Automate the optimum selection of parameter λ. One possible approach is to seek the
value that corresponds to the shortest distance to the origin on the L-curve. Be efficient:
vary the step size in λ depending on how strong the dependence on λ is.
- Optionally, use your program to analyze a real experimental data set (in /work/5P10/Inverse/).
-
Week 9. Ising Model of ferromagnetism (to be submitted Nov.14)
-
- Modify
Evolve() function to implement the Metropolis algorithm.
- Calculate total energy and magnetization and keep a record of these.
- Repeat until the values settle to a stable equilibrium value; may need to ignore some early states that may reflect the initial conditions, wait until those are "forgotten".
- Change the temperature and repeat, recording the equilibrium values and the extent of fluctuations for each temperature.
- Plot magnetization as a function of temperature, find the conditions for ferromagnetic and antiferromagnetic transitions by exploring a range of parameters.
- As an independent part of the project, modify to consider one of:
- nearest- and next-nearest-neighbour interactions
- triangular lattice
- anisotropic spin-spin interactions, e.g. East-West coupling is different in strength from North-South coupling
- lattice of spins that can re-orient at their sites, with the Hamiltonian given by
$$
{\cal H} = - J \sum_{i,j} \vec{s}_i \cdot \vec{s}_j -\mu \sum_j \vec{h} \cdot \vec{s}_j
$$
i.e. dependent on the [cos of the] angle between the two nearest-neigbour spins, and of each spin with the direction of external magnetic field. Without loss of generality, one can assume that $\forall j, \vec{h}_j=\vec{h}=h\hat{k}$.
Academic misconduct is a serious offence. The principle of academic integrity,
particularly of doing one’s own work, documenting properly (including use of
quotation marks, appropriate paraphrasing and referencing/citation),
collaborating appropriately, and avoiding misrepresentation, is a core principle
in university study. Students should consult
“Academic Misconduct” section in the Undergraduate Calendar
to view a fuller description of prohibited actions, and the procedures and penalties.
The University takes academic misconduct extremely seriously and will follow its
strict procedures to the letter in all cases.
A helpful website explains Brock's Academic Integrity Policy.
Please consult it, as all students are expected to know and abide by its provisions.
Courses may use turnitin.com , a phrase-matching software, to verify originality
of your submitted lab reports and written assignments. If you object to uploading your assignmentsr
to turnitin.com for any reason, please notify the instructor to discuss alternative submissions.
Be aware that it is the policy of the Department of Physics that any academic
misconduct including (but not limited to) possessing, using or accessing
unauthorized material in any form (including online) during final exams or
assessments will automatically result in zero grade for the exam. Since
most courses require a minimum passing grade on the final exam to complete the
course, this will likely lead to a failure in the course.
FMS Penalties for Academic Misconduct
Unless otherwise specified, the Department of Physics follows the following
minimum penalty guidelines for cases of academic misconduct in the Faculty of
Mathematics and Science (FMS). Please be aware that the Associate Dean,
Undergraduate Programs, may assign different penalties than those listed here,
depending on the details of individual cases. Also note that cheating on exams
carries significantly higher penalties.
- First offence:
- Zero grade on the assignment, additional penalty of 100% of the weight of the
assignment to be subtracted from the final grade, mandatory completion of the
AZLS Academic Integrity workshop
- Second offence:
- Zero grade on assignment, additional penalty of 100% of the weight of the
assignment to be subtracted from the final grade, 4-month suspension
- Third or additional offence:
- Zero grade in the course, 1-year suspension, permanent removal from major program.
FMS Penalties for Misconduct in Final Exams
- First Offense:
- Zero grade in the course.
- Second Offense:
- Zero grade in the course, 4 month suspension.
- Third Offense:
- Zero grade in the course, 1 year suspension, permanent removal from major program
- Fourth Offense:
- Permanent Suspension, debarment.
Intellectual Property Notice
All slides, presentations, handouts, tests, exams, and other course materials created by the instructor in this course are the intellectual property of the instructor. A student who publicly posts or sells an instructor’s work, without the instructor’s express consent, may be charged with misconduct under Brock’s Academic Integrity Policy and/or Code of Conduct, and may also face adverse legal consequences for infringement of intellectual property rights.
Use of Generative AI (GenAI)
In the age of GenAI (e.g., ChatGPT), our expectation of you remains the same as it ever was: original academic work, following the instructions of the assignment determined by the instructor for this course for requirements, expectations, and parameters for completion and submission of your work for grading. Therefore, the use of GenAI tools and GenAI-generated content is not allowed (unless explicitly requested/instructed) as a resource or source for answers and discussion in submitted work. Unauthorized use of GenAI will be treated as an academic misconduct.
You probably won’t find much use of GenAI in this course anyway, even when writing something like a lab report. Why? GenAI doesn’t know what you did in the lab. GenAI may know a lot about the overall idea you were studying, but not how you demonstrated it. In your lab reports, your answers and discussion need to relate to what you did and the data you took.
Important dates
Please be aware of all the important dates, such as the first/last days of classes,
snow days and reading week, as well as the deadline for withdrawal without academic penalty.
For the current academic term, this information can be found here.
Relationship between attendance and grades
Unless the instructor announces otherwise, students are expected to attend all classes and labs and must submit all assignments in order to pass this course.
Accommodations
The University is committed to fostering an inclusive and supportive environment for all students and will adhere to the Human Rights principles that ensure respect for dignity, individualized accommodation, inclusion and full participation. The University provides a wide range of resources to assist students, as follows:
-
If you require academic accommodation because of a disability or an ongoing health or mental health condition, please contact Student Accessibility Services at askSAS@brocku.ca or 905 688 5550 ext. 3240.
- Medical Self-Declaration Forms (brief absence up to 72 hours)
In the case of a short-term medical circumstance, if a student wishes to seek an academic consideration, please use the Medical Self-Declaration Form. The request is to be made in good faith by the student requesting the academic consideration due to a short-term condition that impacts their academic activities (e.g., participation in academic classes, delay in assignments, etc.).
The period of this short-term medical condition for academic consideration must fall within a 72-hour (3 day) period. The form must be submitted to the instructor either during your brief absence or if you are too unwell, within 24 hours of the end of your 3 day brief absence.
Medical Verification Form (extended duration)
In cases where a student requests academic consideration due to a medical circumstance that exceeds 72 hours (three days) and will impact their academic activities (e.g., participation in academic classes, delay in assignments, etc.), or in the case of a final exam deferral, the medical verification form must be signed by the student and the health professional as per process set out in the Faculty Handbook III:9.4.1.
-
If you are experiencing mental health concerns, contact the Student Wellness and Accessibility Centre. Good2Talk is a service specifically for post-secondary students, available 24/7, 365 days a year, and provides anonymous assistance. Follow the above link or call 1-866-925-5454. For information on wellness, coping and resiliency, visit: Brock University (Mental Health).
-
If you require academic accommodation on religious grounds, you should make a formal, written request to your instructor(s) for alternative dates and/or means of satisfying requirements. Such requests should be made during the first two weeks of any given academic term, or as soon as possible after a need for accommodation is known to exist.
-
If you have been affected by sexual violence, the Human Rights & Equity Office offers support, information, reasonable accommodations, and resources through the Sexual Violence Support & Education Coordinator. For information on sexual violence, visit Brock's Sexual Assault and Harassment Policy or contact the Sexual Violence Support & Response Coordinator at humanrights@brocku.ca or 905 688 5550 ext. 4387.
-
If you have experienced discrimination or harassment on any of the above grounds, including racial, gender or other forms of discrimination, contact the Human Rights and Equity Office at humanrights@brocku.ca.
For a full description of academic policies in the Faculty of Mathematics and Science, consult brocku.ca/mathematics-science/
|
|