How important is python for theoretical physics?

In summary, Python is increasingly important for theoretical physics due to its versatility, ease of use, and extensive libraries that facilitate complex simulations, data analysis, and modeling. It enables physicists to handle large datasets, perform numerical computations, and visualize results efficiently, making it a valuable tool for research and collaboration in the field.
  • #1
robotkid786
22
7
Hey guys, I'm a first year student studying theoretical physics in England.

My physics modules include a fair bit of python programming and I want to apply to ICGs cosmology PhD in England.

Can I escape learning python by choosing maths modules?
 
Physics news on Phys.org
  • #2
Why are you trying to escape learning python?
 
  • Like
Likes PhDeezNutz
  • #3
Frabjous said:
Why are you trying to escape learning python?
I don't enjoy it. Just feels long to learn and uninteresting
 
  • #4
robotkid786 said:
I don't enjoy it. Just feels long to learn and uninteresting
Do you know how to program? It should be a tool in your arsenal.
 
  • Like
Likes DeBangis21, PhDeezNutz and russ_watters
  • #5
Frabjous said:
Do you know how to program? It should be a tool in your arsenal.
No, thats what I'm saying. I don't like learning it because it's boring me. Idk if the cosmology phd will require this kind of programming and whether or not I can just pick it up when I'm actually doing it
 
  • #6
I dont have any degrees of any kind but wouldnt programming (any language really) by incredibly useful for monte carlo simulation?

In fact, I can't really see how you can get by without this tool.
 
  • Like
Likes PhDeezNutz
  • #7
The meta issue is more important than the issue.

If you only want to learn the bare minimum, you will be unsuccessful as a physicist. Especially as a theorist, as your job will be to use ideas not previously part of the "toolbox". You need to seriously consider another line of work. ideally as quickly as possible. You won't like it, and you won't be any good at it.
 
  • Like
Likes gwnorth, DeBangis21, russ_watters and 4 others
  • #8
robotkid786 said:
No, thats what I'm saying. I don't like learning it because it's boring me. Idk if the cosmology phd will require this kind of programming and whether or not I can just pick it up when I'm actually doing it
You do not know how to program, and you want to bypass the parts of your program that will teach you. That does not seem like a good idea.
 
  • Like
Likes PhDeezNutz, russ_watters, Math100 and 1 other person
  • #9
Lol, is anyone here an actual physicist ?

I also didn't say i wouldn't do the programming, i'm saying, i have to do programming, but for the rest of the degree, im gonna pick maths modules over the programming heavy modules.

and yeah monte carlo does require programming, but if i don't work with statistical models, there'll be no reason to be concerned about it.
 
  • Haha
Likes russ_watters and berkeman
  • #10
robotkid786 said:
Lol, is anyone here an actual physicist ?

I also didn't say i wouldn't do the programming, i'm saying, i have to do programming, but for the rest of the degree, im gonna pick maths modules over the programming heavy modules.

and yeah monte carlo does require programming, but if i don't work with statistical models, there'll be no reason to be concerned about it.
Yes.
Sounds like you have already decided. Good luck.
 
  • Like
Likes PhDeezNutz and russ_watters
  • #11
robotkid786 said:
Lol, is anyone here an actual physicist ?
Um, yes.

But hey, you know better. You're a college freshman, after all. Good luck!
 
  • Like
  • Haha
Likes gwnorth, PhDeezNutz, russ_watters and 3 others
  • #12
I don't know why youre implying i have an attitude. but whatever, i get the point. learn python, it's required. thanks.
 
  • #13
robotkid786 said:
I don't know why youre implying i have an attitude. but whatever
It is not what you meant to say, but how it was received that matters.
 
  • Like
Likes russ_watters
  • #14
robotkid786 said:
is anyone here an actual physicist ?
I am not, although I am a physics instructor.

robotkid786 said:
if i don't work with statistical models
Is it even possible to work in cosmology without working with statistical models? I have only read one cosmology paper but it was heavily statistical. I am not sure if that was typical.
 
  • #15
