Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What is the best way to get into Physics as a coder?
32 points by whitepaint 4 months ago | hide | past | favorite | 34 comments
I don't know anything about Physics.



Depends entirely on what you are trying to get out of this.

If you want to write a game engine or something, you just need to understand some equations and how to implement them.

If you actually want to understand physics - as in the rhyme and rhythm of the physical world - you will have to grind it out. Your coding skills won't help you much. No one has written an essay on the Unreasonable Effectiveness of Coding in the Natural Sciences [1], because there isn't much. Most you will get out of your coding skills is that you can quickly numerically simulate some physics equations. But simulating equations is not physics.

Rather than simulating the models, the skill of Physics is to build the models that correctly describe the system in question. Building models requires actions like making the correct assumptions or identifying the symmetries of the system. These skill emerge from mathematically modeling a large number of systems, in a wide variety of domains, so you get the intuitive understanding of what to do when faced with a novel system. Mathematics provides a very convenient framework for making assumptions and identifying symmetries, while coding does not.

So, really, the prescription is to master calculus, linear algebra and differential equations, and then grind your way through about ten physics courses in sequence. There is no shortcuts unfortunately.

I would recommend paying graduate students at your local university to tutor you.

[1] https://www.maths.ed.ac.uk/~v1ranick/papers/wigner.pdf


> No one has written an essay on the Unreasonable Effectiveness of Coding in the Natural Sciences [1], because there isn't much.

Exhibit A: http://groups.csail.mit.edu/mac/users/gjs/6946/sicm-html/


Many of the advancements in computing technology and coding occurred precisely because of Physics. The Manhattan project had human computers to compute the results of theoretical equations. Later early digital computers were used for a wide variety of physics applications. Part of the development of the internet is credited to CERN.

Coding is very useful for parts of Physics. But if you look at the core of the physics skill - being able to build theories and models of new systems - you will see that almost all the fundamental discovery work in Physics was done before the era of digital computers. And despite of now a lifetime of usage of inane amounts of computing powers in Physics, we have hardly discovered any foundational results.

Sure numerical analysis is critical for building intuition about complex systems. And it is a necessary part of a physicists training. And this excellent book does exactly this - derives a bunch of physics equations using mathematics, and then implements them in lisp to build intuition. But writing code will help you with the core physics skill much less than actually struggling with mathematics.


Scott Aaronson, from shtetl-optimized fame, describes his work as on the boundary of math, physics and computers. P vs. NP problem is a CS problem yet has some apparent consequences in quantum world.

Not quite coding though.


As someone who's done the opposite ... gone from physics to coding ... I'd suggest the first thing to do is question your premise. What exactly does "getting into physics" mean for you? What actually comes to your mind if you imagine tasks a physicist might perform ? Which of those do you think you could do as a programmer, and which have you got no idea about how to approach ? Such a questioning approach is typical for physics. Why are things the way they are? What predictions can one make ? etc....

Or do you even mean "physics" in the sense the word is used in computer game development ? Which is "largely" (an over broad term) mechanics; how things move, flow, deform under external forces.

Can you give us more details? That would help with giving you pointers.


For that matter, graphics in computer games are informed by physics in the sense that many methods like rendering, raytracing, NeRF, Gaussian Splatting try to simulate light fields.


First, you’ll need an engaging intro to physics. Without enthusiasm, anything you do will be boring. In the 60’s, books by George Gamow interested me, as did books on astronomy and astrophysics. I can’t say what newer books would help, though I will give that a look.

To learn the basics, something like The Feynmann Lectures on Physics.

Description and links:

https://en.wikipedia.org/wiki/The_Feynman_Lectures_on_Physic...

The lectures online:

https://www.feynmanlectures.caltech.edu/info/

But if you are serious, know that there are really varied branches of physics, some theoretical and some experimental. The theoretical branch (and making it through grad school) will demand lots and lots of math, and not the “numerical” kind that is common in computing. You might get familiar with symbolic math computing, such as MAXIMA.

