You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TPC: High-Performance Two-Point Correlation Function Computation in JAX/PyTorch (GPU/TPU)
📖 Overview
TPCFLib is a high-performance Python library for computing the Two-Point Correlation Function (TPCF) $S_2(r)$ of 3D porous materials and binary microstructures. The library provides accelerated computation using both PyTorch and JAX backends, offering significant speedups over conventional implementations.
The two-point correlation function $S_2(r)$ is defined as:
where $I(\mathbf{x})$ is the indicator function of the phase of interest at position $\mathbf{x}$, and $\langle \cdot \rangle$ denotes ensemble averaging.
🚀 Features
Multi-Backend Support: Choose between PyTorch and JAX for optimal performance
Batch Processing: Efficient computation on multiple 3D volumes simultaneously
Porous Media Datasets: Built-in access to standard porous media datasets
GPU/TPU Acceleration: Automatic GPU/TPU utilization when available (using JAX for TPU)
📦 Installation
Installation
git clone https://github.com/MhmdEsml/TPC.git
cd TPC
pip install -e .
About
TPC is a specialized Python library for accelerated computation of Two-Point Correlation Functions (TPC) in 3D porous materials and microstructures. It provides significant performance improvements over conventional implementations through multi-backend support (PyTorch and JAX) and GPU/TPU acceleration.