Python Library Tutorials
Twelve self-contained scripts that walk you from an empty vacuum to a simulated universe — using only lfm-physics and the two governing equations.
Prerequisites
pip install lfm-physicsPython 3.10+. NumPy is the only hard dependency. CUDA optional for GPU acceleration.
Empty Space
BeginnerWhat does a vacuum actually look like?
Create a 32³ lattice with no particles. Every point has χ = 19 — the intrinsic stiffness of empty space. Run 500 steps and verify that nothing changes.
Your First Particle
BeginnerDrop energy into the lattice and watch gravity appear.
Place a soliton on the grid, run equilibrate(), and see χ drop below 19. The dip is a gravitational well — no Newton's law was injected.
Measuring Gravity
BeginnerProfile the χ-well and verify it falls off like 1/r.
Use radial_profile() to measure χ(r) around a soliton. Check that Δχ(r=4) / Δχ(r=8) ≈ 2 — Newtonian 1/r gravity from wave mechanics.
Two Bodies
BeginnerTwo solitons attract through each other's χ-wells.
Place two solitons 14 cells apart and track their separation every 500 steps. Gravitational attraction emerges from the coupled Ψ–χ wave dynamics.
Electric Charge
IntermediatePhase of the wave = electric charge.
Switch to FieldLevel.COMPLEX and set phase=0 (electron) vs phase=π (positron). Same phase repels; opposite phase attracts — Coulomb's law from interference.
Dark Matter
IntermediateThe well persists after the particle is gone.
Create a deep χ-well, then zero out all Ψ. The gravitational well remains — the substrate "remembers" where matter was. This is dark matter without new particles.
Matter Creation
IntermediateDrive χ at 2χ₀ and watch Ψ explode from nothing.
Seed Ψ with only machine-epsilon noise, then oscillate χ at Ω = 2χ₀ = 38. Parametric resonance amplifies the noise by many orders of magnitude.
Simulate a Universe
AdvancedPoisson-seed a 64³ grid and run to cosmic time.
Place nine solitons, Poisson-equilibrate χ, then evolve for 50 000 steps. χ-wells (galaxies) and voids (dark energy) self-organize from two equations.
Hydrogen Atom
IntermediateA proton well captures an electron — no quantum postulates.
A proton soliton creates a χ-well. An electron soliton binds inside it. Energy levels match the Bohr 1/n² ratio without any Schrödinger equation.
Hydrogen Molecule
IntermediateTwo H atoms bond — or repel — by wave-phase alignment.
Two H atoms share a χ-well when in phase (bonding) and repel when out of phase (anti-bonding). The H₂ bond emerges without molecular orbital theory.
Oxygen Atom
IntermediateZ=8 nucleus supports two electron shells at distinct radii.
Scale up to Z=8. A deeper nuclear χ-well supports two electron shells at distinct radii — no Pauli exclusion postulate required.
Fluid Dynamics
AdvancedForty wave packets become a fluid via stress-energy.
Forty overlapping wave packets become a fluid. Velocity, pressure, and the Euler continuity equation emerge from the stress-energy tensor alone — no fluid equations injected.