iTensor Documentation

Tensor calculus tools for physics, relativity, and fluid dynamics

What is iTensor?

iTensor is a specialized platform for tensor calculus that computes Christoffel symbols, Ricci tensors, and Einstein tensors from any metric you define. Unlike general computer algebra systems, iTensor focuses specifically on differential geometry calculations needed in physics and engineering.

The platform supports both symbolic derivations (showing mathematical steps) and numerical computations (for application to real data). This makes it suitable for education, research, and practical applications in gravitational physics, fluid dynamics, and electromagnetism.

Symbolic Tensor Calculus

The symbolic engine leverages SymPy to manipulate tensor expressions algebraically. Define tensors with symbolic components and perform operations like addition, multiplication, and contraction to derive exact results. Example: Calculate the Einstein tensor for a Kerr metric to analyze black hole properties.

Numerical Tensor Calculus

The numerical module computes tensor field values on discrete grids. Define custom curvature tensors and visualize their components or invariants. This enables simulation of non-standard metrics beyond analytical solutions, opening paths for numerical relativity research.

Black Hole Visualization

The C-based raytracing backend calculates light paths through curved spacetime. Based on precise integration of geodesic equations, it visualizes:

  • Event horizons and ergospheres in Schwarzschild and Kerr metrics
  • Gravitational lensing of background stars and accretion disks
  • Relativistic Doppler and gravitational redshift effects
  • Photon orbits at different impact parameters
  • Frame-dragging effects from rotating black holes

Target Audience

For Students

Learn general relativity and tensor calculus with interactive tools that show each step of the calculation. Check your work by comparing with built-in solutions for standard problems.

For Researchers

Calculate tensor quantities for custom metrics, simulate plasma behavior with MHD, and visualize results with publication-quality output. Export to LaTeX or Python formats.

Getting Started

pip install itensorpy

After installation, run your first calculation:

from itensorpy import Metric # Define Schwarzschild metric schwarzschild = Metric.schwarzschild() # Calculate and print the Ricci tensor components ricci = schwarzschild.compute_ricci_tensor() print(ricci.display())