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, the documentation 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 all implemented Python interfaces functions can be found here. The development of extensions is detailed here and exemplified here.

The implementation of new solvers is exemplified here.

New in $\pi$-PIC v1.3

The following updates has been made for $\pi$-PIC v.3. For more details see Ref.[2].

  • extension for moving window simulations.
  • extension for absorbing boundaries.
  • Improved structure for handeling fields and particles in C++ extensions.
  • An energy conserving solver with improved momentum conservation emc.

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

[1] A. Gonoskov, Explicit energy-conserving modification of relativistic PIC method, J. Comput. Phys., 502, 112820; arXiv:2302.01893 (2024).
[2] F. Brogren, $\pi$-PIC: a framework for modular particle-in-cell developments and simulations, arXiv:2511.09950 (2025).

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pipic-1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pipic-1.3-cp313-cp313-macosx_14_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pipic-1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pipic-1.3-cp312-cp312-macosx_14_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pipic-1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pipic-1.3-cp311-cp311-macosx_14_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pipic-1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pipic-1.3-cp310-cp310-macosx_14_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: pipic-1.3.tar.gz
  • Upload date:
  • Size: 266.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipic-1.3.tar.gz
Algorithm Hash digest
SHA256 40448582c0013495af51bd87a3a244807bd10d4a886386d23b360bc29604cb00
MD5 7734cbb461af591b66b3e23fd405cae3
BLAKE2b-256 2487eba48d6c2727292ca7c5c61d884c3ae1477411c531940c44cfa44bae6f34

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3.tar.gz:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pipic-1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 117a1178041b2a104f5220b3a0218422dddd1cc1cea040a054015a4e2c1ca053
MD5 6a63c35f3d90daa0f3fd0755096dca84
BLAKE2b-256 14500e4bdcb96d89c8fa6c426cb94d6bcdb3098cbfe3a79252f8608d1214076b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

  • Download URL: pipic-1.3-cp313-cp313-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.13, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipic-1.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d3d93351e1a6da244d8f623b571b04607dacaa47c2f63242abd0d91fc0f20ade
MD5 13ef531f2925d32b73a0707061999965
BLAKE2b-256 2c5a4cbe1989fb7ba28798a9a1f0d68d313b4ecfa0110bdb629e8a2a2cdd8667

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pipic-1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6941a11265235941842738eea65f8cc0467374c1919da94544645bb83e4762b5
MD5 fb0ba1921a015d8db5ed1e449f9be9c5
BLAKE2b-256 b4b5c6cbd81f4518b1a2117f3a1cab77e88544fb7309c2db435fc0a132c2de60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

  • Download URL: pipic-1.3-cp312-cp312-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.12, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipic-1.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ccb9c4ba496b8984ead1c7ef53e841406fdcc7aaec0c05b0e9030d0299fa99a9
MD5 f54d9b1c23c043038ef8a4c64de610b1
BLAKE2b-256 8f7b83b922f41fe28d4385ad872a86e2b9c311001f80fe9098d721d2dcef735c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pipic-1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 013b3716446f20749a480972021fb6d0895e89c1650199c54f98b21d6efe0bf3
MD5 73485b94cb008852613049c632372a88
BLAKE2b-256 72918402eead735241e5e9fe5f4b03e7e345b42e36ba32c089fdf596a0bab92d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

  • Download URL: pipic-1.3-cp311-cp311-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.11, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipic-1.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 de60ddcbb5650703fb97c78f92ff9fb2f769cbc414e17d8e58f1804728d2ae86
MD5 f08c6315757fbf91cbe3222ac8a7269d
BLAKE2b-256 6ec850b70bf1b0d3dab9d9b8cd67fd2908d453bf02cf73aea7c2f53c4bdce379

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pipic-1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 383cab595f32827a858cb3c9dd74b160fed2b428e2c35d74892806272f53f05b
MD5 0ec8c426c6ff2e0e08b3262d525426b3
BLAKE2b-256 edc0461c03a335525111ce45376f3822bd34add8f8c12af0b80ff0fdf50621bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipic-1.3-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

  • Download URL: pipic-1.3-cp310-cp310-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.10, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pipic-1.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3816e00995dbe29b62fc4782930df35604282e4c896a6e5a8c47dfb5b2e90aaf
MD5 a7c7ce832fc073b1f3a7b4773cc58b5a
BLAKE2b-256 cafd9efd29013b0485d25766012b33b4d419e3134076b807cd95def6d7f2c3bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipic-1.3-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: deploy.yml on hi-chi/pipic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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