WarpX Geometry
Simple geometry objects for WarpX embedded boundaries.
Combine shapes in Python, and warpx-geometry writes the analytic expressions that WarpX needs for the geometry and for the voltage on each conductor, in Cartesian (XYZ) and cylindrical (RZ) coordinates.
Read the documentation for the guides, examples and API reference.
Gallery
An einzel lens followed by a suppressor ring and a Faraday cup, built in RZ
(einzel_lens_faraday_cup.py):
The potential of an einzel lens, solved with WarpX
(warpx_einzel_lens.py):
"warpX" built from boxes, rotated boxes and hollow cylinders
(warpx_letters.py):
Installation
With uv:
uv pip install warpx-geometry
uv pip install "warpx-geometry[viz]" # for 3D plots
With pip:
pip install warpx-geometry
pip install "warpx-geometry[viz]" # for 3D plots
Example
from warpx_geometry import CylinderZ_hollow, Geometry
# dimensions in m
lens = CylinderZ_hollow(0.011, 0.009, -0.005, 0.005, name="lens", default_voltage=5000)
tube = CylinderZ_hollow(0.030, 0.028, -0.05, 0.05, name="tube")
geometry = Geometry(lens + tube, rz=True)
eb_function = str(geometry) # warpx.eb_implicit_function
potential = geometry.to_potential_expr() # warpx.eb_potential(x,y,z,t)
Using AI assistants
The repository includes a skill that teaches AI assistants how to use the package. See Using AI assistants.
Contributing
Contributions are welcome. See the development guide, and open an issue for questions or problems.
Citation
If you use this package in your research, please cite:
@software{warpx_geometry,
author = {Persaud, Arun},
title = {WarpX Geometry: Simple geometry objects for WarpX},
url = {https://github.com/BLAST-WarpX/warpx-geometry},
year = {2026}
}
License
WarpX Copyright (c) 2018, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov.
Please see the full license agreement in LICENSE.txt.
Please see the notices in NOTICE.txt.
The SPDX license identifier is BSD-3-Clause-LBNL.
Metadata
Release files for warpx-geometry 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| warpx_geometry-0.4.0.tar.gz | 24.1 kB | With provenance | Details for warpx_geometry-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| warpx_geometry-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for warpx_geometry-0.4.0-py3-none-any.whl |
Total release size: 51.0 kB
Release files / warpx_geometry-0.4.0.tar.gz
| Download URL | warpx_geometry-0.4.0.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
804b43d2affe7574e0dad6785c79ea06a7a1f6e0d10b4d316ef24c2a3b0219b2
|
|
BLAKE2b-256 checksum How to use checksums |
754227ce649b5bb051e9303fbf3ba646536b3f0398fe069c473ca7ab90a2bb6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logRelease files / warpx_geometry-0.4.0-py3-none-any.whl
| Download URL | warpx_geometry-0.4.0-py3-none-any.whl |
|---|---|
| Size | 26.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83f7cf64367e1cad8ec9299bf7a6810c3e5e1bba77ffb6cb07537600dce60aa3
|
|
BLAKE2b-256 checksum How to use checksums |
d9569938e88add83c59e6727f58d76e905691062c78b0d38fe8d97fbdb1c5263
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logSecurity for warpx-geometry 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for warpx_geometry-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.