Demonstrating mathematical integrity under GPU parallelization and reduced precision.
Simulating Hamiltonian systems (physics, molecular dynamics, chaos) requires numerical integration. Most methods fail:
❌ Euler: Energy explodes catastrophically
❌ RK4: Energy drifts linearly over time
✅ Symplectic: Energy stays bounded (structure preserved)
Symplectic integrators preserve the mathematical structure (symplectic form) of Hamiltonian systems. Unlike generic numerical methods, they respect the fundamental property: phase space volume is invariant.
Each trajectory is independent → embarrassingly parallel
CPU: Process trajectory 1, then 2, then 3, ... (sequential)
GPU: Process all simultaneously (parallel)
Speedup: 100-1000x
When simulating the Hénon-Heiles chaotic system for 10,000 timesteps:
Here’s what the results indicate:
p_{n+1/2} = p_n - (Δt/2) ∇H(q_n) [half-step p]
q_{n+1} = q_n + Δt p_{n+1/2} [full-step q]
p_{n+1} = p_{n+1/2} - (Δt/2) ∇H(q_{n+1}) [half-step p]
The staggered updates preserve the symplectic structure. This is NOT obvious from the equations alone.
__global__ void symplectic_kernel(
float* x, float* y, float* px, float* py,
int n, float dt, int steps) {
int i = blockIdx.x * blockDim.x + threadIdx.x;
if (i >= n) return;
// Each thread integrates one trajectory
for (int t = 0; t < steps; ++t) {
// Symplectic update (all in registers)
...
}
}
Perfect parallelization: N trajectories = N threads, no synchronization.
| Aspect | CPU | GPU | Speedup |
|---|---|---|---|
| 100 trajectories, 10k steps | ~2s | ~20ms | 100x |
| 1000 trajectories, 100k steps | ~200s | ~100ms | 2000x |
| Memory bandwidth | 50 GB/s | 900 GB/s | 18x |
“Understanding structure preservation” is rare and valuable. Most researchers just use popular libraries without thinking about preservation of invariants.
Clear signal of:
# 1. Run CPU benchmark (immediate)
cd src/cpu
python benchmark.py
# View: data/energy_drift_comparison.png
# 2. Interactive analysis (5 min)
cd ../notebooks
jupyter notebook 01_cpu_benchmark.ipynb
# 3. Build GPU version (requires CUDA)
cd ../..
mkdir build && cd build
cmake .. && make
# 4. Run GPU example
./build/example
“I implemented a GPU-accelerated symplectic integrator to demonstrate that mathematical integrity and high-performance computing are not just compatible—they’re complementary. Symplectic methods preserve the phase-space structure that encodes energy conservation, making them ideal for long-term Hamiltonian simulation. The GPU parallelization exploits the embarrassingly-parallel structure of independent trajectories, achieving 100-1000x speedup over CPU. The CPU baseline clearly shows: Euler fails (energy explodes), RK4 drifts (energy drifts linearly), but symplectic succeeds (energy stays bounded). This demonstrates I understand both the mathematics and the systems that compute it.”
That’s what separates this from generic “fast GPU code”—you’re showing mathematical understanding combined with computational efficiency.