HomeTutorials01 – Empty Space
01Beginner~2 min

Empty Space

In LFM, the vacuum is not empty — it's a lattice where every point carries a stiffness value χ = 19. This tutorial shows you exactly what "nothing" looks like.

What you'll learn

  • How to create a SimulationConfig and Simulation
  • Why χ₀ = 19 is the vacuum value (1 center + 6 face + 12 edge lattice modes)
  • How to read basic metrics: sim.chi, sim.metrics()
  • That empty space is stable — nothing happens without energy

Which equation is running?

LevelFieldForces includedSpeed
REAL ←Ψ ∈ ℝGravity onlyFastest (this tutorial)
COMPLEXΨ ∈ ℂGravity + EM~2× slower
FULLΨₐ ∈ ℂ³All 4 forces~6× slower

FULL is always physically correct — it is simply slower. Tutorials 01–04 use REAL because we are studying gravity only. Tutorial 05 switches to COMPLEX to access phase-based charge. You can pass field_level=lfm.FieldLevel.FULL at any time and get all four forces.

Install

pip install lfm-physics

Full script

"""01 – Empty Space

What does the vacuum look like?

In LFM, empty space isn't nothing – it's a lattice where every
point has a stiffness value chi (χ) equal to 19.  This number
comes from the geometry of a 3D cubic lattice:
    1 center mode + 6 face modes + 12 edge modes = 19.

Run this first.  It takes a few seconds and prints what "nothing"
looks like in the simulation.
"""

import lfm

# Create a 32³ lattice.  No particles, no energy – just vacuum.
config = lfm.SimulationConfig(grid_size=32)
sim = lfm.Simulation(config)

print("01 – Empty Space")
print("=" * 55)
print()
print("A 32×32×32 lattice, freshly created.")
print()

chi = sim.chi
print(f"  chi everywhere  = {chi.mean():.1f}")
print(f"  chi min         = {chi.min():.1f}")
print(f"  chi max         = {chi.max():.1f}")
print(f"  energy density  = {sim.energy_density.sum():.6f}")
print()
print("Every point is χ₀ = 19.  No wells, no voids, no structure.")
print("This is the emptiest possible universe.")
print()

# Evolve for a bit – nothing should change.
sim.run(steps=500)
m = sim.metrics()
print(f"After 500 steps of evolution:")
print(f"  chi mean  = {m['chi_mean']:.4f}")
print(f"  chi std   = {m['chi_std']:.6f}")
print(f"  wells     = {m['well_fraction']*100:.1f}%")
print()
print("Nothing happened – because there's no energy to drive change.")
print("Empty space is stable.  Now let's add something to it (→ 02).")

