A high-performance, real-time interactive generator for Tetration (Power Tower) fractals. This project utilizes the Taichi compiler for GPU parallelization and PySide6 to provide a smooth, interactive desktop GUI.
- Real-time Interaction: Pan and zoom smoothly through complex tetration fractals at 60 FPS.
- Parallelization: Computations are written in Python but compiled down to GPU shaders via taichi (supporting CUDA, Vulkan, Metal).
- Continuous Color Mapping: Smooth color mapping using cosine gradients based on pixel escape times.
- High-Resolution Export: Save ultra-high-resolution snapshots (4K, 8K).
- Animation Export: Render a sequence of high-resolution frames for zoom-in videos.
- Python 3.11+
- Taichi (GPU computation kernel)
- PySide6 (Qt Desktop UI framework)
- NumPy & Pillow (Image processing & export)
Note: Due to the underlying dependency on pre-compiled wheels, Taichi requires Python 3.11 or 3.12. Python 3.14 is currently unsupported. If your system runs 3.14, you must use a virtual environment with Python 3.11.
-
Clone the repository:
git clone https://github.com/FlawlessHexagon/Tetration.git cd Tetration -
Set up a Python 3.11 virtual environment:
python3.11 -m venv venv_311 source venv_311/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
A Tetration Fractal is generated by taking a complex number c and raising it to its own power infinitely.
Because the loop relies heavily on logarithms and exponentials, it is significantly more computationally expensive than the traditional Mandelbrot set.
To achieve real-time interactivity, this project uses the taichi JIT compiler. The core computation loop is optimized to calculate loop invariants outside the iteration loop, granting a significant performance boost.
The Reference/ folder contains the original, pure-Python unoptimized scripts created before the Taichi port. These serve as a ground truth for testing the mathematical correctness of the GPU shaders.