Experimental work is very hands-on, but since so much of it is quantum level, the math is also important. Lesson I learned: if you want to really do physics, learn to love math, advanced stuff.

But if you do get into experimental physics, there are some pretty exciting projects. Just today, I found this article.

If you want something done right, do it yourself: the scientists who build their own tools

https://www.nature.com/articles/d41586-023-04015-0

Astronomy and Astrophysics are similar. You can go experimental, and of course, reduce tons and tons of data. But cosmology is going to require mostly math as your tool, relativity and quantum physics, perhaps the twain will meet.

Of course, you could go the circular route, as I did. I got a B.S. in physics, did optical and electronic engineering, and eventually got a job supporting computing at an outstanding physics department.

I was a great experience, but when funds were cut, I went on to other, mostly computer-related, jobs.

Personally, I took a liking to optics, which requires knowledge of physics, but it was something I could hold in my hands ( i.e. a camera ) or not hold, as in space optics. My optical engineering days were very enjoyable.


You don't need to know about physics.

Some people who do know about physics don't need coders and some do.

You need to find people who do know about physics, but who still need coders.

Physics is just too big a subject to 'know about it' enough to 'get into physics as a coder'.

Yes, you will need to know about a specific 'problem domain' within physics

One that someone somewhere needs a coder for.

But start with people, not with physics

People need coders, physics doesn't

People have physics problems that they need coders to solve

Read up, find the people with the unsolved physics coding problems that you can work out how to help them solve

Then your problems will really begin

Then you'll find out if getting into physics as a coder was right for you


This reads to me like you’re assuming OP is looking to make a career in Physics—what if they’re just looking to learn more about what comprises the field, or to satiate their own curiosity?


Wasn't there this site that had a list on what to learn to go from zero to QM and GR? It was a pretty detailed list with specific sources and subjects. If I remember it was Basically started by this girl who ended up doing it from zero as well. She coded too.

I think most people never make it as far as she did. You have to be really smart and let's face it programming is not the smartest job out there. Even the best programmers mostly end up not knowing physics that well.

I'll post the site if I find it later today.


You might be thinking of this: https://www.susanrigetti.com/physics


As in get a "get a job in physics" or "understand physics"? If it's the former I'd suggest boning up on your FORTRAN and applying to scientific computing jobs. If it's the latter I'd recommend Khan academy. You're going to want to relearn your diff eqs. and your PDEs, plus some linear algebra.


Go an do some work in game design.

- Building a toy physics engine like Box2D or working on a Ray tracer will teach you about mechanics & light respectively.

Also the two volumes of Leonard Suskid's "Theoretical Minimum" are a great place to start for highschool math.

You cannot master all of physics not even professional physicists can master all of physics.

What you need is;

a) The theoretical minimum.

