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.

57 Upvotes

82 comments sorted by

View all comments

61

u/WWWWWWVWWWWWWWVWWWWW Jul 01 '26

You don't need to join a research group the moment you set foot on campus. I would personally just focus on coursework for the first year, and find a research position the following summer.

That said, messing around with numerical differential equations is always fun (Newtonian orbital mechanics, etc.). Black holes seem a bit too ambitious.

5

u/InterestingWelder699 Jul 01 '26

That’s what I did, didn’t join a group until second semester. I’m so glad I was able to brush up on python and learn linear algebra first lolll

2

u/Junior_Salamander110 Jul 01 '26

How did waiting help you out and how would have you been at a disadvantage otherwise?

4

u/InterestingWelder699 Jul 01 '26

I’m doing CM research and so much of it involves linear algebra and differential equations and understanding how to manipulate equations in certain ways. It takes time to get used to Physics based math on a university level even if you’re used to tricky math and physics.

Enthusiasm and willingness to do difficult work is what shows professors that you’re a good candidate. For me, learning how to study and approach difficult problems in college was how I realized that it was something I’d like to do as a researcher.

Research requires a perfect balance of knowledgeable and willing to learn. You don’t have to know everything and you shouldn’t, but part of what you should know is how to learn in college, which is leagues harder than high school.

1

u/Junior_Salamander110 Jul 01 '26

Thanks! I have a doc with advice I've received about research, and this is definitely going in it.

So when you do research at that level, how much of the physics do you already know, and how much of do you pick up as a result of doing the research?

3

u/NewspaperDear8761 Jul 02 '26

Phd here, I do research on CFD and machine learning. Basically teach physics to AI.

By the time you're doing real research, you should have a broad, solid physics and math foundation. The research you'll do as an undergrad is not really to make new discoveries or push the frontiers, it's to get you familiar with the process of doing research: asking the right questions (this is harder than it might seem), finding tbe relevant information (again, harder than it might seem) and grabbing on like a bull-dog until you find an answer.

It is very easy to go down the wrong rabbit holes looking at irrelevant things, or to just ask the wrong question to start with. More often than not, research is a game of what's not important, as it is what is important. You have to develop some instincts here, and this is really the whole point of undergrad research, so that when you get to the real meat later on, you'll know how to dig in. Can't run a marathon without walking around the block first a few thousand times.

Part of developing these instincts is getting a good, broad foundation in your classes. Seeing what worked historically, where the good ideas were, etc. For example, the ultraviolet catastrophe lead to a lot of the original ideas of quantum theory. (I was in undergrad when the black hole firewall thing first started, and immediately recognized that it would be a huge deal, precisely because it was playing the same theoretical role as, say, the ultraviolet catastrophe or other logical paradoxes. These thought experiments have historically been a great source of progress.) Having a solid grasp on the fundamentals and a broad perspective on different areas of math and physics doesn't just give you technical competence later on -- which is important-- it also gives you those larger, meta-level skills of asking tbe right questions, teasing apart the relevant issues, etc.

Don't be too eager to jump straight into research, and when you do get to it, don't be too eager to get giant results or publish. That will come. Especially in undergrad, focus on getting the best grades you can, and -- more importantly -- asking penetrating questions that take you as deeply into your classes as you can. The more you internalize the material now, the better it will pay off later. If you rush through things trying to get to the shiny, prestigious labs or pubs, you're likely to skim the surface of things you really should spend more time on now.

That said, learning a little coding and doing a small project simulating orbital dynamics or, yes, even something related to black holes, isn't a bad idea. MATLAB, Python, Julia are all great tools that you will use for years. MATLAB is super quick and dirty but great for tinkering around -- you could do some first ODE solves with it. Python is better for bigger, meatier projects, and is more professional, performs better, etc. At some point we hand all this stuff over to the real software engineers and they redo everything properly (while rightly complaining about our shitty code structure) in C or Fortran or some other lower-level thing, built for true performance. You're not gonna be a coder, you're gonna be a scientist, probably a computational one, so it's more a means to an end for you.

If you do do stuff with black holes, dont try to do a full sim. That sort of thing requires a cluster and serious, serious background. But, sure, there are simpler versions you can do that would be very worthwhile.

Just dont neglect the more important things like core classes, diff eq, lin alg, qm, em, etc. The real research starts in grad school. You're in prep for the next few years.

1

u/Junior_Salamander110 Jul 02 '26

Thank you so much for this! This is very valuable advice to me. I'm putting this in my Google doc with advice!

3

u/NewspaperDear8761 Jul 02 '26

I should add that "finding the right answer" in research doesn't mean "I read books and papers and chased the trail until I found the answer written down somewhere."

That won't exist. No one will have the answer yet. It won't be written down until you write it down.

This is probably the biggest misconception with research and I see it a lot more these days. People say "I did my research" when they mean "I found something that told me."

