Metadata-Version: 2.4
Name: mnpbem-misc
Version: 0.1.2
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

`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

### 1. Photon Energy-Wavelength Conversion
The conversion between photon energy and wavelength is:

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

### 2. Euclidean Vector Norm
For a vector $\mathbf{v}$:

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

### 3. Vector Normalization
Normalized vector:

$$
\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
Runtime dependencies are installed automatically by `pip`:
- `numpy>=1.24`

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

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

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

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