HomeTutorials

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.

Beginner (01–04)Intermediate (05–07, 09–11)Advanced (08, 12)

Prerequisites

pip install lfm-physics

Python 3.10+. NumPy is the only hard dependency. CUDA optional for GPU acceleration.

01

Empty Space

Beginner

What 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.

2 min
02

Your First Particle

Beginner

Drop 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.

3 min
📐
03

Measuring Gravity

Beginner

Profile 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.

3 min
⚫⚫
04

Two Bodies

Beginner

Two 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.

5 min
05

Electric Charge

Intermediate

Phase 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.

5 min
🌀
06

Dark Matter

Intermediate

The 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.

5 min
💥
07

Matter Creation

Intermediate

Drive χ 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.

5 min
🌌
08

Simulate a Universe

Advanced

Poisson-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.

10 min
09

Hydrogen Atom

Intermediate

A 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.

8 min
🔗
10

Hydrogen Molecule

Intermediate

Two 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.

10 min
11

Oxygen Atom

Intermediate

Z=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.

10 min
🌊
12

Fluid Dynamics

Advanced

Forty 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.

12 min