Skip to content

Commit 393ea3b

Browse files
author
Peter Groom
committed
added more PAC testing
1 parent 0651063 commit 393ea3b

8 files changed

Lines changed: 2647 additions & 5 deletions
Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
# Quick Reference: GAIA Pre-Field Enhancements
2+
3+
**Date**: October 2, 2025
4+
**Version**: 1.0
5+
6+
---
7+
8+
## ⚡ Quick Commands
9+
10+
```bash
11+
# Navigate to GAIA
12+
cd "c:\Users\peter\repos\Dawn Field Institute\dawn-models\research\GAIA"
13+
14+
# Run resonance demo
15+
python usecases/demo_resonance.py
16+
17+
# Run cosmological validation
18+
python usecases/cosmological_validation.py
19+
20+
# Run unit tests
21+
python -m pytest tests/unit/test_resonance_detector.py -v
22+
23+
# Run all tests
24+
python -m pytest tests/ -v
25+
```
26+
27+
---
28+
29+
## 📦 What Got Added
30+
31+
### New Classes
32+
1. **PreFieldResonanceDetector** (`src/core/field_engine.py`)
33+
2. **CosmologicalValidator** (`usecases/cosmological_validation.py`)
34+
35+
### New Files
36+
1. `tests/unit/test_resonance_detector.py` (9 tests)
37+
2. `usecases/demo_resonance.py` (demo script)
38+
3. `usecases/cosmological_validation.py` (validation suite)
39+
4. `docs/resonance_integration_summary.md`
40+
5. `docs/step1_integration_checklist.md`
41+
6. `docs/step2_cosmological_validation_summary.md`
42+
7. `docs/INTEGRATION_SUMMARY_OCT_2_2025.md`
43+
44+
---
45+
46+
## 🎯 Usage Examples
47+
48+
### Enable Resonance Detection
49+
```python
50+
from src.core.field_engine import FieldEngine
51+
52+
# Resonance enabled by default
53+
engine = FieldEngine(shape=(32, 32))
54+
55+
# Or explicitly
56+
engine = FieldEngine(shape=(32, 32), enable_resonance=True)
57+
58+
# Disable if needed
59+
engine = FieldEngine(shape=(32, 32), enable_resonance=False)
60+
```
61+
62+
### Check Resonance State
63+
```python
64+
# After some iterations
65+
metrics = engine.get_pac_metrics()
66+
67+
if 'resonance_state' in metrics:
68+
res = metrics['resonance_state']
69+
if res['resonance_locked']:
70+
print(f"🎵 Locked at {res['detected_frequency']} Hz")
71+
print(f" Speedup: {1/res['tuning_factor']}x")
72+
```
73+
74+
### Run Cosmological Validation
75+
```python
76+
from usecases.cosmological_validation import CosmologicalValidator
77+
78+
validator = CosmologicalValidator(save_results=True)
79+
validator.setup_results_directory()
80+
81+
evolution_data = validator.run_pac_evolution(
82+
iterations=500,
83+
field_size=32
84+
)
85+
86+
results = validator.validate_cosmological_parallel(evolution_data)
87+
validator.plot_results(evolution_data, results)
88+
validator.save_results(evolution_data, results)
89+
90+
print(f"Correlation: {results['entropy_amplification_correlation']}")
91+
```
92+
93+
---
94+
95+
## 📊 Key Metrics
96+
97+
### Resonance Detection
98+
- **Expected Frequency**: ~0.03 cycles/iteration
99+
- **Lock Time**: 50-70 iterations
100+
- **Confidence Threshold**: 0.15
101+
- **Window Size**: 50 iterations
102+
- **Speedup**: 5.11x theoretical
103+
104+
### Cosmological Validation
105+
- **Target Correlation**: r > 0.995
106+
- **Current Correlation**: r ≈ 0.003 (needs tuning)
107+
- **PAC Reduction**: 83.7% ✓
108+
- **Eras Mapped**: 9 (singularity → heat death)
109+
110+
---
111+
112+
## 🔍 Troubleshooting
113+
114+
### Resonance Not Locking
115+
```python
116+
# Check history length
117+
print(f"History: {len(engine.resonance_detector.pac_history)}")
118+
# Needs at least 50 iterations
119+
120+
# Lower confidence threshold
121+
engine.resonance_detector.confidence_threshold = 0.10
122+
123+
# Check frequency range
124+
state = engine.resonance_detector.get_resonance_state()
125+
print(f"Detected: {state['detected_frequency']}")
126+
print(f"Expected: {state['expected_frequency']}")
127+
```
128+
129+
### Low Cosmological Correlation
130+
```python
131+
# Try more iterations
132+
evolution_data = validator.run_pac_evolution(
133+
iterations=2000, # Increased from 500
134+
field_size=32
135+
)
136+
137+
# Try different cooling schedule
138+
# Edit cosmological_validation.py line ~95:
139+
cooling_factor = (1 + i) ** -0.5 # Power-law instead of exponential
140+
```
141+
142+
### Import Errors
143+
```python
144+
# Make sure you're in the right directory
145+
import os
146+
print(os.getcwd())
147+
# Should be: .../Dawn Field Institute/dawn-models/research/GAIA
148+
149+
# Add to path if needed
150+
import sys
151+
sys.path.insert(0, os.path.join(os.getcwd(), 'src'))
152+
```
153+
154+
---
155+
156+
## 📈 Console Output Reference
157+
158+
### Resonance Lock Message
159+
```
160+
🎵 Resonance LOCKED at iteration 119
161+
Frequency: 0.020000 cycles/iteration
162+
Confidence: 0.486
163+
Expected 5.11x speedup in PAC convergence
164+
```
165+
166+
### Cosmological Progress
167+
```
168+
🌌 Starting cosmological validation with 500 iterations...
169+
Iteration 0: PAC= 0.05719, T=1.54e-01K, Era=first_stars
170+
Iteration 100: PAC= 0.02276, T=6.15e-02K, Era=first_stars
171+
🎵 Resonance LOCKED at iteration 119
172+
...
173+
✓ Evolution complete
174+
Final PAC: 0.009301
175+
PAC reduction: 83.7%
176+
```
177+
178+
### Validation Results
179+
```
180+
🔬 Validating cosmological parallel...
181+
Entropy-Amplification Correlation: 0.002830
182+
Big Bang Pattern Match: ✗ FAIL (target: r > 0.995)
183+
PAC Cooling Rate: 0.002269
184+
Phase Transitions Detected: 0
185+
```
186+
187+
---
188+
189+
## 📁 Output Locations
190+
191+
### Resonance Demo
192+
```
193+
usecases/resonance_demo.png
194+
```
195+
196+
### Cosmological Validation
197+
```
198+
usecases/results/cosmological_YYYYMMDD_HHMMSS/
199+
├── cosmological_validation.png
200+
├── cosmological_results.json
201+
└── summary.txt
202+
```
203+
204+
---
205+
206+
## 🧪 Test Commands
207+
208+
```bash
209+
# Single test file
210+
python -m pytest tests/unit/test_resonance_detector.py -v
211+
212+
# Specific test
213+
python -m pytest tests/unit/test_resonance_detector.py::test_initialization -v
214+
215+
# With coverage
216+
python -m pytest tests/unit/test_resonance_detector.py --cov=src.core.field_engine
217+
218+
# All tests
219+
python -m pytest tests/ -v
220+
```
221+
222+
---
223+
224+
## 🎨 Visualization Panels
225+
226+
### Resonance Demo (4 panels)
227+
1. PAC Evolution Trajectory
228+
2. FFT Spectrum at Lock
229+
3. Frequency Detection History
230+
4. Detection Window
231+
232+
### Cosmological Validation (6 panels)
233+
1. PAC Cooling with Eras
234+
2. Entropy-Amplification Correlation
235+
3. Temperature Evolution
236+
4. Phase Transitions
237+
5. FFT Oscillation Spectrum
238+
6. Validation Summary
239+
240+
---
241+
242+
## 🔑 Key Parameters
243+
244+
### PreFieldResonanceDetector
245+
```python
246+
window_size=50 # Analysis window (iterations)
247+
confidence_threshold=0.15 # Lock threshold (0-1)
248+
expected_frequency=0.03 # Target frequency (cycles/iter)
249+
frequency_tolerance=0.01 # Match tolerance (±)
250+
```
251+
252+
### CosmologicalValidator
253+
```python
254+
iterations=500 # Evolution steps
255+
field_size=32 # Field dimensions (NxN)
256+
save_results=True # Enable file export
257+
```
258+
259+
---
260+
261+
## ⚠️ Known Issues
262+
263+
1. **Cosmological correlation low** (r ≈ 0.003, target > 0.995)
264+
- Status: Parameter tuning needed
265+
- Solution: Adjust cooling schedule in line ~95
266+
267+
2. **No phase transitions detected**
268+
- Status: Expected for smooth cooling
269+
- Solution: Add era-specific physics
270+
271+
3. **Resonance frequency mismatch** (0.020 vs 0.03 expected)
272+
- Status: Within tolerance, working correctly
273+
- Note: Varies by initial conditions
274+
275+
---
276+
277+
## 📚 Documentation Links
278+
279+
- **Resonance Integration**: `docs/resonance_integration_summary.md`
280+
- **Step 1 Checklist**: `docs/step1_integration_checklist.md`
281+
- **Step 2 Summary**: `docs/step2_cosmological_validation_summary.md`
282+
- **Complete Summary**: `docs/INTEGRATION_SUMMARY_OCT_2_2025.md`
283+
284+
---
285+
286+
## 🚀 Next Steps
287+
288+
### Option A: Tune Parameters (Step 2 Refinement)
289+
Focus on achieving r > 0.995 correlation
290+
291+
### Option B: Continue to Step 3 (Enhanced Tests)
292+
Build automated test suite for resonance speedup
293+
294+
### Option C: Continue to Step 4 (Dashboard)
295+
Build real-time monitoring dashboard
296+
297+
---
298+
299+
## 💡 Tips
300+
301+
1. **First time running?** Start with `demo_resonance.py`
302+
2. **Want faster results?** Reduce iterations to 100
303+
3. **Need better visualization?** Increase `dpi=300` in plots
304+
4. **Debugging?** Add `print()` statements in validators
305+
5. **Performance issues?** Reduce `field_size` to 16x16
306+
307+
---
308+
309+
**Last Updated**: October 2, 2025
310+
**Status**: ✅ Production Ready (Step 1), ⏳ Tuning Needed (Step 2)
311+
**Questions?** Check full documentation or ask!

0 commit comments

Comments
 (0)