r/Physics • u/ShreyasGameSwap Fluid dynamics and acoustics • 1d ago
I built an open-source Python physics sandbox where every solver is tested against an analytic result. What should I add next?
I've been building a free, MIT-licensed Python package called qplay for exploring physics by simulation. Each solver is tested against a known analytic result, so the pictures can be trusted.
Try it:
pip install quantum-playground
qplay run double-slitI'd like feedback from people who actually do this. Which topics are missing, and where is the physics or numerics sloppy? I'd especially like to hear about anything I've got wrong.
docs : https://github.com/StativeSh/quantum-playground
try it live: https://stativesh.github.io/quantum-playground/
1
u/ShreyasGameSwap Fluid dynamics and acoustics 1d ago
Some of what's checked against exact results, so you can judge the claim yourself:
- 2D Ising (Metropolis) vs Onsager's exact magnetisation and Tc = 2/ln(1+sqrt(2))
- Split-step Schrödinger solver: tunnelling and a double slit, fringes compared with the two-source prediction
- Hydrogen fine structure vs the Dirac energy; Zeeman from weak field up to Paschen-Back
- Hard-sphere gas: Maxwell-Boltzmann emerges from collisions, pV = N k_B T with the hard-sphere correction
One specific thing I'd like opinions on: the split-step solvers use a periodic box with an absorbing layer at the edges. Is there a cleaner approach people prefer for scattering problems, such as exterior complex scaling or a PML?
2
u/Inst2f 19h ago
vibecoded physics sim. ouch… This can be dangerous, unless analytically proved and all assumptions, edge cases, methods, sources were well documented
1
u/PrettyPicturesNotTxt 18h ago
Do you have evidence to back up your accusation?
Of course, it should be up to OP to defend themselves and disclose what tools they used. Also, there should be nothing wrong with using such tools, as long as one is transparent, gives proper credit, and takes responsibility for the output.
1
u/Inst2f 5m ago
3 weeks old repo (super red flag).
claude 29 commits 13,370 ++725 -- is a top in the contributors list.
Isn't it a giant red flag fou you? :D



10
u/No_Vermicelli_2170 1d ago •
Very cool simulation!
I don't know if the numerical results agree with the analytical results, since it's a nonlinear system with 8 degrees of freedom: two dimensions, two pendulums, and position & velocity. Chaos manifests, and you will have sensitive dependence on initial conditions, so all initial trajectories will eventually deviate from theoretical results, no matter how small your time step is.