r/TheoreticalPhysics • u/DazzlingVictory2706 • 7h 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!
1
u/Ash4d 6h 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!
1
u/Accel40 4h 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.
1
u/Space_Bear9999 3h 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/undeniablewan 6h 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.
11
u/quantum4everyone 7h 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.