Ideally you would know not only one but at least two or three computer languages (although learning another when you know one becomes easier). Python is a good place to start because it is relatively simple, intuitive, and has a lot of functionality already available.

As a physicist today, programming is usually an indispensable part of your toolbox. You will need it to analyze data, to run simulations, and to just generally support your work. There may be a few specialties in the theoretical direction where you won’t need it, but cosmology certainly is not one if those.

I encounter way too many students that have the wrong idea about what life as a theoretical physicist would be. Just wanting to do pen and paper calculations and shunning away from complex computer simulations. Students that enjoy using a computer to run simulations and to do analysis are fewer and highly valuable. Particularly if they are good at it.

(Yes, I am a full professor in theoretical astroparticle physics)
 
  • Like
Likes gwnorth, DeBangis21, PhDeezNutz and 2 others
  • #16
No point in trying to escape it, it is ubiquitous, ESPECIALLY in cosmology. But it's also not hard compared to the other stuff you learn in physics so don't worry.
 
  • Like
Likes DeBangis21, russ_watters and berkeman
  • #17
robotkid786 said:
Hey guys, I'm a first year student studying theoretical physics in England.

My physics modules include a fair bit of python programming and I want to apply to ICGs cosmology PhD in England.

Can I escape learning python by choosing maths modules?
Try listening to Leslie Lamport about programming. Python is only a means to realising an algorithm. It might give you a fresh perspective.
 
  • #18
robotkid786 said:
I don't know why youre implying i have an attitude. but whatever, i get the point. learn python, it's required. thanks.
Just to re-iterate what was said above, it is not about learning Python, it is about learning to program, what language you use is less important than the underlying ideas(when I was an undergraduate student we used Ada, it wasn't a popular language even back then).
Nearly all forms of research includes some programming (even it if is just writing Matlab scripts), and many people will routinely use 2-3 languages ( Python, C++, Fortran etc)
It is true that you can learn to use Python (basic usage of say Numpy and Matplotlib) just by "doing it" as part of another course; but that Is NOT the same thing as learning to program.
Hence, having at least one course dedicated to programming on your CV is very valuable, especially if you don't have any prior experience (i.e. you've never done it for fun)

-> also a physicist (based in the UK)
 
  • Like
Likes DeBangis21, gwnorth, PhDeezNutz and 2 others
  • #19
robotkid786 said:
Lol, is anyone here an actual physicist ?

robotkid786 said:
I don't know why youre implying i have an attitude.
Here are a couple reasons why some might think you have a bit of an attitude:
  • You're in your first year of college/university, so it's fair to say that you have little or no idea what a PhD cosmologist actually does.
  • You've been here less than three months with a whopping five posts in your profile. It's stunning to me that you would question the expertise of the members here as a brand new member with so little experience on this site. After you're here for a while, you'll learn that many members here are actual physicists.
 
  • Like
Likes DeBangis21, PhDeezNutz, Frabjous and 4 others
  • #20
Mark44 said:
You've been here less than three months with a whopping five posts in your profile. It's stunning to me that you would question the expertise of the members here as a brand new member with so little experience on this site. After you're here for a while, you'll learn that many members here are actual physicists.
I tried a while back to get the website renamed to "EngineeringForums.com" but failed in that. The Physicists here are such a tight-knit bunch... :wink:
 
  • Haha
  • Love
  • Like
Likes DeBangis21, pbuk, Vanadium 50 and 2 others
  • #21
i haven't done anything arrogant aside from maybe think that i could get away with less programming. hardly arrogance and clearly a rookie error or lack of guidance. this section of the forum is literally about guidance -- the attitude you guys showed initially was a lot more hostile than need be. as a first year, it's hardly welcoming

