warpica
Numerical spacetime metrics, stress-energy tensors and sampled energy-condition
analysis in Python. warpica is a port of
WarpFactory, the MATLAB
toolkit for analysing warp-drive geometries.
Credit to WarpFactory
All of the physics, the algorithms and the structure of this package come from WarpFactory, created by Christopher Helmerich and Jared Fuchs, with contributions from Alexey Bobrick, Luke Sellers, Brandon Melcher, Justin Feng and Gianni Martire. This is an independent port, not an official WarpFactory release, and the WarpFactory authors have not reviewed it. WarpFactory is MIT licensed, as is this project.
If you use this code in published work, please cite the WarpFactory paper, as its authors ask:
C. Helmerich, J. Fuchs, A. Bobrick, L. Sellers, B. Melcher and G. Martire, "Analyzing warp drive spacetimes with Warp Factory", Classical and Quantum Gravity (2024), doi:10.1088/1361-6382/ad2e42, arXiv:2404.03095.
The authors also describe the solver, analyser and optimiser modules in arXiv:2404.10855. To cite this port itself, see CITATION.cff.
What it does
- Metrics: Minkowski, Alcubierre, Lentz, Modified Time, Van Den Broeck,
Schwarzschild and a spherical warp shell (plus comoving variants), a
custom_metricbuilder from lapse, shift and spatial metric, and 3+1 decomposition helpers. - Solver: the stress-energy tensor of any sampled metric, with second- or fourth-order finite differences, in SI units.
- Analyser: null, weak, strong and dominant energy conditions sampled over directions, expansion, shear and vorticity scalars, momentum flow lines, index changes and frame transfers.
- Visualiser: Matplotlib slices of metric and tensor components.
Quick start
Requires Python 3.11 or newer.
pip install "warpica[plot]"
The plot extra adds Matplotlib. To work on the code, install from a checkout:
git clone https://github.com/Francesco-Cini/warpica
cd warpica
python -m venv .venv
.venv/bin/python -m pip install -e ".[plot]" # Windows: .venv\Scripts\python.exe
import numpy as np
from warpica.metrics import metric_get_alcubierre
from warpica.analyser import eval_metric
grid = np.array([1, 9, 9, 9]) # (time, x, y, z) samples
spacing = np.array([1.0, 0.5, 0.5, 0.5]) # seconds and metres
centre = (grid + 1) / 2 * spacing
metric = metric_get_alcubierre(grid, centre, v=0.2, R=1, sigma=2, grid_scale=spacing)
result = eval_metric(metric, num_angular_vec=24, num_time_vec=4)
print(result["weak"].min()) # negative: the condition is violated
The quickstart walks through this step by step.
Stability
The CPU path is stable and is what the 1.x compatibility promise covers. The CUDA (CuPy) and DirectML backends are experimental: DirectML has been tested on one AMD RX 580, and CUDA has never been run on NVIDIA hardware. See GPU validation.
Results are checked against MATLAB WarpFactory on ten reference cases, and the places where this port deliberately differs are listed and justified in MATLAB comparisons. Read that page before comparing numbers with published WarpFactory results.
Documentation
- Hosted site: https://francesco-cini.github.io/warpica/
- Quickstart and concepts (tensor layout, units, indexing)
- How it works: the pipeline and a glossary of the symbols
- Moving from MATLAB WarpFactory
- Public API and plotting
- Runnable examples
- Versioning and support policy
- MATLAB comparisons and intentional differences
- GPU precision, hardware tests and benchmark
- Testing guide, development checks
- Changelog · Contributing
Licence
MIT. See LICENSE.
Metadata
Release files for warpica 1.0.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 |
|---|---|---|---|---|
| warpica-1.0.0.tar.gz | 488.7 kB | With provenance | Details for warpica-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| warpica-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for warpica-1.0.0-py3-none-any.whl |
Total release size: 582.1 kB
Release files / warpica-1.0.0.tar.gz
| Download URL | warpica-1.0.0.tar.gz |
|---|---|
| Size | 488.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a67eab896388139aa664a8d74e4598c2bbc5a4766cdc88bcab4c8d23245c838c
|
|
BLAKE2b-256 checksum How to use checksums |
29545abaad49a8081ac54840aafcb2b6f9f62e5bbfc34d3ca4d58d1ce46f3f00
|
| 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 Nov 12, 2026.
Transparency logRelease files / warpica-1.0.0-py3-none-any.whl
| Download URL | warpica-1.0.0-py3-none-any.whl |
|---|---|
| Size | 93.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a848f8ffad504fc7f4a2d29584b9d859ecf2654d6545e98e0483c671ec7bf717
|
|
BLAKE2b-256 checksum How to use checksums |
2421ba7500cfff6948c785fe23f4c552ea90746861bbe4e7c075fca854ed37fd
|
| 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 Nov 12, 2026.
Transparency logSecurity for warpica 1.0.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 warpica-1.0.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 Nov 12, 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.