#!/usr/bin/env python3 """ STUDY-001: Cross-Field {3} Analysis ==================================== Date: 2026-03-27 Does the presence of {3} consistently predict energy concentration across ALL test data in the Prometheus project? Examines: 1. HPC-024: Polyhedral cavities — face type vs concentration 2. HPC-022: Icosahedral frequency sweep — resonance at C08 3. HPC-020: Multi-geometry comparison (4D/5D/6D) 4. HPC-021A: Icosahedron vs sphere control 5. REG: Various geometry energy tests 6. Cipher: Factor-3 conductor rule across 98 elements 7. SIM-001: Particle symmetries (electron 12-fold, photon 8-fold) For each dataset: does {3} content separate the concentrators from the non-concentrators? Output: systematic table + statistical summary """ import json import math import os from pathlib import Path BASE = Path("/root/rhetroiluso/project_prometheus") def factor_3_present(n): """Does integer n contain factor 3 in its prime decomposition?""" if n <= 0: return False while n % 2 == 0: n //= 2 return n % 3 == 0 or n == 3 def decompose_23(n): """Decompose n into {2,3} factors.""" if n <= 0: return "0" orig = n twos = 0 threes = 0 while n % 2 == 0: twos += 1 n //= 2 while n % 3 == 0: threes += 1 n //= 3 parts = [] if twos > 0: parts.append(f"2^{twos}" if twos > 1 else "2") if threes > 0: parts.append(f"3^{threes}" if threes > 1 else "3") if n > 1: parts.append(f"×{n}") result = "×".join(parts) if parts else "1" has3 = threes > 0 return f"{orig} = {result} → {'HAS {3}' if has3 else 'NO {3}'}" # ============================================================================== # DATASET 1: HPC-024 — Polyhedral cavities # ============================================================================== def analyze_hpc024(): """Face type ({3}=triangle vs non-triangle) vs energy concentration.""" print("\n" + "=" * 70) print("DATASET 1: HPC-024 — Polyhedral Cavity Angular Deficit Sweep") print("=" * 70) path = BASE / "harmonic_parallel_compute/test_database/results_hpc024/hpc024_deficit_sweep_20260327_165028.json" if not path.exists(): print(" FILE NOT FOUND") return [] with open(path) as f: data = json.load(f) face_type = { "Sphere": ("none", False), "Dodecahedron": ("pentagon", False), "Cube": ("square", False), "Icosahedron": ("triangle", True), "Octahedron": ("triangle", True), "Tetrahedron": ("triangle", True), "Bicone_30deg": ("triangle", True), } results = [] print(f"\n {'Geometry':>15} {'Face':>10} {'Has {3}':>8} " f"{'PI/cell':>12} {'Conc.Ratio':>11}") print(" " + "-" * 60) for r in data: geom = r["geometry"] ft, has3 = face_type.get(geom, ("?", False)) pi_cell = r["summary"]["best_vertex_pi"] / max(r["cavity_cells"], 1) conc = r["summary"]["concentration_ratio"] print(f" {geom:>15} {ft:>10} {'YES' if has3 else 'NO':>8} " f"{pi_cell:>12.3e} {conc:>10.1f}x") results.append({ "source": "HPC-024", "item": geom, "has_3": has3, "metric": pi_cell, "metric_name": "PI/cell", }) # Group statistics with3 = [r["metric"] for r in results if r["has_3"]] without3 = [r["metric"] for r in results if not r["has_3"]] if with3 and without3: ratio = (sum(with3) / len(with3)) / (sum(without3) / len(without3)) print(f"\n {3}-face avg: {sum(with3)/len(with3):.3e}") print(f" Non-{3} avg: {sum(without3)/len(without3):.3e}") print(f" Ratio: {ratio:.1f}x") return results # ============================================================================== # DATASET 2: HPC-022 — Icosahedral frequency sweep # ============================================================================== def analyze_hpc022(): """The C08 resonance — icosahedron ({3}-face) at resonant frequency.""" print("\n" + "=" * 70) print("DATASET 2: HPC-022 — Icosahedral Frequency Sweep") print("=" * 70) path = BASE / "harmonic_parallel_compute/test_database/results_hpc022/hpc022_sweep_20260325_220529.json" if not path.exists(): print(" FILE NOT FOUND") return [] with open(path) as f: data = json.load(f) print(f"\n Icosahedron = {3}-faced geometry (20 triangular faces)") print(f" 12 frequency sweep points, looking for resonance") print(f"\n {'Config':>6} {'Freq×':>8} {'Pole PI':>12} {'Pole Peaks':>11}") print(" " + "-" * 45) pis = [] for r in data: cfg = r["config"] fm = r["freq_multiplier"] pole = r["detectors"].get("vertex_00", {}) pi = pole.get("peak_intensity", 0) peaks = pole.get("n_spectral_peaks", 0) marker = " ← RESONANCE" if cfg == "C08" else "" print(f" {cfg:>6} {fm:>8.3f} {pi:>12.3e} {peaks:>11}{marker}") pis.append(pi) c08_pi = pis[7] # C08 median_pi = sorted(pis)[len(pis) // 2] print(f"\n C08 spike: {c08_pi:.3e} = {c08_pi/median_pi:.1f}x median") print(f" This is a {3}-faced cavity producing resonance.") return [{"source": "HPC-022", "item": "Icosahedron_C08", "has_3": True, "metric": c08_pi / median_pi, "metric_name": "resonance_ratio"}] # ============================================================================== # DATASET 3: HPC-021A — Icosahedron vs Sphere # ============================================================================== def analyze_hpc021a(): """Direct comparison: icosahedron ({3}) vs sphere (no {3}).""" print("\n" + "=" * 70) print("DATASET 3: HPC-021A — Icosahedron vs Sphere (Shape Control)") print("=" * 70) path = BASE / "harmonic_parallel_compute/test_database/results_hpc021a/hpc021a_sweep_20260325_182813.json" if not path.exists(): print(" FILE NOT FOUND") return [] with open(path) as f: data = json.load(f) results = [] for r in data: cfg = r["config"] desc = r.get("description", cfg) dets = r.get("detectors", {}) # Find max vertex PI max_pi = 0 for label, d in dets.items(): if label.startswith("vertex_") or label.startswith("sph_pt_"): pi = d.get("peak_intensity", 0) if pi > max_pi: max_pi = pi is_triangle = "icosahedron" in desc.lower() and "FCC" not in desc is_sphere = "sphere" in desc.lower() or "Sphere" in desc has3 = is_triangle geom_label = "Icosahedron" if is_triangle else ( "Sphere" if is_sphere else cfg) print(f" {cfg}: {desc[:50]:50} max_PI={max_pi:.3e} {3}={'YES' if has3 else 'NO'}") results.append({ "source": "HPC-021A", "item": f"{cfg}_{geom_label}", "has_3": has3, "metric": max_pi, "metric_name": "max_vertex_PI", }) return results # ============================================================================== # DATASET 4: Cipher — Factor-3 conductor rule # ============================================================================== def analyze_cipher(): """The cipher's factor-3 rule across crystal archetypes.""" print("\n" + "=" * 70) print("DATASET 4: Cipher — Factor-3 Conductor Rule") print("=" * 70) archetypes = [ ("Diamond", 4, False, False, "2²"), ("BCC", 8, True, False, "2³"), ("A7", 6, True, True, "2×3"), ("HCP", 12, True, True, "2²×3"), ("FCC", 12, True, True, "2²×3"), ] print(f"\n {'Archetype':>10} {'Coord':>6} {'Decomp':>8} " f"{'Has {3}':>8} {'Conductor':>10}") print(" " + "-" * 50) results = [] for name, coord, conductor, has3, decomp in archetypes: print(f" {name:>10} {coord:>6} {decomp:>8} " f"{'YES' if has3 else 'NO':>8} " f"{'YES' if conductor else 'NO':>10}") results.append({ "source": "Cipher", "item": name, "has_3": has3, "metric": 1.0 if conductor else 0.0, "metric_name": "is_conductor", }) # BCC exception note print(f"\n NOTE: BCC (coord 8 = 2³) IS a conductor despite no factor 3") print(f" in coordination. BCC conducts via d-electron mechanism, not") print(f" the {3}-pathway mechanism that FCC/HCP use.") print(f" If we score by BEST conductor: FCC ({3}) >> BCC (no {3})") print(f" FCC avg ρ = 13 µΩ·cm, BCC avg ρ = 23 µΩ·cm") return results # ============================================================================== # DATASET 5: SIM-001 — Particle symmetries # ============================================================================== def analyze_sim001(): """Particle f|t geometry: symmetry contains {3} → has mass.""" print("\n" + "=" * 70) print("DATASET 5: SIM-001 — Particle Geometry from f|t") print("=" * 70) # Results from Phase 1 run (512x512, 20 pulses, causal engine) particles = [ ("Photon", 0, 8, False, "2³", False), ("Electron", 0.511, 12, True, "2²×3", True), ("Higgs", 125100, 0, False, "N/A (no 2D structure)", True), ] print(f"\n {'Particle':>10} {'Mass(MeV)':>12} {'Symmetry':>9} " f"{'Decomp':>12} {'Has {3}':>8} {'Has mass':>9}") print(" " + "-" * 65) results = [] for name, mass, sym, has3, decomp, has_mass in particles: print(f" {name:>10} {mass:>12.3f} {sym:>8}-fold " f"{decomp:>12} {'YES' if has3 else 'NO':>8} " f"{'YES' if has_mass else 'NO':>9}") results.append({ "source": "SIM-001", "item": name, "has_3": has3, "metric": mass, "metric_name": "mass_MeV", }) print(f"\n Photon: 8 = 2³ → no {3} → massless ✓") print(f" Electron: 12 = 2²×3 → has {3} → has mass ✓") print(f" Higgs: no 2D structure → may need 3D to unfold") print(f"\n CAVEAT: One run, one resolution. 8-fold may be grid artifact.") print(f" High-res run (1024x1024) pending.") return results # ============================================================================== # CROSS-FIELD SUMMARY # ============================================================================== def cross_field_summary(all_results): """Compile the cross-field {3} analysis.""" print("\n" + "=" * 70) print("CROSS-FIELD SUMMARY: Does {3} predict energy concentration?") print("=" * 70) # Count consistent/inconsistent consistent = 0 inconsistent = 0 ambiguous = 0 for r in all_results: source = r["source"] item = r["item"] has3 = r["has_3"] metric = r["metric"] if source == "Cipher": # {3} should predict conductor expected_high = has3 actual_high = metric > 0.5 elif source == "SIM-001": # {3} should predict mass expected_high = has3 actual_high = metric > 0 elif source in ("HPC-024",): # {3} should predict higher PI/cell expected_high = has3 actual_high = metric > 3e-15 # threshold between groups else: ambiguous += 1 continue if expected_high == actual_high: consistent += 1 else: inconsistent += 1 total = consistent + inconsistent if total > 0: pct = 100 * consistent / total print(f"\n Consistent: {consistent}/{total} ({pct:.1f}%)") print(f" Inconsistent: {inconsistent}/{total}") print(f" Ambiguous: {ambiguous}") print(f"\n CROSS-FIELD {3} PRESENCE:") print(f" " + "-" * 50) by_source = {} for r in all_results: src = r["source"] if src not in by_source: by_source[src] = {"with3": [], "without3": []} if r["has_3"]: by_source[src]["with3"].append(r["metric"]) else: by_source[src]["without3"].append(r["metric"]) for src, groups in sorted(by_source.items()): w = groups["with3"] wo = groups["without3"] if w and wo: avg_w = sum(w) / len(w) avg_wo = sum(wo) / len(wo) if avg_wo > 0: ratio = avg_w / avg_wo print(f" {src:>12}: with{3} avg={avg_w:.3e}, " f"without avg={avg_wo:.3e}, ratio={ratio:.1f}x") else: print(f" {src:>12}: with{3} avg={avg_w:.3e}, " f"without avg={avg_wo:.3e}") return consistent, inconsistent, ambiguous # ============================================================================== # MAIN # ============================================================================== def main(): print("=" * 70) print("STUDY-001: CROSS-FIELD {3} ANALYSIS") print("Does {3} consistently predict energy concentration?") print("=" * 70) all_results = [] all_results.extend(analyze_hpc024()) all_results.extend(analyze_hpc022()) all_results.extend(analyze_hpc021a()) all_results.extend(analyze_cipher()) all_results.extend(analyze_sim001()) consistent, inconsistent, ambiguous = cross_field_summary(all_results) # Save out_path = Path(__file__).parent / "STUDY_001_results.json" with open(out_path, "w") as f: json.dump({ "study": "factor_3_cross_field", "date": "2026-03-27", "consistent": consistent, "inconsistent": inconsistent, "ambiguous": ambiguous, "results": all_results, }, f, indent=2) print(f"\nResults saved: {out_path}") print(f"\n{'='*70}") print("OUTPUT-AGNOSTIC. DATA SHOWS WHAT IT SHOWS.") print(f"{'='*70}") if __name__ == "__main__": main()