Python Library Tutorials
Sixteen 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 behavior is analogous to dark matter, without new particles.
Matter Creation
IntermediateDrive χ at 2χ₀ and watch Ψ amplify from machine-precision noise.
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 and voids self-organize from two equations — structure analogous to the cosmic web.
Hydrogen Atom
IntermediateA proton well captures an electron — no quantum postulates.
A proton soliton creates a χ-well. An electron soliton binds inside it. χ-well depth shows 1/r-like distance scaling — no Schrödinger equation needed.
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). Bond-like χ-well sharing appears without invoking 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 — shell separation emerges from χ-well depth and wave dynamics alone.
Fluid Dynamics
AdvancedH2O-like molecules become a fluid via stress-energy.
Seed H2O-like triads as an initial condition, then evolve with GOV-01/GOV-02 only. Velocity, pressure, and continuity emerge from stress-energy diagnostics.
Weak Force
AdvancedMeasure parity asymmetry from epsilon_w · j in GOV-02.
Enable complex fields, generate a momentum current j, and compare epsilon_w=0.1 vs 0.0 control. Weak parity asymmetry appears as a left/right chi-depression imbalance.
Strong Force
AdvancedRun color fields and measure a confinement proxy from chi alone.
Use FieldLevel.COLOR and compute a confinement proxy as a chi line integral between color sources. The proxy grows with separation, indicating flux-tube-like behavior.
Visualisation & Analysis
BeginnerSlice it, plot it, sweep it — the lfm.viz toolkit.
Use the built-in visualisation module to create field slices, radial profiles, evolution dashboards, power spectra, and parameter sweeps. No matplotlib boilerplate needed.
Lorentz, Anisotropy, and Dispersion
AdvancedRed-team the lattice: detectability, isotropy, and bounds.
Measure directional anisotropy proxies, fit low-k Lorentz-like dispersion, and map where lattice corrections can be constrained or falsified.