Programing language for quantum mechanics, optics or plasma.

In summary, Python is a good option for computational physics, largely because it is a fast, easy to use language that is cross-platform. However, you should also know C or Fortran, as they are the languages used to do number crunching.
  • #1
Immersion
5
0
Hi, I'm student of physics, i want to specialize in the areas of optics, quantum mechanics or plasma, but i want give an approach computational physics, therefore, my question is, which programing language is advisable for these areas of physics?. The options that most i read were fortran, C, C++, phyton; also, specialized software in numeric calculus such as matlab, mathematica, maple, etc.

Thank you for your answers, i want choose the better option.

P.S: I have basic knowledge about C.
 
Physics news on Phys.org
  • #2
I would say that it really depends on the specific application. For a quick analysis or simulation where you want to be able to play around and quickly change parameters of a system, esp. one that requires generating some sort of visualization (plots etc.), it's definitely handy to know MATLAB, or Mathematica, or Maple, with different people advocating each one, according to personal preference. If I recall correctly, Maple (and I think Mathematica?) can do symbolic algebra, whereas MATLAB cannot? (But there may be some sort of MATLAB add-on module for that). On the other hand, I think that python is starting to supplant these three as a quick and versatile higher-level language that is equally powerful in terms of available visualization tools, and has the advantage of being cross-platform, open-source, and free of charge.

On the other hand, if you're creating a complicated data analysis pipeline, there are some other considerations that enter in, including: 1. you want it to run fast, and 2. you want to be very very sure that you know what's going on numerically, and can avoid common numerical errors. For these reasons, I know of a few examples where data analysis pipelines are written in C or a similar language. There are all sorts of library packages for scientific data analysis in C (and FORTRAN too) each specific to a certain type of mathematical analysis (e.g. linear algebra, or fast Fourier transforms, or numerical integration, or ...)

Unfortunately, you can't get away with knowing only one language and using it exclusively, I don't think. One the other hand, if you invest the time to learn how to *program well* in one language, the marginal cost of learning the syntax for another is less. Personally, I use C regularly, and I've started to use python for some stuff. In the past, I've used MATLAB and IDL. (I've also used Mathematica and Maple, but only because each was required for a particular undergraduate assignment). I know nothing about FORTRAN and don't wish to touch it with a 10-ft pole. But I know that some people will strongly disagree with me and extoll its merits above C.
 
Last edited:
  • Like
Likes 1 person
  • #3
Immersion said:
Hi, I'm student of physics, i want to specialize in the areas of optics, quantum mechanics or plasma, but i want give an approach computational physics, therefore, my question is, which programing language is advisable for these areas of physics?. The options that most i read were fortran, C, C++, phyton; also, specialized software in numeric calculus such as matlab, mathematica, maple, etc.

Thank you for your answers, i want choose the better option.

P.S: I have basic knowledge about C.

My advice is that you need to know:

(1) One symbolic/visualization tool - Mathematica, MATLAB, or Maple. Personally I use Mathematica.

(2) One quick to write, interpreted language. I strongly recommend Python.

(3) One compiled "number crunching" language. This should be either C or Fortran, and as cepheid said, you will find proponents of both. If you already know C, I would recommend you stick with that. I thought that Fortan was dying in favor of C, but I no longer think that. Lots of people are still using Fortran, and many swear that it is much easier to learn and debug than C.

My experience is that most technical computing today is written with a Python wrapper which does the file handling and plotting stuff, and calls compiled components written in either C or Fortran for the computationally intensive pieces.
 
  • Like
Likes 1 person
  • #4
You use whatever language the people around you use, and then you learn enough CS so that you can switch whatever language it is.
 
  • Like
Likes 1 person
  • #5
twofish-quant said:
You use whatever language the people around you use, and then you learn enough CS so that you can switch whatever language it is.

Excellent advice. One of the worst things a physics grad student can do is to focus on coding instead of physics. And even if you do insist on getting heavily into programming, understanding computer science better really has very little to do with learning more languages. Languages are interchangeable. They all do pretty much the same thing.
 
  • #6
You should focus less on which language you learn, and more the methods that are used to solve the complicated problems that need computers, as well as their pseudo-code implementation. In other words, you should be able to write in (engineering/physics) english how you will solve a problem.

I've worked in computational plasma physics as a graduate student for over a year and a half now, and I rely heavily on Python and MATLAB. If you want to do something relatively complicated (something it would take one person ~1 month to do) then C/C++ come in very handy. Anything that is extremely complex though (modeling a whole system) will require a code that has been developed for many years (even decades). L3 has a code as well as the Air Force Research Lab.
 
  • Like
Likes 1 person

Related to Programing language for quantum mechanics, optics or plasma.

1. What is a programing language for quantum mechanics, optics or plasma?

A programing language for quantum mechanics, optics or plasma is a set of instructions and syntax used to create software for analyzing and simulating these complex physical phenomena.

2. What are the main differences between traditional programing languages and those used for quantum mechanics, optics or plasma?

The main differences between traditional programing languages and those used for quantum mechanics, optics or plasma are the level of abstraction and the types of computations they support. Programing languages for these fields often have higher levels of abstraction to handle complex quantum operations and support specific mathematical functions for solving equations in optics and plasma.

3. What are some examples of programing languages used in quantum mechanics, optics or plasma?

Some examples of programing languages used in quantum mechanics include Q#, Quipper, and ProjectQ. For optics, popular languages include MATLAB, Python, and C++. For plasma, Fortran, IDL, and Julia are commonly used.

4. How do programing languages for quantum mechanics, optics or plasma contribute to scientific research?

Programing languages for quantum mechanics, optics or plasma play a crucial role in scientific research by allowing researchers to create simulations and models that can accurately predict and understand complex physical phenomena. These languages also enable researchers to design and implement experiments in these fields.

5. Are there any resources available for learning programing languages for quantum mechanics, optics or plasma?

Yes, there are various resources available for learning programing languages for quantum mechanics, optics or plasma. These include online courses, tutorials, books, and forums where you can interact with experts in the field. Some universities also offer courses on programing languages specifically for these fields.

Similar threads

Replies
10
Views
1K
Replies
6
Views
279
Replies
1
Views
921
  • STEM Academic Advising
Replies
5
Views
1K
  • STEM Academic Advising
Replies
2
Views
1K
  • STEM Academic Advising
Replies
2
Views
975
  • STEM Academic Advising
Replies
7
Views
1K
  • STEM Academic Advising
Replies
4
Views
860
  • STEM Academic Advising
2
Replies
60
Views
3K
Back
Top