/MacroMax

Library for solving the macroscopic Maxwell equations in complex dielectric materials. The materials may be any mixture of isotropic and anisotropic permittivity, permeability, and coupling tensors.

Primary LanguagePythonMIT LicenseMIT

Macroscopic Maxwell Solver

Introduction

Efficient solving the macroscopic Maxwell equations in complex dielectric materials - in Python and Matlab.

The material properties are defined on a rectangular grid (1D, 2D, or 3D) for which each voxel defines an isotropic or anisotropic permittivity. Optionally, a heterogeneous (anisotropic) permeability as well as bi-anisotropic coupling factors may be specified (e.g. for chiral media). The source, such as an incident laser field, is specified as an oscillating current-density distribution.

The method iteratively corrects an estimated solution for the electric field (default: all zero). Its memory requirements are on the order of the storage requirements for the material properties and the electric field within the calculation volume. Full details can be found in the open-access manuscript "Calculating coherent light-wave propagation in large heterogeneous media". Automatic leveraging of detected GPU/Cloud is implemented using PyTorch in the Python version of MacroMax (for further details follow this link).

The source code is available on GitHub under the MIT License: https://opensource.org/licenses/MIT

When to use this method?

The algorithm is particularly efficient for solving complex scattering:

  • wave problems such as those encountered in electromagnetism and acoustics,
  • subject to temporal coherent (monochromatic) irradiation,
  • and a limited variation of a gain-free potential (permittivity),
  • in complex, heterogeneous, materials.

Although incoherent and aperiodic problems can be solved by solving multiple coherent problems, alternative methods might be more appropriate for this type of problems.

When not to use this method?

With the exception of gain materials, MacroMax works for a wide variety of problems. However, more appropriate solutions may exist when:

  • an approximate solution is sufficient, → e.g. the beam propagation method
  • the material has a simple structure, → e.g. Mie scattering from a perfect sphere
  • coherence is not important, → e.g. ray tracing
  • the variation in the complex potential (permittivity) is very large, e.g. due to the presence of conductors → e.g. finite element methods
  • the material has gain, e.g. an active laser cavity → e.g. finite element method
  • aperiodic time-dependence is important, → e.g. finite difference method The convergence rate of MacroMax is approximately inversely proportional to the variation in the potential. Materials with a refractive index or extinction coefficients larger than 5 will generally lead to slow convergence. By consequence, the presence of a superconductor would lead to infinitely slow convergence (a.k.a. divergence).

Pure Python and Matlab implementations

Please follow the links for further information, source code, and examples:

PyPI - Python Version PyPI - License PyPI PyPI - Status PyPI - Wheel PyPI - Downloads GitHub code size in bytes GitHub last commit Libraries.io dependency status for latest release Documentation Status