Skip to main content

Shared numerical and vector algebra toolkit for MNPBEM-Python.

Project description

mnpbem-misc

PyPI version Python versions

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

Project details


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.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mnpbem_misc-0.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file mnpbem_misc-0.1.4.tar.gz.

File metadata

  • Download URL: mnpbem_misc-0.1.4.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

Hashes for mnpbem_misc-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1fb03e6e8ba1da3ef562041c01d3007db5fb841d06f2b1b18b02999da23abef3
MD5 a0f0b1eed0504db558129c14a9bb91c4
BLAKE2b-256 7f761f2a88d7dec346fe8fe2544ec20f9f5676c59aeb4f67e403d9a9c9a3d7af

See more details on using hashes here.

File details

Details for the file mnpbem_misc-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: mnpbem_misc-0.1.4-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

Hashes for mnpbem_misc-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2874d97e4da7a4517dcb875c80dcaa776aebceae922e40960ecba6c476389c9
MD5 2dd38720c4d7ee0b81cb391a6e41a578
BLAKE2b-256 729bfe0a1761397f6af75c5f604a78d8fb49c0daf851b4e93702ddda4c5d5d98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page