HomeTutorials

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.

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

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 behavior is analogous to dark matter, without new particles.

5 min
💥
07

Matter Creation

Intermediate

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

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 and voids self-organize from two equations — structure analogous to the cosmic web.

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. χ-well depth shows 1/r-like distance scaling — no Schrödinger equation needed.

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). Bond-like χ-well sharing appears without invoking 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 — shell separation emerges from χ-well depth and wave dynamics alone.

10 min
🌊
12

Fluid Dynamics

Advanced

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

12 min
13

Weak Force

Advanced

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

12 min
🔺
14

Strong Force

Advanced

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

14 min
📊
15

Visualisation & Analysis

Beginner

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

8 min
🎯
16

Lorentz, Anisotropy, and Dispersion

Advanced

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

14 min