Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meep script to compute transmittance of metagrating imported from CSV file #5

Merged
merged 4 commits into from
May 31, 2022

Conversation

oskooi
Copy link
Collaborator

@oskooi oskooi commented Mar 29, 2022

This PR adds a Meep script to the Metagrating3D subfolder for computing the transmittance of the m=+1 diffracted order of the 3d metagrating with 2d design imported from device1.csv. Results for the S and P polarizations are compared with the values from RCWA (Reticolo) provided in the README.md file.

At a resolution of 20 pixels/μm, results for the P polarization are in reasonable agreement with a relative error of ~10%. However, there is a large discrepancy of ~45% in the results for the S polarization.

err:, P, 0.618525 (Meep), 0.566073 (reticolo), 0.092659 (error)
err:, S, 0.324193 (Meep), 0.590917 (reticolo), 0.451372 (error)

edit: Increasing the resolution to 50 pixels/μm, the discrepancy seems to get worse:

err:, P, 0.692707 (Meep), 0.566073 (reticolo), 0.223707 (error)
err:, S, 0.252974 (Meep), 0.590917 (reticolo), 0.571896 (error)

cell_xy

diff_eff_P = 0.9114 # P-pol. diffraction efficiency computed using Reticolo (RCWA)
diff_eff_S = 0.9514 # S-pol. diffraction efficiency computed using Reticolo (RCWA)
# convert diffraction efficiency into transmittance in the Z direction
Treticolo = (diff_eff_P if P_pol else diff_eff_S) * Tfresnel * math.cos(theta_d)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conversion should not be necessary, since apparently reticolo is computing the power efficiency: the Poynting flux per unit cell in the diffraction order divided by the Poynting flux per unit cell in the incident wave.

@jiaqi-jiang
Copy link
Contributor

I have simulated the device using Reticolo RCWA again with different number of Fourier orders. TM pol (P-pol) is quite stable with 91% efficiency while TE pol (S-pol) is sensitive to number of Fourier orders. It might be the issue that Reticolo is not good at simulating device with small feature size for TE polarization. Therefore I have generated 3 robust devices and uploaded them to the repo. Their efficiencies are reported in README.md. I've simulated them with different number of Fourier orders, their efficiencies should only have 1% variation.

@oskooi
Copy link
Collaborator Author

oskooi commented Apr 12, 2022

I think the problem here is that it is not currently possible to demonstrate that the Poynting flux values (or what is referred to as "deflection efficiency") are converged with respect to the Meep grid resolution because the image files (e.g., device1.csv and others provided in #8) are at a low resolution of ~86 pixels/μm (i.e., the unit cell is 118 pixels ⨉ 45 pixels corresponding to dimensions of 1.37 μm ⨉ 0.53 μm). Increasing the Meep grid resolution as part of a convergence investigation which involves repeatedly doubling the resolution (e.g., 20, 40, 80, 160, ...) means that resolutions larger than 86 pixels/μm involve trying to resolve individual pixels of the image files which introduces discretization artifacts that are degrading the accuracy. Note that Meep's MaterialGrid uses bilinear interpolation to downsample the image onto the Yee grid. (Subpixel smoothing is not being used for the MaterialGrid.)

@jiaqi-jiang, is it possible to provide image files of your devices at significantly larger resolutions (i.e., 200+ pixels/μm)?

@jiaqi-jiang
Copy link
Contributor

@oskooi I've updated these csv files with higher resolution in my repo

@oskooi
Copy link
Collaborator Author

oskooi commented Apr 18, 2022

With some minor changes, I am able to reproduce the ~0.90 transmittance values from #8 for the P polarization: 0.909333 for device1.csv and 0.896271 for device3.csv at a Meep resolution of 100 pixels/μm. However, there seems to be large discretization errors for the S polarization. As an example, here are the results for the convergence study for device1.csv (two columns: resolution, transmittance):

50, 0.766658
100, 0.049936
150, 0.493341

The reason there is such large changes can perhaps be understood by looking at the actual structure. Most of the air-silicon interfaces have a surface normal in the x direction. The P polarization involves an Jx current source whereas the S polarization uses a Jy source. It's no wonder that small changes in the grid resolution therefore tend to be larger changes in the S polarization response. Large discretization errors thus seem to be an inherent feature of the design, unfortunately.

cell_xy

@stevengj
Copy link
Contributor

However, there seems to be large discretization errors for the S polarization.

Is there a narrow resonance effect here? e.g. what happens if you fix the resolution and vary λ?

@oskooi
Copy link
Collaborator Author

oskooi commented Apr 19, 2022

Is there a narrow resonance effect here? e.g. what happens if you fix the resolution and vary λ?

There does seem to be a resonance effect. For the S polarization of device1.csv, fixing the resolution at 50 pixels/μm and varying λ shows large changes in the transmittance:

wavelength (μm), transmittance
0.95, 0.157733
1.05, 0.766658
1.15, 0.441166

This is not surprising since, as described in the README.MD, the periodicity of the unit cell for these designs are chosen based on λ = 1.05 μm: Px = 1050/sin(50) nm, Py = 0.5* 1050 nm.

Based on this, we may want to just use a different set of designs preferably broadband structures.

@jiaqi-jiang
Copy link
Contributor

I have updated the metagrating designs in my repo. They are only optimized for TM polarization.

@oskooi
Copy link
Collaborator Author

oskooi commented May 3, 2022

So far, I have been able to obtain the transmittance for device1.csv of 0.954938 at a resolution of 170 pixels/μm which seems to agree with the 0.957 value from RCWA. I am still working on the results for the other two devices. The reason it is taking a while is that the fields tend to blow up for large resolutions which requires twiddling the other parameters (source bandwidth, Courant number, etc.).

@oskooi
Copy link
Collaborator Author

oskooi commented May 7, 2022

I am now able to obtain transmittance values for all three designs using Meep which show reasonable agreement with RCWA:

device1.csv: 0.954938 (Meep), 0.957 (RCWA)

device2.csv: 0.936288 (Meep), 0.933 (RCWA)

device3.csv: 0.949643 (Meep), 0.966 (RCWA)

It turns out that to ensure the fields did not blow up it was necessary to disable the default subpixel averaging (by specifying eps_averaging=False in the Simulation object constructor) even though subpixel averaging for the MaterialGrid is disabled by default.

Nevertheless, even though these designs were optimized for just a single polarization (TM) with the expectation that they would be more robust to discretization artifacts than the previous set of designs which used both polarizations, the transmittance significantly degrades if the wavelength is perturbed from its nominal value of 1.05 μm. To demonstrate this, here are results for device2.csv:

wavelength (μm), transmittance
0.95, 0.049337
1.05, 0.936288
1.15, 0.699328

@jiaqi-jiang, I think we now have the agreement we need so you can go ahead and create a PR with the newest set of designs.

@stevengj stevengj merged commit c137fc9 into NanoComp:main May 31, 2022
@oskooi oskooi deleted the metagrating_meep branch May 31, 2022 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants