Skip to main content

Electromagnetic simulation (RCWA) & optimization package in Python

Project description

Meent

Meent is an Electromagnetic(EM) simulation package with Python, composed of three main parts:

  • Modeling
  • EM simulation
  • Optimization

Backends

Meent provides three libraries as a backend:
alt text

  • NumPy
    • The fundamental package for scientific computing with Python
    • Easy and lean to use
  • JAX
    • Autograd and XLA, brought together for high-performance machine learning research.
  • PyTorch
    • A Python package that provides two high-level features: Tensor computation with strong GPU acceleration and Deep neural networks built on a tape-based autograd system

When to use

Numpy JAX PyTorch Description
64bit support O O O Default for scientific computing
32bit support O O O 32bit (float32 and complex64) data type operation*
GPU support X O O except Eigendecomposition**
TPU support* X X X Currently there is no workaround to do 32 bit eigendecomposition on TPU
AD support X O O Automatic Differentiation (Back Propagation)
Parallelization X O X JAX pmap function

*In 32bit operation, operations on numbers of 8>= digit difference fail without warning or error. Use only when you do understand what you are doing.
**As of now(2023.03.19), GPU-native Eigendecomposition is not implemented in JAX and PyTorch. It's enforced to run on CPUs and send back to GPUs.

Numpy is simple and light to use. Suggested as a baseline with small ~ medium scale optics problem.
JAX and PyTorch is recommended for cases having large scale or optimization part.
If you want parallelized computing with multiple devices(e.g., GPUs), JAX is ready for that.
But since JAX does jit compilation, it takes much time at the first run.

How to install

pip install meent

JAX and PyTorch is needed for advanced utilization.

How to use

import meent

# backend 0 = Numpy
# backend 1 = JAX
# backend 2 = PyTorch

backend = 1
mee = meent.call_mee(backend=backend, ...)

Tutorials

Jupyter notebooks are prepared in tutorials to give a brief introduction.

Examples

Comprehensive examples of computational optics with Meent can be found in examples folder.

Citation

To cite this repository:

@article{kim2024meent,
    title={Meent: Differentiable Electromagnetic Simulator for Machine Learning},
    author={Kim, Yongha and Jung, Anthony W. and Kim, Sanmun and
            Octavian, Kevin and Heo, Doyoung and Park, Chaejin and
            Shin, Jeongmin and Nam, Sunghyun and Park, Chanhyung and
            Park, Juho and Han, Sangjun and Lee, Jinmyoung and
            Kim, Seolho and Jang, Min Seok and Park, Chan Y.},
    journal={arXiv preprint arXiv:2406.12904},
    year={2024}
}

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

meent-0.12.0.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

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

meent-0.12.0-py3-none-any.whl (109.7 kB view details)

Uploaded Python 3

File details

Details for the file meent-0.12.0.tar.gz.

File metadata

  • Download URL: meent-0.12.0.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for meent-0.12.0.tar.gz
Algorithm Hash digest
SHA256 16ee67dbb2ea613f9e832ddc1b0561eb4f8a187a8c72bd7579d6c120ac34547a
MD5 0f2a2252f91ddebe8cd10b95efbfde98
BLAKE2b-256 45e3bfe2b249690a67c56deaef104ddc8aaf1ea646fbfe628a72b35a949a38af

See more details on using hashes here.

File details

Details for the file meent-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: meent-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 109.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for meent-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b52e7c926448d21daadb17db08a28086dacf488151994c2db79c19284448f94
MD5 ca041ff0d9edc7673cc351dc8b6932bd
BLAKE2b-256 8ba444e193fd03b5ec66ca96b5eb5d81bdaeb0435ee3a141073136550fd7ba44

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