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

  • Physics
  • Thread starter MegaDeth
  • Start date
  • #1
83
0
If so, what software are the likely to use?
 

Answers and Replies

  • #2
1,254
3
Yes.
Mathematica, matlab, IDL, python, C(++), fortran --- are probably the most common.
 
  • #3
83
0
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.
 
  • #4
1,254
3
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.
 
  • #5
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
 
  • #6
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.
 
  • #7
Astronuc
Staff Emeritus
Science Advisor
19,261
2,751
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:
  • #8
6,814
15
If so, what software are the likely to use?

For most fields, yes.

Software is mostly hand written.
 
  • #9
6,814
15
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
Hepth
Gold Member
448
39
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.
 

Related Threads on Do theoretical physicists need to know how to write computer programmes?

Replies
7
Views
1K
Replies
3
Views
6K
Replies
7
Views
4K
Replies
14
Views
3K
Replies
3
Views
5K
Replies
2
Views
14K
Replies
4
Views
3K
Top