Package: fbpic
Fourier-Bessel Particle-In-Cell code (FBPIC)Online documentation:http://fbpic.github.ioSupport:Join slackOverviewFBPIC is aParticle-In-Cell (PIC) codefor relativistic plasma physics.It is especially well-suited for physical simulations oflaser-wakefield accelerationandplasma-wakefield acceleration, with close-to-cylindrical symmetry.AlgorithmThe distinctive feature of FBPIC is to use
aspectral decomposition in
cylindrical geometry(Fourier-Bessel
decomposition) for the fields. This combines the advantages ofspectral 3DPIC codes (high accuracy and stability) and
those offinite-difference cylindricalPIC codes
(orders-of-magnitude speedup when compared to 3D simulations).
For more details on the algorithm, its advantages and limitations, see
thedocumentation.Language and hardwareFBPIC is written entirely in Python, but usesNumbaJust-In-Time compiler for high
performance. In addition, the code can run onCPU(with multi-threading)
and onGPU. For large simulations, running the
code on GPU can be much faster than on CPU.Advanced features of laser-plasma accelerationFBPIC implements several useful features for laser-plasma acceleration, including:Moving windowCylindrical geometry (with azimuthal mode decomposition)Calculation of space-charge fields at the beginning of the simulationIntrinsic mitigation of Numerical Cherenkov Radiation (NCR) from relativistic bunchesField ionization module (ADK model)In addition, FBPIC supports theboosted-frametechnique (which can
dramatically speed up simulations), and includes:Utilities to convert input parameters from the lab frame to the boosted frameOn-the-fly conversion of simulation results from the boosted frame back to the lab frameSuppression of the Numerical Cherenkov Instability (NCI) using the Galilean techniqueInstallationThe installation instructions below are for a local computer. For more
details, or for instructions specific to a particular HPC cluster, see
thedocumentation.The recommended installation is through theAnacondadistribution.
If Anaconda is not your default Python installation, download and install
it fromhere.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 mpi4pyDownload and install FBPIC:pip install fbpic(If you want to run FBPIC through thePICMIinterface, you can instead usepip install fbpic[picmi].)Optional:in order to run on GPU, install the additional packagecudatoolkitandcupy-- 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 ; seethis tablefor more info.)Optional:in order to run on a CPU which isnotan Intel model, you
need to installpyfftw, in order to replace the MKL FFT:conda install -c conda-forge pyfftwRunning simulationsOnce installed, FBPIC is available as aPython moduleon your
system.Therefore, in order to run a physical simulation, you will need aPython
scriptthat imports FBPIC's functionalities and use them to setup the
simulation. You can find examples of such scripts in thedocumentationor in this repository, indocs/source/example_input/.Once your script is ready, the simulation is run simply by typing:python fbpic_script.pyThe code outputs HDF5 files, that comply with theOpenPMD standard,
and which can thus be read as such (e.g. by using theopenPMD-viewer).ContributingWe welcome contributions to the code! Please readthis pagefor guidelines on how to contribute.Research & AttributionFBPIC was originally developed by Remi Lehe atBerkeley Lab,
and Manuel Kirchen atCFEL, 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: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) andLehe et al., PRE, 2016(arXiv)Parallel finite-order solver for multi-CPU/GPU simulations:S. Jalas et al., PoP, 2017(arXiv)Parallel finite-order boosted-frame simulations for multi-CPU/GPU simulations:M. Kirchen et al., PRE, 2020If 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.