Do theoretical physicists need to know how to write computer programmes?

Click For Summary

Discussion Overview

The discussion revolves around whether theoretical physicists need to know how to write computer programs and what software tools are most beneficial for their work. It covers various programming languages and software applications relevant to theoretical physics, including Mathematica, C++, Python, and Fortran.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants assert that theoretical physicists should know programming, citing common languages such as Mathematica, MATLAB, IDL, Python, C++, and Fortran.
  • One participant recommends starting with C++ if the user has prior knowledge of Java, suggesting that other languages will be easier to learn afterward.
  • Another participant argues that Mathematica is superior for physics due to its integration of symbolic computation and visualization, claiming it allows for a focus on problem-solving rather than programming issues.
  • Some participants express skepticism about the effectiveness of Mathematica for complex problems, arguing that it may not handle substantial computations well.
  • There is a discussion about the evolution of Fortran, with some participants defending its efficiency for scientific computing despite its age.
  • One participant emphasizes the importance of using the right tool for the task, suggesting that theoretical physicists should prioritize software that excels in symbolic computation and visualization over general-purpose programming languages.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and effectiveness of various programming languages and software for theoretical physics. There is no consensus on which software is definitively the best choice, with multiple competing perspectives on the utility of Mathematica, C++, Python, and Fortran.

Contextual Notes

Participants highlight the importance of context when choosing software, noting that different areas of physics may require different tools. The discussion reflects a range of experiences and preferences, indicating that the choice of programming language may depend on specific applications and individual familiarity.

MegaDeth
Messages
83
Reaction score
0
If so, what software are the likely to use?
 
Physics news on Phys.org
Yes.
Mathematica, matlab, IDL, python, C(++), fortran --- are probably the most common.
 
zhermes said:
Yes.
Mathematica, matlab, IDL, python, C(++), fortran --- are probably the most common.

Thanks, which software should I start to use first? I know a bit of Java.
 
I'd recommend C++ (which will be easier to learn if you know some java). If you're comfortable with C++, the other ones are fairly trivial.
 
I find that Mathematica is the best choice for physics. Do not waste your time on C/C++. Try to find the symbolic Fourier series expansion using C or C++. In Mathematica, it is one command.

I have worked using all the other systems and languages mentioned above and found that when using Mathematica I spend more time looking at the problem itself and less about dealing with programming issues.

Mathematica allows me to quickly visualize and simulate a problem since all the graphics and the mathematics are so well integrated in one system unlike the others.

Matlab is not as good since it does not come close to Mathematica's symbolic features. In Physics, symbolic work is very important.

Mathematica now is much better than Maple also. few years ago, Maple was on bar with Mathematica, but not anymore. Matlab is strong in the numerical area only. Mathematica is strong in both numerical and symbolic and graphics.

In addition, now Mathematica has new technology called (CDF) Computable Document Format which none of other system has anything similar. CDF allows one to send computable document to someone else, who might not even have Mathematica, and yet they can run it using a free player (something similar to sending a pdf file to someone and them using a PDF reader to read the pdf file), except CDF is much more powerful, since one can run the computations inside dynamically and not just look at static images.

Mathematica does take more time to learn initially, but I think it is worth it.

Robert
 
h_robert64 said:
In Mathematica, it is one command.

I have nothing against Mathematica, but its symbolic logic is so powerful that it spoils me.

I am not a pro, but I have been using Mathematica for years for everything I encountered in my course work and data analysis. However, I do not consider myself a programmer by any means. I have had a course on VB and done minor programming in IDL, but don't trust me to write a program--at least in a reasonable time.

What about Fortran? It seems to me it is still good mathematical and scientific computing despite its age.
 
MegaDeth said:
Do theoretical physicists need to know how to write computer programmes?


If so, what software are the likely to use?
It would help.

python, C(++), fortran are common.

I see somewhat of a divergence - between those who program in C++ and python, and those who adhere to Fortran. Fortran has evolved to Fortran 2008.

I learned Fortran 77 (F77), which evolved to Fortran 90, Fortran 95, Fortran 2003, to F2008.
http://en.wikipedia.org/wiki/Fortran

It really depends upon the compiler. And some old timers hold that Fortran makes for more efficient computation.

python/C++ and Fortran have their strengths. Being familiar with both systems is useful.

Knowing the language of simulation, and developing the optimal I/O, in addition to the computation, is critical to matching theory with experiment/observation.

These days, computational physics, computational material science and computational chemistry are critical areas for developement. For example - http://www.materialsdesign.com/ - http://en.wikipedia.org/wiki/Density_functional_theory
 
Last edited by a moderator:
MegaDeth said:
If so, what software are the likely to use?

For most fields, yes.

Software is mostly hand written.
 
h_robert64 said:
I find that Mathematica is the best choice for physics. Do not waste your time on C/C++.

This is false except for very, very simple physics problems. For anything substantial, if you toss it at mathematica, it will die.
 
  • #10
twofish-quant said:
This is false except for very, very simple physics problems. For anything substantial, if you toss it at mathematica, it will die.

I'm not sure I agree there. I can take a generic lagrangian, and for a given process A-> B C have it output all possible graphs up to say 1-loop, sandwich it between an in and out state that have some distribution function, have it calculate all of the loop integrals, plot up my energy distributions, spit me out a width, then go "oh darn, I forgot to add that piece" and change one think, shift-enter, and it does it again.

I even have mathematica output a lot of my data into a table form that I mad a subroutine that makes it into a LaTeX table.

Its QUITE useful. I'm not saying all of that stuff is built in, but it really doesn't take that long to get yourself set up. Saves me a TON of time in simplifying dirac matrices alone.

I can program quite well in C++ and F77, but I couldn't imagine having to do all of that in either.
 
  • #11
There seems to be some confusion here about what theoretical physics is.

The topic is asking about software for "theoretical physicists". Clearly a theoretical physicist would need to do more just write numerical code, if they'll even do that.

The idea is that a theoretical physicist will do much more algebraic and symbolic computation, than number crunching and then plotting a curve at the end.

It seems to me to be clear that a theoretical physicist would be better off learning a tool which is strong in the computer algebra, symbolic computation, calculus, visualization and so on, than learning a general purpose software to do number crunching with.

It would be better to use a tool which you can use to do more than one thing with, than one tool to do one thing, and another tool to do another thing. Less time to learn different tools, less time to integrate things from different software.

If the original user have asked which is the best software to learn for work in say computational fluid dynamics or such field, then may be Fortran or Matlab would be fine in that case.

Use the best tool for the task at hand. If I want to write a device driver, I will use C. But If I want to do mostly scientific software, and in the area of physics, and more towards theory, then I would choose a tool build from the ground up to meet the needs of this area than waste my time on C/C++/Phython and such.
 

Similar threads

Replies
5
Views
5K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 25 ·
Replies
25
Views
5K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 18 ·
Replies
18
Views
11K