Difference between revisions of "Simulation Methods in Physics I WS 2021/2022"
(Created page with "test") 
(fill page with information from last year) 

Line 1:  Line 1:  
−  +  == Overview ==  
+  
+  ;Type  
+  :Lecture (2 SWS) and Tutorials (2 SWS)  
+  ;Lecturer  
+  :Prof. Dr. [[Christian Holm]]  
+  ;Course language  
+  :English  
+  ;Location and Time  
+  :'''Lecture''': TBA  
+  :'''Tutorials''': TBA ([[Mariano Brito]]); TBA ([[Alexander Reinauer]])  
+  ; Prerequisites  
+  : We expect the participants to have basic knowledge in classical and statistical mechanics, thermodynamics, and partial differential equations, as well as knowledge of a programming language (Python and C).  
+  
+  The lecture is accompanied by handson tutorials which will take place TBA. They consist of practical exercises at the computer such as small programming tasks, simulations, visualization and data analysis.  
+  The tutorials build upon each other, therefore continuous attendance is expected.  
+  
+  == Course material ==  
+  
+  All course material (general info, lecture recordings, worksheets, ...) will be distributed via ILIAS (you join the ILIAS groups upon registration through C@MPUS)  
+  
+  == Lecture ==  
+  
+  === Scope ===  
+  
+  The first part of the course intends to give an overview about modern simulation methods used in physics today. The focus of the lecture will be to introduce different approaches to simulating a problem, hence we will not go too to deep into specific details but rather try to cover a broad range of methods. In more detail, the lecture will consist of:  
+  
+  ; Molecular Dynamics  
+  :The first problem that comes to mind when thinking about simulating physics is solving Newtons equations of motion for particles with given interactions. From that perspective, we first introduce the most common numerical integrators. This approach quickly leads us to Molecular Dynamics (MD) simulations. Many of the complex problems of practical importance require us to take a closer look at statistical properties, ensembles and the macroscopic observables.  
+  :The goal is to be able to set up and run real MD simulations for different ensembles and understand and interpret the output.  
+  
+  ; Error Analysis  
+  :Autocorrelation, Jackknifing, Bootstrapping  
+  
+  ; Monte Carlo Simulations  
+  :Since their invention, the importance of Monte Carlo (MC) sampling has grown constantly. Nowadays it is applied to a wide class of problems in modern computational physics. We want to present the general idea and theory behind MC simulations and show some more properties using simple toy models such as the Ising model.  
+  
+  ; Critical exponents in second order phase transitions  
+  : Finitesize scaling, universality concept, how to determine critical exponent with lattice spin models  
+  
+  === Course Material ===  
+  
+  { class="wikitable"  
+    
+  ! !! Date !! Subject !! Resources !! Remarks  
+  
+    
+  12021TBA  Organization, Introduction, MD Basics  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture01_slides.pdf Slides]   
+  
+    
+  22021TBA  Integrators Chaos, LJPotential, Units  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture02_notes.pdf Lecture Notes]   
+  
+    
+  32021TBA  Basics of Statistical Mechanics  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture03_notes.pdf Lecture Notes]   
+  
+  
+    
+  42021TBA  PBC, celllists, simple MD  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture04_notes.pdf Lecture Notes]   
+  
+  
+    
+  52021TBA  Observables, Brownian Motion, Diffusion  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture05_notes.pdf Lecture Notes]   
+  
+    
+  62021TBA  Diffusion, GreenKubo, Langevin Dynamics  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture06_notes.pdf Lecture Notes]   
+  
+    
+  72021TBA  Thermostats part 1  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture07_notes.pdf Lecture Notes]   
+  
+    
+  82022TBA  Error analysis  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture08_notes.pdf Lecture Notes]   
+  
+    
+  92022TBA  Thermostat part2 + Intro Monte Carlo  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture09_notes.pdf Lecture Notes]   
+  
+    
+  102022TBA  MonteCarlo Method and critical phenomena  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture11_notes.pdf Lecture Notes]   
+  
+    
+  112022TBA  Critical Exponents  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture12_notes.pdf Lecture Notes]   
+  
+    
+  122022TBA  Finite Size Scaling  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture13_notes.pdf Lecture Notes]   
+  
+    
+  132022TBA  Reweighting  [https://www.icp.unistuttgart.de/~icp/html//teaching/2019wssim_methods/lecture14_notes.pdf Lecture Notes]   
+  
+  }  
+  
+  
+  === Script ===  
+  A '''''preliminary''''' version of the script can be downloaded {{DownloadExt/teaching/2015wssim_methods/script.pdfhere}}.  
+  
+  If you find any kind of mistake / error / typo / bad formatting / etc. in the script, please send an email to [[Alexander Reinauer]] or [[Mariano Brito]].  
+  
+  === Recommended literature ===  
+  <bibentry>frenkel02b,allen87a,rapaport04a,landau05a,newman99a,thijssen07,tuckerman10</bibentry>  
+  We recommend that you search the university library for ebook versions of these books  
+  === Useful online resources ===  
+  
+  * Thermostats: Philippe H. Hünenberger, [http://link.springer.com/chapter/10.1007%2Fb99427 <i>Thermostat Algorithms for Molecular Dynamics Simulations</i>], Adv. Polym. Sci. (2005) 173:105–149.  
+  
+  * Error analysis: W. Janke, [http://www.physik.unileipzig.de/~janke/Paper/nic10_423_2002.pdf <i>Statistical Analysis of Simulations:Data Correlations and Error Estimation</i>], Quantum Simulations of Complex ManyBody Systems:  
+  From Theory to Algorithms, Lecture Notes, (2002).  
+  
+  * Reweighing: W. Janke, [https://link.springer.com/chapter/10.1007/9789401001731_7 <i>Histograms and all that</i>], Computer Simulations of Surfaces and Interfaces, pp 137157, Springer book  
+  
+  * Monte Carlo Simulations: W. Janke, [https://link.springer.com/chapter/10.1007/9783642852381_3 <i>Monte Carlo</i>], Monte Carlo Simulations of Spin Systems, Computational Physics pp 1043  
+  
+  * [http://homepage.tudelft.nl/v9k6y/imsst/index.html Introduction to Molecular Simulation and Statistical Thermodynamics (pdf textbook from TU Delft)]  
+  
+  
+  == Tutorials ==  
+  
+  
+  === General Remarks ===  
+  
+  * For the tutorials, you will get a [[ICP Unix Accounts for Studentspersonal account for the ICP machines]].  
+  * For the reports, we have a nice {{Downloadlatextemplate.texLaTeX templatetxt}}.  
+  <!  
+  * You can do the exercises in the CIPPool if it is allowed due to the pandemic and when it is not [[CIP Pool Occupancyoccupied by another course]]. The pool is accessible on all days, except weekends and late evenings.  
+  * If you do the exercises in the CIPPool, all required software and tools are available.  
+  >  
+  
+  === Handinexercises ===  
+  
+  * The worksheets are to be solved in groups of two or three people. We will ''not'' accept handinexercises that only have a single name on it.  
+  * A written report (between 5 and 10 pages) has to be handed in for each worksheet. We recommend using LaTeX to prepare the report.  
+  * You have two weeks to prepare the report for each worksheet.  
+  * The report has to be sent to your tutor via email ([[Mariano Brito]] or [[Alexander Reinauer]]).  
+  * Each task within the tutorial is assigned a given number of points. Each student should have 50 % of the points from each tutorial as a prerequisite for the oral examination.  
+  
+  === What happens in a tutorial ===  
+  
+  * The tutorials take place every week.  
+  * You will receive the new worksheet on the days before the tutorial.  
+  * In the first tutorial after you received a worksheet, the solutions of the previous worksheet will be presented (see below) and the new worksheet will be discussed.  
+  * In the second tutorial after you received the worksheet, there is time to work on the exercises and to ask questions for the tutor.  
+  * You will have to hand in the reports on Monday after the second tutorial.  
+  * In the third tutorial after you received the worksheet, the solutions will be discussed:  
+  ** The tutor will ask a team to present their solution.  
+  ** The tutor will choose one of the members of the team to present each task.  
+  ** ''This means that each team member should be able to present any task.''  
+  ** At the end of the term, everybody should have presented at least once.  
+  
+  == Getting ready for the exercises ==  
+  
+  ==== Linux ====  
+  * {{Downloadlinuxcheatsheet.pdfLinux Cheat Sheet}} ({{Downloadlinuxcheatsheet.odtsource}}) – the most important linux commands on a single page  
+  
+  ==== Python ====  
+  * Use the existing documentation of Python itself! To get help on the command <code>print</code>, use  
+  pydoc print  
+  * Or use the Web browser to read it. Start  
+  pydoc p 4242  
+  :and visit the page http://localhost:4242  
+  * http://python.org/doc/ – the official Python documentation (including tutorials etc.)  
+  * {{DownloadByte_of_Python.pdf}} – the free eBook "A byte of Python" [http://www.swaroopch.com/notes/python/], also available in German[http://sourceforge.net/projects/abopgerman.berlios/]  
+  
+  ==== NumPy ====  
+  * first of all, try to use  
+  pydoc numpy  
+  * http://numpy.scipy.org/ – the homepage of NumPy contains a lot of documentation  
+  * {{DownloadSS_2014_PadC.pdfScript of the lecture "Physik auf dem Computer" (German)}} – Numerics in Python using Numpy  
+  
+  ==== LaTeX ====  
+  * [http://ctan.tug.org/texarchive/info/lshort/english/lshort.pdf The Not So Short Introduction to LaTeX]  
+  * [http://www.latexproject.org/guides/ Documentation list of the LaTeX project]  
+  
+  === Running Python on your own computer ===  
+  
+  If you want to solve the problems on your own computer, you need to install Python along with a few extensions. This works differently depending on your operating system.  
+  
+  ==== Debian und Ubuntu Linux ====  
+  <pre>  
+  sudo aptget update  
+  sudo aptget install python3 python3numpy python3scipy \  
+  python3matplotlib ipython ipythonnotebook gcc g++  
+  mkdir p ~/.config/matplotlib  
+  echo 'backend: TkAgg' > ~/.config/matplotlib/matplotlibrc  
+  </pre>  
+  
+  ==== OpenSUSE Linux ====  
+  <pre>  
+  sudo zypper install python pythonnumpy pythonscipy \  
+  pythonmatplotlib IPython gcc pythonCython  
+  mkdir p ~/.config/matplotlib  
+  echo 'backend: TkAgg' > ~/.config/matplotlib/matplotlibrc  
+  </pre>  
+  
+  ==== Mac OS X ====  
+  First, install the C compiler:  
+  <pre>  
+  xcodeselect install  
+  xcodebuild license accept  
+  </pre>  
+  Now download and install [https://www.macports.org/install.php MacPorts].  
+  Next, you can install the Python packages.  
+  <pre>  
+  sudo port selfupdate  
+  sudo port install python36 py36numpy py36scipy \  
+  py36matplotlib py36ipython py36jupyter  
+  sudo port select python python36  
+  sudo port select ipython py36ipython  
+  </pre>  
+  
+  ==== Windows ====  
+  For Windows, we recommend [https://www.continuum.io/downloads#_windows Anaconda Python], an allinone package that includes all required Python modules.  
+  
+  For the worksheets that use Cython, you will also need to install a [https://conda.io/docs/userguide/tutorials/buildwindows.html compatible C compiler]. If you chose Python 2.7, that is [http://download.microsoft.com/download/A/5/4/A54BADB69C3F478D865793B3FC9FE62D/vcsetup.exe Visual Studio 2008 Express Edition] plus, if you are running 64bit Windows, the [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4741A433A9BE5FA919850BDBF&displaylang=en Windows SDK 2008] (in the installer, select "Installation Options", "Developer Tools", "Visual C++ Compilers", "Install the Visual C++ 9.0 Compilers).  
+  If you chose Python 3.5 or 3.6, you need [https://e5.onthehub.com/WebStore/OfferingsOfMajorVersionList.aspx?pmv=a45a6d43f81ee7119427b8ca3a5db7a1&cmi_mnuMain=f764a1c9eb5ee011971f0030487d8897&ws=058d537910d2e31193fcb8ca3a5db7a3&vsro=8 Visual Studio 2015 Community Edition] (in the installer, select "Custom" and on the next page, select "Common Tools for Visual C++ 2015" in the "Programming Languages" category and uncheck all the other components that we do not need).  
+  
+  == Examination ==  
+  
+  Depending on the programme you are enrolled in, Simulation Methods is part of different modules that award different numbers of credits after different kinds of exams. Please have a look at [[File:SimMethModuleOverview.pdf]], which also explains how you can take Advanced Simulation Methods.  
+  
+  == C++ Course ==  
+  The Computer Science department is offering a weeklong [https://campus.unistuttgart.de/cusonline/ee/ui/ca2/app/desktop/#/slc.tm.cp/student/courses/269105?$ctx=design=ca;lang=de C++ course] at the end of this semester. We recommend all students that plan on participating the ''Advanced Simulation Methods'' lecture in winter semester 2023 to take this course. We also recommend it to all students that are considering doing a master's or bachelor's thesis at the ICP.  
+  Current bachelor students might be able to take this course as ''Schlüsselqualifikation'' – but please contact the organizing Professor beforehand to ensure that this is actually the case. Master students will be able to take this course as ''One Course (2 SWS) in an Application Field of Simulation Methods'' as part of the ''Fortgeschrittene Simulationsmethoden (Schwerpunkt)'' module, pending a change of the ''Modulhandbuch''. Note that even current bachelor students can already take the course in 2021 if they intend to enroll in the master programme (starting in fall 2022) and take Advanced Simulation Methods (in summer 2023). All students will need to present their ''"Schein"'' at the Advanced Simulation Methods exam in order to prove that they successfully participated in the C++ course and completed all required exercises. 
Revision as of 08:05, 23 September 2021
Overview
 Type
 Lecture (2 SWS) and Tutorials (2 SWS)
 Lecturer
 Prof. Dr. Christian Holm
 Course language
 English
 Location and Time
 Lecture: TBA
 Tutorials: TBA (Mariano Brito); TBA (Alexander Reinauer)
 Prerequisites
 We expect the participants to have basic knowledge in classical and statistical mechanics, thermodynamics, and partial differential equations, as well as knowledge of a programming language (Python and C).
The lecture is accompanied by handson tutorials which will take place TBA. They consist of practical exercises at the computer such as small programming tasks, simulations, visualization and data analysis. The tutorials build upon each other, therefore continuous attendance is expected.
Course material
All course material (general info, lecture recordings, worksheets, ...) will be distributed via ILIAS (you join the ILIAS groups upon registration through C@MPUS)
Lecture
Scope
The first part of the course intends to give an overview about modern simulation methods used in physics today. The focus of the lecture will be to introduce different approaches to simulating a problem, hence we will not go too to deep into specific details but rather try to cover a broad range of methods. In more detail, the lecture will consist of:
 Molecular Dynamics
 The first problem that comes to mind when thinking about simulating physics is solving Newtons equations of motion for particles with given interactions. From that perspective, we first introduce the most common numerical integrators. This approach quickly leads us to Molecular Dynamics (MD) simulations. Many of the complex problems of practical importance require us to take a closer look at statistical properties, ensembles and the macroscopic observables.
 The goal is to be able to set up and run real MD simulations for different ensembles and understand and interpret the output.
 Error Analysis
 Autocorrelation, Jackknifing, Bootstrapping
 Monte Carlo Simulations
 Since their invention, the importance of Monte Carlo (MC) sampling has grown constantly. Nowadays it is applied to a wide class of problems in modern computational physics. We want to present the general idea and theory behind MC simulations and show some more properties using simple toy models such as the Ising model.
 Critical exponents in second order phase transitions
 Finitesize scaling, universality concept, how to determine critical exponent with lattice spin models
Course Material
Date  Subject  Resources  Remarks  

1  2021TBA  Organization, Introduction, MD Basics  Slides  
2  2021TBA  Integrators Chaos, LJPotential, Units  Lecture Notes  
3  2021TBA  Basics of Statistical Mechanics  Lecture Notes 

4  2021TBA  PBC, celllists, simple MD  Lecture Notes 

5  2021TBA  Observables, Brownian Motion, Diffusion  Lecture Notes  
6  2021TBA  Diffusion, GreenKubo, Langevin Dynamics  Lecture Notes  
7  2021TBA  Thermostats part 1  Lecture Notes  
8  2022TBA  Error analysis  Lecture Notes  
9  2022TBA  Thermostat part2 + Intro Monte Carlo  Lecture Notes  
10  2022TBA  MonteCarlo Method and critical phenomena  Lecture Notes  
11  2022TBA  Critical Exponents  Lecture Notes  
12  2022TBA  Finite Size Scaling  Lecture Notes  
13  2022TBA  Reweighting  Lecture Notes 
Script
A preliminary version of the script can be downloaded here (929 kB).
If you find any kind of mistake / error / typo / bad formatting / etc. in the script, please send an email to Alexander Reinauer or Mariano Brito.
Recommended literature

Daan Frenkel and Berend Smit.
"Understanding Molecular Simulation".
Academic Press, San Diego, 2002.
[DOI] 
Mike P. Allen and Dominik J. Tildesley.
"Computer Simulation of Liquids".
Oxford Science Publications, Clarendon Press, Oxford, 1987.

Rapaport, D. C..
"The Art of Molecular Dynamics Simulation".
Cambridge University Press, 2004.
[DOI] 
D. P. Landau and K. Binder.
"A guide to Monte Carlo Simulations in Statistical Physics".
Cambridge, 2005.

M. E. J. Newman and G. T. Barkema.
"Monte Carlo Methods in Statistical Physics".
Oxford University Press, 1999.
We recommend that you search the university library for ebook versions of these books
Useful online resources
 Thermostats: Philippe H. Hünenberger, Thermostat Algorithms for Molecular Dynamics Simulations, Adv. Polym. Sci. (2005) 173:105–149.
 Error analysis: W. Janke, Statistical Analysis of Simulations:Data Correlations and Error Estimation, Quantum Simulations of Complex ManyBody Systems:
From Theory to Algorithms, Lecture Notes, (2002).
 Reweighing: W. Janke, Histograms and all that, Computer Simulations of Surfaces and Interfaces, pp 137157, Springer book
 Monte Carlo Simulations: W. Janke, Monte Carlo, Monte Carlo Simulations of Spin Systems, Computational Physics pp 1043
Tutorials
General Remarks
 For the tutorials, you will get a personal account for the ICP machines.
 For the reports, we have a nice LaTeX template (7 KB).
Handinexercises
 The worksheets are to be solved in groups of two or three people. We will not accept handinexercises that only have a single name on it.
 A written report (between 5 and 10 pages) has to be handed in for each worksheet. We recommend using LaTeX to prepare the report.
 You have two weeks to prepare the report for each worksheet.
 The report has to be sent to your tutor via email (Mariano Brito or Alexander Reinauer).
 Each task within the tutorial is assigned a given number of points. Each student should have 50 % of the points from each tutorial as a prerequisite for the oral examination.
What happens in a tutorial
 The tutorials take place every week.
 You will receive the new worksheet on the days before the tutorial.
 In the first tutorial after you received a worksheet, the solutions of the previous worksheet will be presented (see below) and the new worksheet will be discussed.
 In the second tutorial after you received the worksheet, there is time to work on the exercises and to ask questions for the tutor.
 You will have to hand in the reports on Monday after the second tutorial.
 In the third tutorial after you received the worksheet, the solutions will be discussed:
 The tutor will ask a team to present their solution.
 The tutor will choose one of the members of the team to present each task.
 This means that each team member should be able to present any task.
 At the end of the term, everybody should have presented at least once.
Getting ready for the exercises
Linux
 Linux Cheat Sheet (2.27 MB) (source (42 KB)) – the most important linux commands on a single page
Python
 Use the existing documentation of Python itself! To get help on the command
print
, use
pydoc print
 Or use the Web browser to read it. Start
pydoc p 4242
 and visit the page http://localhost:4242
 http://python.org/doc/ – the official Python documentation (including tutorials etc.)
 Byte_of_Python.pdf (546 KB) – the free eBook "A byte of Python" [1], also available in German[2]
NumPy
 first of all, try to use
pydoc numpy
 http://numpy.scipy.org/ – the homepage of NumPy contains a lot of documentation
 Script of the lecture "Physik auf dem Computer" (German) (3.42 MB) – Numerics in Python using Numpy
LaTeX
Running Python on your own computer
If you want to solve the problems on your own computer, you need to install Python along with a few extensions. This works differently depending on your operating system.
Debian und Ubuntu Linux
sudo aptget update sudo aptget install python3 python3numpy python3scipy \ python3matplotlib ipython ipythonnotebook gcc g++ mkdir p ~/.config/matplotlib echo 'backend: TkAgg' > ~/.config/matplotlib/matplotlibrc
OpenSUSE Linux
sudo zypper install python pythonnumpy pythonscipy \ pythonmatplotlib IPython gcc pythonCython mkdir p ~/.config/matplotlib echo 'backend: TkAgg' > ~/.config/matplotlib/matplotlibrc
Mac OS X
First, install the C compiler:
xcodeselect install xcodebuild license accept
Now download and install MacPorts. Next, you can install the Python packages.
sudo port selfupdate sudo port install python36 py36numpy py36scipy \ py36matplotlib py36ipython py36jupyter sudo port select python python36 sudo port select ipython py36ipython
Windows
For Windows, we recommend Anaconda Python, an allinone package that includes all required Python modules.
For the worksheets that use Cython, you will also need to install a compatible C compiler. If you chose Python 2.7, that is Visual Studio 2008 Express Edition plus, if you are running 64bit Windows, the Windows SDK 2008 (in the installer, select "Installation Options", "Developer Tools", "Visual C++ Compilers", "Install the Visual C++ 9.0 Compilers). If you chose Python 3.5 or 3.6, you need Visual Studio 2015 Community Edition (in the installer, select "Custom" and on the next page, select "Common Tools for Visual C++ 2015" in the "Programming Languages" category and uncheck all the other components that we do not need).
Examination
Depending on the programme you are enrolled in, Simulation Methods is part of different modules that award different numbers of credits after different kinds of exams. Please have a look at File:SimMethModuleOverview.pdf, which also explains how you can take Advanced Simulation Methods.
C++ Course
The Computer Science department is offering a weeklong C++ course at the end of this semester. We recommend all students that plan on participating the Advanced Simulation Methods lecture in winter semester 2023 to take this course. We also recommend it to all students that are considering doing a master's or bachelor's thesis at the ICP. Current bachelor students might be able to take this course as Schlüsselqualifikation – but please contact the organizing Professor beforehand to ensure that this is actually the case. Master students will be able to take this course as One Course (2 SWS) in an Application Field of Simulation Methods as part of the Fortgeschrittene Simulationsmethoden (Schwerpunkt) module, pending a change of the Modulhandbuch. Note that even current bachelor students can already take the course in 2021 if they intend to enroll in the master programme (starting in fall 2022) and take Advanced Simulation Methods (in summer 2023). All students will need to present their "Schein" at the Advanced Simulation Methods exam in order to prove that they successfully participated in the C++ course and completed all required exercises.