Testing the Intelligence Explosion: Can AI turn one physicist into a research team?
This repository contains a complete scientific paper and verification study demonstrating AI-assisted research at scale. Both the GANDALF code and this paper were primarily written by AI, guided by domain expertise.
π Read the full story: Testing the Intelligence Explosion: Can AI Turn One Physicist Into a Research Team?
π Read the paper: GANDALF_paper.pdf (pre-compiled, ready to view)
This project tests whether AI can produce research-grade scientific work, not just toy examples. The deliverables include:
- A production code: GANDALF - 2,000+ lines of JAX implementing spectral KRMHD solver
- This paper: ~1,000 lines of LaTeX for Journal of Plasma Physics submission
- Rigorous verification: Three benchmark suites demonstrating spectral accuracy
- Publication-quality figures: 12 figures generated from numerical experiments
- Automated quality control: GitHub Actions with Claude-based review workflows
Nearly everything:
- Complete JAX codebase (spectral methods, time integration, parallelization)
- All paper sections (introduction through conclusions)
- Mathematical formulation and LaTeX equations
- Benchmark analysis and figure generation
- Documentation and workflow automation
Human contributions:
- Scientific direction and physics expertise
- Verification criteria and benchmark selection
- Quality review and refinement
- Connection to existing research literature
GANDALF is a modern reimplementation of Kinetic Reduced MHD (KRMHD) turbulence physics using JAX. It enables plasma turbulence research on commodity hardware (laptops, desktops, Apple Silicon) without requiring HPC clusters.
Key Features:
- Fourier spectral discretization in perpendicular plane
- Hermite spectral expansion in parallel velocity
- GANDALF integrating factor time stepping (exact linear propagation)
- Transparent CPU/GPU/TPU execution via JAX
- Research-grade accuracy with ~2-3Γ performance trade-off vs CUDA codes
Physical Regime:
- Strong guide field: kβ βͺ kβ₯
- AlfvΓ©nic turbulence and phase mixing
- Solar wind, magnetospheric, and fusion plasma applications
This paper demonstrates three levels of validation:
- Linear: AlfvΓ©n wave dispersion relations (machine precision: ~10β»ΒΉβ΅ error)
- Nonlinear: Orszag-Tang vortex evolution (10β»βΆ energy conservation)
- Turbulent: Forced cascade with kβ₯β»β΅/Β³ spectrum over 200 AlfvΓ©n times
- Velocity Space: Phase mixing cascade with mβ»ΒΉ/Β² scaling
Each benchmark includes convergence studies and comparison with analytical/theoretical predictions.
gandalf-paper/
βββ paper/
β βββ main.tex # Master LaTeX document
β βββ sections/
β β βββ introduction.tex # Physics motivation
β β βββ formulation.tex # KRMHD equations
β β βββ numerics.tex # Spectral methods
β β βββ implementation.tex # JAX architecture
β β βββ verification.tex # Benchmark results
β β βββ discussion.tex # Interpretation and ecosystem positioning
β β βββ conclusions.tex # Impact and future work
β βββ figures/ # Publication-quality figures (12 PDFs/PNGs)
β βββ references.bib # Bibliography
β βββ notation.tex # Mathematical notation definitions
β βββ main.pdf # Compiled paper
βββ data/
β βββ benchmarks/ # Raw benchmark data
β βββ alfven_wave/
β βββ orszag_tang/
β βββ turbulent_cascade/
βββ scripts/ # Python analysis and plotting scripts
βββ .github/workflows/ # Automated quality control
β βββ claude-code-review.yml # Claude-based code review
β βββ notation-check.yml # Notation consistency checks
β βββ paper-review.yml # Paper quality checks
βββ CLAUDE.md # Detailed project guidelines
Quick start: A pre-compiled PDF is available at the root: GANDALF_paper.pdf
To rebuild from source:
# LaTeX distribution (TeX Live, MacTeX, or MiKTeX)
# Required packages: amsmath, amssymb, graphicx, hyperref, cleveref
# Python environment for regenerating figures
pip install jax numpy scipy matplotlib h5pycd paper/
make # Compiles main.tex β main.pdf
make clean # Removes auxiliary filesOr manually:
cd paper/
pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.texThe compiled PDF will be paper/main.pdf.
All benchmark results can be regenerated from the GANDALF code:
# Clone the GANDALF repository
git clone https://github.com/anjor/gandalf.git
cd gandalf
# Run benchmarks (see GANDALF README for configuration)
python examples/alfven_wave_benchmark.py
python examples/orszag_tang_benchmark.py
python examples/turbulent_cascade_benchmark.pyRaw data is archived in data/benchmarks/ for figure regeneration without re-running simulations.
This repository demonstrates an AI-assisted research workflow:
- Development: AI generates code/text with human guidance
- Verification: Automated tests and benchmark validation
- Review: GitHub Actions with Claude-based quality checks
- Iteration: PR-based workflow with AI code review
- Refinement: Human physicist reviews for correctness and clarity
The .github/workflows/ directory contains automation examples. See CLAUDE.md for detailed guidelines used to direct AI contributions.
- Submission Target: Journal of Plasma Physics
- Current Status: Pre-submission (final review in progress)
- Preprint: Coming soon
@article{kanekar2025gandalf,
title={GANDALF: GPU-Accelerated Numeric Dynamics of Alfv\'enic Turbulence with JAX},
author={Kanekar, Anjor},
journal={Journal of Plasma Physics},
year={2025},
note={In preparation}
}- Main Code Repository: github.com/anjor/gandalf
- Blog Post: Testing the Intelligence Explosion
- JAX Documentation: jax.readthedocs.io
- Journal of Plasma Physics: cambridge.org/jpp
- Schekochihin et al. (2009) - KRMHD formulation (ApJS 182:310)
- Numata et al. (2010) - AstroGK gyrokinetic code (JCP 229:9347)
- Meyrand et al. (2019) - Plasma echo physics (PNAS 116:1185)
This paper uses a PR-based workflow with automated quality checks:
- Create a feature branch:
git checkout -b feature-name - Make changes to
paper/sections/*.tex - Submit PR to
mainbranch - Claude-based review runs automatically
- Address feedback and merge
See CLAUDE.md for detailed writing guidelines (notation, style, figure formatting).
β Can AI produce research-grade work? Yes, with proper guidance.
- Mathematical rigor: Correct KRMHD formulation with consistent notation
- Numerical correctness: Spectral methods with verified convergence rates
- Scientific writing: JPP-standard exposition for expert audience
- Software engineering: Production-quality JAX implementation
- Scientific direction and research questions
- Physical intuition for interpreting results
- Connection to broader research context
- Quality judgment and refinement
- Ethical oversight and verification
- AI as force multiplier: One physicist can produce the work of a small research team
- Iterative refinement essential: Initial AI output requires multiple rounds of review
- Domain expertise critical: Guiding AI requires deep understanding of the field
- Automation accelerates iteration: GitHub Actions enable rapid feedback cycles
- Transparency matters: Clear documentation of AI contributions builds trust
This paper and associated materials are available under MIT License. See LICENSE for details.
The GANDALF code is separately licensed (see main repository).
This work was made possible by:
- Claude (Anthropic) for AI assistance in code and paper generation
- JAX team (Google) for the numerical computing framework
- Plasma physics community for theoretical foundations
Built on research by Schekochihin, Kunz, Loureiro, Dorland, Barnes, Howes, and many others in the plasma turbulence community.
For questions about:
- The AI experiment: See blog post
- The physics: Read
paper/main.pdfor open an issue - The code: Visit github.com/anjor/gandalf
- Replicating this approach: See
CLAUDE.mdand.github/workflows/