Skip to main content

A Python library for particle-in-cell plasma simulation.

Project description


Actions Status PyPI version PyPI platforms

$\pi$-PIC (PIPIC, Python-controlled Interactive PIC) is an open-source collection of relativistic particle-in-cell solvers featuring

  • exact energy conservation;
  • absence of numerical dispersion.

The solvers provide a way to either suppress or eliminate numerical artefacts (instabilities, heating, numerical Cherenkov radiation, etc.) permitting larger space and time steps, as well as lower number of particles per cell. Because of reduced computational demands, the solvers can be found useful for quick tests of ideas, as well as for scanning parameter spaces. For a description of the underlying methods see Reference.


Overview

$\pi$-PIC provides all tools necessary for designing 1D/2D/3D simulations and arbitrary outputs directly from Python. In addition, it has interfaces for incorporating extensions (read/modify field and particles, add/remove particles) that can be developed in Python, C/C++, Fortran or any other language that generate callable functions (see extensions for a list of extensions included in $\pi$-PIC installation). The project and its development are hosted on GitHub.

To get started, it should for most cases be sufficient to install $\pi$-PIC via pip (this requires: gcc, openmp and fftw3; for details and information on compilation via CMake see installation instructions):

pip install pipic

The basic layout of a simulation includes five elements:

  • creating a container with cells with given parameters
  • adding particles of all necessary types
  • setting initial electromagnetic field
  • defining output (via loops over particles and grid values of field)
  • advance and read the state of the defined physical system

We demonstrate the use of these elements in the tutorial. A complete list of supported interfaces can be found here. The development of extensions is detailed and exemplified here.

New in $\pi$-PIC v1.1

  • extensions for QED-PIC simulations (qed_volokitin2023, qed_gonoskov2015)
  • extension for ensemble down-sampling (downsampler_gonoskov2022)

See all releases here.

Reference

A. Gonoskov, Explicit energy-conserving modification of relativistic PIC method, J. Comput. Phys., 502, 112820; arXiv:2302.01893 (2024).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipic-1.1.tar.gz (225.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page