Skip to content

Additional features for working with modes #6

Description

@jan-david-fischbach

Hey @flaport,
I am a big fan of meow. Besides its EME capabilities, I think it makes quite a lot of sense to use it as an abstraction layer over different FDE algorithms, as switching between "simulation backends" can otherwise necessitate significant code rework (for the structure definition alone). Maybe even interesting for gdsfactory (@joamatab) (We could also build a femwell backend for meow). With that in mind, there is a couple of things I'd like to add:

  • Poynting flux: auxiliary properties to calculate the poynting flux in x,y and z.

$$ \vec{P} = \vec{E} \times \vec{H} $$

An implementation using np.cross is probably most sensible. Addressed in #7.

  • Effective mode area: another auxiliary measure I tend to use relatively frequently. It is not that well defined/ agreed on in literature but I would use the definition as in lumerical's implementation:

$$ A_{eff} = \frac{\left(\int|\vec{E}|^2dA\right)^2}{\int|\vec{E}|^4dA} $$

  • Implementation of the field energies for irregular meshes: At this moment the modal energies are computed by summing over the energy densities, which for equidistant meshes leads to a value proportional to the actual modal energy.:
def electric_energy(mode: Mode) -> float:
    """get the electric energy contained in a `Mode`"""
    return electric_energy_density(mode).sum()

The proportionality constant can be eliminated by normalization, as it is not dependent on the field distribution. This does however not hold for non-equidistant meshes, as finely meshed regions are over-emphasized compared to the more coarsely meshed regions. I would therefore suggest dividing by the mesh step in x and y before summing or even better do a proper integration over the energy densities e.g. using nested np.trapz evaluations.

  • I would love to be able to also easily get the group index. That would however require multiple frequency points to do a finite difference differentiation on the effective index with frequency/wavelength, right?

Activity

  1. flaport commented on Jan 22, 2023

    @flaport
    Member

    Hey @Jan-David-Black ,

    Glad you like the library!

    A few commonts on each of your points:

    • I accepted PR Include Poynting Vector calculation #7 .
    • Sticking to the Lumerical definition is the smart choice. It still is a leading standard on its own.
    • I agree that generalizing some of the formulas for non-cartesian or non-uniform meshes is a good idea.
    • We could add a group index function to the mode object which runs another mode simulation with exactly the same settings but a slightly perturbed wavelength. If we document this behavior (i.e. that this calculation is not instant) it might be a good solution.
  2. jan-david-fischbach commented on Jan 23, 2023

    @jan-david-fischbach
    CollaboratorAuthor

    Tidy3D doesn't yet seem to support non-equidistant meshes: flexcompute/tidy3d#652
    Lumerical does however.

    We could add a group index function to the mode object which runs another mode simulation with exactly the same settings but a slightly perturbed wavelength. If we document this behavior (i.e. that this calculation is not instant) it might be a good solution.

    Interesting idea. We already have the cell available, so it should be relatively easy to do. Lumerical directly returns the group index. So in that case we can just cache it and avoid the second calculation. When I have time I'll open a PR

  3. simbilod commented on Feb 24, 2023

    @simbilod

    @Jan-David-Black we have all these things in femwell, and started trying to combine it with MEOW to do EME (https://github.com/HelgeGehring/femwell/blob/main/femwell/eme.py). Not quite there yet, however

  4. smartalecH commented on Mar 25, 2023

    @smartalecH

    I would love to be able to also easily get the group index. That would however require multiple frequency points to do a finite difference differentiation on the effective index with frequency/wavelength, right?

    You can actually compute the group index from the fields directly (a simple integral from Snyder and Love, or you can rederive it using the Hellmann-Feynman theorem). No need to do any extra simulations by perturbing the wavelength etc.

  5. flaport commented on Mar 27, 2023

    @flaport
    Member

    Thanks @smartalecH , I'll try that once I find some time :)

  6. jan-david-fischbach commented on Apr 30, 2023

    @jan-david-fischbach
    CollaboratorAuthor

    @smartalecH, you are talking about this formula, right?

    $$ \tilde{v}_{\mathrm{g}}=-2 \frac{\tilde{\beta}}{k} \frac{c}{\lambda^3} \int_{A_x} \Psi^2 \mathrm{~d} A / \int_{A_x} \Psi^2 \frac{\mathrm{d}}{\mathrm{d} \lambda}\left(\frac{n^2}{\lambda^2}\right) \mathrm{d} A . $$

    Which is equation 33-16 of Snyder and Love.

  7. smartalecH commented on Apr 30, 2023

    @smartalecH

    you are talking about this formula, right?

    Yep that's right. There's lots of ways you can massage it into various forms depending on what the problem looks like and what you are after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions