Skip to main content

Fourier-Bessel Particle-In-Cell code (FBPIC)

pypi version License DOI

Online documentation: http://fbpic.github.io
Support: Join slack

Overview

FBPIC is a Particle-In-Cell (PIC) code for relativistic plasma physics.

It is especially well-suited for physical simulations of laser-wakefield acceleration and plasma-wakefield acceleration, with close-to-cylindrical symmetry.

Algorithm

The distinctive feature of FBPIC is to use a spectral decomposition in cylindrical geometry (Fourier-Bessel decomposition) for the fields. This combines the advantages of spectral 3D PIC codes (high accuracy and stability) and those of finite-difference cylindrical PIC codes (orders-of-magnitude speedup when compared to 3D simulations). For more details on the algorithm, its advantages and limitations, see the documentation.

Language and hardware

FBPIC is written entirely in Python, but uses Numba Just-In-Time compiler for high performance. In addition, the code can run on CPU (with multi-threading) and on GPU. For large simulations, running the code on GPU can be much faster than on CPU.

Advanced features of laser-plasma acceleration

FBPIC implements several useful features for laser-plasma acceleration, including:

  • Moving window
  • Cylindrical geometry (with azimuthal mode decomposition)
  • Calculation of space-charge fields at the beginning of the simulation
  • Intrinsic mitigation of Numerical Cherenkov Radiation (NCR) from relativistic bunches
  • Field ionization module (ADK model)

In addition, FBPIC supports the boosted-frame technique (which can dramatically speed up simulations), and includes:

  • Utilities to convert input parameters from the lab frame to the boosted frame
  • On-the-fly conversion of simulation results from the boosted frame back to the lab frame
  • Suppression of the Numerical Cherenkov Instability (NCI) using the Galilean technique

Installation

The installation instructions below are for a local computer. For more details, or for instructions specific to a particular HPC cluster, see the documentation.

The recommended installation is through the Anaconda distribution. If Anaconda is not your default Python installation, download and install it from here.

Installation steps:

  • Install the dependencies of FBPIC. This can be done in two lines:

    conda install numba scipy h5py mkl
    conda install -c conda-forge mpi4py
    
  • Download and install FBPIC:

    pip install fbpic
    

    (If you want to run FBPIC through the PICMI interface, you can instead use pip install fbpic[picmi]. FBPIC currently supports picmistandard up to version 0.34.0.)

  • Optional: in order to run on GPU, install the additional package cupy — e.g. using CUDA version 11.8. (The command below also automatically installs cudatoolkit which is also needed by FBPIC.)

    conda install cupy cuda-version=11.8
    

    (In the above command, you should choose a CUDA version that is compatible with your GPU driver ; see this table for more info.)

    If you want to use CUDA version 12+ which no longer comes with the cudatoolkit package, explicit installation of cuda-nvcc and cuda-nvrtc is required

    conda install cupy cuda-version=12.0 cuda-nvcc cuda-nvrtc
    
  • Optional: in order to run on a CPU which is not an Intel model, you need to install pyfftw, in order to replace the MKL FFT:

    conda install -c conda-forge pyfftw
    

Running simulations

Once installed, FBPIC is available as a Python module on your system.

Therefore, in order to run a physical simulation, you will need a Python script that imports FBPIC's functionalities and use them to setup the simulation. You can find examples of such scripts in the documentation or in this repository, in docs/source/example_input/.

Once your script is ready, the simulation is run simply by typing:

python fbpic_script.py

The code outputs HDF5 files, that comply with the OpenPMD standard, and which can thus be read as such (e.g. by using the openPMD-viewer).

Contributing

We welcome contributions to the code! Please read this page for guidelines on how to contribute.

Research & Attribution

FBPIC was originally developed by Remi Lehe at Berkeley Lab, and Manuel Kirchen at CFEL, Hamburg University. The code also benefitted from the contributions of Soeren Jalas (CFEL), Kevin Peters (CFEL), Irene Dornmair (CFEL), Laurids Jeppe (CFEL), Igor Andriyash (Laboratoire d'Optique Appliquee), Omri Seemann (Weizmann Institute), Daniel Seipt (University of Michigan), Samuel Yoffe (University of Strathclyde), David Grote (LLNL and LBNL) and Anton Golovanov (Weizmann Institute).

FBPIC's algorithms are documented in following scientific publications:

If you use FBPIC for your research project: that's great! We are very pleased that the code is useful to you!

If your project even leads to a scientific publication, please consider citing at least FBPIC's original paper. If your project uses the more advanced algorithms, please consider citing the respective publications in addition.

Metadata

Release files for fbpic 0.27.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fbpic 0.27.1
File Size Uploaded
fbpic-0.27.1.tar.gz 284.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fbpic 0.27.1
File Interpreter ABI Platform
fbpic-0.27.1-py3-none-any.whl Python 3 none any Details

Total release size: 590.3 kB

Release files / fbpic-0.27.1.tar.gz

Download URL fbpic-0.27.1.tar.gz
Size 284.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d50b051d84fe1ff7fa8ac302aac3f88ec2c3af07ed65e4d8b7dcfbec9e6081c6
BLAKE2b-256 checksum
How to use checksums
baea0edf0ea2fa86241f4bdd8fae0a7d61ae55f56df76b7e1fd1c5e60a285e00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / fbpic-0.27.1-py3-none-any.whl

Download URL fbpic-0.27.1-py3-none-any.whl
Size 305.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
906ad9ca4a2a10fde2f052805ec3fba0c84b4bec014e7078c6eb0cee564ef041
BLAKE2b-256 checksum
How to use checksums
bc39300a34bcc4ac3d6110b321db4b6df351d9d52715e01d58ce4403d1144a53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.27.1 This release

2 release files

0.27.0

2 release files

0.26.1

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.22.0

2 release files

0.20.1

2 release files

0.19.1

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.14.0

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.12.0

2 release files

0.10.0

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page