Shared numerical and vector algebra toolkit for MNPBEM-Python.
Project description
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:
\lambda_{\mathrm{nm}} = \frac{C_{\mathrm{eV\cdot nm}}}{E_{\mathrm{eV}}},
\qquad C_{\mathrm{eV\cdot nm}} \approx 1239.841984
Euclidean vector norm:
\|\mathbf{v}\|_2 = \sqrt{\sum_i |v_i|^2}
Normalization:
\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
pip install mnpbem-misc
Example
Runnable example:
examples/basic_usage.py
Run:
python examples/basic_usage.py
Author
- GALIH RIDHO UTOMO
- g4lihru@students.unnes.ac.id
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mnpbem_misc-0.1.6.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mnpbem_misc-0.1.6.tar.gz.
File metadata
- Download URL: mnpbem_misc-0.1.6.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab452de575f0fb271e05402d8f759ebc3e3f2c4052fd028b7da5c700ff10a0ae
|
|
| MD5 |
42d819aab041ecaa0f11fe4d49bb9601
|
|
| BLAKE2b-256 |
0a88a08fe5e10b779adb9ca5b93211f7112ca6154038c3c8bed578aae03fa775
|
File details
Details for the file mnpbem_misc-0.1.6-py3-none-any.whl.
File metadata
- Download URL: mnpbem_misc-0.1.6-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a755f0d50ece4ee0f17b1db8153a234946e70e8b43b14285f099fc14ccef68fa
|
|
| MD5 |
80024afd17a83766e3bf87d74ada5905
|
|
| BLAKE2b-256 |
dc7892c57346dda2c3429b59128b30f2ecd234d85be7e53835d6217a50815fff
|