i'm not even whining, im having to reply to people who can't fathom that writing/speaking is not black and white - impressions are subjective, re-read my initial post and it's obvious i came genuinely, whereas some of the posters were literally telling me to abandon physics without a single detail on me other than available and making assumptions that I won't code or whatever, when i clearly would and made it clear i need to know how much effort to put into it

stop patting each other on the back for being hostile; proper weird vibe. And i have done physics before. except i dropped out for reasons i won't go into on here, this is actually my second time doing first year and second time tryna be a physicist albeit under different circumstances

for the informative posts, thank you very much, i really kindly appreciate the time you've taken to write out informatively, i'll keep going with the degree but if i find programming is not for me, i won't pursue phd in cosmology
 
  • #22
robotkid786 said:
No, thats what I'm saying. I don't like learning it because it's boring me. Idk if the cosmology phd will require this kind of programming and whether or not I can just pick it up when I'm actually doing it
That's a fair question, and you got reasonable replies that said yes, you need to learn how to program.

robotkid786 said:
i'm not even whining
Then you should not have interjected this insult:
robotkid786 said:
Lol, is anyone here an actual physicist ?

You've gotten good replies here from a variety of folks, including theoretical physicists. Thread is done now. Have a nice day.
 
  • Like
Likes DeBangis21 and Mark44
  • #23
robotkid786 said:
i haven't done anything arrogant aside from maybe think that i could get away with less programming. hardly arrogance and clearly a rookie error or lack of guidance. this section of the forum is literally about guidance -- the attitude you guys showed initially was a lot more hostile than need be. as a first year, it's hardly welcoming
I'm an engineer, not a physicist (but I have taken several programming classes), and I had to go get a crowbar from my toolbox to pry my jaw off the floor after reading your first post. As a moderator, I'll say: all of the posts prior to your display of attitude in post 9 were shockingly flat in response to a spectacularly bad question.

[edit] posts crossed in cyberspace; @berkeman feel free to delete this if you think it's redundant/unnecessary.
 
  • #24
To the OP's strong credit, they have now started this new thread. Well done. :smile:

robotkid786 said:
I'm looking at a book called python crash course for beginners (eric mathes), does anyone have experience of using this book or any other book that you would recommend for learning python

if not that, is there a specific course you'd suggest that isn't in book form?

I'm completely new to programming if it helps. So i need a gameplan for learning it quite quickly for my undergrad studies
 

FAQ: How important is python for theoretical physics?

How important is Python for theoretical physics research?

Python is extremely important for theoretical physics research due to its versatility, ease of use, and vast ecosystem of scientific libraries. It allows researchers to quickly prototype models, perform complex calculations, and visualize data effectively.

Can Python replace traditional programming languages used in theoretical physics?

While Python is highly capable and often used, it may not completely replace traditional languages like Fortran or C/C++ in all scenarios. These languages are still preferred for highly optimized, performance-critical simulations. However, Python is often used as a high-level interface to these languages.

What libraries in Python are most useful for theoretical physics?

Some of the most useful Python libraries for theoretical physics include NumPy for numerical computations, SciPy for scientific calculations, Matplotlib for data visualization, SymPy for symbolic mathematics, and Pandas for data manipulation. Additionally, libraries like TensorFlow and PyTorch are useful for machine learning applications in physics.

Is Python suitable for large-scale simulations in theoretical physics?

Python is suitable for large-scale simulations when combined with optimized libraries or used as a wrapper for more performance-oriented languages. Tools like Cython, Numba, and parallel computing libraries can help Python handle large-scale simulations more efficiently.

How does Python facilitate collaboration in theoretical physics research?

Python facilitates collaboration through its readability, extensive documentation, and a large, active community. Researchers can easily share code and data, use version control systems like Git, and leverage collaborative platforms like Jupyter Notebooks to work together seamlessly.

Similar threads

Replies
4
Views
2K
Replies
2
Views
2K
Replies
37
Views
7K
Replies
3
Views
3K
Replies
25
Views
4K
Replies
10
Views
3K
Replies
3
Views
3K
Back
Top