Metadata-Version: 2.4
Name: mnpbem-misc
Version: 0.1.3
Summary: Shared numerical and vector algebra toolkit for MNPBEM-Python.
Author-email: GALIH RIDHO UTOMO <g4lihru@students.unnes.ac.id>
License-Expression: GPL-2.0-only
Project-URL: Homepage, https://pypi.org/project/mnpbem-misc/
Project-URL: Repository, https://github.com/galihru/mnpbem/tree/main/mnpbem-misc
Project-URL: Source, https://github.com/galihru/mnpbem
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24

# mnpbem-misc

[![PyPI version](https://img.shields.io/pypi/v/mnpbem-misc.svg)](https://pypi.org/project/mnpbem-misc/)
[![Python versions](https://img.shields.io/pypi/pyversions/mnpbem-misc.svg)](https://pypi.org/project/mnpbem-misc/)

`mnpbem-misc` provides shared numerical utilities used across MNPBEM-Python submodules.

## Features
- Physical unit conversions between photon energy and wavelength.
- Vector norms and normalization utilities with MATLAB-compatible behavior.
- Tensor-aware linear algebra helpers (`matmul`, `matcross`, `inner`, `outer`, `spdiag`).

## Mathematical Formulations
Photon energy-wavelength conversion:

```text
\lambda_{\mathrm{nm}} = \frac{C_{\mathrm{eV\cdot nm}}}{E_{\mathrm{eV}}},
\qquad C_{\mathrm{eV\cdot nm}} \approx 1239.841984
```

Euclidean vector norm:

```text
\|\mathbf{v}\|_2 = \sqrt{\sum_i |v_i|^2}
```

Normalization:

```text
\tilde{\mathbf{v}} = \frac{\mathbf{v}}{\|\mathbf{v}_{\mathrm{ref}}\|_2}
```

## Implementation
- Unit conversion utilities: `src/mnpbem_misc/units.py`
- Vector operations: `src/mnpbem_misc/vector.py`
- Linear algebra helpers: `src/mnpbem_misc/linalg.py`

## Dependencies
- `numpy>=1.24`

## Installation
```bash
pip install mnpbem-misc
```

## Example
Runnable example:
- `examples/basic_usage.py`

Run:
```bash
python examples/basic_usage.py
```

## Author
- GALIH RIDHO UTOMO
- g4lihru@students.unnes.ac.id
