fancompute / angler

Frequency-domain photonic simulation and inverse design optimization for linear and nonlinear devices
https://arxiv.org/abs/1811.01255
MIT License
158 stars 49 forks source link

Making the output in second mode #36

Closed aonurdasdemir closed 5 years ago

aonurdasdemir commented 5 years ago

Hi,

I see that while adding mode there is an 'order' option which specifies the mode order. But normalization is dependent to the first modes of input and output in direct wave guide. If I want to design a device which has the input in first mode and output in second mode, how should I adjust the optimization?

twhughes commented 5 years ago

Hi @aonurdasdemir

First, it's worth mentioning that the normalization is mostly for convenience in that it gives an upper bound on the objective function, making it easier to reason about.

If you want to design a mode converter from 1st -> 2nd order mode, you might have to do this a bit differently, because there is not really a straightforward way to compute the normalization.

One option would be to use the first order normalization, just as a benchmark. It might be that, due to power conservation, this ends up being the correct normalization for your problem.

Another option would be to use Simulation.flux_probe to compute the power injected into the straight waveguide, and then use this as a normalization.

Both options should give you reasonable results.

Hope it helps!