diff --git a/.gitignore b/.gitignore index 97103a6..93b45ef 100644 --- a/.gitignore +++ b/.gitignore @@ -96,6 +96,8 @@ results/s2-examine/ # --- PNG output --- *.png +# Exception: spiral graphic in docs/ +!docs/lattice-periodic-spiral.png # --- Numpy arrays (experiment output) --- *.npy @@ -111,5 +113,8 @@ golden-weave-experiments/ training/ *.jsonl +# --- VS Code local config --- +.vscode/ + # --- Archive (removed) --- archive/ diff --git a/docs/generate_spiral.py b/docs/generate_spiral.py new file mode 100644 index 0000000..161c55c --- /dev/null +++ b/docs/generate_spiral.py @@ -0,0 +1,45 @@ +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os + +# Load data +script_dir = os.path.dirname(os.path.abspath(__file__)) +df = pd.read_csv(os.path.join(script_dir, 'lattice-periodic-table.csv')) + +# Golden angle +phi = (1 + np.sqrt(5)) / 2 +golden_angle = np.pi * (3 - np.sqrt(5)) # ≈ 2.39996 radians + +# Calculate positions +df['angle'] = df['AtomicNumber'] * golden_angle +df['radius'] = (df['AsymmetryValue'] - 13.2) * 10 # scale factor +df['x'] = df['radius'] * np.cos(df['angle']) +df['y'] = df['radius'] * np.sin(df['angle']) + +# Color by stability +colors = {'Stable': '#00aa00', 'Metastable': '#ffaa00', 'Radioactive': '#aa0000'} +df['color'] = df['Stability'].map(colors) + +# Size by valency +df['size'] = (df['ValencyLobes'] + 1) * 20 + +# Plot +fig, ax = plt.subplots(figsize=(16, 16)) +scatter = ax.scatter(df['x'], df['y'], c=df['color'], s=df['size'], alpha=0.7) + +# Add element symbols +for idx, row in df.iterrows(): + ax.annotate(row['Symbol'], (row['x'], row['y']), fontsize=8, ha='center') + +# Fibonacci spiral overlay +theta = np.linspace(0, 4*np.pi, 1000) +r = np.exp(theta / (2*np.pi) * np.log(phi)) +ax.plot(r * np.cos(theta), r * np.sin(theta), 'k--', alpha=0.3, linewidth=1) + +ax.set_aspect('equal') +ax.axis('off') +plt.title('Lattice Physics Periodic Table — Phi-Harmonic Spiral', fontsize=16) +plt.savefig(os.path.join(script_dir, 'lattice-periodic-spiral.png'), dpi=300, bbox_inches='tight') +plt.savefig(os.path.join(script_dir, 'lattice-periodic-spiral.svg'), format='svg') +print("Generated: lattice-periodic-spiral.png + .svg") diff --git a/docs/lattice-periodic-spiral.png b/docs/lattice-periodic-spiral.png new file mode 100644 index 0000000..16a3596 Binary files /dev/null and b/docs/lattice-periodic-spiral.png differ diff --git a/docs/lattice-periodic-spiral.svg b/docs/lattice-periodic-spiral.svg new file mode 100644 index 0000000..46c901d --- /dev/null +++ b/docs/lattice-periodic-spiral.svg @@ -0,0 +1,3303 @@ + + + + + + + + 2026-03-25T15:52:52.362983 + image/svg+xml + + + Matplotlib v3.10.8, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +