PyCharge Documentation#

PyCharge is an electromagnetics simulation library for moving point charges built on JAX.

Key Features#

⚡️ Point Charge Electrodynamics

Compute relativistically-correct electromagnetic potentials and fields generated by moving point charges.

⚛️ Self-Consistent N-Body Electrodynamics

Simulate the dynamics of electromagnetic sources—such as free charges and dipoles—interacting through their self-generated fields.

🔥 Powered by JAX

Leverage JAX’s just-in-time (XLA) compilation for GPU/TPU acceleration, vectorization, and scalable parallel execution.

🛠️ Fully Differentiable

End-to-end differentiability enables gradient-based optimization, control, and inverse design workflows.

Get Started Quickly#

New to PyCharge?

Begin with the Quickstart to install PyCharge, run your first simulation, and learn the core ideas in a few minutes.

Curious about the theory?

See the User Guide for the underlying electromagnetics and how they map onto the code.

Need examples?

Explore the Examples gallery for ready-to-run notebooks covering common setups and workflows.

Looking for API details?

Use the API Reference for documentation of all functions and classes.

Installation#

PyCharge is available on PyPI and can be installed with:

pip install pycharge

Contributing#

We welcome contributions! See our Contributing Guide for details.

Citing PyCharge#

If you use PyCharge in your research, please cite our paper.

License#

PyCharge is distributed under the MIT License. See the LICENSE file for more details.