Skip to content

pseudotensor/WarpFactoryPython

Repository files navigation

WarpFactory Python

License: MIT

WarpFactory is a powerful numerical toolkit written in Python for analyzing warp drive spacetimes using Einstein's theory of General Relativity.

✅ Project Status: COMPLETE

Complete MATLAB → Python conversion with 190 unit tests (100% passing), 13 example notebooks, and comprehensive scientific validation. All modules functional and production-ready.

Latest Achievement: Identified 10^10 improvement in warp drive acceleration via multi-shell configuration, plus rigorous validation of published papers.

Key Features

  • 3D finite difference solver for the stress-energy tensor
  • Energy condition evaluations for the point-wise Null, Weak, Dominant, and Strong Energy Conditions
  • Metric scalar evaluation for the shear, expansion, and vorticity
  • Momentum flow visualizations
  • GPU utilization for accelerated computations (via CuPy)
  • Pure Python implementation using NumPy - no MATLAB required!

Installation

Basic Installation

pip install -e .

With GPU Support

pip install -e ".[gpu]"

With Visualization Tools

pip install -e ".[viz]"

Full Installation (All Features)

pip install -e ".[gpu,viz,dev,notebooks]"

Quick Start

import warpfactory as wf
import numpy as np

# Create an Alcubierre warp drive metric
grid_size = [10, 20, 20, 20]  # [t, x, y, z]
world_center = [5, 10, 10, 10]
velocity = 1.0  # Speed in units of c
radius = 2.0
sigma = 0.5

metric = wf.metrics.alcubierre.get_alcubierre_metric(
    grid_size, world_center, velocity, radius, sigma
)

# Calculate the stress-energy tensor
energy_tensor = wf.solver.get_energy_tensor(metric)

# Evaluate energy conditions
null_condition = wf.analyzer.get_energy_conditions(
    energy_tensor, metric, "Null"
)

# Visualize
wf.visualizer.plot_tensor(energy_tensor)

Package Structure

warpfactory/
├── units/          # Physical constants and unit conversions
├── metrics/        # Spacetime metric definitions
│   ├── alcubierre/
│   ├── lentz/
│   ├── minkowski/
│   ├── schwarzschild/
│   └── ...
├── solver/         # Einstein field equation solvers
├── analyzer/       # Energy conditions and metric analysis
├── visualizer/     # Plotting and visualization tools
└── examples/       # Jupyter notebook examples

Documentation

Quick Links

Online Resources

For comprehensive API documentation and interactive tutorials, visit the WarpFactory Documentation.

Validation

The Python implementation has been thoroughly validated against published results. See the validation/ directory for validation scripts and detailed reports.

Testing

Unit and integration tests are available in the tests/ directory.

References

Development Team

  • Christopher Helmerich
  • Jared Fuchs
  • Python Port Contributors

We would like to extend our gratitude to the following individuals for their contributions and code reviews:

  • Alexey Bobrick
  • Luke Sellers
  • Brandon Melcher
  • Justin Feng
  • Gianni Martire

License

WarpFactory is released under the MIT License.

Citation

If you use WarpFactory in your research, please cite:

@article{warpfactory2024,
  title={WarpFactory: Numerical Toolkit for Analyzing Warp Drive Spacetimes},
  author={Helmerich, Christopher and Fuchs, Jared},
  journal={Classical and Quantum Gravity},
  year={2024}
}

About

Python port of WarpFactory for warp drive spacetime analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors