-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathintroduction.html
More file actions
945 lines (821 loc) · 35.1 KB
/
introduction.html
File metadata and controls
945 lines (821 loc) · 35.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introduction & System Overview - Albert Framework</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}
h1, h2, h3 {
color: #1976d2;
}
h1 {
font-size: 2.5em;
margin-bottom: 10px;
}
.subtitle {
font-size: 1.2em;
color: #666;
margin-bottom: 30px;
}
.section-card {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
margin-bottom: 30px;
}
.code-block {
background: #1e1e1e;
color: #d4d4d4;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
font-family: 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
margin: 15px 0;
white-space: pre-wrap;
}
.keyword { color: #569cd6; }
.string { color: #ce9178; }
.comment { color: #6a9955; }
.number { color: #b5cea8; }
.args-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
.args-table th, .args-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #eee;
}
.args-table th {
background-color: #f8f9fa;
font-weight: 600;
color: #1976d2;
}
.args-table code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
}
#system-diagram {
width: 100%;
height: 600px;
border: 1px solid #e0e0e0;
border-radius: 8px;
margin-top: 20px;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-top: 30px;
}
.feature-card {
background: #f8f9fa;
padding: 25px;
border-radius: 8px;
border-left: 4px solid #1976d2;
}
.feature-card h3 {
margin-top: 0;
color: #1976d2;
}
.quickstart-steps {
counter-reset: step-counter;
margin-top: 20px;
}
.step {
padding: 20px;
margin-bottom: 15px;
background: #f8f9fa;
border-radius: 8px;
position: relative;
padding-left: 60px;
counter-increment: step-counter;
}
.step::before {
content: counter(step-counter);
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
background: #1976d2;
color: white;
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
}
.highlight {
background: #fff3cd;
padding: 15px;
border-left: 4px solid #ff9800;
border-radius: 4px;
margin: 20px 0;
}
/* Mobile responsive styles */
@media (max-width: 768px) {
body {
padding: 10px;
font-size: 14px;
}
h1 {
font-size: 1.8em;
}
h2 {
font-size: 1.4em;
}
h3 {
font-size: 1.2em;
}
.subtitle {
font-size: 1em;
}
.section-card {
padding: 20px;
margin-bottom: 20px;
}
.code-block {
padding: 15px;
font-size: 12px;
overflow-x: auto;
white-space: pre;
}
.args-table {
font-size: 12px;
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.args-table th, .args-table td {
padding: 8px;
min-width: 80px;
}
.args-table tbody {
display: table;
width: 100%;
}
.feature-grid {
grid-template-columns: 1fr;
gap: 15px;
margin-top: 20px;
}
.feature-card {
padding: 20px;
}
.quickstart-steps {
margin-top: 15px;
}
.step {
padding: 15px;
padding-left: 50px;
margin-bottom: 10px;
}
.step::before {
left: 15px;
width: 25px;
height: 25px;
font-size: 14px;
}
.highlight {
padding: 12px;
margin: 15px 0;
}
#system-diagram {
height: 400px;
margin-top: 15px;
}
.warning-box {
padding: 15px;
margin-bottom: 20px;
}
.warning-box h2 {
font-size: 1.3em;
}
.warning-box p, .warning-box li {
font-size: 13px;
}
}
@media (max-width: 480px) {
body {
padding: 8px;
font-size: 13px;
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.2em;
}
.section-card {
padding: 15px;
}
.code-block {
padding: 10px;
font-size: 11px;
}
.args-table {
font-size: 11px;
}
.args-table th, .args-table td {
padding: 6px;
}
#system-diagram {
height: 300px;
}
}
</style>
</head>
<body>
<h1>Albert Framework</h1>
<p class="subtitle">A Validation Framework for Fundamental Physics</p>
<div class="section-card">
<h2>Quick Start</h2>
<div class="quickstart-steps">
<div class="step">
<h3>One-line Installation</h3>
<div class="code-block">
<span class="comment"># Download and install Albert CLI</span>
curl -fsSL https://raw.githubusercontent.com/PimDeWitte/albert/refs/heads/main/download_cli.sh | bash</div>
</div>
<div class="step">
<h3>Clone and Setup</h3>
<div class="code-block">
<span class="comment"># Clone the repository</span>
git clone https://github.com/pimdewitte/albert.git
cd albert
<span class="comment"># Run setup script</span>
./setup_unified.sh</div>
</div>
<div class="step">
<h3>Run Simulations</h3>
<div class="code-block">
<span class="comment"># Run all theories with default settings</span>
albert run
<span class="comment"># Run specific theories</span>
albert run --theories schwarzschild kerr
<span class="comment"># Run with options</span>
albert run --max-steps 100000
albert run --black-hole-preset stellar_mass
albert run --particles electron photon</div>
</div>
<div class="step">
<h3>Additional Commands</h3>
<div class="code-block">
<span class="comment"># Configure Albert (API keys, etc.)</span>
albert setup
<span class="comment"># Discover new theories (EXPERIMENTAL - see warning above)</span>
albert discover --initial "unified field theory"
<span class="comment"># Make albert available globally</span>
sudo ln -s $(pwd)/albert /usr/local/bin/albert</div>
</div>
</div>
<div class="warning-box" style="background: #fff3cd; border: 2px solid #ff9800; border-radius: 8px; padding: 20px; margin-bottom: 30px;">
<h2 style="color: #ff6f00; margin-top: 0;">⚠️ Experimental Features Warning</h2>
<p style="color: #856404; font-weight: 500; margin-bottom: 15px;">
The following features are <strong>COMPLETELY EXPERIMENTAL</strong> and should be used with caution:
</p>
<ul style="color: #856404; margin-bottom: 10px;">
<li><strong>Quantum Features (PennyLane Integration):</strong> All quantum computing features, including quantum geodesic simulations, quantum circuit implementations, and quantum corrections are highly experimental. Results may be unstable and should not be relied upon for production use.</li>
<li><strong>Self-Discovery System:</strong> The automated theory discovery system using genetic algorithms and machine learning is in early experimental stages. Generated theories may be physically invalid or numerically unstable.</li>
</ul>
<p style="color: #856404; margin-top: 15px; font-style: italic;">
These features are provided for research purposes only. They may change significantly or be removed in future versions without notice.
</p>
</div>
<div class="section-card">
<h2>Command Line Arguments</h2>
<h3>theory_engine_core.py Arguments</h3>
<table class="args-table">
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--theories</code></td>
<td>str (multiple)</td>
<td>all</td>
<td>Space-separated list of theories to test (e.g., schwarzschild kerr)</td>
</tr>
<tr>
<td><code>--r0</code></td>
<td>float</td>
<td>100</td>
<td>Initial radius in Schwarzschild radii (r/r_s)</td>
</tr>
<tr>
<td><code>--n_steps</code></td>
<td>int</td>
<td>1000</td>
<td>Number of integration steps</td>
</tr>
<tr>
<td><code>--dtau</code></td>
<td>float</td>
<td>0.01</td>
<td>Proper time step size</td>
</tr>
<tr>
<td><code>--device</code></td>
<td>str</td>
<td>cuda/cpu</td>
<td>Computation device (auto-detects CUDA)</td>
</tr>
<tr>
<td><code>--dtype</code></td>
<td>str</td>
<td>float64</td>
<td>Numerical precision (float32/float64)</td>
</tr>
<tr>
<td><code>--no-cache</code></td>
<td>flag</td>
<td>False</td>
<td>Disable trajectory caching</td>
</tr>
<tr>
<td><code>--particles</code></td>
<td>str (multiple)</td>
<td>electron</td>
<td>Particles to simulate (see section below)</td>
</tr>
<tr>
<td><code>--black-hole-preset</code></td>
<td>str</td>
<td>primordial_mini</td>
<td>Black hole configuration (see section below)</td>
</tr>
<tr>
<td><code>--validators-only</code></td>
<td>flag</td>
<td>False</td>
<td>Run only analytical validators</td>
</tr>
</tbody>
</table>
<h3>evaluation.py Arguments</h3>
<table class="args-table">
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--theories</code></td>
<td>str (multiple)</td>
<td>all</td>
<td>Theories to evaluate</td>
</tr>
<tr>
<td><code>--category</code></td>
<td>str</td>
<td>all</td>
<td>Theory category: baseline, classical, quantum <span style="color: #ff6f00;">(experimental)</span>, emergent</td>
</tr>
<tr>
<td><code>--validators</code></td>
<td>str (multiple)</td>
<td>all</td>
<td>Specific validators to run</td>
</tr>
<tr>
<td><code>--output-dir</code></td>
<td>str</td>
<td>runs/</td>
<td>Output directory for results</td>
</tr>
<tr>
<td><code>--parallel</code></td>
<td>int</td>
<td>auto</td>
<td>Number of parallel workers</td>
</tr>
</tbody>
</table>
</div>
<div class="section-card">
<h2>Black Hole Configurations</h2>
<p>Albert provides several pre-configured black hole presets for different research scenarios. The default is <code>primordial_mini</code> for optimal numerical stability.</p>
<table class="args-table">
<thead>
<tr>
<th>Preset</th>
<th>Mass</th>
<th>Schwarzschild Radius</th>
<th>Use Case</th>
<th>Command</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>primordial_mini</code> <span style="color: #4caf50; font-weight: bold;">(default)</span></td>
<td>10^15 kg<br/><small>(~5×10^-16 M☉)</small></td>
<td>1.5 pm<br/><small>(subatomic scale)</small></td>
<td>Quantum gravity research <span style="color: #ff6f00;">(experimental)</span>, numerically stable</td>
<td><code>--black-hole-preset primordial_mini</code></td>
</tr>
<tr>
<td><code>stellar_mass</code></td>
<td>10 M☉</td>
<td>29.5 km</td>
<td>Standard astrophysical simulations</td>
<td><code>--black-hole-preset stellar_mass</code></td>
</tr>
<tr>
<td><code>laboratory_micro</code></td>
<td>10^8 kg<br/><small>(~5×10^-23 M☉)</small></td>
<td>1.5×10^-19 m</td>
<td>Extreme quantum gravity regime <span style="color: #ff6f00;">(experimental)</span></td>
<td><code>--black-hole-preset laboratory_micro</code></td>
</tr>
<tr>
<td><code>intermediate_mass</code></td>
<td>1000 M☉</td>
<td>2953 km</td>
<td>Globular cluster dynamics</td>
<td><code>--black-hole-preset intermediate_mass</code></td>
</tr>
<tr>
<td><code>sagittarius_a_star</code></td>
<td>4.15×10^6 M☉</td>
<td>1.2×10^10 m</td>
<td>Galactic center physics</td>
<td><code>--black-hole-preset sagittarius_a_star</code></td>
</tr>
</tbody>
</table>
<div class="highlight">
<strong>Why primordial_mini is default:</strong>
<ul style="margin-top: 10px; margin-bottom: 0;">
<li>Allows larger timesteps (0.1 vs 0.01) for faster computation</li>
<li>Extreme curvature regime tests numerical stability</li>
<li>Orbital periods in femtoseconds enable quick testing</li>
<li>Ideal for testing solver accuracy in strong fields</li>
</ul>
</div>
<h3>Custom Black Holes</h3>
<div class="code-block">
<span class="comment"># Create custom black hole in code</span>
<span class="keyword">from</span> physics_agent.black_hole_loader <span class="keyword">import</span> BlackHoleLoader
loader = BlackHoleLoader()
<span class="comment"># Moon-mass black hole example</span>
moon_bh = loader.create_custom(
mass_kg=<span class="number">7.342e22</span>, <span class="comment"># Moon's mass</span>
name=<span class="string">"Moon Mass Black Hole"</span>
)
<span class="keyword">print</span>(f<span class="string">"Schwarzschild radius: {moon_bh.schwarzschild_radius_m:.2e} m"</span>)</div>
</div>
<div class="section-card">
<h2>Particle Types</h2>
<p>Albert simulates four fundamental particles with different properties and orbital behaviors:</p>
<table class="args-table">
<thead>
<tr>
<th>Particle</th>
<th>Type</th>
<th>Mass</th>
<th>Charge</th>
<th>Spin</th>
<th>Orbital Type</th>
<th>Command</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>electron</code> <span style="color: #4caf50; font-weight: bold;">(default)</span></td>
<td>Massive</td>
<td>9.109×10^-31 kg</td>
<td>-1.602×10^-19 C</td>
<td>1/2</td>
<td>Elliptical precessing</td>
<td><code>--particles electron</code></td>
</tr>
<tr>
<td><code>photon</code></td>
<td>Massless</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>Gravitational lensing</td>
<td><code>--particles photon</code></td>
</tr>
<tr>
<td><code>neutrino</code></td>
<td>Nearly massless</td>
<td>< 0.12 eV/c²</td>
<td>0</td>
<td>1/2</td>
<td>Near-null geodesic</td>
<td><code>--particles neutrino</code></td>
</tr>
<tr>
<td><code>proton</code></td>
<td>Massive</td>
<td>1.673×10^-27 kg</td>
<td>+1.602×10^-19 C</td>
<td>1/2</td>
<td>Stable circular</td>
<td><code>--particles proton</code></td>
</tr>
</tbody>
</table>
<h3>Orbital Parameters</h3>
<p>Each particle has specific orbital parameters that control its trajectory behavior:</p>
<ul>
<li><strong>angular_velocity_factor:</strong> Controls tangential motion (< 1.0 for more radial, > 1.0 for more tangential)</li>
<li><strong>radial_velocity_factor:</strong> Controls radial motion (negative = inward, positive = outward)</li>
<li><strong>orbit_type:</strong> Descriptive name for the trajectory type</li>
</ul>
<h3>Multi-Particle Simulations</h3>
<div class="code-block">
<span class="comment"># Simulate multiple particles at once</span>
python -m physics_agent.theory_engine_core \
--theories schwarzschild \
--particles electron photon neutrino proton \
--black-hole-preset stellar_mass
<span class="comment"># In Python code</span>
<span class="keyword">from</span> physics_agent.theory_engine_core <span class="keyword">import</span> TheoryEngine
<span class="keyword">from</span> physics_agent.theories.schwarzschild.theory <span class="keyword">import</span> Schwarzschild
<span class="comment"># Initialize engine and theory</span>
engine = TheoryEngine(black_hole_preset=<span class="string">'stellar_mass'</span>)
theory = Schwarzschild()
<span class="comment"># Run multi-particle trajectories</span>
results = engine.run_multi_particle_trajectories(
model=theory,
r0_si=<span class="number">295338.39</span>, <span class="comment"># Initial radius in meters</span>
N_STEPS=<span class="number">10000</span>, <span class="comment"># Number of integration steps</span>
DTau_si=<span class="number">0.01</span>, <span class="comment"># Proper time step</span>
theory_category=<span class="string">'classical'</span>
)
<span class="comment"># Access results for each particle</span>
<span class="keyword">for</span> particle_name, result <span class="keyword">in</span> results.items():
hist = result[<span class="string">'trajectory'</span>]
metrics = result[<span class="string">'metrics'</span>]
<span class="keyword">print</span>(f<span class="string">"{particle_name}: {hist.shape}"</span>)</div>
<div class="highlight">
<strong>Note:</strong> The muon particle is used in g-2 anomaly validation tests but is not available for trajectory simulations. The four particles above represent different regimes: charged massive (electron/proton), massless (photon), and nearly massless (neutrino).
</div>
</div>
<div class="section-card">
<h2>System Architecture</h2>
<canvas id="system-diagram"></canvas>
<div class="feature-grid">
<div class="feature-card">
<h3>Theory Engine Core</h3>
<p>Central orchestrator that manages theory evaluation, trajectory computation, and validation workflows. Handles multi-particle simulations and quantum corrections <span style="color: #ff6f00;">(quantum features are experimental)</span>.</p>
</div>
<div class="feature-card">
<h3>Geodesic Integration</h3>
<p>High-precision numerical solvers including 8th-order Dormand-Prince, symplectic integrators, and implicit methods for extreme curvature regions.</p>
</div>
<div class="feature-card">
<h3>Validation Framework</h3>
<p>Comprehensive testing against analytical solutions, numerical convergence, and experimental data from LIGO, solar system observations, atomic clocks, and astrophysical measurements.</p>
</div>
<div class="feature-card">
<h3>Caching System</h3>
<p>Intelligent trajectory caching using PyTorch tensors, providing massive speedups for parameter sweeps and repeated computations.</p>
</div>
<div class="feature-card">
<h3>Visualization</h3>
<p>WebGPU-accelerated 3D trajectory viewers, performance dashboards, and interactive analysis tools for exploring results.</p>
</div>
<div class="feature-card" style="border-left-color: #ff9800;">
<h3>Theory Discovery <span style="color: #ff6f00; font-size: 0.8em;">(EXPERIMENTAL)</span></h3>
<p>Automated system for generating and testing novel gravitational theories using genetic algorithms and machine learning. <strong style="color: #ff6f00;">This feature is completely experimental and results should be carefully validated.</strong></p>
</div>
</div>
</div>
<div class="section-card">
<h2>Example Usage</h2>
<h3>Basic Theory Test</h3>
<div class="code-block">
<span class="keyword">from</span> physics_agent.theory_engine_core <span class="keyword">import</span> TheoryEngine
<span class="keyword">from</span> physics_agent.theories.defaults.baselines.schwarzschild <span class="keyword">import</span> Schwarzschild
<span class="comment"># Initialize engine</span>
engine = TheoryEngine(device=<span class="string">'cuda'</span>, dtype=torch.float64)
<span class="comment"># Create theory instance</span>
theory = Schwarzschild()
<span class="comment"># Run trajectory simulation</span>
hist, tag, kicks = engine.run_trajectory(
model=theory,
r0_si=<span class="number">295338.39</span>, <span class="comment"># 100 Schwarzschild radii</span>
N_STEPS=<span class="number">10000</span>,
DTau_si=<span class="number">0.01</span>
)
<span class="keyword">print</span>(f<span class="string">"Trajectory shape: {hist.shape}"</span>)
<span class="keyword">print</span>(f<span class="string">"Tag: {tag}"</span>) <span class="comment"># 'cached_trajectory' if loaded from cache</span></div>
<h3>Multi-Particle Simulation</h3>
<div class="code-block">
<span class="comment"># Simulate multiple particles</span>
results = engine.run_multi_particle_trajectories(
model=theory,
r0_si=<span class="number">295338.39</span>,
N_STEPS=<span class="number">10000</span>,
DTau_si=<span class="number">0.01</span>,
particles=[<span class="string">'electron'</span>, <span class="string">'photon'</span>, <span class="string">'neutrino'</span>]
)
<span class="keyword">for</span> particle, data <span class="keyword">in</span> results.items():
<span class="keyword">print</span>(f<span class="string">"{particle}: {data['trajectory'].shape}"</span>)</div>
<div class="highlight">
<strong>Pro Tip:</strong> The caching system automatically saves computed trajectories. The first run may take minutes, but subsequent runs with the same parameters load in milliseconds!
</div>
</div>
<script>
// System architecture diagram
const canvas = document.getElementById('system-diagram');
const ctx = canvas.getContext('2d');
// Responsive canvas sizing
function resizeCanvas() {
canvas.width = canvas.offsetWidth;
canvas.height = window.innerWidth > 768 ? 600 : (window.innerWidth > 480 ? 400 : 300);
}
resizeCanvas();
window.addEventListener('resize', () => {
resizeCanvas();
// Reset particles to prevent animation issues on resize
particles.length = 0;
connections.forEach((conn, index) => {
setTimeout(() => {
particles.push(new DataParticle(conn));
}, index * 200);
});
});
// Define system components with responsive scaling
function getScaledComponents() {
const scale = canvas.width / 1260;
const vScale = canvas.height / 600;
const baseComponents = [
// Input layer
{name: 'Theory Definitions', x: 100, y: 100, width: 180, height: 60, color: '#4caf50', layer: 'input'},
{name: 'Experimental Data', x: 100, y: 200, width: 180, height: 60, color: '#4caf50', layer: 'input'},
{name: 'Initial Conditions', x: 100, y: 300, width: 180, height: 60, color: '#4caf50', layer: 'input'},
// Core engine
{name: 'Theory Engine', x: 400, y: 200, width: 200, height: 80, color: '#1976d2', layer: 'core'},
// Processing
{name: 'Geodesic Integrator', x: 700, y: 100, width: 180, height: 60, color: '#ff9800', layer: 'process'},
{name: 'Validator Suite', x: 700, y: 200, width: 180, height: 60, color: '#ff9800', layer: 'process'},
{name: 'Cache System', x: 700, y: 300, width: 180, height: 60, color: '#ff9800', layer: 'process'},
// Output
{name: 'Results & Scores', x: 1000, y: 150, width: 160, height: 60, color: '#9c27b0', layer: 'output'},
{name: 'Visualizations', x: 1000, y: 250, width: 160, height: 60, color: '#9c27b0', layer: 'output'}
];
return baseComponents.map(comp => ({
...comp,
x: comp.x * scale,
y: comp.y * vScale,
width: comp.width * scale,
height: comp.height * vScale
}));
}
let components = getScaledComponents();
// Connection definitions
const connections = [
{from: 0, to: 3}, {from: 1, to: 3}, {from: 2, to: 3},
{from: 3, to: 4}, {from: 3, to: 5}, {from: 3, to: 6},
{from: 4, to: 7}, {from: 5, to: 7}, {from: 6, to: 7},
{from: 4, to: 8}, {from: 5, to: 8}, {from: 7, to: 8},
{from: 6, to: 4} // Cache feedback to integrator
];
// Particle animation
const particles = [];
let animationTime = 0;
class DataParticle {
constructor(path) {
this.path = path;
this.progress = 0;
this.speed = 0.01 + Math.random() * 0.005;
this.color = `hsl(${200 + Math.random() * 60}, 70%, 50%)`;
}
update() {
this.progress += this.speed;
if (this.progress > 1) {
this.progress = 0;
}
}
draw() {
const from = components[this.path.from];
const to = components[this.path.to];
const x = from.x + from.width/2 + (to.x + to.width/2 - from.x - from.width/2) * this.progress;
const y = from.y + from.height/2 + (to.y + to.height/2 - from.y - from.height/2) * this.progress;
ctx.fillStyle = this.color;
ctx.beginPath();
ctx.arc(x, y, 4, 0, Math.PI * 2);
ctx.fill();
}
}
// Initialize particles
connections.forEach((conn, index) => {
setTimeout(() => {
particles.push(new DataParticle(conn));
}, index * 200);
});
function drawSystemDiagram() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Update components on resize
components = getScaledComponents();
// Scale factors
const scale = canvas.width / 1260;
const vScale = canvas.height / 600;
// Draw layer backgrounds with scaling
const baseLayers = [
{x: 50, width: 280, color: '#e8f5e9', label: 'Input'},
{x: 350, width: 300, color: '#e3f2fd', label: 'Core Engine'},
{x: 650, width: 280, color: '#fff3e0', label: 'Processing'},
{x: 950, width: 260, color: '#f3e5f5', label: 'Output'}
];
const layers = baseLayers.map(layer => ({
...layer,
x: layer.x * scale,
width: layer.width * scale
}));
layers.forEach(layer => {
ctx.fillStyle = layer.color;
ctx.fillRect(layer.x, 50 * vScale, layer.width, 320 * vScale);
ctx.fillStyle = '#666';
const fontSize = Math.max(10, 14 * Math.min(scale, 1));
ctx.font = `bold ${fontSize}px Arial`;
ctx.textAlign = 'center';
ctx.fillText(layer.label, layer.x + layer.width/2, 40 * vScale);
});
// Draw connections
ctx.strokeStyle = '#ddd';
ctx.lineWidth = 2;
connections.forEach(conn => {
const from = components[conn.from];
const to = components[conn.to];
ctx.beginPath();
ctx.moveTo(from.x + from.width, from.y + from.height/2);
ctx.lineTo(to.x, to.y + to.height/2);
ctx.stroke();
});
// Draw components
components.forEach(comp => {
// Shadow
ctx.fillStyle = 'rgba(0,0,0,0.1)';
ctx.fillRect(comp.x + 3, comp.y + 3, comp.width, comp.height);
// Component box
ctx.fillStyle = comp.color;
ctx.fillRect(comp.x, comp.y, comp.width, comp.height);
// Text with responsive font size
ctx.fillStyle = 'white';
const compFontSize = Math.max(9, 13 * Math.min(scale, 1));
ctx.font = `bold ${compFontSize}px Arial`;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
// Word wrap for small screens
if (scale < 0.6 && comp.name.length > 15) {
const words = comp.name.split(' ');
const midPoint = Math.ceil(words.length / 2);
const line1 = words.slice(0, midPoint).join(' ');
const line2 = words.slice(midPoint).join(' ');
ctx.fillText(line1, comp.x + comp.width/2, comp.y + comp.height/2 - compFontSize/2);
ctx.fillText(line2, comp.x + comp.width/2, comp.y + comp.height/2 + compFontSize/2);
} else {
ctx.fillText(comp.name, comp.x + comp.width/2, comp.y + comp.height/2);
}
});
// Update and draw particles
particles.forEach(particle => {
particle.update();
particle.draw();
});
// Draw title with responsive font
ctx.fillStyle = '#333';
const titleFontSize = Math.max(12, 16 * Math.min(scale, 1));
ctx.font = `bold ${titleFontSize}px Arial`;
ctx.textAlign = 'center';
const titleText = scale < 0.6 ? 'System Architecture' : 'Albert System Architecture - Data Flow';
ctx.fillText(titleText, canvas.width/2, 20 * vScale);
animationTime++;
requestAnimationFrame(drawSystemDiagram);
}
drawSystemDiagram();
</script>
</body>
</html>