Photonic-Architecture-Laboratories / si-photonics-toolkit

Photonic Integrated Design Package
MIT License
11 stars 0 forks source link

finite difference on n_g #29

Closed esmagden closed 1 year ago

esmagden commented 1 year ago

This is from one of our example notebooks:

Note: group_index function implementation is based on finite difference method. Therefore, the result is not exact. However, the result is accurate enough for most of the cases. If you need exact result, please use grad_neff function to calculate the derivative of neff function.

I think we no longer have a grad_neff function right? We should fix that first.

Even then, why wouldn't we directly use grad(neff()) anyways, since it's more reliable than using a finite difference approach?

aycandv commented 1 year ago

grad_neff function is implemented under effective_index.neff. If we decide to keep it, I will update group_index function accordingly.

https://github.com/Photonic-Architecture-Laboratories/si-photonics-toolkit/blob/c7c9898b8feae02acd7b2ba3a7c18a9d1a3faf7a/sipkit/effective_index.py#L172-L191