Skip to content

Commit

Permalink
Merge pull request #28 from kc-ml2/DEV
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
yonghakim authored Mar 7, 2023
2 parents 8e64117 + 548306a commit e778081
Show file tree
Hide file tree
Showing 45 changed files with 743 additions and 2,571 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.idea
*.egg-info
Miniconda3-py310_22.11.1-1-Linux-x86_64.sh
.vscode/launch.json
.vscode
.DS_Store

venv/
build/
dist/
2 changes: 1 addition & 1 deletion QA/backprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import time
from copy import deepcopy

from meent.entrance import call_solver
from meent.main import call_solver
import torch


Expand Down
2 changes: 1 addition & 1 deletion QA/run_debug.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
import numpy as np

from meent.entrance import RCWA
from meent.main import RCWA


def run_debug_cases(n_I, n_II, theta, phi, grating_type, pol):
Expand Down
2 changes: 1 addition & 1 deletion QA/run_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
import numpy as np

from meent.entrance import call_solver
from meent.main import call_solver


def run_test(n_I, n_II, theta, phi, grating_type, pol):
Expand Down
2 changes: 1 addition & 1 deletion QA/run_test2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from meent.entrance import call_solver, sweep_wavelength
from meent.main import call_solver, sweep_wavelength


pol = 1 # 0: TE, 1: TM
Expand Down
2 changes: 1 addition & 1 deletion QA/test_case.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from meent.entrance import call_solver
from meent.main import call_solver


def test():
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,19 @@
Meent is a RCWA solver and its applications on optimization problem. We are expecting that this tool can accelerate ML research in photonics.

## How to install

You can install from PyPI

```shell
pip install meent
```

or download this repo and run

```shell
pip install .
```
JAX and PyTorch is needed for advanced utilization.

## How to use

Meent provides Numpy, JAX and PyTorch as a backend.

```python
import meent
from meent.entrance import call_solver
from meent.main import call_solver

# mode 0 = Numpy
# mode 1 = JAX
Expand All @@ -34,6 +27,7 @@ mode_key = 1
solver = meent.rcwa.call_solver(mode=mode_key, ...)
```


## When to use

| | Numpy | JAX | PyTorch |
Expand Down
11 changes: 10 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Benchmark
run EM simulation in Python process.
Compare Meent to other EM simulation SW. \
This is only to provide technical report and discussion, not to say any tool is good or bad.

## 1. Fourier transform
convergence test with both of Discrete FT and Continuous FT.

## 2. Calculation time
time to get diffraction efficiencies from EM solver.

## 3. Eigendecomposition with CPU core limit

62 changes: 0 additions & 62 deletions benchmarks/benchmark_run_fill_factor.py

This file was deleted.

60 changes: 0 additions & 60 deletions benchmarks/benchmark_run_ucell.py

This file was deleted.

6 changes: 3 additions & 3 deletions benchmarks/fft_method_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import jax.numpy as jnp
import time

from meent.entrance import call_solver
from meent.main import call_solver
import torch


Expand Down Expand Up @@ -116,8 +116,8 @@ def compare_conv_mat_method(mode_key, dtype, device):
from meent.on_numpy.emsolver.convolution_matrix import to_conv_mat_continuous as conv2

elif mode_key == 1:
from meent.on_jax.convolution_matrix import to_conv_mat_discrete as conv1
from meent.on_jax.convolution_matrix import to_conv_mat_continuous as conv2
from meent.on_jax.emsolver.convolution_matrix import to_conv_mat_discrete as conv1
from meent.on_jax.emsolver.convolution_matrix import to_conv_mat_continuous as conv2
else:
from meent.on_torch.emsolver.convolution_matrix import to_conv_mat_discrete as conv1
from meent.on_torch.emsolver.convolution_matrix import to_conv_mat_continuous as conv2
Expand Down
62 changes: 0 additions & 62 deletions benchmarks/interface/Eval_Eff_1D.m

This file was deleted.

Loading

0 comments on commit e778081

Please sign in to comment.