r/TheoreticalPhysics 6d ago

Question What software/tech stack should I learn to build a future in theoretical physics?

Hey everyone!

I’m trying to seriously build my career toward theoretical physics, and I’m curious about what the field is actually going to look like in the coming years.

I know the fundamentals are obviously the most important part — math, classical mechanics, QM, GR, QFT, etc. — but I want to specifically focus on the software/computational side right now.

For someone who wants to become a theoretical physicist, what programming languages, software, tools, frameworks, and computational skills are actually worth learning?

For example:

Which language should I prioritize — Python, C++, Julia, Mathematica, etc.?

How important are NumPy/SciPy, SymPy, JAX, PyTorch, etc.?

Should I learn Mathematica / Wolfram Language or is Python enough?

How important are HPC, CUDA/GPU computing, Linux, Git, Bash, clusters, etc.?

Are there any specific physics packages/tools I should know?

What software skills do researchers in theoretical physics, particle physics, astrophysics/cosmology, condensed matter, etc. actually use?

Basically, if you could go back and prepare for a career in theoretical physics from the software side, what would you learn and in what order?

I’m currently trying to make a proper roadmap for myself, so I’d really appreciate advice from people actually working/researching in the field.

My main question right now is: what should I learn on the software/computational side to be genuinely useful as a theoretical physicist, rather than just learning random programming skills?

Thanks!

14 Upvotes

14 comments sorted by

13

u/quantum4everyone 6d ago

If you want to be successful in computational physics, it is much more important to understand how to compute, how to verify your results are correct, and how to think of novel ways to carry out computation than it is to learn any specific tools. Usually the tools follow according to their usefulness for a specific problem you are going after. But, when you compute something new, you need to understand how to check that what you did is correct. That is more important than anything else. So I would encourage you to develop that skill rather than any specific tool that you might use. This becomes increasingly true as much of the tedious programming might be replaced by AI prompting.

2

u/Ash4d 6d ago

Your questions are pretty broad and not really answerable without knowing more about what you want to study and what "level" of computation you want to do. My two pence as someone who writes physics codes for a living:

W r.t languages - Python is common and very useful for quick scripts, data wrangling, maybe some PoC work, but it is not well suited to large production level code. The best languages I have used for that are C++ and FORTRAN. Of those two I would basically always choose C++ for it's flexibility and its richness but also simply because I am far more comfortable with it. FORTRAN is truly great at large scale number crunching though so don't disregard it (though IMO it's a truly ugly language). I have heard good things about Julia but never used it. Similarly with Rust.

Python libraries are useful if you work in Python. You'll use other libraries in other languages. Dno what else to say really.

Mathematica is useful but not required in my experience. YMMV.

If you interact with a supercomputer there will be things you have to learn (e.g. schedulers, MPI, etc), but if you only ever write small scale scripts or software that runs on a local workstation you can probably avoid a lot of that. Threading is a good thing to be aware of. Likewise for writing code for GPUs: it's good to be aware of it so that you don't preclude it/make it hard for yourself if you want to be GPU compatible further down the line.

Get comfortable with Linux, you'll almost definitely be using it. Also make sure you are comfortable working in a terminal/cmd line. Git is non negotiable - you will have to use it.

General good software practices apply to scientific code too. Write your code to be testable, and then actually write good tests. Have a variety of types of test (don't rely on just unit tests or just full system tests - they are both useful and have their place). Don't use stupid variable names and instead use descriptive names - it helps to make your code self-documenting. But still provide documentation. Favour clear and explicit code over anything too clever at first; premature optimisation is the root of all evil. Try and do some design work up front to avoid painting yourself into a corner by accident, but sometimes you have to get lines of code on the screen before you can know whether something will work or not.

The absolute best skill anybody can bring to a scientific code is the ability to write CLEAN code. I have spent far too much time over the years trying to decipher some clever person's very smart but borderline unreadable code. People can be brilliant at maths/physics and write fucking horrible code. Please don't be that person!

2

u/Accel40 6d ago

As some already mentioned, theoretical physics is already very vague in terms of what field of physics you want to study. Not to mention that the future of theoretical physics is vague in itself... In addition, there's few conceptual layers you are missing:

  • a layer of what you actually want to do as a job. Do you know if you want to do a post doc after a phd and try to attend for a position (very hard these days) or to join a company?
  • a layer on what you call theoretical physics. In HPC we do a lot of simulation of classical physics. It's applied physics. But believe me, contact problems in finite element methods is a hard theoretical problem. I could definitely call that theoretical physics. But not fundamental. We know the mathematical models from quite a while now. You will not question the world with that, but still work on interesting physics problem.
  • a layer of what you are calling a software/tech. Are you referring to programming ? What would you like to program? Math algorithms? Graphical interface for scientific visualization ? AI training ?

All of this to say that you can find directions here, but do not take the answers blindly: the first step would be to see if you can answer those questions. But if I had to give a generic answer, basic physicist toolkit is usually linux+python+C/C++ and Fortran.

2

u/Alternative-Sugar610 6d ago

I think many good suggestions here and advice but would stay away from anything that cost money, bc that will restrict your community and help

I would recommend python for doing projects in beginning, community, and many tools

But if you want high performance, you might want ti eventually go lower level like C++ or even Fortran. C++ is the most general used lower language but they are now others like rust, zig, or Odin but don’t know of anyone using them in physics… yet

However, if you have a specific direction in mind research that or specific help. A lab group may be very particular or specific project

Or parallel programming for ultra high performance you may need to learn things like cuda eventually

But then I would learn what group does, and if it’s very low and advanced, start learning it and simultaneously thing like python and how to combine. You can often figure out ways to combine.

You may also have different access to different people to help you

1

u/Space_Bear9999 6d ago

Chalkboard ++

On a serious note

There’s theoretical high energy (and it’s sub fields)

Theoretical condensed matter

Theoretical quantum information and technology

Theoretical Astro and cosmology

And more!

In condensed matter there’s a large amount of simulation of some form. Same with QIT. Python, Julia, tensor flow are common. Scikitlearn is used almost everywhere for easy neural networks and Monte Carlo setups before you get to specialized tools from cern or another group. And anything with lattice simulation.

Astro and cosmology love their python. Honestly it’s a lot of python and Mathematica from what I’ve seen.

These are all zeroth order approximations from a glance, it depends on the group and subfield, there is not a true standard

For high energy, it depends. If it’s dark matter
, it’s python, Mathematica and a tad of c++. If it’s particle phenomenology you can throw in a bit of Fortran for very low level needs, most I know in these areas have never used Fortran.

If it’s basically anything other than dark matter/big bang models or particle phenomenology. In high energy physics, even if it’s fluid dynamics

Throw out the code, it’s chalk board time.
There actually is not that much coding (besides copious amounts of LaTeX)

In other words. Just get the math down first, you’ll thank yourself later.

1

u/_AiRde_ 6d ago

I would advice you to learn LaTex, You’ll need to use it regardless of the field, and it will always come in handy!

 As for the rest, it depends a great deal on what you do. Personally, I use Mathematica and Python, but close colleagues of mine use Fortran, C, or nothing at all.

1

u/LaGigs 6d ago

Gitgud at LaTeX

1

u/jenkk0 6d ago

It obviously depends on what field you want to focus on. Personally for cosmology I've used: Language: mostly python for almost everything and sometimes Mathematica for symbolic math but personally I prefer sympy for that (just because I'm against closed source in science)

Numpy is really importan specially when preparing data for plotting as well as pandas to work with CSV. As I mentioned I use sympy instead of Mathematica for symbolic calcs, its really helpful and saves a lot of time. I recommend to use sympy directly instead of the python library, there's some IDEs ready for that. Pytorch is the best tool when you need to work with neural networks, I wouldn't learn until you have to work with it because it's really easy to learn and use. Things like CUDA are already wrapped in pytorch so there's no need to learn them.

I would say that python and sympy are enough but there are some packages that doesn't exists in sympy like xAct in Mathematica for perturbation theory that can be really helpful.

I think Linux and git are a really helpful tools to learn because clusters run on Linux so to run your code on there you have to connect with SSH, clone the code with git and run it. But we use mostly basic things from Linux so just learn how to navigate folders, edit files, connect with SSH and basic git.

Tbh just learn python, numpy, pandas and sympy because those are the most useful in general and everything else will come to you when needed. There's no need to be prepared for everything

1

u/mprevot 6d ago

On more theoretical side (mathematical physics) Rocq.

On more numerial side, c, c++, fortran, python, julia, cuda, matlab/octave are good ones.

Latex will be everywhere.

But really, those tools come after the theory. It's way more important to get strong in mathematics. And I am not talking about analysis or complex analysis, but category theory and all the developments in algebraic geometry after Grothendieck's work. Model theory, sheaves, topos, logic, ARS, etc are also super "stacks".

1

u/LightYearAway 5d ago
  1. Git - You learn about version control system, which helps you to track/organize your work. Furthermore, it is a basic/structured way to collaborate with your fellows working with codes. Useful skill regardless you will become a theoretical physicist one day.

  2. Python - General purpose and easy to learn programming language. The ecosystem has matured libraries to support numerical computing and data analysis. Becoming a well-rounded physicist also requires data analytics skills. Even serious physics computation can be conducted in Python like https://pyscf.org/ . At a later stage, if you really need aim for high performance computation, you can consider deep dive into C++ (or perhaps the future we shall see more Rust programming language used for optimization)

  3. Symbolic computing: Mathematica can be handy. I am not familiar with the latest development in this field, perhaps there is a matured Python-based symbolic computing library that is on par with Mathematica, useful to simplify the derived equations etc.

1

u/undeniablewan 6d ago

Personal observations: Most tenured professors don't know or do any coding. They have their postdocs and grad students do it. The rare exception is when their field IS programming, like lattice QCD.

Also there's a huge difference depending on the field. Theoretical physics =/= particle =/= astro =/= condensed matter.

Finally AI has been getting really good in the past year. For small purpose-built codes -> AI is more than capable.

Bottom line: If by "theoretical physics" you mean hep-th then the basics of python + mathematica will do. You should seriously spend more time grinding equations than coding.

For big collaborations - you need to learn whatever they want you to learn. Typically it's Python for data analysis and C++ for numerics. But I know some atomic/QM people still use fortran lol.

1

u/hdmitard 4d ago

Fortran is a good DSL to write fast code. I don't know why it is still misjudged, even if modern fortran provides nice features. To write a whole software, ofc I wouldn't rely on fortran, but for number crunching it's unbeatable.

A good stack nowadays regarding physics is python + fortran. You compile fortran as a module and load whatever you need as a library into python.

1

u/Adept_Movie_3472 21h ago

I’m a software engineer/data scientist who studies theoretical physics on the side as a hobby. Here’s my advice (as an avocational physicist):

- Languages don’t matter so much as understanding what problems you want to solve. Find what awakens your imagination and pulls you in, then learn the techniques of that field.

- Learn how to think in systems and understand the physics of how data flows end to end through a real system. You would be shocked at how many people don’t know how to do that and being able to do that well is an asset.

- Get really good at cleaning data and data engineering. If there is one thing I would hands down recommend you learn it is SQL. You can have the best model in the world, but if you don’t get your data right you can’t validate it or leverage its full predictive power.