A Scalable Fast Multipole Method Poisson Solver for the RAMSES code: I. Unigrid Algorithm

This paper presents a scalable, O(N)O(N) complexity Fast Multipole Method Poisson solver implemented in the RAMSES code that achieves accuracy comparable to multigrid methods while offering superior suitability for isolated boundary conditions and better parallel scalability through a single upward-downward pass hierarchy.

Original authors: Jun-Young Lee, Romain Teyssier

Published 2026-06-15
📖 6 min read🧠 Deep dive

Original authors: Jun-Young Lee, Romain Teyssier

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to calculate the gravitational pull of every star, planet, and cloud of gas in a massive simulation of the universe. To do this accurately, you have to figure out how every single piece of matter interacts with every other piece. If you have a billion pieces of matter, checking every single pair against each other is like trying to shake hands with every person on Earth individually—it takes way too long and crashes your computer.

This paper introduces a new, faster way to solve this "gravity math problem" for a popular astronomy software called RAMSES. The authors, Jun-Young Lee and Romain Teyssier, have built a new tool called the Fast Multipole Method (FMM) and tested it against the old standard tool, called Multigrid (MG).

Here is the breakdown of what they did and found, using simple analogies:

The Problem: The "Handshake" Bottleneck

In the old way of doing things (direct calculation), if you have NN objects, you have to do roughly N2N^2 calculations. If you double the number of stars, the work quadruples. This is too slow for big simulations.

Both the old method (MG) and the new method (FMM) are "smart" shortcuts that reduce the work to just NN (linear scaling). This means if you double the stars, you only double the work. But they get there in very different ways.

The Old Way: Multigrid (MG) – The "Relay Race"

Think of the Multigrid solver as a relay race that requires many laps.

  1. The Process: It starts with a rough guess of the gravity, then passes that guess through a series of "sponges" (mathematical steps) that clean up the errors. It goes from fine details to a coarse overview and back again.
  2. The Catch: To get a good answer, it has to run this relay race many times (called "V-cycles") until the errors are small enough.
  3. The Boundary Issue: When the simulation reaches the edge of the box (the edge of the universe being simulated), the old method has to make a guess about what's outside. It uses a "fake" boundary condition (like pretending the edge is a wall). This guess isn't perfect and creates errors near the edges of the simulation.

The New Way: Fast Multipole Method (FMM) – The "One-Trip Delivery"

The new FMM solver is like a highly organized delivery service that only needs to make one trip up and one trip down a hierarchy of neighborhoods.

  1. The Upward Trip (Gathering): Imagine grouping stars into neighborhoods, then neighborhoods into districts, then districts into cities. The algorithm gathers the "mass" of these groups into a single summary (a multipole) for each group. It does this from the smallest groups all the way up to the biggest city.
  2. The Downward Trip (Delivering): Now, it sends the gravity information back down.
    • Far Away: If a star is very far away, it doesn't need to know about every single star in a distant city; it just needs the "summary" of that city. The algorithm translates that summary into a local force.
    • Close By: If a star is right next to another, the algorithm calculates the exact force between them directly.
  3. The Benefit: It only does this one upward and one downward pass. It doesn't need to run a relay race to converge.
  4. The Boundary Advantage: Because it calculates gravity based on the actual distribution of matter without needing to guess what's outside the box, it handles "empty space" (vacuum) boundaries perfectly. It doesn't need fake walls.

The Results: Speed vs. Accuracy

The authors ran tests to see how these two methods compared:

  • For Smooth Things (like gas clouds): Both methods are equally accurate.
  • For Sharp Things (like a single point mass): The new FMM method has a slightly "blocky" error pattern. Because it groups things into grids, the math jumps a little at the grid lines, creating a box-shaped error. The old method is smoother here.
  • For Empty Space: The new FMM method wins. The old method gets messy near the edges of the simulation because of its "fake wall" guesses. FMM handles isolated systems (like a single galaxy in a void) much better.
  • Speed and Scaling:
    • The Math Count: Theoretically, the new FMM method does about 30 times more math operations (floating-point operations) than the old method.
    • The Real-World Speed: Surprisingly, they run at almost the same speed on a single computer core. Why? Because the new method does "heavier" math that keeps the computer's brain (CPU) very busy, while the old method spends a lot of time waiting for data to move around.
    • The Multi-Core Winner: When using many computer cores (MPI ranks) together, the new FMM method scales much better. The old method gets bogged down because it has to talk to other cores constantly during its many relay laps. The new method talks less and works more, making it faster as you add more computers.

The Verdict

The authors conclude that while the new FMM method does more raw math, it is more efficient because it keeps the computer's processor busy and avoids the communication delays that slow down the old method.

  • Best for: Simulations of isolated systems (like a single galaxy in a void) where the old method struggles with edge errors.
  • Best option: They found that a specific setting of the new method (called "FMM-1") is the sweet spot. It is just as accurate as the more complex setting but runs faster.

What's Next?
This paper is the first part of a series. The authors are currently working on adapting this new method to handle Adaptive Mesh Refinement (AMR). This means the simulation can have some areas that are super detailed (zoomed in) and others that are blurry (zoomed out), and the new method will be able to handle the different time steps required for those different zoom levels.

In short: They built a new, one-trip delivery system for gravity that is just as accurate as the old multi-lap race, handles empty space better, and scales up to massive supercomputers more efficiently.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →