Skip to main content
Live
Main content

Astrophysicist uses OpenAI's Codex to simulate black holes

Chi-kwan Chan is pairing Codex with general relativity code to model extreme physics and stress-test Einstein's predictions.

Jaeden Schafer
Editor in Chief · · 4 min read
OpenAI logo

Astrophysicist Chi-kwan Chan is using Codex, OpenAI's coding agent, to help build the simulations he runs of black holes — the kind of computational work that sits between general relativity, plasma physics, and high-performance computing. OpenAI published the case study on its site, framing Codex as a research collaborator rather than a productivity tool for shipping web apps. The work feeds into the broader scientific effort to test Einstein's theory of general relativity against direct observational data.

Chan's simulations model the behavior of matter and light near event horizons, where the equations of general relativity stop behaving like anything that has a closed-form answer. To get useful predictions out of the math, researchers write numerical code that discretizes spacetime, integrates the field equations, and traces photon paths through warped geometry. That code is notoriously difficult to write, debug, and optimize, and Chan is using Codex to accelerate parts of that pipeline.

The pitch from OpenAI is straightforward: Codex can read scientific code, propose refactors, generate new routines, and handle the kind of boilerplate around simulation harnesses that eats hours of researcher time. For a domain where a single production run can consume significant supercomputer allocations, getting the code right before the job submits is not a convenience — it is the difference between a usable result and a wasted allocation.

Key facts

  • 01Astrophysicist Chi-kwan Chan is using OpenAI's Codex to help build simulations of black holes.
  • 02The simulations are used to study extreme physics and test Einstein's theory of general relativity.
  • 03Codex assists with the heavy numerical and code-generation work behind relativistic simulation pipelines.
  • 04The case study is part of OpenAI's effort to showcase Codex in scientific research workflows beyond commercial software.

Black hole simulation is one of the more demanding corners of computational physics. The Event Horizon Telescope collaboration's images of M87* and Sagittarius A* depended on libraries of synthetic black hole images generated from general relativistic magnetohydrodynamic simulations, then compared against the interferometric data. Chan has worked in that lineage, and the simulation codes involved — written in C, Fortran, CUDA, and increasingly Python wrappers — are exactly the kind of polyglot, performance-sensitive software where an AI coding agent has to actually understand what it is doing rather than just pattern-match.

The case study fits a deliberate pattern from OpenAI: positioning Codex inside research workflows that are visible, technically credible, and unambiguously hard. Astrophysics is a useful showcase precisely because the code is not the kind a junior developer can be hired to write quickly. If Codex can hold its own assisting on relativistic ray tracing or plasma dynamics, the implicit argument is that it can hold its own on most enterprise codebases too.

Codex itself has been through several iterations since OpenAI revived the brand for its coding agent. The current version operates as a longer-horizon agent capable of reading repositories, running tests, and iterating on changes — a meaningful step up from the autocomplete tools that dominated AI coding two years ago. The pricing and access model has been tied to OpenAI's ChatGPT subscriptions and API, putting it in direct competition with Anthropic's Claude Code and other agentic coding products.

The scientific computing angle is where this case study gets interesting from a market perspective. Research code has historically been a backwater for commercial software tooling — the customers are academics with grant budgets, not enterprise procurement teams, and the codebases are idiosyncratic. But the same labs are increasingly buying API credits directly, and a researcher who finds Codex genuinely useful is a researcher who will defend that line item to a department chair.

There are real limits to what an AI agent can do in this domain that the case study does not resolve. Numerical relativity has subtle correctness traps — gauge choices, coordinate singularities, conservation violations — that produce code which runs cleanly and outputs garbage. An agent that confidently refactors a stress-energy tensor routine without understanding the underlying physics could ship plausible-looking bugs into a simulation pipeline. Chan's role as the physicist in the loop is doing the load-bearing work; Codex is a force multiplier, not a replacement for domain expertise.

Related · from this week
ChatGPT gains an Apple Messages plug-in that can draft and send texts
Jaeden Schafer · 4 min read →

For OpenAI, the value of publishing the Chan case study is less about converting astrophysicists and more about establishing that Codex is credible in the hardest coding environments scientists run. Every frontier lab is now competing on the agentic coding axis — Anthropic with Claude, Google with Gemini's coding modes, and a tier of startups building on top of all of them. Showing the tool helping simulate spacetime is a more defensible marketing position than showing it building another to-do app.

ShareXLinkedInEmail
AI Box

Every AI model. One chat.

The latest models from ChatGPT, Claude, Gemini, Sora, ElevenLabs — 80+ models in a single chat. Compare answers side by side. Pick the best one every time.

  • ChatGPT, Claude, Gemini, Grok, DeepSeek — in one chat
  • Generate images & video with Sora, Veo, Ideogram
  • Compare any two models side by side
  • From $8.99/mo · 80+ models, all included
Try AI Boxaibox.ai
Trusted by 3,000+ teams
Got a tip?

Working on something we should cover, or seeing a story we missed? Send leads, documents, or feedback to hello@aichatdaily.com. For sensitive tips, see our secure tips page for Signal and PGP options.

Spotted an error? Email hello@aichatdaily.com with the URL and the issue, or read our full corrections policy.

AI Box Daily briefingFree · Daily · No fluff

Stay ahead of everyone in AI.

The tightly edited AI news email engineers, founders, and investors actually open. One email. Every weekday. Five minutes to finish.

Loved by 10,000+ AI professionals
Free forever. Unsubscribe with one click.

The briefing read inside teams at

Keep reading

More from Tools

OpenAI logo
Tools

ChatGPT gains an Apple Messages plug-in that can draft and send texts

OpenAI's new integration lets ChatGPT sort, edit, and send iMessages on a user's behalf — with a local runtime and a warning about auto-approval.

Jaeden Schafer4 min read
OpenAI logo
Tools

OpenAI brings ChatGPT Voice to the desktop app with agent control

The macOS and Windows update lets users direct ChatGPT Work and Codex agents by voice, powered by the new GPT-Live model family.

Jaeden Schafer4 min read
OpenAI logo
Tools

OpenAI puts Codex inside the ChatGPT mobile app on iOS and Android

Phone users can now dispatch tasks to Codex running on their desktop, with files and credentials staying on the local machine.

Jaeden Schafer4 min read