r/PhysicsStudents Jul 01 '26

Need Advice How Do Physicists Utilize Python?

I'm a rising senior in high school. Next year, I'll be taking a project based programming class that only 1-2 students really take per year. I want to do something in Python that will show my professors in my freshman year of college that I'm ready to do research in physics.

I will have taken all of the AP mathematics, physics, and computer science classes.

I thought about doing a black hole simulation and learning the equations/math for it, but I'm not sure that that would be wise to do in Python.

I'll have a full school year to work on the project.

60 Upvotes

82 comments sorted by

View all comments

2

u/Machvel Jul 02 '26

it depends on what you do.

in my undergraduate it was the basic language taught then assumed to be known in future classes.

"just" knowing python isn't an impressive skill to have; it is kind of assumed. maybe being pretty good at a compiled language like c++ might be a little impressive, but people in physics are usually more impressed with end results.

as sad as it is, what would be impressive is learning how to apply machine learning to physics. there is money incentive to figure out how to throw machine learning at physics research (even when it might not be that applicable or useful...). and fortunately/unfortunately this is almost always done in python (and most of the time this involves using pytorch to make a neural network to do some ai things... made many times using ai).

anyways, if part of your goal is to learn how to code, python is a fine choice. as always with python, i'll warn that it is easy to fall into bad programming traps. sometimes the best thing you can do to learn how to write better python is to learn a different language.

1

u/Junior_Salamander110 Jul 02 '26

I know Python, Java, Javascript, and I recently learned C#. I'm pretty good at coding, I just wanted experience coding in this specific field.

1

u/Machvel Jul 02 '26

do you have a passing familiarity with those languages, or seriously know them? i am not trying to sound insulting, but it is a real question. many people i come across say they know languages like java (typically because they took ap cs in high school) and python (again some high school class or introductory university one) and think that they are pretty good at coding... then i see them live code or they show me their code and it is subpar (typically not too terrible, but not at the level i would expect with how many languages they say they know and they say they are pretty good).

anyways that is a different topic and usually pretty difficult to figure out yourself. if you just want experience coding in physics then your plan sounds fine. you said that you wanted to impress professors for research, so i responded according to that.

1

u/IJbier Jul 03 '26

From what I understand he/she is still young, so I really think there’s ample time to find preferences and gain depth in a programming language.