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

In summary: I imagine it would be a nightmare.In summary, if you are starting out, I would recommend C++. If you are comfortable with C++, the other ones are fairly trivial.
  • #1
MegaDeth
83
0
If so, what software are the likely to use?
 
Physics news on Phys.org
  • #2
Yes.
Mathematica, matlab, IDL, python, C(++), fortran --- are probably the most common.
 
  • #3
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.
 
  • #4
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
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.
 
  • #7
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:
  • #8
MegaDeth said:
If so, what software are the likely to use?

For most fields, yes.

Software is mostly hand written.
 
  • #9
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.
 

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

1. What is the role of computer programming in theoretical physics?

Computer programming is an essential tool for theoretical physicists as it allows them to create mathematical models and simulations to test their theories and hypotheses. It also helps them analyze and interpret large amounts of data, which is crucial for making predictions and understanding complex physical systems.

2. Do all theoretical physicists need to know how to write computer programmes?

While computer programming skills are becoming increasingly important for theoretical physicists, it is not a requirement for all of them. Some may choose to collaborate with computer scientists or work with existing software packages. However, having a basic understanding of programming can greatly enhance a theoretical physicist's research capabilities.

3. Are there specific programming languages that theoretical physicists should learn?

There is no one "best" programming language for theoretical physicists. However, some popular languages in the field include Python, MATLAB, and Fortran. It ultimately depends on the individual's research needs and preferences. Learning multiple languages can also be beneficial for tackling different types of problems.

4. Can theoretical physicists rely solely on computer simulations for their research?

No, computer simulations are just one aspect of theoretical physics research. Theoretical physicists also use a variety of mathematical and analytical techniques to develop their theories and make predictions. However, simulations play a crucial role in testing these theories and can provide valuable insights that are difficult to obtain through other methods.

5. Are there any downsides to theoretical physicists learning computer programming?

There are no major downsides to theoretical physicists learning computer programming. However, it may require additional time and effort to learn a new skill, which can take away from other aspects of their research. Additionally, becoming proficient in programming may not be necessary for all theoretical physicists, so it may not be a worthwhile investment for everyone.

Similar threads

Replies
18
Views
2K
Replies
4
Views
2K
Replies
7
Views
2K
Replies
25
Views
4K
Replies
19
Views
1K
Replies
14
Views
4K
Replies
15
Views
867
Replies
18
Views
7K
Back
Top