Metadata-Version: 2.1
Name: polymath-physics
Version: 2.0.1
Summary: A world-class polymorphic physics and calculus engine backed by Triton and SymPy.
Author: Antigravity
Author-email: Antigravity <AI@google.com>
Description-Content-Type: text/markdown
Requires-Dist: sympy >=1.10.0
Provides-Extra: gpu
Requires-Dist: torch ; extra == 'gpu'
Requires-Dist: triton ; extra == 'gpu'

# Polymath Physics

A world-class, heavily optimized, polymorphic physics and calculus engine backed by Triton GPU parallelization and SymPy's Exact Computer Algebra System (CAS).

## Key Features

1. **True Polymorphism**: Pass raw `floats` for blistering bare-metal speed, pass `Vector3D` objects for spatial mechanics, or pass `sympy.Symbol` variables to generate exact algebraic equations. 
2. **Deep Calculus Integration**: The engine doesn't just calculate numbers—it calculates equations. You can pass abstract algebraic positions and natively derive exact velocity and acceleration formulas.
3. **Strict Domain Gatekeeping**: `polymath-physics` intercepts invalid physics requests (like passing negative masses or 3D vectors into scalar fields) with strict, polymorphic type-checking before the math ever crashes.
4. **GPU Acceleration (Opt-in)**: For massive N-Body simulations and fluid dynamics, the library falls back onto highly parallelized Triton GPU kernels.

## Installation

Install the core library (Zero external dependencies outside of `sympy`):
```bash
pip install polymath-physics
```

Install with massive parallel GPU acceleration enabled (Requires CUDA):
```bash
pip install polymath-physics[gpu]
```

## Quick Start: The Power of Polymorphism

### 1. Bare-Metal Speed
When you need raw performance, just pass standard floats. The engine evaluates it instantly.
```python
from physics.astrophysics.cosmology import schwarzschild_radius

# Calculate the Event Horizon of a black hole with mass 1.989e30 kg
r = schwarzschild_radius(mass=1.989e30)
print(r) # Returns: 2953.25 meters
```

### 2. Exact Calculus & Algebra
By combining `polymath-physics` with `SymPy`, you can derive exact mathematical formulas instead of just numeric answers. 
```python
from physics.solver import AlgebraicSolver
from physics.mechanics.calculus_kinematics import derive_velocity

# Create a variable 't' for time
t = AlgebraicSolver.create_symbol('t')

# Define an abstract position equation: p(t) = 5t^3 + 2t
position_eq = 5*(t**3) + 2*t

# Natively derive the exact algebraic velocity curve!
velocity_eq = derive_velocity(position_eq, time_symbol=t)
print(velocity_eq) # Returns: 15*t**2 + 2
```

### 3. Strict Physics Guardrails
Our built-in `PhysicsDomainError` strictly prevents invalid concepts (like negative mass) from polluting your calculations.
```python
from physics.astrophysics.cosmology import schwarzschild_radius

# This will immediately raise a PhysicsDomainError!
schwarzschild_radius(mass=-500) 
```

## Architecture
`polymath-physics` spans across dozens of graduate-level domains, including:
- Classical Mechanics & Calculus Kinematics
- Quantum Mechanics & Plasma Physics
- General Relativity & Cosmology
- Advanced Fluid Dynamics & Thermodynamics

## Complete API Reference
For an exhaustive list of all 100+ functions available in this library, please refer to the [API Reference](https://github.com/your-repo/physics/blob/main/API_REFERENCE.md) (or see the included API_REFERENCE.md file).
