flexcompute / tidy3d

Fast electromagnetic solver (FDTD) at scale.
https://docs.flexcompute.com/projects/tidy3d/en/latest/
GNU Lesser General Public License v2.1
183 stars 40 forks source link

Modal group index calculation without finite differences #2010

Open gvnwst opened 1 week ago

gvnwst commented 1 week ago

Problem

Modal group index calculations take a while, and cost a lot. That's because they use finite differences.

Aside from the cost, it becomes quite problematic to finite difference when simulating GVD. Not only are you propagating even more numerical error (and are susceptible to choice of step size, though this is a lesser issue), frequently photonics designers are searching for places where GVD is flat or zero -- exactly where numerical noise will be the most visible!

Solution I'd like

It's possible to analytically calculate the modal group index based off the effective index, modal field distribution, and permittivity distribution. This was referenced in a comment on #1169, but seems to have been lost in the ether when that issue closed.

References for equations to implement

The referenced paper here has a rigorous treatment of this (Eqs. 14 and 15). There are additional simplifications which can be made, particularly considering the case of Z-invariant (X-invariant, whatever) propagation, but this is probably easy enough to implement as-is.

Po-Ru and Steven's derivation does not include the effects of anisotropy. It's not a difficult extension -- I've derived it in the past for the case of negligible loss (maintaining a hermetian operator) with fully-anisotropic and dispersive materials. If there's interest in pushing this forward I can dig up those derivations. A super brief version exists in this paper, Section 6 of the supplement, leaving it in a general form and then the solution in the plane-wave basis.

A problem with this would be that material dispersion can strongly affect the EM energy density and must be accounted for. In general you already have dispersive materials so it's juts a question of dielectric smoothing. While dielectric smoothing is underway, it'd be useful to get these calculations going with the restriction that it only works for un-smoothed models (much like fully anisotropic materials are at the moment).

momchil-flex commented 1 week ago

Yeah this would be great to have. By the way one of the reasons for keeping our frontend open (including the local mode solver!) is hoping the community can also contribute with things like these that we may not find time for right now. It sounds like you have quite a lot of expertise on the matter so if you want to give it an initial try, we'd certainly be happy to support as much as possible.

gvnwst commented 6 days ago

I've poked around at what it would take -- still pretty new to the tidy3D interface so I'm hesitant to write something crappy and submit it 😅

There are some other things I'm going to try my hand at first, in particular dielectric smoothing for generally-anisotropic materials. That'd be a much bigger improvement for the projects I'm working on in the forseeable future (and would make the solution to this problem better!). Might rope @DoddGray into it. Upcoming Issue on this, most likely...