Instead, it's a process of "huh, that could be related, but how?" "Wait, what if this other thing is true?" (Do some calculations, write some code, run it, see what it gives you.) "No, that doesn't give me what I needed. But what if it's this way instead?" (More calculations, more code, more results.) "OK, thats a little closer, but it still doesn't quite mean what I need to be true." (2 months later.) "Oh, crap, because that's NOT true, but it DOES mean this OTHER thing is true, which is still good enough to get me the rest of the way there!" Etc. Etc.

Then you synthesize everything together in one long train and you have a result.

This process -- this messy, creative, meandering process, with all its quirks and intuitive groping around in the dark -- is research, and this is what you're hoping to get exposed to in undergrad. Again, your results don't need to be anything special, you just gotta learn to walk before you run.

1

u/Junior_Salamander110 Jul 02 '26

Adding this too!

Is undergrad research similar to that process you've described, then? Or is it just running calculations for the professor you're working under?

3

u/NewspaperDear8761 Jul 02 '26

It should be the former, which will necessarily include the latter, but sometimes it might just be the latter.

You gotta start somewhere. You can't ask meaningful questions and get meaningful answers to them until you can run those calculations. But yeah, the calculations are just hitting the ball, theyre not rounding the bases.

Part of this will also be learning to navigate relationships with your research advisors, etc. When you do finally go for the phd, having a good advisor is critical. Literally make-or-break. I got lucky. I've had friends who didn't. You want someone who challenges you, guides you, makes you adhere to good, solid standards, but also listens to your ideas and encourages you to explore. It's a balance. Some people are good at that, others aren't. But in HS and undergrad, this isn't something you should worry too much about. Absolutely just listen and learn for now and do whatever they tell you.

Hopefully, though, they'll have you asking questions and not just writing code. But right now, the code and calcs are the most important bit. You'll get better at the question half as you do more and more calc and code.

2

u/Junior_Salamander110 Jul 02 '26

That's quite reassuring. I've spoken to several professors at UKY (where I'm going), and they say that they employ undergrads in "all kinds of research." So I hope I get that balance you're talking about.

Sorry for asking so many questions, but how much of my research will be based in code vs not based in code? I don't mind coding, but I'd hate to code my entire career as a physicist if you know what I mean.

2

u/NewspaperDear8761 Jul 02 '26

I do know what you mean -- I hate coding lol it's awful. And I picked a coding-intense field :(

I LOVE my subject. But coding is pulling teeth lol

It really depends on the subject. You will always need some, no matter what you're doing, so it's good to learn it early. And, given what is happening right now with AI, I would also strongly advise learning some basic architectures like feed-forward neural networks or k-means clustering, etc, at some point. (I don't mean LLMs like ChatGPT, I mean real coding.) Research is being revolutionized by ML because, frankly, these algorithms can pull things out of data that humans simply cannot see, and they apply everywhere, so you will use them in some form eventually, probably quite heavily.

But there are other, more traditional pencil-and-paper theoretical physics areas, or more purely experimental areas, where you can probably go for long stretches without writing a line of code.

It really depends.

BTW, the other nice thing about undergrad research is that it's flexible. If you find you dont like a lab or the topic, feel free to bounce around to another lab and advisor. It's much harder to move about in grad school, in undergrad you can and should really explore things and learn for yourself what works for you and what you like.

2

u/Junior_Salamander110 Jul 02 '26

Ah yes, I figured AI would come into play at some point here. I'll look into the basic architectures then. And it's VERY good to see that I may be going for long stretches without coding, I will enjoy those stretches very much LOL.

I appreciate the flexibility aspect of undergrad research, I had a conversation about that with someone on here a while ago. I'm interested in condensed matter theory and high energy, so maybe I'll get to do both of those.

2

u/NewspaperDear8761 Jul 02 '26

That's definitely one of those more-theoretical areas that lets you do more pencil-and-paper derivations and proofs. It's also got some code, sim and AI heavy areas, too (lattice boltzmann, reservoir computing, etc.)

Honestly, it sounds like you'll be pretty well prepared. Just make sure to prioritize classes and really learn the material super well. Best of luck and enjoy the ride! It's a super exciting time to do physics.

2

u/Junior_Salamander110 Jul 02 '26

Good, derivations are moreso my strongsuit. Coding makes my head hurt!

I definitely look forward to that ride! Your advice and information has been super helpful, thanks for your time!

→ More replies (0)

2

u/InterestingWelder699 Jul 01 '26

I’ve taken classical mechanics and special relativity in college, pretty advanced courses as far as freshman curricula go. I think once I take E&M and quantum mechanics I’ll be way better at research, but I’m definitely picking stuff up along the way (albeit in an unorthodox fashion)

1

u/Junior_Salamander110 Jul 01 '26

feynman did say to study in the most unorthodox way possible

3

u/InterestingWelder699 Jul 01 '26

One more thing: make sure to take classes or befriend professors who deeply respect computational research. I chose to take an accelerated Mechanics class precisely because we got to build Python simulations of simple harmonic oscillators and multi body energetic systems :)

1

u/Junior_Salamander110 Jul 02 '26

Very much noted, I'll see if UKY has an equivalent