Metadata-Version: 2.3
Name: flashquad
Version: 0.1.0
Summary: A user-friendly Python numerical integration library with GPU acceleration
Author: Ze Ouyang, Zijian Yi
Author-email: Ze Ouyang <ze_ouyang@utexas.edu>, Zijian Yi <zijianyi@utexas.edu>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: numpy==2.3.2
Requires-Dist: array-api-compat==1.14.0
Requires-Dist: pytest==9.0.2 ; extra == 'dev'
Requires-Dist: ruff==0.15.8 ; extra == 'dev'
Requires-Dist: ty==0.0.26 ; extra == 'dev'
Requires-Dist: scipy==1.17.1 ; extra == 'dev'
Requires-Dist: torch==2.11.0 ; extra == 'dev'
Requires-Dist: cupy-cuda13x==14.0.1 ; extra == 'dev'
Requires-Dist: jax[cuda13]==0.9.2 ; extra == 'dev'
Requires-Dist: sphinx>=8.0 ; extra == 'docs'
Requires-Dist: myst-parser>=4.0 ; extra == 'docs'
Requires-Dist: sphinx-autodoc2>=0.5 ; extra == 'docs'
Requires-Dist: furo>=2024.8 ; extra == 'docs'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/FlashQuad-dev/flashquad
Project-URL: Documentation, https://flashquad.readthedocs.io
Provides-Extra: dev
Provides-Extra: docs
Description-Content-Type: text/markdown

# FlashQuad

A user-friendly Python numerical integration library with GPU acceleration.

## Installation

We recommend using [uv](https://docs.astral.sh/uv/):
```bash
uv add flashquad
uv sync
```
or directly install:

```bash
uv pip install flashquad
```

## Quick start

```python
import numpy as np
from flashquad import FlashQuad

fq = FlashQuad(backend="numpy")

result = fq.simpson(
    func=lambda x, y: np.sin(x) * np.cos(y),
    intervals=[[0, np.pi], [0, np.pi]],
    num_points=[101, 101],
)
```

Switch to GPU by changing the backend (we recommend using CuPy for minimal setup):

```python
fq = FlashQuad(backend="cupy")
```

Batch thousands of parameter sets in a single GPU call:

```python
import cupy as cp
from flashquad import FlashQuad

fq = FlashQuad(backend="cupy")
params = cp.linspace(0.1, 10.0, 5000).reshape(-1, 1)  # 5000 parameter sets

results = fq.simpson(
    func=lambda x, a: cp.exp(-a * x**2),
    intervals=[[0, 5]],
    num_points=[201],
    params=params,
)
```

## Methods

| Method | Call |
|--------|------|
| Trapezoidal | `fq.trapz(...)` |
| Simpson's 1/3 | `fq.simpson(...)` |
| Boole's | `fq.booles(...)` |
| Gauss-Legendre | `fq.gauss(...)` |
| Monte Carlo | `fq.mc(...)` |
| Adaptive Monte Carlo | `fq.adpmc(...)` |

## Backends

NumPy, PyTorch, CuPy, and JAX.

## License

MIT
