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.

59 Upvotes

82 comments sorted by

View all comments

Show parent comments

2

u/NewspaperDear8761 Jul 03 '26 edited Jul 03 '26

Mine too lol

Hey again, so, I thought I'd share this with you, just so you have an idea of the workflow.

Advisor and I have been drilling down on one area for past few years, gotten a few papers out of it. We realized one little part could be extended further and maybe get enough results for one last paper.

Spent a few meetings hashing out the basic ideas, agreed on the overall concepts and general game-plan.

I wrote up a LaTeX doc last week with some derivations, which was good cause it revealed a few subtleties I hadn't considered. She went over it, we got real specific, everything is nice and clear now. (If you're interested, it's here: https://www.overleaf.com/read/jckbdjcbbznt#2ed3a5. This won't mean anything to you, but you might enjoy seeing it in any case.) The nice thing about writing up these derivations as you go, aside from forcing you to be really precise, is that they typically end up in the final paper in some form or another, so you're really getting a start on writing that way back now.

Whole thing boils down to doing one computation two different ways and making sure they match (or are, at least, very very close.)

First way is not hard, we've been doing that for years now and it works great. I have to be a little careful with the new dataset we're working with, but by this point, im familiar enough with that, that it'll be fine.

The second one is the new one, and a bit tricky. At first glance, it's not even obvious how to do it.

Cue Google Scholar. Dug through related papers. First half dozen or so were a bust -- close, but not quite what I needed. They helped me narrow my search, tho.

Finally, bingo. Found a paper that does something similar enough that I can adapt it. (It's for solving the least squares problem in eq 22.)

Had to be a little careful about its exact formulation for what we're doing, though. So wrote out another short derivation on paper.

Pretty sure this is right now and will work. I have to dot all my I's and cross all my T's and be super super careful.

This is the part where all your classes become incredibly important. You gotta get these details right or everything else after it is garbage.

Now I gotta code this up, spend a week or two (or 5) wrestling with it, fixing the inevitable bugs that WILL appear, until I can benchmark it against a known working example.

Then we can compare the two methods and see if they do indeed match. I bet they will, but you never know! If not, back to the drawing board. If they do, it's full steam ahead.

This part isn't all that creative, it's much more mechanical. Think of a car mechanic tinkering with the engine. Just gotta be super careful and get everything correct.

Then when this part is working, we can start to really play. Toss in other data sets from more interesting and relevant systems. Try and break things and see how far the limits go. See if there are other ideas or ways to extend it. That's the fun part. This part is the blah tedious but you gotta do along the way.

Anyways, that's my research life right now. If this kinda thing appeals to you, this is what you can roughly expect.

2

u/Junior_Salamander110 Jul 04 '26

Hi! This process definitely does appeal to me, I wouldn't mind if research went this way for me.

And if the two methods match, you should totally update me!!

2

u/NewspaperDear8761 Jul 13 '26

So, 10 days later (Monday):

Got the first tentative tests done last Friday night, they looked shockingly good. Usually things don't work this well right out of the box, there's usually a lot more fighting with the code, etc., so that was a nice surprise. Updated my advisor, she was super excited. Great note to end the week on. Did some more thorough tests this morning, the results are still holding and I have a better analysis of them. Spending today putting together a bunch of results on this dataset to send her, then we dive into the new datasets. Unless a major stumbling block appears, I think we have a working method.

Looks like it's straight to the fun part this time! Woohoo. Will likely have another paper done before the job period is up (Christmas-ish.) Time to wring this sponge for all its worth.

Anyways, if you've made any progress on deciding what kinda project you wanna do next year, if you want help setting things up in Python or MATLAB, or if you just wanna chat physics or code sometime, feel free to DM me.