# ─── 3D Lattice Visualization ──────────────────────────────────────────────
# Requires matplotlib.  Generates: tutorial_01_3d_lattice.png
# (All panels are blank – vacuum has uniform χ=19 and zero energy.)
try:
    import matplotlib; matplotlib.use("Agg")
    import matplotlib.pyplot as _plt
    import numpy as _np
    _N    = sim.chi.shape[0]
    _step = max(1, _N // 20)
    _idx  = _np.arange(0, _N, _step)
    _G    = _np.meshgrid(_idx, _idx, _idx, indexing="ij")
    _xx, _yy, _zz = _G[0].ravel(), _G[1].ravel(), _G[2].ravel()
    _e    = (sim.psi_real[::_step, ::_step, ::_step] ** 2).ravel()
    if sim.psi_imag is not None:
        _e  = _e + (sim.psi_imag[::_step, ::_step, ::_step] ** 2).ravel()
    _ch   = sim.chi[::_step, ::_step, ::_step].ravel()
    _bg   = "#08081a"
    _fig  = _plt.figure(figsize=(15, 5), facecolor=_bg)
    _fig.suptitle("01 – Empty Space: 3D Lattice (Energy | χ Field | Combined)",
                  color="white", fontsize=11)
    _chi_range = _ch.max() - _ch.min()
    _chi_lo    = _ch.max() - max(_chi_range * 0.05, 0.1)
    for _col, (_ttl, _v, _cm, _lo) in enumerate([
        ("Energy |Ψ|²",            _e,  "plasma", max(_e.max() * 0.15, 1e-9)),
        ("χ Field (gravity wells)", _ch, "cool_r",  _chi_lo),
    ]):
        _ax = _fig.add_subplot(1, 3, _col + 1, projection="3d")
        _ax.set_facecolor(_bg)
        _mask = (_v < _lo) if _col == 1 else (_v > _lo)
        if _mask.any():
            _sc = _ax.scatter(_xx[_mask], _yy[_mask], _zz[_mask],
                              c=_v[_mask], cmap=_cm, s=8, alpha=0.70)
            _plt.colorbar(_sc, ax=_ax, shrink=0.46, pad=0.07)
        _ax.set_title(_ttl, color="white", fontsize=8)
        for _t in (_ax.get_xticklabels() + _ax.get_yticklabels() +
                   _ax.get_zticklabels()):
            _t.set_color("#666")
        _ax.set_xlabel("x", color="w", fontsize=6)
        _ax.set_ylabel("y", color="w", fontsize=6)
        _ax.set_zlabel("z", color="w", fontsize=6)
        _ax.xaxis.pane.fill = _ax.yaxis.pane.fill = _ax.zaxis.pane.fill = False
        _ax.grid(color="gray", alpha=0.07)
    _ax3 = _fig.add_subplot(1, 3, 3, projection="3d"); _ax3.set_facecolor(_bg)
    _em  = _e > _e.max() * 0.15 if _e.max() > 0 else _np.zeros_like(_e, dtype=bool)
    _cm2 = _ch < _chi_lo
    if _em.any():  _ax3.scatter(_xx[_em],  _yy[_em],  _zz[_em],
                                c="#ff9933", s=8, alpha=0.55, label="Energy")
    if _cm2.any(): _ax3.scatter(_xx[_cm2], _yy[_cm2], _zz[_cm2],
                                c="#33ccff", s=8, alpha=0.45, label="χ well")
    _ax3.legend(fontsize=7, labelcolor="white", facecolor=_bg, framealpha=0.5)
    _ax3.set_title("Combined", color="white", fontsize=8)
    for _t in (_ax3.get_xticklabels() + _ax3.get_yticklabels() +
               _ax3.get_zticklabels()):
        _t.set_color("#666")
    _ax3.set_xlabel("x", color="w", fontsize=6)
    _ax3.set_ylabel("y", color="w", fontsize=6)
    _ax3.set_zlabel("z", color="w", fontsize=6)
    _ax3.xaxis.pane.fill = _ax3.yaxis.pane.fill = _ax3.zaxis.pane.fill = False
    _plt.tight_layout()
    _plt.savefig("tutorial_01_3d_lattice.png", dpi=110, bbox_inches="tight",
                 facecolor=_bg)
    _plt.close()
    print()
    print("Saved: tutorial_01_3d_lattice.png  (3D: Energy | χ | Combined)")
except ImportError:
    print()
    print("(install matplotlib to generate 3D visualization)")

Step-by-step explanation

Step 1 — Create the lattice

config = lfm.SimulationConfig(grid_size=32) sim = lfm.Simulation(config)

This allocates 32³ = 32,768 lattice cells. Every cell stores two values: Ψ (wave amplitude, starts at 0) and χ (stiffness, starts at 19).

Step 2 — Inspect the χ field

chi = sim.chi print(chi.mean(), chi.min(), chi.max())

sim.chi returns a 32×32×32 NumPy array. In vacuum, every element equals χ₀ = 19 exactly — no variation at all.

Step 3 — Run 500 steps and confirm nothing changes

sim.run(steps=500) m = sim.metrics() print(m['chi_std'])  # → 0.000000

GOV-02 reads |Ψ|² − E₀². With Ψ = 0 and E₀² = 0, the right-hand side is zero, so χ never changes. An empty lattice is perfectly stable.

Expected output

01 – Empty Space
=======================================================

A 32×32×32 lattice, freshly created.

  chi everywhere  = 19.0
  chi min         = 19.0
  chi max         = 19.0
  energy density  = 0.000000

Every point is χ₀ = 19.  No wells, no voids, no structure.
This is the emptiest possible universe.

After 500 steps of evolution:
  chi mean  = 19.0000
  chi std   = 0.000000
  wells     = 0.0%

Nothing happened – because there's no energy to drive change.
Empty space is stable.  Now let's add something to it (→ 02).

Why χ₀ = 19?

On a 3D cubic lattice, the discrete Laplacian has a specific mode structure. The lowest non-propagating modes are: 1 center mode + 6 face-neighbor modes + 12 edge-neighbor modes = 19. This is the geometry of 3D space itself — not a free parameter.

Visual preview

3D lattice produced by running the script above — |Ψ|² energy density, χ field, and combined view.

3D lattice visualization for tutorial 01