Skip to main content

Particle-in-cell library for plasma physics

Project description

PIC Simulation Library

Introduction

libpic is a high-performance Particle-In-Cell (PIC) simulation framework implemented in Python. The core functionalities of libpic include electromagnetic field solvers, particle pushers, interpolators, and current depositors.

libpic serves as the backend for λPIC (will be released soon). Performance optimizations are achieved through the use of Numba JIT and Cython.

This project is under construction.

Project Roadmap

  • Functionalities
    • Maxwell solver
    • Particle pusher
    • Interpolator
    • Current depositor
    • QED
      • Photon emission
      • Pair production
    • CPML boundary
    • Collision
    • Nuclear physics
  • Replace Numba JIT and Cython with C extensions
    • Current depositor
    • Patch synchronizer
    • Maxwell solver
    • Particle pusher
      • unified pusher
    • Interpolator
    • sorter
    • PML
  • Remove dependence on numba.typed.List
  • MPI
  • 3D
    • QED
  • GPU acceleration
  • Documentation

Installation

From PyPI:

pip install libpic

From source:

git clone https://github.com/xsgeng/libpic.git
pip install -e ./libpic

Core Classes

classDiagram
    Patches --> Patch : contains

    Patch --> ParticlesBase : contains
    Patch --> Fields : contains
    Patch --> PML : contains

    Patch <|-- Patch2D~Patch~
    Patch <|-- Patch3D~Patch~

    RadiationBase --> Patches : contains
    PairProductionBase --> Patches : contains
    CurrentDeposition --> Patches : contains
    PusherBase --> Patches : contains
    FieldInterpolation --> Patches : contains
    MaxwellSolver --> Patches : contains

    Pydantic.BaseModel <|-- Species
    Species <|-- XXX~Species~
    Species <|-- Electron~Species~
    Species --> ParticlesBase : creates

    class Patch {
        index: int
        *_neighbor_index: int
    }

    class Patches {
        sync_particles()
        sync_guard_fields()
        sync_currents()
    }

    class ParticlesBase {
        x,y,z ...: NDArray[float]
        is_dead: NDArray[bool]
    }

    class Fields {
        ex, ey, ...: NDArray[float]
    }

    class Species {
        name, q, m, ...
        density: Callable
    }

Acknowledgments

This work was supported by the National Natural Science Foundation of China (NSFC) under Grant No. 12304384.

This project was inspired by and adapted elements from the EPOCH and the Smilei projects.

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

libpic-0.0.15.tar.gz (104.8 kB view details)

Uploaded Source

File details

Details for the file libpic-0.0.15.tar.gz.

File metadata

  • Download URL: libpic-0.0.15.tar.gz
  • Upload date:
  • Size: 104.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for libpic-0.0.15.tar.gz
Algorithm Hash digest
SHA256 3422e653d7bf2690838844913fbf663da459b7daec85a399409ddd3c6beeaf1b
MD5 699a6dfa33f11eb92be309dead5f21fc
BLAKE2b-256 17baf9a63ec18ae59b08fb23149da2838c2ca529677987d90230551b66a0680c

See more details on using hashes here.

Provenance

The following attestation bundles were made for libpic-0.0.15.tar.gz:

Publisher: python-publish.yml on xsgeng/libpic

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page