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.5.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.5.tar.gz.
File metadata
- Download URL: mnpbem_misc-0.1.5.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
458b5b0b8cb529fb2aa1a8e5782132f30c00c67025dec9d49342205d6f4fd65e
|
|
| MD5 |
b14982ab97ba586976ccea4bca44504d
|
|
| BLAKE2b-256 |
c26ff8d953d8769db1251971c943e417b92c56b4e5ceae3094b3e383263f46f8
|
File details
Details for the file mnpbem_misc-0.1.5-py3-none-any.whl.
File metadata
- Download URL: mnpbem_misc-0.1.5-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.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
221b9114c848c1a01598297108970cb946ac2664d00caaa370f71c0ddb55264a
|
|
| MD5 |
5c7f93ee17be299586542f6a9c9af71c
|
|
| BLAKE2b-256 |
3efbffd31d75640b069449abbfb14219658745721854bbaba4da779777c521eb
|