Has too many ideas for his own good! Occasionally streams computational physics at twitch.tv/physbuzz

Joined May 2022
375 Photos and videos
David Moore retweeted
Not all commons are overgrazed, and not all rides are free. Sometimes things just work because people happen to care.
3
4
126
12,408
David Moore retweeted
"Brilliant pattern recognition", yes I be making same mistakes again and again and notice patterns in it 🙃
1
1
175
David Moore retweeted
Lately I've been trying to make a nonlinear wave equation simulation in curved space. That took way too much time, but I finally got something that seems to work. The wave equation behaves similarly to a liquid, and it's orbiting a Kerr-Newman black hole. Wave accretion disk?👀🤨
4
12
109
left one is me searching for my keys around the house
Final one of the day, "NUS" landscape
3
129
David Moore retweeted
Replying to @Jonathan_Blow
One time as COD Designer, 10 years I did Campaign mission design, Zombies gameplay systems multiplayer spawns objectives/modes killstreaks, Battle Royale items vehicles layout. All took huge amounts of scripting I was dinged by bosses that I was "too much of a generalist"🤣
1
2
26
2,936
This is a good one. Normally I'd call anything like the integral of 1/polynomial "boring", but this one is fun.
Generalization … Beta, Gamma, diGamma properties to the rescue
8
223
David Moore retweeted
super simple way to solve linear systems of equations: start with a set of linear equations. for this example the following will do 3x y = 5 y z = 4 x - y 2z = 8 convert each equation to a homogeneous vector representation 3x y = 5 --> 3x y - 5w y z = 4 --> y z - 4w x - y 2z = 8 --> x - y 2z - 8w next, we need the exterior product. the exterior product is pretty easy once you get the hang of it. you write it like a ∧ b. there are just a few basic rules of the wedge we need. 1. a basis vector wedged with itself is zero. x ∧ x = 0. 2. you can flip the operands if you negate. x ∧ y = - y ∧ x. 3. it distributes over addition. a ∧ (b c) = a ∧ b a ∧ c. 4. scalars factor out. x ∧ 4 y = 4 (x ∧ y). these are all the properties we will need. continuing from earlier, join all of our equations using the wedge product. (3x y -5w) ∧ (y z - 4w) ∧ (x - y 2z - 8w) now reduce using the rules of the wedge product the normal rules of a vector space. this part is tedious, so i'll just show off the first multiplication (3x y -5w) ∧ (y z - 4w) = 3x∧y 3x∧z - 12x∧w y∧y y∧z - 4y∧w - 5w∧y - 5w∧z 20w∧w y∧y and w∧w turn in to zero. and we can swap some of the wedge products, adding in minus signs, so that we can group terms together. after all this we end up with 3x∧y 3x∧z - 12x∧w y∧z y∧w 5z∧w once we wedge this term with the remaining term, x - y 2z - 8w, and simplify (left as an exercise for the reader), we get the following 10x∧y∧z - 35 x∧y∧w 5x∧z∧w - 15y∧z∧w the final thing we need to calculate for this expression is the dual. the dual is traditionally written like ⋆v. the dual of a wedge product v is another wedge product w, such that v∧w equals the wedge of all of our basis vectors in ascending order. in our case this is x∧y∧z∧w. to find the dual of a particular wedge product, say z∧x, we can solve this equation using the swapping rule for the wedge z∧x∧⋆(z∧x) = x∧y∧z∧w z∧x∧⋆(z∧x)= -x∧z∧y∧w z∧x∧⋆(z∧x)= z∧x∧y∧w x∧⋆(z∧x)= x∧y∧w ⋆(z∧x)= y∧w the dual also distributes over addition. if we compute the dual for the term ⋆(10x∧y∧z - 35 x∧y∧z 5x∧y∧w - 15y∧z∧w) we get the result -10w - 35z - 5y - 15x or in a more familiar order -15x - 5y - 35z - 10w final step, we homogenize. make it so the coefficient in front of the w is 1. to do this we divide the whole term by the coefficient in front of the w, -10, and are left with 3/2x 1/2y 7/2z w reading off the x, y, and z coefficients of the result we get the solution to the linear system. to summarize: take your linear system. put it in homogeneous coordinates. wedge those vectors together. reduce them using the rules of vector and wedge arithmetic. take the dual. homogenize. read off the values. ------------------------------- i like this approach cuz it is so simple and algebraic. just the normal rules for vector arithmetic, plus the fairly minor addition of the wedge product (which has a lot of uses elsewhere! it is worth learning!), are enough to solve linear systems of equations. i kind of wish this is how i had learned linear algebra in school. gaussian elimination is fine, but i feel like it requires too much creativity. i don't wanna think about which rows to mash together. i wanna just rewrite over and over and over again. btw this approach fails in predictable ways if the system is under or over constrained. i think. if several constraints are linearly dependent, when they all get wedged together they wedge to 0. and 0 wedged with anything else is 0. so the whole system becomes 0. this is one condition that can be checked. the other is when the system is inconsistent, like you have x = 2 and x = 4 as equations. in this case it appears that the coefficient of the homogeneous coordinate, w, becomes zero. this prevents us from homogenizing the system back to normal cuz you cant divide by zero. i don't totally know for sure that this is how things work, that's just what ive seen messing around with a lil toy implementation. don't got formal proofs to the effect. ------------------------------- i think there is some kind of good geometric intuition hiding under the hood here somewhere. linear equations are like hyperplanes or something, and the wedge product is a well known way to intersect geometric objects. the way the homogeneous coordinate behaves is basically how it works in projective geometry too. when the homogeneous coordinate is zero, this is algebraically the same condition as a "point at infinity" in projective geometry. somehow the idea that infinity ties to the impossibility of satisfying a linear system, idk that seems right. ------------------------------- i don't have anything for a final section idk why i added another section delimiter ------------------------------- alright here is an attempt at a conclusion. linear systems of equations show up all over the place. they are so basic and solvers are so ubiquitous that it is easy to avoid thinking about the fundamentals. especially when the fundamentals are kind of awkward to deal with. i think it is pretty neat that there is such a mechanical, brainless way to solve these systems of equations. now if you are stuck on a deserted island and you forget how to invert a matrix, you can rest easy knowing how to use the wedge product as your backup.
5
10
122
17,533
David Moore retweeted
Newton fractal created using the Newton method applied to a Blaschke product. Made with #Python, #Matplotlib, #NumPy and #Sympy.
1
18
166
7,506
David Moore retweeted
squaregod.com u can dm me if ur interested
1
8
249
May 28
Excited to share our most powerful new Claude Code feature: dynamic workflows! Mention "workflow" in a prompt and Claude will dynamically create an orchestration plan that it strictly follows, allowing you to confidently trust that every stage happens in the right order even across 100s of agents.
3
133
bounce
2
1
11
937
Fun quantum mechanics story involving "how do you tackle solving the 1 particle Schrodinger equation as fast and robustly as possible?" With code. - For the Schrodinger equation, naive Euler timestepping is absolutely unstable 😱 (diverges with any delta t, delta x) - The Crank-Nicolson method is absolutely stable (never blows up at any delta t, delta x), but it's implicit. I love this because you can crank up the timestep in interactive simulations without worrying. - BUT to do Crank-Nicolson on, say, a 4k monitor with N by M pixels, you need to do a sparse array solve involving a (N*M)^2 entry matrix. This matrix's entries are mostly zero, my point is that dense methods are doomed. - When trying to optimize this to run as fast as possible, hopefully in real-time, you might hop from Mathematica to C land and do a bunch of super efficient LAPACK solves. "Mathematica is slow, C is fast" right? - In this Mathematica project the linear solves (600 on a 250^4 entry sparse matrix) takes 6.4 seconds: wolframcloud.com/obj/62f48ef… - ChatGPT Pro's implementation of the same thing in C and LAPACK takes 6.7 seconds: chatgpt.com/share/6a16d076-a… (I did not debug / deeply read this code) - So, at least pre-LLM it was a lot of C coding work for sometimes zero gain! And we learn the lesson that Mathematica can be a serious linear algebra workhorse. - In my experience Matlab always beat whatever I could do with C &LAPACK or Mathematica. Typing that sentence pains me greatly, but it's true. BUT we are talking like 5 seconds vs 6 seconds, if Mathematica is taking 100x longer you've almost surely messed something up and accidentally asked it to solve a symbolic problem when you meant to ask it to solve a numerical problem. - BTW: the winners for implementing a Schrodinger equation solver in real-time are... -- Visscher 1991, "A fast explicit algorithm for the time-dependent Schrödinger equation". This is a conditionally stable algorithm, but the paper explicitly says that basically whatever you gain from using straightforward implicit methods like Crank-Nicolson with a large dt, by the time the instability of Visscher matters your Crank-Nicolson solution is also garbage, it's just garbage that hasn't diverged. -- I think you could also do a webgpu Crank-Nicolson with a few Jacobi iteration steps. IMO in real-time interactivity, robustness is king, so this is probably worth it but I never bothered. -- There's also the Fourier split-step method. I learned this from independent study of numerical linear algebra in "A First Course In Computational Physics - P. DeVries (2ed)" (the one that uses matlab, not fortran). But I've never had a good payoff from using the split step method. In my book it's what you use if you can't be arsed to write an implicit solver, and you don't know about Visscher's paper. Erm, this deserves its own post but: - What does the video have to do with Crank-Nicolson? - I wanted a video of a quantum particle bouncing "elastically", eg. it looks like a lump of probability that maintains its shape and bounces off the walls like a ball. - If you study the problem you find out that this is equivalent to having m=hbar=1 with a high momentum. There is no getting around this. Usually you say "to get a particle to behave more classically, increase the mass or take hbar smaller." For our problem this is the exact same thing as taking m=hbar=1 and increasing the momentum. - So an efficient simulation will have the wavelength only a bit above the lattice size (by a factor of 4 or 8 or 16 or something). - Crank-Nicolson "gets the picture across" (notwithstanding the caveats pointed out in Visscher's paper), is absolutely stable, and lets you crank delta t up a little bit. - If you want the particle to stay as a small lump of probability for even longer, without using a ridiculously fine resolution grid, you're going to go to semiclassical or particle-based methods. TLDRs: Mathematica sparse array solving is fast, basically bare metal for what we're doing. The Crank–Nicolson method is great. Visscher's algorithm is great. David seems to hate the split-step method, I wonder if it keyed his car or something. Bouncing quantum particles are cool. Call to action: You should make a weekend project of implementing an interactive Schrodinger equation solver with Crank-Nicolson on webgpu, probably using Jacobi iteration.
3
2
15
1,404
(my morning basically went: "Oh, I can answer a question with that old code I have on my hard drive!" "Hm, I guess I should double check that my claims about sparse linear algebra speeds are correct" "Hm, now I have these artifacts it would be a shame not to write it up.")
3
106
David Moore retweeted
Weyl spinor. The Weyl equation is the zero mass version of the Dirac equation. The Weyl spinors travel at the speed of light. To see this I have added a vertical dotted yellow line that moves rightwards at c. As you can see the wave packet moves at c also.
3
11
424
(just memeing, carry on.)
GOALPOST MOVED. "LLM must solve major conjecture without lean or data augmentation using lean. Otherwise its neuro symbolic AI, just as I predicted years ago. Gotcha."
1
4
201
Do your part, post a cool application of a SAT solver.
May 18
What are some very cool applications of SAT solvers you know?
6
362
Wrote some silly/excessive notes on finite dimensional Gaussian integrals for QFT. Web: mathandcode.com/2026/05/18/g… Markdown source for chucking into LLMs: github.com/physbuzz/mathandc…
3
30
957
Hm definitely needs another typo pass but it can wait til next weekend.
96
Man I love Twitter, such a good thought piece. Anki-style flashcards helped me a ton in undergrad/grad physics and math... for Fernando's example of a flash card testing the knowledge "Are all unitary matrices invertible?", I'd write: "Q: Define what it is for a matrix to be unitary. What about for a general linear operator in an inner product space?" In general anki-style quizzes helped me a lot, even in graduate school physics qualifying exams. I'd literally have on a flash card, "derive the Einstein Field Equations from the Hilbert action." For a question like that, the goal is not to get out a few sheets of paper and scrawl everything out, but to carry out the argument in your head adequately. If I ran through the whole argument in my head and piece-by-piece only said "yep, I know how to do that" then I considered it answering the question successfully without writing anything down! There'd also be an army of supporting questions so saying "skip, I don't remember enough to answer that" is perfectly valid. My memory is trash so it's pretty important for me. Actually it would be super fun to go over some flash cards I made back in, jeez, 2015, for a group theory course. I think the top three scores on the final exam were like 115%, 108%, 60% 😆 I conceded second best but the point is the flash cards helped! FWIW I find ChatGPT 5.5 pro and Claude opus 4.7 to be frustrating and ~break-even effortwise for writing math 'n' physics flash cards (half decent for generating ideas and great for verbose technically-correct-but-misses-the-salient-point answers, but very little makes it into the final output).
I have written.
19
1,510
David Moore retweeted
Replying to @backslashvarphi
oh no did i hurt a physicists feelings? should we build a new supercollider? should we call Michio Kaku? GO DO MATH
1
1
5
485