Metalens example


Dear Sir/Mrs,

Concerning the metalens example, I can see that the referenced paper describes a Titania metasurface based on geometric phase which is not the case in the FDTD file using PMMA with different duty cycle ?
I am not sure how can I check the results of the metalens and the S parameter analysis group if the results are not reproduced from the referenced paper?

Concerning the S parameter advanced group , analysis script commands. I have many questions.

1- In this part: Line 245: analysis group S parameters

# Select largest input field component (s or p) for S-parameter extraction
    tempG = abs(G_input)^2;  #absolute value squared of three field components

Question: is that for all frequencies ?

pol_to_select = find( tempG, max( tempG) );
Questions : why  do we need Maximum input field (Er,Etheta,Ephi) in far field?

2- Line 262: analysis group S parameters

# Save dominant polarization component of all grating projections
    G_input  = pinch( G_input (pol_to_select) )/norm_input;

why do we take the maximum value and normalize it to all spherical field components?

G_forward  = pinch( G_forward (pol_to_select) );
G_backward = pinch( G_backward(pol_to_select) );

I understand that we have field components (Er,Etheta,Ephi) for zero grating order at all frequencies , what is the maximum value we are pinching at?

3- line 271: if(dim == 2) { phase_correction = exp(1i*pi/4); } #2D and 3D are different
how can you get this phase correction factor?

4- line 295 and line 303: Question: what is the difference between normalization in these two lines
S21_Gn(i) = G_forward phase_correctionexp(-1i*phase_T_to_forward)/input; #S21 from source to monitor T

S11_Gn(i) = S11_Gn(i) * sqrt(R(i));

5- The phase corrections are done twice : first part line 273:
I can not understand what you are trying to do here.
That is clear.

6- line 304: S21_Gn(i) = S21_Gn(i) * sqrt(T(i)) * (sqrt(refractive_index_1/refractive_index_2));

Question: can you a give a reference for this refractive index correction?

7- for the script file names " [metalens_2D_duty_cycle_sweep.lsf]"(

when you extracted the (abs S21), I found this script command
T0(i) = abs(S.S21_Gn)^2*refractive_index_2/refractive_index_1;
Questions: you have made the correction twice for the S21, one in the S_parameters advanced analysis group and the other in extraction the amplitude .
I am not sure if that is correct?

it is a lot of questions but the illustrations provided are not sufficient

Thank you in advance.


Hi @maisaad

I need to discuss your case with my colleague and will get back to you next week.

Thanks for your patience.


Thank you waiting for your replies.


Hi @maisaad

Thanks for your patience.

The example is indeed different, however the analysis groups are checked with stackrt script command that uses analytical solution. You can also modify the geometry and try to replicate the results of the paper of interest.

  1. The commands are inside a for loop starting at line 141. The calculations are done for each frequency separately.

    The find command calculates the maximum field component to calculate the results for s or p polarization in the S results. Currently we assume that there is no cross polarization term i.e. there is no polarization rotation, but we need to modify the script to reflect this by limiting the user to have only s or p polarized light. For the moment, please limit the source to cases where light is only s or p polarized and take the S_polarization results instead of S.

  2. We are interested in only zero grating order results. The normalization is done to normalize zero order projection and avoid very rare cases that there might be some artefacts with non-zero higher order projection orders.

  3. I will get back to you about inquiry.

  4. For the S parameters, results should be normalized to input filed (first normalization):
    Also, since we are working with the farfield results where the sum of field intensity is 1, results should be normalized to square root of transmitted power to compensated for any loss or scattering due to metalens.

  5. The farfield projection calculated the projection for a 1m distance from the origin of simulation i.e. (0,0,0). The first correction is done to calculate the phase from the origin to monitor location.

    PMMA is considered to be the object where we want to obtain the s-parameter for. Since the source and monitor are not exactly at the surface of PMMA and are spaced, we need to account for phase change from source/monitor to PMMA surface.

  6. The transmitted power depends on the material index (\( \epsilon E^2\)), however s-parameters are simply the ratio of electric fields and do not depend on the material index. For s-parameter calculations we need to multiply the results by the inverse index ratios to calculate the correct s-paramters.

  7. Here we are trying to calculate transmission from s-parameters. Thus we need to multiply the s-results to material index to calculate the transmission. This is opposite of what we did in step 6 to move from s-paramter to power.

Please let me know if you have any further questions. Please limit your post to one question at a time so that we can address them completely.



Hi @maisaad

The extra phase can be understood by considering the diffraction from an aperture that is large compared to the wavelength (an actual plane wave would be the limit where the aperture has infinite size). Theoretically, we expect that for distances farther and farther away from the aperture we pick up this phase, which is the 1/i factor in the Fresnel diffraction integral (see: ). Therefore, if you start with a large but finite sized aperture and take the limit of an infinite distance from it you pick up this phase, but if you start with an actual plane wave (infinite aperture) and go to the far field you won’t get the additional phase. This is the underlying problem in our grating projection calculation. Luckily, this is only an overall frequency-independent phase, which is typically not important because most of the time you only care about the angular power distribution in the far field. It’s only in situations where you want to go back from the far field to the intermediate or near field where you need to worry about the right phase to get the correct complex fields. This is what we do in the example you mentioned and in other ones like the S-parameter calculation for metamaterials (see for example: ).

The difference between 3D and 2D is due to the difference in the Green function for the field propagation.