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.3.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.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mnpbem_misc-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 864c11d8adbaa79b9807780c93b5f35c52a85c0f9ea9b07d7b6ba08cb31a14a1
MD5 fd3685c7acd84b6cc32f1a9103d103c1
BLAKE2b-256 9ddc17f0246f033f52c8ffa28f136ae568f5d08280bfc529dc4b7b7736ba29ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mnpbem_misc-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1a23418265e78ca84e09d6fc70ac4fb40eac357c64757eddeb196b5fad1c1f99
MD5 1cb4be5a958f14da12337e16994daecf
BLAKE2b-256 19c2955a0f6ef9efaf0533fdb55b59f8eceb98381f33b049c2a56fa49d1f031e

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