Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

I have been wondering recently how useful programming is to a physicist. It seems fairly useful (simulations are a lot cheaper than the actual thing in many cases) in some areas (say space programs), but in other areas (for example at CERN) it seems pointless. So is it useful and perhaps how do you use it?

share|improve this question
What?! Programming useless at CERN? Where does that come from? –  Jen Jul 25 '11 at 19:22
You are perhaps not aware that WWW itself originated in CERN? I am not aware about many technologically (also IT-wise) more advanced facilities than CERN. –  Marek Jul 25 '11 at 19:41
Related question on TP.SE. –  Qmechanic Aug 10 '12 at 21:33
add comment

5 Answers

Programming is immensely useful in any branch of physics. I don't know where the notion that programming is not useful at CERN comes from (? Home of the ROOT package, and the internet? Really? TeraGrid, eh? 1 GB/s of data from the detectors at the LHC won't analyze themselves!), but you may wish to revisit your research on that matter.

I can say that in my 10 years working in physics, there isn't a day that I haven't encountered something related to programming. From writing scripts to help move along my data processing, to writing applications to interface with a network to collect data, to writing code to analyze data, to, the current bane of my existence, troubleshooting other people's code, I interact with computer programming every day. And I have never identified with a cartoon more than this one.

So - yes. I would say that computer programming is immensely useful. Perhaps my experience is unique, but I doubt it.

share|improve this answer
A question for you - I have a BS in Computer Science and a Minor in Phyiscs, also will be starting a Masters in Computer Engineering soon. What options for careers related to Physics would you say are potentially available to someone with my background? –  MGZero Jul 25 '11 at 19:40
I guess it's not unique but I suppose theorists and mathematically inclined kind of guys wouldn't quite confirm it. On the other hand, guys specializing in numerics and simulations obviously don't do anything much besides programming. –  Marek Jul 25 '11 at 19:46
@Marek: that is not entirely true. Even if you do a PhD or something similar in lattice field theory, you'll spend the majority of your time working out new renormalization schemes and understanding the (non-trivial) physics in general. On the postdoc level, a lot of code is shared: I know researchers that hardly know how "their" code works, they just choose which parameters to plug in and try to interpret what comes out... –  Gerben Jul 25 '11 at 21:47
@Gerben: sure, that was an oversimplification on my part. I just wanted to point out that there is a continuous scale of physicists from no programming to only programming. In any case, knowledge of programming can't hurt. –  Marek Jul 25 '11 at 21:52
@Marek - experimental physicists also do a lot of programming. From assembler on device drivers, through data-analysis and even a bit of modelling. –  Martin Beckett Jul 26 '11 at 1:20
add comment

Programming is extremely important in almost every area of physics. Not every physicist has to be an expert programmer, but many are, and virtually all physicists are at least competent programmers.

In most experiments, the process of data analysis is complex enough to require some programming. More importantly, in many situations, the best (or only) way of telling whether your results are consistent with any given model is to simulate the experiment.

In particular, CERN is absolutely chock-full of programmers analyzing and simulating.

share|improve this answer
add comment

Programming is a skill that some physicists need and others do not. Ditto for knowing your way around a mill or a lathe. Ditto for digital electronics, or contour integrals, or writing popularizations, or vacuum systems.

share|improve this answer
add comment

An addition to the above answers: I believe there are a couple of ways modern physicists use computers. On the most theoretical level, people use computer algebra systems (CAS) to do lengthy calculations completely or to check results. If you're into theory, you can think of software packages to do tensor manipulations in GR or software that calculates perturbative expansions (trace formulas...) in QFT. Most of the time, these packages don't have an extremely user-friendly interface, so some amount of 'programming' is needed in order to work with them. Furthermore, a lot of theorists use Maple or Mathematica to do/check difficult integrations, solve ODE's, plot graphs quickly...

Then there's the data analysis part: at the end of the day, you're stuck with a heap of data and you'll need to analyze it (manually, in Mathematica, in the language R, ...) and visualize it (in Matlab, using GNUplot, ...).

Next, almost all physicists use simulations once in a while. Theorists like to get a feel for what a non-toy model does, people in hydrodynamics like to see how a flow runs past an obstacle, geophysicists look how the Earth's magnetic field flips chaotically etc. Most of the time, these things can be done using comprehensive software packages (Matlab, Mathematica, ...), but you do need to set up your simulation properly.

Finally, a minority of physicists do simulations for a living. Think of people who calculate collision outcomes at CERN, cosmologists working on numerical relativity, lattice people calculating quark masses etc. This is all typically done in actual programming languages, like C++ or Python, and most of the time on computer clusters.

share|improve this answer
add comment

In addition to all has has already been covered, I would like to tell a word about my own programming experience.

I am an experimental physicist and I've spent a significant fraction of the past few years programming on the experimental side. A few of the experiments in our team use non-trivial experimental protocols or feedback loops, and some have real-time constraints. I spent quite some time writing and maintaining the software we use for instrument control and data acquisition, helping others with their scripts (the software is scriptable and experimental protocols are implemented as scripts) and interfacing with other instruments that use a variety of protocols and buses.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.