Introduction to WarpX
Last updated on 2025-04-22 | Edit this page
Overview
Questions
- 🤌 What is WarpX?
- 🤔 What is a PIC code?
- 🧐 What can I use WarpX for?
Objectives
- 💡 Understand the basics of PIC codes
- 🧑💻 Learn about the features of WarpX
- 🎯 Figure out if WarpX can be useful for you!
Overview of PIC
WarpX is a general purpose
open-source high-performance
Particle-In-Cell (PIC) code.
The PIC method is a very popular approach to simulate the
dynamics of physical systems governed by relativistic
electrodynamics. Plasmas ⭐ and beams ☄️,
which are often made of charged particles that may travel almost at the
speed of light, fall into this category. Additionally, other physical
effects can be integrated into the PIC algorithm, such as different
quantum 🎲 processes.
Here is a picture that condenses the core idea: there are particles and fields. The particles are approximated as macroparticles (usually each representative of many real particles), while the fields are approximated on a grid in space. The particles and the fields are updated, self-consistently, in a temporal loop.
Here is a more informative image that explains the core algorithmic steps. As the particles travel in space, they generate currents, which in turn generate an electromagnetic field. The electromagnetic field then push the particles via the Lorentz force. Therefore, the current density \(\textbf{J}\) and the force \(\textbf{F}_L\) are the quantitieis that connect the particles and the fields, or in PIC lingo, the macroparticles and the grid. Hence, the idea is the following. First, define a well-posed initial condition, and then iterate the following: * Interpolate the fields from the grid to the particles’ positions and compute the Lorentz force that acts on each macroparticle, * Advance the position and momenta of the macroparticles using Newton equations, * Project while cumulating the contribution to the current density of each macroparticles, * Solve Maxwell’s equations.
In some cases, one can choose to solve Poisson’s equation instead of Maxwell’s. In that case, the current \(\textbf{J}\) calculation is replaced with the charge density \(\rho\) calculation. Once \(\rho\) is known, the electrostic potential is computed to then find the electric field.
If you want to know more about PIC, here are a few references:
- The two bibles on PIC 📚
- An old review written by one of the pioneers: John M. Dawson,
Particle simulation of plasmas, Rev. Mod. Phys. 55, 403
- Browse our docs for many, many more references about advanced algorithms and methods.
Features and applications of WarpX
WarpX is developed and used by a wide range of researchers working in different fields, from beam physics to nuclear fusion and a lot more. To learn about what WarpX can be used for, check out our examples and the scientific publications that acknowledged WarpX.
Checklist
Some cool features of WarpX:
📖 Open-source!
✈️ Runs on GPUs: NVIDIA, AMD, and Intel
🚀 Runs on multiple GPUs or CPUs, on systems ranging from laptops to supercomputers
🤓 Many many advanced algorithms and methods: mesh-refinement, embedded boundaries, electrostatic/electromagnetic/pseudospectral solvers, etc.
💾 Standards: openPMD for input/output data, PICMI for inputs
🤸 Active development and mainteinance: check out our GitHub repo
🗺️ International, cross-disciplinary community: plasma physics, fusion devices, laser-plasma interactions, beam physics, plasma-based acceleration, astrophysics, others?
We will add here more details soon!