# Introduction

Introduction — MC Grating documentation for Modal Collinear and Modal Conical. The Modal methods Grating package is designed to run on any Windows® OS. The…

Canonical: https://mcgrating.com/docs/modal/introduction.html


Written by Nikolay M. LyndinLast revised 2018-01-09

This documentation was written for releases up to 2018 and is being revised. Some dialogs have changed since. If something does not match what you see, write to [mc@mcgrating.com](mailto:mc@mcgrating.com).

The Modal methods Grating package is designed to run on any Windows® OS. The codes interface is written in Delphi. The most critical matrix routines (LAPACK) are taken from Intel® MKL 2018 version. The routines in MKL are hand optimized by exploiting today’s multicore and many core processors, wider vector units and other processor architectural features.
 There are 32 and 64 bit version of the codes. All things being equal a 64 bit code is 30% faster.
 For 32-bit version the highest number of modes is restricted by 2 Giga Byte of memory for single application.
 For 64 bit version practically there isn’t limitation on the highest number of modes. Memory usage is restricted only by hardware capabilities.

In the Modal methods based package the True Modes Method1-6 (TMM) and the Fourier Modes Method7-9 (FMM) also known as RCWA are implemented. The package is intended to calculate gratings with a rectangular profile and includes two independent codes:

- The ***Collinear*** **version** deals with a multilayer grating structure and when incidence wave vector belongs to the *XZ* plane normal to the structure and grating grooves.
- The ***Conical version*** extends the possibilities of *Collinear** version* to a conical mount. This version accepts files saved by the *Collinear** version* but it is about eight times slowly.

The codes calculate the interaction of a plane electromagnetic wave with the multilayer corrugated structure providing the efficiencies (complex amplitude and power) of all reflected and transmitted diffraction waves and also calculate the complex field distribution and power flow in the multilayer structure and ambient media. Codes are based on a complex permittivity of layers for the electromagnetic wave. Incident wave has a unity amplitude of vector ***E***, (***s*** –polarization) or of vector ***H***, (***p*** –polarization) for the non conical mount versions and of modulus **|*E*| **(for conical mount versions) and zero phase at position *x = 0* and *z = 0*. Incident wave power flow always equals to unity.

All codes have almost the same interface adapted for particular code possibilities. The main form is a container for independent project editor windows. The project editor window may display a text with a structure parameters or a text table with results of calculation. The graphic tools take data from the results text table. This seems to be reasonable because the user has an opportunity to edit the data before displaying and to display in a graphic form a saved data files. The user can change the results precision and diffraction orders of interest to display in the text table without repeating calculation because a complete result data is kept in a PC memory. The user is provided with the possibility of insertion any comment before the structure parameters text. The comment should not contain the structure first line text specification. The structure parameters can be edited as from the text window or from the*** [Settings Dialog](https://mcgrating.com/docs/modal/settings.html)*** window. Lines of more than 2500 characters length are displayed by editor in truncated form and it is safely to edit them only as a whole (delete, copy, paste). The software will use full length lines. Dialog windows are also used to access any other tool options.

All codes also include:

- A layer slicing into sinusoidal, trapezoidal and user defined profile. ***[Go](https://mcgrating.com/docs/modal/layer-slicing.html)***
- A waveguide resonances search. ***[Go](https://mcgrating.com/docs/common/resonance.html)***
- Analysis of a finite Gauss beam reflection and transmission10. ***[Go](https://mcgrating.com/docs/common/analysis.html)***
- An optimization possibility in multidimensional space11 for sophisticated criterion function. ***[Go](https://mcgrating.com/docs/common/optimization-dialog.html)***
- General and 3D graphics for results presentation of one or two parameters scanning. ***[Go](https://mcgrating.com/docs/common/graph.html)***
- A refractive index materials catalog. ***[Go](https://mcgrating.com/docs/common/material.html)***

In the designing of the codes the following publications were used:

1. L. C. Botten, M. S. Craig, R. C. McPhedran, J. L. Adams, and J. R. Andrewartha, “The dielectric lamellar diffraction grating”, Opt. Acta **28**, 413-428 (1981);
2. L. C. Botten, M. S. Craig, R. C. McPhedran, J. L. Adams, and J. R. Andrewartha, “The finitely conducting lamellar diffraction grating”, Opt. Acta **28**, 1087-1102 (1981);
3. L. C. Botten, M. S. Craig, R. C. McPhedran, “Highly conducting lamellar diffraction gratings”, Opt. Acta **28**, 1103-1106 (1981);
4. Lifeng Li, “A modal analysis of lamella diffraction gratings in conical mountings”, Journal of Modern Optics, **40**, 553-573 (1993);
5. Lifeng Li, G. Granet, J. P. Plumey, and J. Chandezon, “Some topics in extending the C method to multilayer gratings of different profiles”, Pure Appl. Opt. **5**, 141-156 (1996).
6. M. Foresti, L. Menez, A. V. Tishchenko, “Modal method in deep metal-dielectric gratings: the decisive role of hidden modes”, J. Opt. Soc. Am. A, Vol. **23**, No. 10, p. 2501 (2006)
7. P. Lalanne and G. M. Morris, “Highly improved convergence of the coupled-wave method for TM polarization”, J. Opt. Soc. Am. A **13**, No. 4, p. 779 (1996).
8. L. Li, “Use of Fourier series in the analysis of discontinuous periodic structures”, J. Opt. Soc. Am. A **13**, No. 9, p. 1870 (1996).
9. N. Lyndin, O. Parriaux and A.V. Tishchenko, “Modal analysis and suppression of the FMM instabilities in highly conductive gratings”, J. Opt. Soc. Am. A, Vol. **24**, No. 12, p. 3781 (2007).
10. S. M. Loktev, N. M. Lyndin, O. Parriaux, V. A. Sychugov, A. V. Tishchenko, “Reflection of a finite light beam from a finite waveguide grating”, Sov. J. Quantum Electron. **27** 445-449 (1997).
11. R. Fletcher, M.J.D. Powell, “A rapidly convergent descent method for minimization”, The Computer Journal, 6 163-168 (1963).

From the in-application help of Modal Collinear and Modal Conical, documented through 2018. If you publish results computed with MC Grating, see [how to cite it](https://mcgrating.com/references.html#cite).
