Closed jlin0351 closed 7 months ago
# Incoming wave
freq = 1/wavelength
Qabs = 1e5
freqcmp = freq*(1+1j/2/Qabs)
Note that you are solving Maxwell's equation at a complex frequency, so the reflection is likely nonzero beyond the cutoff. For this value of Qabs, it's normal to see this level of low reflection. If you further increase Qabs
, I think you can see the derivative drops.
Ah I see, that makes sense. Thank you!
Hi!
Description
I am trying to calculate the derivative of reflection coefficients with respect to incident plane wave angle in a 1D grating structure. I would like to be able to calculate the derivative at a fixed angle (theta = 0.) but with varying wavelength. I am using autograd to calculate the theta derivative, but I notice that the derivative beyond the cutoff of the m = -1 diffraction order (when the wavelength just exceeds the grating period) is non-zero even though the reflection coefficients themselves, calculated with GRCWA, are identically zero.
Example
Here is an example code:
and the plot output on my end:
I've tried inputting a grating with randomised permittivities in
grating_grid
, and increasingNx
andnG
but the result is still a non-zero derivative after cutoff. I was wondering if you would have any insights into this behaviour?Thank you for your time, and thanks for making this package!