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 or a presentation at PIF24.


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.2

  • options for energy correction routine in ec and ec2 (see docs/guides/INTERFACES.md)
  • extension for initializing arbitrary tightly focused pulses, e.g. dipole waves (focused_pulse)

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.2.tar.gz (229.9 kB view details)

Uploaded Source

File details

Details for the file pipic-1.2.tar.gz.

File metadata

  • Download URL: pipic-1.2.tar.gz
  • Upload date:
  • Size: 229.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pipic-1.2.tar.gz
Algorithm Hash digest
SHA256 6bd4b1296d602490f783775d29e0d6155e35d80bf7e1c010f0e0c4a098073239
MD5 d3edb3a84f2184c06ca1c1d6eb129e5b
BLAKE2b-256 d4f5c9292492584d0b62c667b7bbd6fa0659c8b655c1aa3d013129a2d175eee7

See more details on using hashes here.

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