Computational Physics

Having been in the business of computational physics for 5 years, I feel this is a good time to summarize the essential skills I have learnt. These summaries will serve as notes to help my future self relearn any of the skills I will forget as well as to offer an “I-wish-I-had” perspective for those who just started their journey to become a computational physicist. My perspective is limited, but it’s better than none at all.

Rule #1: Keep an open mind. This applies to both the physics and computational aspects. In physics, no model is perfect, only some are useful. It is important to avoid developing a personal relationship with your method/data however exciting it/they may be. Such attachment can blind you to the limitations in your methodology and mislead you to see trends that don’t exist. Instead, let the data guide your thoughts and adapt theories to suit facts. At the end of the day, your contribution to the scientific community will be something someone else can improve on after you die (or preferably before). It can be a method that works in some limit and/or some data that demonstrate the regime of validity of a method. Therefore it is more important to be systematic and eliminate as many variables as you can instead of trying to produce the “best” result, so someone in the future (may be yourself!) can easily build on your findings. On the computation side, no style is THE style. Everyone has their own favorite programming language, operating system, editor, coding practices. Some are superior to others, most are not comparable. It is more important to learn from someone else’s successes and mistakes than to bash him/her for being different.

Rule #2: Focus on the science. After you become somewhat competent at programming, it is easy to get lost in data generation and data analysis and forget about the big picture. Always read a LOT of papers to maintain a perspective of how your work fits into the big picture. Try to remember WHAT you are doing and WHY you are doing it. I believe, robots (scripts) can replace humans in data generation and analysis in the near future. However, robots can’t decide what data to generate, at least only in the more distant future.

Rule #3: ALWAYS leave a paper trail. I know this is the 21st century, so I guess electronic logs are also acceptable :P. All kidding aside, your future self will be very unhappy if he/she ends up wasting a day having to relearn a trick, rediscover a bug or trace the source of some data.

Tool Kit

Now that we have some ground rules, let’s move forward and acquire a few essential tools [some choices] (my choice):

  1. Get a linux distribution [Cent, Mint, Fedora, Ubuntu, Kubuntu] (Ubuntu)*
  2. Learn enough bash to navigate and manipulate the linux file system (cd,ls,pwd,cp,mv,man,grep,sed,crtl+c,crtl+d,crtl+l,bg,fg)
  3. Learn a console-based editor [Vi,Vim,Emacs] (Vim)
  4. Learn an interpretive language [Perl, R, Python] (Python)
  5. Pick up a compiled language [Fortran,C,C++] (C++)
  6. Pick up an intelligent language if available [Mathematica, Matlab] (Mathematica)

* I use windows 8 (with classic shell of course) as my host system due to its highly optimized core and superb compatibility with a variety of software. Ubuntu is ran in a virtual machine with VMWare (virtual box works as well). One can also dual boot, but it’s good to have your cake and eat it too 😀

Don’t dwell over learning all the toys though, it is more important to focus on the science! You can’t learn everything in one day and often have to revisit the materials. That is why I am leaving these on the cover page, so you will look at them every time you come here. These tools will be used extensively in the following tutorials, so you can learn as you go.

With the toolkit assembled, let us debark on our journey!

(Skill Set moved to Tutorial)