Spectral, quasi-3D Particle-In-Cell for CPU and GPU
Fourier-Bessel Particle-In-Cell code (FBPIC)
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.
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
The installation instructions below are for a local computer. For more details, or for instructions specific to a particular HPC cluster, see the documentation.
- 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
- Optional: in order to run on GPU, install the additional package
cupy-- e.g. using CUDA version 10.0.
conda install cudatoolkit=10.0 pip install cupy-cuda100
(In the above command, you should choose a CUDA version that is compatible with your GPU driver ; see this table for more info.)
- 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
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
Once your script is ready, the simulation is run simply by typing:
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), Igor Andriyash (Weizmann Institute), Omri Seemann (Weizmann Institute), Daniel Seipt (University of Michigan) and Samuel Yoffe (University of Strathclyde).
FBPIC's algorithms are documented in following scientific publications:
- General description of FBPIC and it's algorithm (original paper): R. Lehe et al., CPC, 2016 (arXiv)
- Boosted-frame technique with Galilean algorithm: M. Kirchen et al., PoP, 2016 (arXiv) and Lehe et al., PRE, 2016 (arXiv)
- Parallel finite-order solver for multi-CPU/GPU simulations: S. Jalas et al., PoP, 2017 (arXiv)
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.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size fbpic-0.15.0-py3-none-any.whl (255.1 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size fbpic-0.15.0.tar.gz (195.8 kB)||File type Source||Python version None||Upload date||Hashes View hashes|