
A timely agent for gravitational theory research
One engine to model everything. In code. Rooted in the laws of physics.
# One-line installation
curl -fsSL https://raw.githubusercontent.com/PimDeWitte/albert/refs/heads/main/download_cli.sh | bash
# Clone and setup
git clone https://github.com/pimdewitte/albert.git
cd albert
./setup_unified.sh
# Run all theories (standard run)
albert run
# Run with specific options
albert run --max-steps 100000
albert run --theories schwarzschild kerr
albert run --theories schwarzschild --black-hole-preset stellar_mass
albert run --category quantum
# Configure Albert (API keys, etc.)
albert setup
# Discover new theories automatically
albert discover --initial "unified field theory"
# Discover variations of an existing theory
albert discover --from-theory theories/quantum_corrected
# Optional: Make albert available globally
sudo ln -s $(pwd)/albert /usr/local/bin/albert
# Now you can use 'albert' from anywhere
Albert provides a unified CLI with multiple subcommands:
# Run all theories with default settings
albert run
# Run specific theories
albert run --theories schwarzschild kerr # Multiple theories
albert run --category quantum # Run category
albert run --candidates # Include candidates
# Black hole configurations
albert run --black-hole-preset stellar_mass # 10 solar masses
albert run --black-hole-preset primordial_mini # Default: quantum scale
albert run --black-hole-preset sagittarius_a_star # Galactic center
albert run --black-hole-preset laboratory_micro # Extreme quantum regime
albert run --black-hole-preset intermediate_mass # Globular clusters
# Particle simulations
albert run --particles electron photon neutrino # Multi-particle
albert run --particles proton # Specific particle
# Performance options
albert run --device cuda --dtype float32 # GPU acceleration
albert run --device cpu --dtype float64 # Max precision
albert run --max-steps 1000000 # Million-step trajectories
albert run --no-cache # Force recomputation
albert run --clear-cache # Clear cache and exit
# Advanced options
albert run --validators-only # Skip trajectory computation
albert run --max-parallel-workers 16 # Parallel processing
albert run --test # Run pre-flight tests
albert run --enable-sweeps # Enable parameter sweeps
albert run --sweep-only gamma # Sweep only specific parameter
albert run --experimental # Enable experimental quantum features
albert run --verbose # Enable verbose logging
albert run --final # High-quality publication mode
albert run --early-stop # Enable early stopping
albert run --quantum-field-content all # Configure quantum field content
# Start discovery with default settings
albert discover
# Discovery with initial prompt
albert discover --initial "unified field theory with torsion"
# Improve existing theory
albert discover --from-theory theories/quantum_corrected
# Continuous monitoring mode
albert discover --self-monitor
# Interactive setup wizard
albert setup
albert validate path/to/theory.py # Validate specific theory
albert test # Run environment tests
albert --help # Show all commands
Albert uses 14 comprehensive validators to test gravitational theories against experimental data:
- Mercury Precession: 43.98 arcsec/century (100% pass rate)
- Light Deflection: 1.75 arcsec at solar limb (100% pass rate)
- Photon Sphere: r = 3M for Schwarzschild (100% pass rate)
- PPN Parameters: Ξ³ = Ξ² = 1 for GR (100% pass rate)
- COW Interferometry: Neutron phase shift in gravity (100% pass rate)
- Gravitational Waves: LIGO/Virgo waveform matching (100% pass rate)
- PSR J0740: Shapiro time delay in binary pulsars (100% pass rate)
- Trajectory vs Kerr: Geodesic comparison (100% pass rate)
- Circular Orbit: ISCO radius & orbital frequency (93.8% pass rate)
- Quantum Geodesic Sim: 2-qubit quantum simulation (96.9% pass rate)
- g-2 Anomaly: Muon magnetic moment (40.6% pass rate)
- Scattering Amplitude: Tree-level graviton exchange (68.8% pass rate)
- CMB Power Spectrum: Planck satellite constraints (71.9% pass rate)
- Primordial GWs: B-mode polarization (93.8% pass rate)
Albert uses AI to generate and test new gravitational theories automatically:
- AI Generation: LLM generates novel theory code based on prompts
- Validation: Theories tested against 14 comprehensive validators
- Ranking: Top performers promoted to candidate status
- Storage: Candidates saved with full results and metadata
- Review: Community can review and submit via pull requests
# Basic discovery
albert discover
# Guided discovery with physics hints
albert discover --initial "incorporate holographic principle"
# Theory improvement
albert discover --from-theory theories/quantum_corrected
# Continuous discovery with monitoring
albert discover --self-monitor
physics_agent/theories/candidates/
βββ proposed/ # Theories awaiting review
βββ new/ # Recently discovered theories
βββ rejected/ # Theories that didn't pass validation
- First run: Full geodesic integration (minutes)
- Cached runs: Near-instant load (8.6ms)
- Speedup: Up to 29,323x for million-step trajectories
- Storage: ~30MB per trajectory
Trajectory Steps | Integration Time | Cached Load | Speedup |
---|---|---|---|
10,000 | 2.75 s | 2.5 ms | 1,110x |
100,000 | 25.80 s | 2.4 ms | 10,674x |
1,000,000 | 4m 12.7s | 8.6 ms | 29,323x |
- Parameter sweeps run in parallel
- Auto-detects optimal worker count
- GPU support (CUDA, MPS for Apple Silicon)
- Adaptive precision (float32/float64)
Preset | Mass | Schwarzschild Radius | Use Case | Command |
---|---|---|---|---|
primordial_mini β |
10ΒΉβ΅ kg | 1.5 pm | Quantum gravity research | --black-hole-preset primordial_mini |
stellar_mass |
10 Mβ | 29.5 km | Standard astrophysics | --black-hole-preset stellar_mass |
laboratory_micro |
10βΈ kg | 1.5Γ10β»ΒΉβΉ m | Extreme quantum regime | --black-hole-preset laboratory_micro |
intermediate_mass |
1000 Mβ | 2953 km | Globular clusters | --black-hole-preset intermediate_mass |
sagittarius_a_star |
4.15Γ10βΆ Mβ | 1.2Γ10ΒΉβ° m | Galactic center | --black-hole-preset sagittarius_a_star |
β Default: primordial_mini
enables larger timesteps and quantum effects
Particle | Type | Mass | Charge | Spin | Orbital Behavior |
---|---|---|---|---|---|
electron β |
Massive | 9.1Γ10β»Β³ΒΉ kg | -e | 1/2 | Elliptical precessing |
photon |
Massless | 0 | 0 | 1 | Gravitational lensing |
neutrino |
Nearly massless | < 0.12 eV/cΒ² | 0 | 1/2 | Near-null geodesic |
proton |
Massive | 1.67Γ10β»Β²β· kg | +e | 1/2 | Stable circular |
β Default particle
- Create theory file:
theories/my_theory/theory.py
- Define your metric:
from physics_agent.base_theory import GravitationalTheory, Tensor
import torch
class MyTheory(GravitationalTheory):
def __init__(self):
super().__init__(
name="My Theory",
description="Novel gravitational theory",
category="quantum" # or "classical", "emergent", "baseline"
)
def get_metric(self, r, M, C, G):
# Define your g_ΞΌΞ½ components
g_tt = -(1 - 2*G*M/(C**2 * r))
g_rr = 1/(1 - 2*G*M/(C**2 * r))
# ... define all components
return Tensor("metric", [...])
- Run validation:
albert run --theories "My Theory"
-
Dormand-Prince 8(7): 8th order with adaptive step control
- Error tolerance: 10β»ΒΉΒ² relative, 10β»ΒΉβ΄ absolute
- 13 Runge-Kutta stages per step
- Performance: 47.3ms for 1,024 steps
-
Symplectic Integrators: Energy-preserving for periodic orbits
- Energy drift: < 10β»ΒΉβ΅ over 10βΆ orbits
- 4th and 6th order implementations
-
Implicit Methods: For extreme curvature near horizons
- A-stable and L-stable
- Newton-Raphson convergence
Albert is building toward a unified physics engine where:
- Every physical law is implemented and validated
- All experimental data is digitized and accessible
- Theories can be tested against all known physics
- Synthetic data generation for games and training
Currently supports:
- 32 gravitational theories including GR, quantum corrections, UGM
- 14 validation tests from solar system to quantum scales
- Multi-particle simulations with different quantum numbers
- WebGPU visualization for interactive exploration
Future extensions:
- Fluid dynamics solvers
- Quantum field theory
- Condensed matter physics
- Statistical mechanics
- Plasma physics
- Add new validators for your field
- Implement experimental datasets
- Verify theoretical predictions
- Contribute new baseline theories
- Optimize solvers with torch.compile
- Implement GPU kernels
- Add visualization tools
- Improve caching system
- Test new theories
- Report bugs
- Improve documentation
- Join discussions on Discord
- Introduction & System - Architecture overview
- Solvers & Validators - Testing framework
- Cache System - Performance optimization
- API Reference - Full documentation
This project continues Einstein's quest for unification. Special thanks to:
- Partanen & Tulkki (2025) for the UGM framework
- The open-source physics community
- Everyone who believes in open science
flowchart TD
START[albert run] --> PARSE[Parse CLI Arguments]
PARSE --> SETUP[Setup Execution Mode]
SETUP --> DEVICE[Determine Device & Dtype<br/>GPU/CPU, float32/float64]
DEVICE --> ENGINE[Create TheoryEngine Instance]
ENGINE --> LOADER[Load 32 Theories<br/>baseline/classical/quantum/emergent]
LOADER --> FILTER[Apply Filters<br/>--theories, --category, --candidates]
FILTER --> PHASE0[PHASE 0: Baseline Tests<br/>Schwarzschild & Kerr]
PHASE0 --> PHASE1[PHASE 1: Theory Validation<br/>14 Validators Γ 32 Theories]
PHASE1 --> CACHE{Check Cache?}
CACHE -->|Hit<br/>8.6ms| LOAD[Load Tensor]
CACHE -->|Miss<br/>4+ min| INTEGRATE[Geodesic Integration<br/>RK8/Symplectic/Implicit]
INTEGRATE --> SAVE[Save to Cache]
SAVE --> VALIDATE
LOAD --> VALIDATE[Run Validators]
VALIDATE --> PHASE2[PHASE 2: Full Trajectories<br/>Multi-particle simulations]
PHASE2 --> PHASE3[PHASE 3: Predictions<br/>Novel physics tests]
PHASE3 --> LEADERBOARD[Generate Results<br/>HTML Report + 3D Viz]
LEADERBOARD --> END[Complete]
style START fill:#90EE90
style END fill:#FFB6C1
style CACHE fill:#FFE4B5
style INTEGRATE fill:#FF6B6B
style LOAD fill:#4ECDC4
graph TD
A[π€ LLM Generation<br/>AI generates novel theories] -->|Python code| B[π¬ Validation<br/>14 comprehensive tests]
B --> C{Pass Rate?}
C -->|> 85%| D[π Top Performer<br/>Promoted to candidate]
C -->|< 85%| E[β Rejected<br/>Logged for analysis]
D --> F[π Candidate Storage<br/>theories/candidates/new/]
F --> G[π Metadata<br/>β’ Test results<br/>β’ Trajectories<br/>β’ Performance metrics]
G --> H[πΏ Git Workflow<br/>Create PR]
H --> I[π₯ Community Review<br/>Physics validation]
E --> J[π Feedback Loop<br/>Improve prompts]
J --> A
graph LR
A[Trajectory Request] --> B{Cache Key<br/>SHA256 Hash}
B --> C[Parameter Set<br/>β’ Theory name<br/>β’ Black hole preset<br/>β’ Particle type<br/>β’ Integration steps<br/>β’ Numerical params]
C --> D{Cache Lookup}
D -->|Found| E[Load PyTorch Tensor<br/>8.6ms]
D -->|Not Found| F[Compute Trajectory<br/>4+ minutes]
F --> G[Save to Cache<br/>~30MB for 1M steps]
G --> H[Return Result]
E --> H
style E fill:#4ECDC4
style F fill:#FF6B6B
- Python: 3.9+
- GPU: NVIDIA (CUDA), Apple Silicon (MPS), or CPU fallback
- API Key: xAI/Grok (recommended) or experimental support for other providers
Albert uses AI to generate new theories. Get your API key:
- xAI/Grok: https://x.ai/api
- OpenAI, Anthropic, Google Gemini (limited support)
Run the setup wizard:
albert setup
β Albert Einstein