Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Electromagnetic simulation (RCWA) & optimization package in Python

License

NotificationsYou must be signed in to change notification settings

kc-ml2/meent

Repository files navigation

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

NumpyJAXPyTorchDescription
64bit supportOOODefault for scientific computing
32bit supportOOO32bit (float32 and complex64) data type operation*
GPU supportXOOexcept Eigendecomposition**
TPU support*XXXCurrently there is no workaround to do 32 bit eigendecomposition on TPU
AD supportXOOAutomatic Differentiation (Back Propagation)
ParallelizationXOXJAX 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

importmeent# backend 0 = Numpy# backend 1 = JAX# backend 2 = PyTorchbackend=1mee=meent.call_mee(backend=backend, ...)

Tutorials

Jupyter notebooks are prepared intutorials to give a brief introduction.

Examples

Comprehensive examples of computational optics with Meent can be found inexamples 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}}

[8]ページ先頭

©2009-2025 Movatter.jp