Skip to content
VLASIFY™
ComparisonPlasma & PIC simulation

WarpX vs FBPIC: which PIC code for laser–plasma acceleration?

Updated · Scientifically reviewed by Dinkar Mishra, PhD on

Short answer

FBPIC is a Python code with a quasi-cylindrical spectral solver that runs very efficiently on one or a few NVIDIA GPUs, which makes it ideal for nearly cylindrically symmetric wakefield studies and fast parameter scans. WarpX is a C++ exascale code supporting 1D, 2D, quasi-cylindrical (RZ) and full 3D, mesh refinement, boosted frames and CPUs plus NVIDIA, AMD and Intel GPUs. It is the choice for 3D physics, large machines and broader feature needs.

Who this is for

Laser–plasma and accelerator physicists choosing a PIC code for a new project, thesis or facility study.

At a glance

FBPICWarpX
Language / interfacePython (Numba, CuPy)C++ (AMReX), input files or Python (PICMI)
GeometryQuasi-cylindrical (r–z with azimuthal modes)1D, 2D, RZ (quasi-cylindrical) and 3D
Field solverSpectral (PSATD), dispersion-free in vacuumFDTD (Yee, CKC) and PSATD spectral
HardwareCPU (Numba), NVIDIA GPUsCPUs, NVIDIA (CUDA), AMD (HIP) and Intel (SYCL) GPUs
ScaleWorkstation to a few dozen GPUsWorkstation to exascale supercomputers
Boosted frameYesYes
Mesh refinementNoYes
Extra physicsIonisation, external fields, boosted-frame diagnosticsIonisation, collisions, QED, PML, embedded boundaries and more
Best fitFast, accurate near-axisymmetric LWFA/PWFA studies and scans3D physics, large campaigns, broad feature needs, multi-vendor HPC

When to choose each

Choose FBPIC when:

  • your problem is nearly cylindrically symmetric (standard LWFA, PWFA, plasma lenses);
  • you want many runs quickly on one or a few NVIDIA GPUs, for example for parameter scans or optimisation;
  • you prefer a compact Python workflow.

Choose WarpX when:

  • you need full 3D physics: asymmetric beams, hosing, transverse instabilities, complex targets;
  • you will run at scale on national supercomputers, including AMD or Intel GPU systems;
  • you need mesh refinement, embedded boundaries, collisions, QED or other modules;
  • you want 1D/2D/RZ/3D in one code for reduced-to-full-model studies.

Use both for critical results: a quasi-cylindrical FBPIC scan to explore parameters, then WarpX 3D runs at the interesting points. Agreement between independent codes is strong verification.

Moving between the two codes

Both codes write openPMD output, so analysis scripts based on openPMD-viewer or openPMD-api can be shared between them. WarpX’s RZ geometry also uses azimuthal modes, so a quasi-cylindrical FBPIC setup can be translated to a WarpX RZ run before going to full 3D. Translate parameters carefully: laser definitions (waist, duration conventions, polarisation), density profiles and particle loading differ in syntax and sometimes in definition.

Cost intuition

A quasi-cylindrical run with NmN_m modes stores fields on Nz×NrN_z \times N_r grids per mode instead of Nz×Nx×NyN_z \times N_x \times N_y. For a typical wakefield box this reduces memory and compute by orders of magnitude compared with 3D, which is why FBPIC runs that take hours on one GPU can correspond to 3D runs needing a supercomputer allocation. Estimate the 3D cost with the PIC Simulation Planner.

Assumptions and limitations

  • Feature lists summarise the documentation at the time of writing. Both codes evolve, so check the docs for the capabilities of the release you use.
  • No performance numbers are given. They depend on hardware, resolution and features, and should be measured on your problem.
  • Other codes (Smilei, EPOCH, OSIRIS, PIConGPU) are also widely used for laser–plasma work. See the plasma simulation software comparison.

Frequently asked questions

Can I get the same results from both codes?+

For well-resolved, nearly cylindrical problems both codes should agree within numerical uncertainty, since both solve the same physics. Running a reference case in both is an excellent cross-code verification for important results.

Is quasi-cylindrical geometry accurate enough?+

For laser wakefield problems with a near-axisymmetric laser and plasma, a few azimuthal modes capture the physics at a fraction of the 3D cost. It breaks down when the problem is strongly asymmetric, for example with large pointing jitter studies, hosing or multiple off-axis beams.

Which is easier to learn?+

FBPIC is a Python package with short scripts, which many students find quickest to start with. WarpX can be driven with plain-text input files or from Python (PICMI), and has broader documentation for HPC systems, but its build options and features take longer to master.

Are both codes actively maintained?+

WarpX is under active development with frequent releases. FBPIC is mature and widely used; check its repository for recent activity and supported versions before starting a long project.

References

  1. WarpX documentation · WarpX developers
  2. FBPIC documentation · FBPIC developers
  3. Lehe et al., A spectral, quasi-cylindrical and dispersion-free particle-in-cell algorithm, Comput. Phys. Commun. 203, 66 (2016) · Peer-reviewed article
  4. Vay et al., Modeling of a chain of three plasma accelerator stages with the WarpX electromagnetic PIC code on GPUs, Phys. Plasmas 28, 023105 (2021) · Peer-reviewed article

Not sure which to choose?

We benchmark candidate tools on your actual problem and recommend one, independently of any vendor.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote