lfm-physics 0.1.2__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lfm_physics-0.2.2/.readthedocs.yaml +16 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/CHANGELOG.md +45 -0
- lfm_physics-0.2.2/PKG-INFO +280 -0
- lfm_physics-0.2.2/README.md +238 -0
- lfm_physics-0.2.2/benchmarks/README.md +29 -0
- lfm_physics-0.2.2/benchmarks/bench_evolver.py +83 -0
- lfm_physics-0.2.2/benchmarks/bench_fields.py +101 -0
- lfm_physics-0.2.2/docs/api/analysis.rst +19 -0
- lfm_physics-0.2.2/docs/api/config.rst +7 -0
- lfm_physics-0.2.2/docs/api/constants.rst +8 -0
- lfm_physics-0.2.2/docs/api/core.rst +31 -0
- lfm_physics-0.2.2/docs/api/fields.rst +23 -0
- lfm_physics-0.2.2/docs/api/io.rst +7 -0
- lfm_physics-0.2.2/docs/api/simulation.rst +7 -0
- lfm_physics-0.2.2/docs/api/units.rst +7 -0
- lfm_physics-0.2.2/docs/changelog.rst +4 -0
- lfm_physics-0.2.2/docs/conf.py +73 -0
- lfm_physics-0.2.2/docs/contributing.rst +4 -0
- lfm_physics-0.2.2/docs/examples.md +171 -0
- lfm_physics-0.2.2/docs/index.rst +54 -0
- lfm_physics-0.2.2/docs/installation.md +74 -0
- lfm_physics-0.2.2/docs/quickstart.md +111 -0
- lfm_physics-0.2.2/docs/requirements.txt +4 -0
- lfm_physics-0.2.2/examples/01_empty_space.py +45 -0
- lfm_physics-0.2.2/examples/02_first_particle.py +51 -0
- lfm_physics-0.2.2/examples/03_measuring_gravity.py +59 -0
- lfm_physics-0.2.2/examples/04_two_bodies.py +67 -0
- lfm_physics-0.2.2/examples/05_electric_charge.py +82 -0
- lfm_physics-0.2.2/examples/06_dark_matter.py +76 -0
- lfm_physics-0.2.2/examples/07_matter_creation.py +85 -0
- lfm_physics-0.2.2/examples/08_universe.py +135 -0
- lfm_physics-0.2.2/examples/09_hydrogen_atom.py +90 -0
- lfm_physics-0.2.2/examples/10_hydrogen_molecule.py +107 -0
- lfm_physics-0.2.2/examples/11_oxygen.py +99 -0
- lfm_physics-0.2.2/examples/12_fluid_dynamics.py +101 -0
- lfm_physics-0.2.2/examples/13_weak_force.py +95 -0
- lfm_physics-0.2.2/examples/14_strong_force.py +86 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/__init__.py +52 -15
- lfm_physics-0.2.2/lfm/analysis/__init__.py +58 -0
- lfm_physics-0.2.2/lfm/analysis/color.py +62 -0
- lfm_physics-0.2.2/lfm/analysis/energy.py +307 -0
- lfm_physics-0.2.2/lfm/analysis/observables.py +402 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/config.py +41 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/constants.py +46 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/backends/cupy_backend.py +3 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/backends/kernel_source.py +41 -4
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/backends/numpy_backend.py +35 -4
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/evolver.py +1 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/integrator.py +40 -7
- lfm_physics-0.2.2/lfm/io/__init__.py +87 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/simulation.py +85 -0
- lfm_physics-0.2.2/lfm/units.py +277 -0
- lfm_physics-0.2.2/paper_experiments/why_is_c_what_it_is.py +180 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/pyproject.toml +10 -3
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_analysis.py +51 -0
- lfm_physics-0.2.2/tutorial_03_3d_lattice.png +0 -0
- lfm_physics-0.2.2/tutorial_07_3d_lattice.png +0 -0
- lfm_physics-0.2.2/tutorial_08_3d_lattice.png +0 -0
- lfm_physics-0.2.2/tutorial_12_3d_lattice.png +0 -0
- lfm_physics-0.1.2/PKG-INFO +0 -123
- lfm_physics-0.1.2/README.md +0 -88
- lfm_physics-0.1.2/examples/checkpoint_resume.py +0 -81
- lfm_physics-0.1.2/examples/cosmic_structure_formation.py +0 -278
- lfm_physics-0.1.2/examples/dark_matter_memory.py +0 -98
- lfm_physics-0.1.2/examples/em_from_phase.py +0 -111
- lfm_physics-0.1.2/examples/parametric_resonance.py +0 -91
- lfm_physics-0.1.2/examples/particle_masses.py +0 -83
- lfm_physics-0.1.2/examples/predict_constants.py +0 -80
- lfm_physics-0.1.2/examples/soliton_gravity.py +0 -64
- lfm_physics-0.1.2/examples/two_body_orbit.py +0 -113
- lfm_physics-0.1.2/lfm/analysis/__init__.py +0 -30
- lfm_physics-0.1.2/lfm/analysis/energy.py +0 -159
- lfm_physics-0.1.2/lfm/formulas/__init__.py +0 -65
- lfm_physics-0.1.2/lfm/formulas/masses.py +0 -208
- lfm_physics-0.1.2/lfm/formulas/predictions.py +0 -405
- lfm_physics-0.1.2/lfm/io/__init__.py +0 -1
- lfm_physics-0.1.2/tests/test_formulas.py +0 -207
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/.github/workflows/publish.yml +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/.github/workflows/test.yml +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/.gitignore +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/CONTRIBUTING.md +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/LICENSE +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/analysis/metrics.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/analysis/structure.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/__init__.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/backends/__init__.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/backends/protocol.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/core/stencils.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/fields/__init__.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/fields/arrangements.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/fields/equilibrium.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/fields/random.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/fields/soliton.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/lfm/py.typed +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/__init__.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/conftest.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_backends.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_config.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_constants.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_evolver.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_fields.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_integrator.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_simulation.py +0 -0
- {lfm_physics-0.1.2 → lfm_physics-0.2.2}/tests/test_stencils.py +0 -0
|
@@ -4,6 +4,51 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [0.2.1] - 2026-03-20
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- GOV-02 v14: color variance term `κ_c·f_c·Σ|Ψₐ|²` with `KAPPA_C = 1/189`
|
|
11
|
+
- GOV-01 v15: cross-color coupling `ε_cc·χ²·(Ψₐ − Ψ̄)` with `EPSILON_CC = 2/17`
|
|
12
|
+
- `color_variance()` analysis function for color field diagnostics
|
|
13
|
+
- `momentum_density()`, `weak_parity_asymmetry()`, `confinement_proxy()` observables
|
|
14
|
+
- `continuity_residual()`, `fluid_fields()` for hydrodynamic analysis
|
|
15
|
+
- Constants: `KAPPA_C`, `EPSILON_CC`, `ALPHA_S`, `N_COLORS`
|
|
16
|
+
- Config: `kappa_c`, `epsilon_cc`, `n_colors` parameters
|
|
17
|
+
- Example 13: weak force (parity asymmetry)
|
|
18
|
+
- Example 14: strong force (color screening and confinement proxy)
|
|
19
|
+
- Website tutorials 13-14 (emergentphysicslab.com)
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Ruff lint: import sorting, unused imports, line lengths
|
|
23
|
+
- `PlanckScale` type annotation in `SimulationConfig.planck_scale`
|
|
24
|
+
- Version alignment between `pyproject.toml` and `__init__.py`
|
|
25
|
+
|
|
26
|
+
## [0.1.3] - 2026-03-19
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `PlanckScale.at_planck_resolution(grid_size, dt)` — classmethod that sets 1 cell = 1 Planck length exactly
|
|
30
|
+
- `PlanckScale.is_planck_resolution` — bool property, True when cells_per_planck == 1.0
|
|
31
|
+
- `PlanckScale.cell_size_m` — cell size in metres (Planck length × cells_per_planck)
|
|
32
|
+
- `PlanckScale.step_to_planck_ticks(step)` — convert simulation steps to Planck time ticks
|
|
33
|
+
- `PlanckScale.planck_ticks_to_step(ticks)` — inverse conversion
|
|
34
|
+
- `PlanckScale.step_to_seconds(step)` — convert steps to SI seconds
|
|
35
|
+
- Sphinx documentation source tree (`docs/`) with furo theme and autodoc
|
|
36
|
+
- Read the Docs configuration (`.readthedocs.yaml`)
|
|
37
|
+
- Benchmark suite (`benchmarks/`) with evolver and field-ops benchmarks
|
|
38
|
+
- `lfm.io` module with module-level `save_checkpoint` / `load_checkpoint` wrappers
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
- `lfm/formulas/` stub directory (untracked, had no content)
|
|
42
|
+
|
|
43
|
+
## [0.1.2] - 2026-03-18
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- `Simulation.save_checkpoint(path)` — full state persistence (fields, step counter, config, metric history) to compressed `.npz`
|
|
47
|
+
- `Simulation.load_checkpoint(path, backend)` — classmethod to restore a simulation from checkpoint, ready for `run()`
|
|
48
|
+
- `Simulation.history` property — list of metric snapshots recorded during `run()`
|
|
49
|
+
- `CosmicScale` unit mapper: converts lattice cells/steps to Mpc/Gyr with Hubble calibration
|
|
50
|
+
- `PlanckScale` unit mapper: default observable-universe scale and Planck-resolution mode
|
|
51
|
+
|
|
7
52
|
## [0.1.1] - 2026-03-18
|
|
8
53
|
|
|
9
54
|
### Fixed
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lfm-physics
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Lattice Field Medium physics simulation library
|
|
5
|
+
Project-URL: Homepage, https://github.com/gpartin/lfm-physics
|
|
6
|
+
Project-URL: Repository, https://github.com/gpartin/lfm-physics
|
|
7
|
+
Project-URL: Issues, https://github.com/gpartin/lfm-physics/issues
|
|
8
|
+
Author-email: Greg Partin <gpartin@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: field-theory,klein-gordon,lattice,physics,simulation
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: numpy>=1.24
|
|
22
|
+
Requires-Dist: scipy>=1.10
|
|
23
|
+
Provides-Extra: all
|
|
24
|
+
Requires-Dist: cupy-cuda12x>=12.0; extra == 'all'
|
|
25
|
+
Requires-Dist: matplotlib>=3.7; extra == 'all'
|
|
26
|
+
Provides-Extra: benchmark
|
|
27
|
+
Requires-Dist: pytest-benchmark>=4.0; extra == 'benchmark'
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
32
|
+
Provides-Extra: docs
|
|
33
|
+
Requires-Dist: furo>=2024.1; extra == 'docs'
|
|
34
|
+
Requires-Dist: myst-parser>=2.0; extra == 'docs'
|
|
35
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.24; extra == 'docs'
|
|
36
|
+
Requires-Dist: sphinx>=7.0; extra == 'docs'
|
|
37
|
+
Provides-Extra: gpu
|
|
38
|
+
Requires-Dist: cupy-cuda12x>=12.0; extra == 'gpu'
|
|
39
|
+
Provides-Extra: viz
|
|
40
|
+
Requires-Dist: matplotlib>=3.7; extra == 'viz'
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
|
|
43
|
+
# lfm-physics
|
|
44
|
+
|
|
45
|
+
[](https://github.com/gpartin/lfm-physics/actions/workflows/test.yml)
|
|
46
|
+
[](https://pypi.org/project/lfm-physics/)
|
|
47
|
+
[](https://pypi.org/project/lfm-physics/)
|
|
48
|
+
[](LICENSE)
|
|
49
|
+
|
|
50
|
+
**Lattice Field Medium** — a physics simulation library implementing the LFM framework.
|
|
51
|
+
|
|
52
|
+
Two governing equations. One integer (χ₀ = 19). All of physics.
|
|
53
|
+
|
|
54
|
+
LFM runs two coupled wave equations on a discrete 3D lattice.
|
|
55
|
+
Gravity, electromagnetism, the strong and weak forces, dark matter, and cosmic
|
|
56
|
+
structure all emerge from the dynamics — no forces injected, no constants
|
|
57
|
+
assumed. Just a grid, two update rules, and initial noise.
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install lfm-physics
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
GPU acceleration (NVIDIA, optional):
|
|
66
|
+
```bash
|
|
67
|
+
pip install "lfm-physics[gpu]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import lfm
|
|
74
|
+
|
|
75
|
+
# 1. Create a 64³ lattice — empty space has χ = 19 everywhere
|
|
76
|
+
sim = lfm.Simulation(lfm.SimulationConfig(grid_size=64))
|
|
77
|
+
|
|
78
|
+
# 2. Drop a soliton (energy blob) onto the grid
|
|
79
|
+
sim.place_soliton((32, 32, 32), amplitude=6.0)
|
|
80
|
+
|
|
81
|
+
# 3. Let the substrate settle into equilibrium
|
|
82
|
+
sim.equilibrate()
|
|
83
|
+
|
|
84
|
+
# 4. Run the two equations for 5 000 steps
|
|
85
|
+
sim.run(steps=5000)
|
|
86
|
+
|
|
87
|
+
# 5. Measure what emerged
|
|
88
|
+
m = sim.metrics()
|
|
89
|
+
print(f"χ_min = {m['chi_min']:.2f}") # χ dropped — a gravity well!
|
|
90
|
+
print(f"Wells = {m['well_fraction']*100:.1f}%")
|
|
91
|
+
|
|
92
|
+
# 6. Look at the shape of gravity
|
|
93
|
+
profile = lfm.radial_profile(sim.chi, center=(32,32,32), max_radius=20)
|
|
94
|
+
# profile['r'] and profile['profile'] — does it fall like 1/r?
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## The Equations
|
|
98
|
+
|
|
99
|
+
Everything in LFM follows from two coupled wave equations evaluated on a
|
|
100
|
+
3D cubic lattice with a 19-point stencil (6 face + 12 edge neighbours):
|
|
101
|
+
|
|
102
|
+
**GOV-01** — matter wave equation (Klein-Gordon on the lattice):
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Ψⁿ⁺¹ = 2Ψⁿ − Ψⁿ⁻¹ + Δt²[ c²∇²Ψⁿ − (χⁿ)²Ψⁿ ]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**GOV-02** — substrate field equation (complete, v14):
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
χⁿ⁺¹ = 2χⁿ − χⁿ⁻¹ + Δt²[ c²∇²χⁿ
|
|
112
|
+
− κ(Σₐ|Ψₐⁿ|² + ε_W·jⁿ − E₀²) ← gravity + weak
|
|
113
|
+
− 4λ_H·χⁿ((χⁿ)² − χ₀²) ← Higgs self-interaction
|
|
114
|
+
− κ_c·f_c·Σₐ|Ψₐⁿ|² ] ← color screening
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Term | Force | What it does |
|
|
118
|
+
|------|-------|--------------|
|
|
119
|
+
| `κ·Σ\|Ψ\|²` | **Gravity** | Energy density creates χ wells — waves curve toward low χ |
|
|
120
|
+
| `ε_W·j` | **Weak** | Momentum current j breaks parity symmetry in χ |
|
|
121
|
+
| `4λ_H·χ(χ²−χ₀²)` | **Higgs** | Mexican-hat potential makes χ₀ = 19 a dynamical attractor |
|
|
122
|
+
| `κ_c·f_c·Σ\|Ψ\|²` | **Strong** | Color variance f_c gives extra χ deepening for non-singlet states |
|
|
123
|
+
| Phase interference | **EM** | Same phase → constructive → repel; opposite → destructive → attract |
|
|
124
|
+
|
|
125
|
+
### Field Levels
|
|
126
|
+
|
|
127
|
+
| Level | Field | Components | Forces | Use for |
|
|
128
|
+
|-------|-------|------------|--------|---------|
|
|
129
|
+
| `REAL` | E ∈ ℝ | 1 real | Gravity | Cosmology, dark matter |
|
|
130
|
+
| `COMPLEX` | Ψ ∈ ℂ | 1 complex | Gravity + EM | Atoms, charged particles |
|
|
131
|
+
| `COLOR` | Ψₐ ∈ ℂ³ | 3 complex | All four | Full multi-force simulations |
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
# Gravity-only cosmology (fastest)
|
|
135
|
+
cfg = lfm.SimulationConfig(grid_size=128, field_level=lfm.FieldLevel.REAL)
|
|
136
|
+
|
|
137
|
+
# Electromagnetism + gravity
|
|
138
|
+
cfg = lfm.SimulationConfig(grid_size=64, field_level=lfm.FieldLevel.COMPLEX)
|
|
139
|
+
|
|
140
|
+
# All four forces
|
|
141
|
+
cfg = lfm.SimulationConfig(grid_size=64, field_level=lfm.FieldLevel.COLOR)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Constants — All Derived from χ₀ = 19
|
|
145
|
+
|
|
146
|
+
| Constant | Symbol | Value | Origin |
|
|
147
|
+
|----------|--------|-------|--------|
|
|
148
|
+
| `CHI0` | χ₀ | 19 | 3D lattice modes: 1 + 6 + 12 = 19 |
|
|
149
|
+
| `KAPPA` | κ | 1/63 ≈ 0.0159 | Unit coupling on 4³ − 1 = 63 modes |
|
|
150
|
+
| `LAMBDA_H` | λ_H | 4/31 ≈ 0.129 | z₂ lattice geometry |
|
|
151
|
+
| `EPSILON_W` | ε_W | 2/(χ₀+1) = 0.1 | Weak mixing angle factorisation |
|
|
152
|
+
| `KAPPA_C` | κ_c | κ/3 = 1/189 | Color variance coupling |
|
|
153
|
+
| `ALPHA_S` | α_s | 2/17 ≈ 0.118 | Strong coupling at M_Z |
|
|
154
|
+
| `EPSILON_CC` | ε_cc | 2/17 | Cross-color coupling (GOV-01 v15) |
|
|
155
|
+
| `ALPHA_EM` | α | 11/(480π) ≈ 1/137.1 | Fine-structure constant |
|
|
156
|
+
| `OMEGA_LAMBDA` | Ω_Λ | 13/19 ≈ 0.684 | Dark energy fraction |
|
|
157
|
+
| `OMEGA_MATTER` | Ω_m | 6/19 ≈ 0.316 | Matter fraction |
|
|
158
|
+
|
|
159
|
+
## Examples — Build a Universe in 14 Steps
|
|
160
|
+
|
|
161
|
+
Each example builds on the one before, from empty space to a simulated cosmos:
|
|
162
|
+
|
|
163
|
+
| # | Example | What you'll see |
|
|
164
|
+
|---|---------|-----------------|
|
|
165
|
+
| 1 | [01_empty_space.py](examples/01_empty_space.py) | A grid with χ = 19 everywhere — nothing happens |
|
|
166
|
+
| 2 | [02_first_particle.py](examples/02_first_particle.py) | Add energy → χ drops → a gravity well appears |
|
|
167
|
+
| 3 | [03_measuring_gravity.py](examples/03_measuring_gravity.py) | Measure χ(r) and check for 1/r falloff |
|
|
168
|
+
| 4 | [04_two_bodies.py](examples/04_two_bodies.py) | Two solitons attract — gravitational interaction emerges |
|
|
169
|
+
| 5 | [05_electric_charge.py](examples/05_electric_charge.py) | Phase = charge: same phase repels, opposite attracts |
|
|
170
|
+
| 6 | [06_dark_matter.py](examples/06_dark_matter.py) | Remove matter — the χ-well persists (substrate memory) |
|
|
171
|
+
| 7 | [07_matter_creation.py](examples/07_matter_creation.py) | Oscillate χ at 2χ₀ — matter appears from nothing |
|
|
172
|
+
| 8 | [08_universe.py](examples/08_universe.py) | Random noise on 64³ → wells + voids → cosmic structure |
|
|
173
|
+
| 9 | [09_hydrogen_atom.py](examples/09_hydrogen_atom.py) | Proton χ-well traps an electron — energy-level ladder emerges |
|
|
174
|
+
| 10 | [10_hydrogen_molecule.py](examples/10_hydrogen_molecule.py) | Two H atoms bond — bonding vs anti-bonding orbitals |
|
|
175
|
+
| 11 | [11_oxygen.py](examples/11_oxygen.py) | Heavier nucleus (8 electrons) — deeper well, richer structure |
|
|
176
|
+
| 12 | [12_fluid_dynamics.py](examples/12_fluid_dynamics.py) | 40-soliton gas → Euler equation from the stress-energy tensor |
|
|
177
|
+
| 13 | [13_weak_force.py](examples/13_weak_force.py) | Turn ε_W on/off and measure parity asymmetry from χ + j |
|
|
178
|
+
| 14 | [14_strong_force.py](examples/14_strong_force.py) | Color fields — measure confinement proxy via χ line integrals |
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
cd examples
|
|
182
|
+
python 01_empty_space.py # start here
|
|
183
|
+
python 08_universe.py # the payoff — cosmic structure from noise
|
|
184
|
+
python 14_strong_force.py # all four forces active
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Interactive tutorials with visualisations:**
|
|
188
|
+
[emergentphysicslab.com/tutorials](https://emergentphysicslab.com/tutorials)
|
|
189
|
+
|
|
190
|
+
## Measurement & Analysis
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
# Radial χ profile around a soliton
|
|
194
|
+
profile = lfm.radial_profile(sim.chi, center=(32,32,32), max_radius=20)
|
|
195
|
+
|
|
196
|
+
# Find the N brightest energy peaks
|
|
197
|
+
peaks = lfm.find_peaks(sim.energy_density, n=5)
|
|
198
|
+
|
|
199
|
+
# Track separation between two bodies over time
|
|
200
|
+
sep = lfm.measure_separation(sim.energy_density)
|
|
201
|
+
|
|
202
|
+
# Energy conservation drift
|
|
203
|
+
drift = lfm.energy_conservation_drift(sim)
|
|
204
|
+
|
|
205
|
+
# Fluid velocity from the stress-energy tensor
|
|
206
|
+
fields = lfm.fluid_fields(psi_real, psi_imag, chi, dt, c=1.0)
|
|
207
|
+
# fields['velocity_x'], fields['pressure'], fields['energy_density']
|
|
208
|
+
|
|
209
|
+
# Momentum density (Noether current — sources weak force)
|
|
210
|
+
j = lfm.momentum_density(psi_real, psi_imag, dx=1.0)
|
|
211
|
+
|
|
212
|
+
# Color variance (strong force diagnostic)
|
|
213
|
+
fc = lfm.color_variance(psi_real_color, psi_imag_color)
|
|
214
|
+
|
|
215
|
+
# Confinement proxy — χ line integral between peaks
|
|
216
|
+
proxy = lfm.confinement_proxy(sim.chi, pos_a, pos_b)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Checkpoints & Units
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
# Save / resume a simulation
|
|
223
|
+
sim.save_checkpoint("my_run.npz")
|
|
224
|
+
sim2 = lfm.Simulation.load_checkpoint("my_run.npz")
|
|
225
|
+
|
|
226
|
+
# Map lattice ticks to physical units
|
|
227
|
+
scale = lfm.CosmicScale(box_mpc=100.0, grid_size=64)
|
|
228
|
+
print(scale.format_cosmic_time(50_000)) # "1.28 Gyr"
|
|
229
|
+
|
|
230
|
+
# Planck-resolution mode
|
|
231
|
+
ps = lfm.PlanckScale.at_planck_resolution(grid_size=256)
|
|
232
|
+
print(ps.cells_per_planck) # 1.0 exactly
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Low-Level API — Evolver
|
|
236
|
+
|
|
237
|
+
For maximum performance or custom evolution loops:
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from lfm import SimulationConfig, FieldLevel, Evolver
|
|
241
|
+
|
|
242
|
+
cfg = SimulationConfig(grid_size=128, field_level=FieldLevel.COLOR)
|
|
243
|
+
evo = Evolver(cfg, backend="auto") # auto-selects GPU if available
|
|
244
|
+
|
|
245
|
+
# Inject initial conditions
|
|
246
|
+
evo.set_psi_real(my_array)
|
|
247
|
+
evo.set_chi(my_chi)
|
|
248
|
+
|
|
249
|
+
# Evolve 100 000 steps
|
|
250
|
+
evo.evolve(100_000)
|
|
251
|
+
|
|
252
|
+
# Extract fields as NumPy arrays
|
|
253
|
+
chi = evo.get_chi()
|
|
254
|
+
psi = evo.get_psi_real()
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## GPU Support
|
|
258
|
+
|
|
259
|
+
The library automatically uses your NVIDIA GPU when CuPy is installed:
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
print(lfm.gpu_available()) # True if CuPy + CUDA detected
|
|
263
|
+
|
|
264
|
+
# Force CPU even if GPU is available
|
|
265
|
+
sim = lfm.Simulation(cfg, backend="cpu")
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Typical speedup: **50-200×** for N ≥ 64 grids on modern NVIDIA GPUs.
|
|
269
|
+
|
|
270
|
+
## Documentation
|
|
271
|
+
|
|
272
|
+
- [Interactive Tutorials](https://emergentphysicslab.com/tutorials) — step-by-step guides with live visualisations
|
|
273
|
+
- [LFM Physics Papers](https://zenodo.org/communities/lfm-physics) — 84+ published papers
|
|
274
|
+
- [Constants Reference](https://github.com/gpartin/lfm-physics/blob/main/lfm/constants.py) — χ₀ = 19 and everything derived from it
|
|
275
|
+
- [Changelog](CHANGELOG.md) — version history
|
|
276
|
+
- [Contributing](CONTRIBUTING.md)
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
MIT
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# lfm-physics
|
|
2
|
+
|
|
3
|
+
[](https://github.com/gpartin/lfm-physics/actions/workflows/test.yml)
|
|
4
|
+
[](https://pypi.org/project/lfm-physics/)
|
|
5
|
+
[](https://pypi.org/project/lfm-physics/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
**Lattice Field Medium** — a physics simulation library implementing the LFM framework.
|
|
9
|
+
|
|
10
|
+
Two governing equations. One integer (χ₀ = 19). All of physics.
|
|
11
|
+
|
|
12
|
+
LFM runs two coupled wave equations on a discrete 3D lattice.
|
|
13
|
+
Gravity, electromagnetism, the strong and weak forces, dark matter, and cosmic
|
|
14
|
+
structure all emerge from the dynamics — no forces injected, no constants
|
|
15
|
+
assumed. Just a grid, two update rules, and initial noise.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install lfm-physics
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
GPU acceleration (NVIDIA, optional):
|
|
24
|
+
```bash
|
|
25
|
+
pip install "lfm-physics[gpu]"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import lfm
|
|
32
|
+
|
|
33
|
+
# 1. Create a 64³ lattice — empty space has χ = 19 everywhere
|
|
34
|
+
sim = lfm.Simulation(lfm.SimulationConfig(grid_size=64))
|
|
35
|
+
|
|
36
|
+
# 2. Drop a soliton (energy blob) onto the grid
|
|
37
|
+
sim.place_soliton((32, 32, 32), amplitude=6.0)
|
|
38
|
+
|
|
39
|
+
# 3. Let the substrate settle into equilibrium
|
|
40
|
+
sim.equilibrate()
|
|
41
|
+
|
|
42
|
+
# 4. Run the two equations for 5 000 steps
|
|
43
|
+
sim.run(steps=5000)
|
|
44
|
+
|
|
45
|
+
# 5. Measure what emerged
|
|
46
|
+
m = sim.metrics()
|
|
47
|
+
print(f"χ_min = {m['chi_min']:.2f}") # χ dropped — a gravity well!
|
|
48
|
+
print(f"Wells = {m['well_fraction']*100:.1f}%")
|
|
49
|
+
|
|
50
|
+
# 6. Look at the shape of gravity
|
|
51
|
+
profile = lfm.radial_profile(sim.chi, center=(32,32,32), max_radius=20)
|
|
52
|
+
# profile['r'] and profile['profile'] — does it fall like 1/r?
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## The Equations
|
|
56
|
+
|
|
57
|
+
Everything in LFM follows from two coupled wave equations evaluated on a
|
|
58
|
+
3D cubic lattice with a 19-point stencil (6 face + 12 edge neighbours):
|
|
59
|
+
|
|
60
|
+
**GOV-01** — matter wave equation (Klein-Gordon on the lattice):
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Ψⁿ⁺¹ = 2Ψⁿ − Ψⁿ⁻¹ + Δt²[ c²∇²Ψⁿ − (χⁿ)²Ψⁿ ]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**GOV-02** — substrate field equation (complete, v14):
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
χⁿ⁺¹ = 2χⁿ − χⁿ⁻¹ + Δt²[ c²∇²χⁿ
|
|
70
|
+
− κ(Σₐ|Ψₐⁿ|² + ε_W·jⁿ − E₀²) ← gravity + weak
|
|
71
|
+
− 4λ_H·χⁿ((χⁿ)² − χ₀²) ← Higgs self-interaction
|
|
72
|
+
− κ_c·f_c·Σₐ|Ψₐⁿ|² ] ← color screening
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Term | Force | What it does |
|
|
76
|
+
|------|-------|--------------|
|
|
77
|
+
| `κ·Σ\|Ψ\|²` | **Gravity** | Energy density creates χ wells — waves curve toward low χ |
|
|
78
|
+
| `ε_W·j` | **Weak** | Momentum current j breaks parity symmetry in χ |
|
|
79
|
+
| `4λ_H·χ(χ²−χ₀²)` | **Higgs** | Mexican-hat potential makes χ₀ = 19 a dynamical attractor |
|
|
80
|
+
| `κ_c·f_c·Σ\|Ψ\|²` | **Strong** | Color variance f_c gives extra χ deepening for non-singlet states |
|
|
81
|
+
| Phase interference | **EM** | Same phase → constructive → repel; opposite → destructive → attract |
|
|
82
|
+
|
|
83
|
+
### Field Levels
|
|
84
|
+
|
|
85
|
+
| Level | Field | Components | Forces | Use for |
|
|
86
|
+
|-------|-------|------------|--------|---------|
|
|
87
|
+
| `REAL` | E ∈ ℝ | 1 real | Gravity | Cosmology, dark matter |
|
|
88
|
+
| `COMPLEX` | Ψ ∈ ℂ | 1 complex | Gravity + EM | Atoms, charged particles |
|
|
89
|
+
| `COLOR` | Ψₐ ∈ ℂ³ | 3 complex | All four | Full multi-force simulations |
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Gravity-only cosmology (fastest)
|
|
93
|
+
cfg = lfm.SimulationConfig(grid_size=128, field_level=lfm.FieldLevel.REAL)
|
|
94
|
+
|
|
95
|
+
# Electromagnetism + gravity
|
|
96
|
+
cfg = lfm.SimulationConfig(grid_size=64, field_level=lfm.FieldLevel.COMPLEX)
|
|
97
|
+
|
|
98
|
+
# All four forces
|
|
99
|
+
cfg = lfm.SimulationConfig(grid_size=64, field_level=lfm.FieldLevel.COLOR)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Constants — All Derived from χ₀ = 19
|
|
103
|
+
|
|
104
|
+
| Constant | Symbol | Value | Origin |
|
|
105
|
+
|----------|--------|-------|--------|
|
|
106
|
+
| `CHI0` | χ₀ | 19 | 3D lattice modes: 1 + 6 + 12 = 19 |
|
|
107
|
+
| `KAPPA` | κ | 1/63 ≈ 0.0159 | Unit coupling on 4³ − 1 = 63 modes |
|
|
108
|
+
| `LAMBDA_H` | λ_H | 4/31 ≈ 0.129 | z₂ lattice geometry |
|
|
109
|
+
| `EPSILON_W` | ε_W | 2/(χ₀+1) = 0.1 | Weak mixing angle factorisation |
|
|
110
|
+
| `KAPPA_C` | κ_c | κ/3 = 1/189 | Color variance coupling |
|
|
111
|
+
| `ALPHA_S` | α_s | 2/17 ≈ 0.118 | Strong coupling at M_Z |
|
|
112
|
+
| `EPSILON_CC` | ε_cc | 2/17 | Cross-color coupling (GOV-01 v15) |
|
|
113
|
+
| `ALPHA_EM` | α | 11/(480π) ≈ 1/137.1 | Fine-structure constant |
|
|
114
|
+
| `OMEGA_LAMBDA` | Ω_Λ | 13/19 ≈ 0.684 | Dark energy fraction |
|
|
115
|
+
| `OMEGA_MATTER` | Ω_m | 6/19 ≈ 0.316 | Matter fraction |
|
|
116
|
+
|
|
117
|
+
## Examples — Build a Universe in 14 Steps
|
|
118
|
+
|
|
119
|
+
Each example builds on the one before, from empty space to a simulated cosmos:
|
|
120
|
+
|
|
121
|
+
| # | Example | What you'll see |
|
|
122
|
+
|---|---------|-----------------|
|
|
123
|
+
| 1 | [01_empty_space.py](examples/01_empty_space.py) | A grid with χ = 19 everywhere — nothing happens |
|
|
124
|
+
| 2 | [02_first_particle.py](examples/02_first_particle.py) | Add energy → χ drops → a gravity well appears |
|
|
125
|
+
| 3 | [03_measuring_gravity.py](examples/03_measuring_gravity.py) | Measure χ(r) and check for 1/r falloff |
|
|
126
|
+
| 4 | [04_two_bodies.py](examples/04_two_bodies.py) | Two solitons attract — gravitational interaction emerges |
|
|
127
|
+
| 5 | [05_electric_charge.py](examples/05_electric_charge.py) | Phase = charge: same phase repels, opposite attracts |
|
|
128
|
+
| 6 | [06_dark_matter.py](examples/06_dark_matter.py) | Remove matter — the χ-well persists (substrate memory) |
|
|
129
|
+
| 7 | [07_matter_creation.py](examples/07_matter_creation.py) | Oscillate χ at 2χ₀ — matter appears from nothing |
|
|
130
|
+
| 8 | [08_universe.py](examples/08_universe.py) | Random noise on 64³ → wells + voids → cosmic structure |
|
|
131
|
+
| 9 | [09_hydrogen_atom.py](examples/09_hydrogen_atom.py) | Proton χ-well traps an electron — energy-level ladder emerges |
|
|
132
|
+
| 10 | [10_hydrogen_molecule.py](examples/10_hydrogen_molecule.py) | Two H atoms bond — bonding vs anti-bonding orbitals |
|
|
133
|
+
| 11 | [11_oxygen.py](examples/11_oxygen.py) | Heavier nucleus (8 electrons) — deeper well, richer structure |
|
|
134
|
+
| 12 | [12_fluid_dynamics.py](examples/12_fluid_dynamics.py) | 40-soliton gas → Euler equation from the stress-energy tensor |
|
|
135
|
+
| 13 | [13_weak_force.py](examples/13_weak_force.py) | Turn ε_W on/off and measure parity asymmetry from χ + j |
|
|
136
|
+
| 14 | [14_strong_force.py](examples/14_strong_force.py) | Color fields — measure confinement proxy via χ line integrals |
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cd examples
|
|
140
|
+
python 01_empty_space.py # start here
|
|
141
|
+
python 08_universe.py # the payoff — cosmic structure from noise
|
|
142
|
+
python 14_strong_force.py # all four forces active
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Interactive tutorials with visualisations:**
|
|
146
|
+
[emergentphysicslab.com/tutorials](https://emergentphysicslab.com/tutorials)
|
|
147
|
+
|
|
148
|
+
## Measurement & Analysis
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
# Radial χ profile around a soliton
|
|
152
|
+
profile = lfm.radial_profile(sim.chi, center=(32,32,32), max_radius=20)
|
|
153
|
+
|
|
154
|
+
# Find the N brightest energy peaks
|
|
155
|
+
peaks = lfm.find_peaks(sim.energy_density, n=5)
|
|
156
|
+
|
|
157
|
+
# Track separation between two bodies over time
|
|
158
|
+
sep = lfm.measure_separation(sim.energy_density)
|
|
159
|
+
|
|
160
|
+
# Energy conservation drift
|
|
161
|
+
drift = lfm.energy_conservation_drift(sim)
|
|
162
|
+
|
|
163
|
+
# Fluid velocity from the stress-energy tensor
|
|
164
|
+
fields = lfm.fluid_fields(psi_real, psi_imag, chi, dt, c=1.0)
|
|
165
|
+
# fields['velocity_x'], fields['pressure'], fields['energy_density']
|
|
166
|
+
|
|
167
|
+
# Momentum density (Noether current — sources weak force)
|
|
168
|
+
j = lfm.momentum_density(psi_real, psi_imag, dx=1.0)
|
|
169
|
+
|
|
170
|
+
# Color variance (strong force diagnostic)
|
|
171
|
+
fc = lfm.color_variance(psi_real_color, psi_imag_color)
|
|
172
|
+
|
|
173
|
+
# Confinement proxy — χ line integral between peaks
|
|
174
|
+
proxy = lfm.confinement_proxy(sim.chi, pos_a, pos_b)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Checkpoints & Units
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
# Save / resume a simulation
|
|
181
|
+
sim.save_checkpoint("my_run.npz")
|
|
182
|
+
sim2 = lfm.Simulation.load_checkpoint("my_run.npz")
|
|
183
|
+
|
|
184
|
+
# Map lattice ticks to physical units
|
|
185
|
+
scale = lfm.CosmicScale(box_mpc=100.0, grid_size=64)
|
|
186
|
+
print(scale.format_cosmic_time(50_000)) # "1.28 Gyr"
|
|
187
|
+
|
|
188
|
+
# Planck-resolution mode
|
|
189
|
+
ps = lfm.PlanckScale.at_planck_resolution(grid_size=256)
|
|
190
|
+
print(ps.cells_per_planck) # 1.0 exactly
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Low-Level API — Evolver
|
|
194
|
+
|
|
195
|
+
For maximum performance or custom evolution loops:
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
from lfm import SimulationConfig, FieldLevel, Evolver
|
|
199
|
+
|
|
200
|
+
cfg = SimulationConfig(grid_size=128, field_level=FieldLevel.COLOR)
|
|
201
|
+
evo = Evolver(cfg, backend="auto") # auto-selects GPU if available
|
|
202
|
+
|
|
203
|
+
# Inject initial conditions
|
|
204
|
+
evo.set_psi_real(my_array)
|
|
205
|
+
evo.set_chi(my_chi)
|
|
206
|
+
|
|
207
|
+
# Evolve 100 000 steps
|
|
208
|
+
evo.evolve(100_000)
|
|
209
|
+
|
|
210
|
+
# Extract fields as NumPy arrays
|
|
211
|
+
chi = evo.get_chi()
|
|
212
|
+
psi = evo.get_psi_real()
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## GPU Support
|
|
216
|
+
|
|
217
|
+
The library automatically uses your NVIDIA GPU when CuPy is installed:
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
print(lfm.gpu_available()) # True if CuPy + CUDA detected
|
|
221
|
+
|
|
222
|
+
# Force CPU even if GPU is available
|
|
223
|
+
sim = lfm.Simulation(cfg, backend="cpu")
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Typical speedup: **50-200×** for N ≥ 64 grids on modern NVIDIA GPUs.
|
|
227
|
+
|
|
228
|
+
## Documentation
|
|
229
|
+
|
|
230
|
+
- [Interactive Tutorials](https://emergentphysicslab.com/tutorials) — step-by-step guides with live visualisations
|
|
231
|
+
- [LFM Physics Papers](https://zenodo.org/communities/lfm-physics) — 84+ published papers
|
|
232
|
+
- [Constants Reference](https://github.com/gpartin/lfm-physics/blob/main/lfm/constants.py) — χ₀ = 19 and everything derived from it
|
|
233
|
+
- [Changelog](CHANGELOG.md) — version history
|
|
234
|
+
- [Contributing](CONTRIBUTING.md)
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Benchmarks
|
|
2
|
+
|
|
3
|
+
Timing benchmarks for the lfm-physics core routines.
|
|
4
|
+
|
|
5
|
+
## Running
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install "lfm-physics[benchmark]"
|
|
9
|
+
cd benchmarks
|
|
10
|
+
pytest bench_evolver.py bench_fields.py -v --benchmark-sort=mean
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or for a quick text summary without pytest-benchmark:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python bench_evolver.py
|
|
17
|
+
python bench_fields.py
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Typical results (RTX 4060, 8 GB VRAM)
|
|
21
|
+
|
|
22
|
+
| Benchmark | Grid | Steps/sec |
|
|
23
|
+
|-----------|------|-----------|
|
|
24
|
+
| evolver (CPU, N=32) | 32³ | ~150 000 |
|
|
25
|
+
| evolver (CPU, N=64) | 64³ | ~18 000 |
|
|
26
|
+
| evolver (GPU, N=128) | 128³ | ~3 400 |
|
|
27
|
+
| evolver (GPU, N=256) | 256³ | ~350 |
|
|
28
|
+
| equilibrate_from_fields (N=64) | — | ~2 200/s |
|
|
29
|
+
| radial_profile (N=64) | — | ~40 000/s |
|