b) A niche in physics you have an interest in. (I recommend you start with the "A Very short introduction" books.

You can get into Astronomy, Cosmology, Electricity for example.

Also it would be great to have a copy 9f Richard Feynman's Lectures of physics.


Check out your local community college! I'm in my 30s and taking a physics I-III class series, just as a fun exploration/challenge. I found the social aspect of going to school more engaging than self-teaching, since I work from home all day.


Take/get involved with basic physics courses with eye on developing/automating the lab course work (excel spread sheets, etc) and/or other things[0][1] that others can see/understand/demonstrate that you're interested in doing physics realted things.

[0] : https://docs.vizycam.com/doku.php?id=wiki:motionscope_app [1] : https://docs.vizycam.com/doku.php#applications


OpenStax has some free Physics text books: https://openstax.org/


There is nothing special about coders as far as getting into physics goes.

Knowing math can help you in general for sure. Knowing programming will help you if you get into numerical simulations etc.

Other than that - there is nothing to suggest here.

You choose your goal (“get into physics” is not a goal) and you start digging towards it like everybody else.


Hang out at places like Barnes and Noble while you code and drink coffee.

Pick up books from subjects that you think might interest you while you hang. Read a few chapters and decide if the book/subject is for you.

If you really love it; buy the book and take it home.

I did this for a number of years, and absorbed a lot from coding, general physics, quantum mechanics, and even tried to dabble in Astro physics.


Make simulators. Anything. Finite elements, diffusions

soon enough you'll learn about gradients, curls, and how to implement them

Oh, and play kerbal space programs


If you are serious about it then grab a Physics 101 textbook and get familiar with the subject. Read skim through it and then reevaluate and decide what exactly you need or want to learn. Physics is a huge subject so you need to be a bit more focused on what you need or want to be able to understand where to start.


“Structure and interpretation of classical mechanics” by Sussman bridges this gap beautifully


Here's a super neat Strange Loop talk about implementing and animating SICM: https://youtu.be/Jv2JgzAl5yU?si=_dHboDt-MKXon2-c


I came to the comments to say more or less the same thing; however, I would also propose that it should probably be updated to use python for maximum accessibility of the cool ideas therein in this day and age (said even though I am a certifiable schemer).


Is the prerequisite of this book SICP? Thanks.


Go apply maxwell equations to real world situations and gain experience tackling the gravity of issues with free form 3d printing feyman diagrams for programming language bnf forms without material support. VR works too.


The question is too broad, you need to be more specific.

I learned a lot of Physics watching youtube channels like PBS Space Time. That's much easier than buying a textbook.



I'm a fellow programmer who has been self-learning physics for the past few months. My opinion is that a programming background is largely irrelevant to the "learning physics" part. It might help depending on what you want to do with the physics after you learn it, if that involves writing simulations or something like that. But really learning physics mostly involves reading books and solving physics problems.

I think the most important advice is don't try to skip ahead. It's tempting to jump straight into the cool modern physics topics like quantum mechanics and general relativity before you have the necessary background. I've gone down that route and didn't really learn anything that way.

If you haven't taken any physics at the university level, you probably want to start with one of the big calculus-based intro books like Young's University Physics. Calculus, differential equations, and linear algebra are really important, so you might want to pick up separate textbooks on those (or a single volume Engineering Mathematics textbook) unless you have already learned these subjects. Everyone speaks highly of the Feynman Lectures, but some say that they're only really beneficial after you already have a decent understanding of the subjects being covered. I believe I heard Sean Carroll say this once on a podcast, and I trust his opinion on physics matters.

The core subjects in undergraduate physics are classical mechanics, electrodynamics, special relativity, quantum mechanics, and statistical mechanics/thermodynamics. You will learn all of these subjects from an intro textbook as a first pass. After that, you'll return to each subject and essentially relearn it at a more advanced level with dedicated textbooks for each (except SR which is covered in electrodynamics). General relativity and quantum field theory are usually taught at the graduate level or as upper-level undergraduate electives, so those are best to save for last.

Having forgotten a lot of the math I learned a decade ago, I've found that having one of those Mathematical Methods books nearby at all times is indispensable. I went with Riley/Hobson/Bence, but Boas also gets good reviews. These books are a bit terse if you're learning a subject for the first time, but they're great as a reference and contain pretty much all the math you will ever need to know unless you plan on doing research-level physics.

Don't forget about YouTube. There are lots of lectures available from top universities, as well as independent content creators. I haven't looked much into physics channels yet, but on the math side I highly recommend 3Blue1Brown, especially his series "Essence of Calculus" and "Essence of Linear Algebra".

This is a good roadmap to guide your study path and has good textbook recommendations: https://www.susanrigetti.com/physics


Read a good textbook. I personally like the Feynman lectures of Physics, always very clearly explained.


All available online now, too! https://www.feynmanlectures.caltech.edu/


What kind of physics?


Physical physics i think.


game engine?


or quantum computer sim




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: