There are two script files for this example: https://optics.ansys.com/hc/en-us/articles/360042097313-Metalens
Next time please specify which script file you are referring.
A1: I am not sure where we mentioned the mode amplitude. I think it is the E amplitude. E anfd H are the mode fields.
A2: m and n are the grating diffraction orders. They are result, not input parameters
Q3 " in RCWA, I am not sure how far for ekx_f... can we use the same method in FDTD to get this phase?"
and since this is analytical solution, the result is on the surface, similar to Fresnel coefficients.
Please visit this page https://optics.ansys.com/hc/en-us/articles/4414567929235-rcwa-Script-command
Amplitudes of E and H fields will be returned as
they are field amplitudes in k space for E and H.
Mode amplitudes will be returned as
Here s and p are the polarization. a and b means E and H (I do not know why), and xy components only.
I do not know where "kx, ky" is from in which file?
index_sub = getfdtdindex("SiO2 (Glass) - Palik",excitation.f,min(excitation.f),max(excitation.f)); is to get the refractive index of the material (SiO2 in this case).
pinch(pinch(Fields.E,5),5): please refer "pinch" https://optics.ansys.com/hc/en-us/articles/360034405674-pinch-Script-command
Please note that Fields.E is a 6 dimension matrix, x,y,z,f,radius and Ex/Ey/Ez in the 6th dimension.
dist = 0.151606*um; #Distance between source and first layer in FDTD model
should be from FDTD simulation file. But I believe the FDTD simulation file has been modified as this distance is no loner this value.
Earnestly, I really do not know why it uses those strange values. If I did this example, I would use some values to match the mesh, or some integer numbers.