# Grating

Grating — MC Grating documentation for Chandezon Crossed. The field Period has two editor controls for periods along X and Y directions, measurement unit is…

Canonical: https://mcgrating.com/docs/chandezon-crossed/grating.html


Written by Nikolay M. LyndinLast revised 2017-03-04

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 field ***Period*** has two editor controls for periods along *X* and *Y *directions, measurement unit is *nm. *The selected Check box between these editor controls imposes constrain on period values preserving their ratio during editing.
- The field ***Depth*** has two controls: ***Grating ***and *f*(x) or *g(y)* function*s*. ***Grating ***represents the minimum thickness of the imaginary layer which contains the grating profile. After exiting from these controls or after pressing the Enter key, all sinusoidal harmonics and points values in the representation of the grating profile or the function will be automatically recalculated preserving the functional shape.
- The ***Profile type*** control has three options: first two represent the grating profile as the sum or the product of functions *f*(*x) *and *g*(*y*) and third - as an arbitrary 2D harmonics presentation.
 - First two options allow editing functions *f*(*x) *and *g*(*y*) individually. The state of corresponding fields for selected function depends on the state of button ***Conversion to*** i.e. on the text under this button. If this text is *“X Points Presentation”* or *“Y Points Presentation”*, the user can edit any sinusoidal harmonic (defined by ***Harmonic Order***) individually. The user can also change the total number of harmonics in the field ***Number of Sinus Harmonics***. After pressing the button ***Conversion to*** and after the appearance of the text *“X Harmonics Presentation” *or* “Y Harmonics Presentation”*, the user can insert the data of the function profile point by point (the original function profile will be deleted) and should choose the ***Number of Approximating Harmonics*** to decompose the inserted function as a harmonic set. In this regime by right mouse click of the ***Point Index*** control the user activates a *Popup Menu* which helps to edit points of a grating profile. After finishing the data insertion, the user can convert these data to the pure harmonics presentation or leave it as it is. This operation does not affect the result of the calculation but it is irreversible in the representation of the function profile.
 - Third option activates the button ***Load profile***. If there is not 2D harmonics data the button ***Profile plot*** is inactive.
- Pressing the ***Load profile*** button opens the intermediate *Profile 1D to Harmonics* or *Profile 2D to Harmonics* window depending on the state of Profile Type control.
 In case of 1D Profile window the user may load the data text file (extensions .dat or .txt) followed by selection of profile depth and number of harmonics approximation of loaded profile. Profile must be single-valued function on a unit cell of the grating. File should contain two columns X or Y (arbitrary) and Z (nanometer) coordinates respectively. The length of the profile table must be greater than or equal to two. The first line of the columns names is allowed. Columns should be separated by tab or double space. Values in the X or Y column will be normalized by software to a corresponding single period.
 In case of 2D Profile window the user may load user defined or one of the predefined profiles followed by selection of profile depth and number of *X* and *Y* Fourier harmonics in profile presentation. The view of full grating can be activated by right mouse click at *Combo box* or *Select* button, where the unit grating cell is selected by the red square boundary.
 The user 2D Profile must be defined on a unit cell of the grating and must be single-valued function. Two text file formats are accepted by software. First format is a simple *Nx* (number of lines) by *Ny* (number of entries in each row) *FFT* grid table of profile height values in *nm* separated by tab or double space character*. *The numbers *Nx* and *Ny* must be power of two and belong to a range of 8-512. Second format is a general table of profile height values in *nm* with first column and first line representing* X* and *Y *coordinates respectively. The number of lines and the number of entries in each row must be greater than or equal to 3. Coordinates (X and Y) can be of any scale but in no decreasing sequence. These coordinates will be normalized by software to corresponding single periods. Common element of first line and column should be a simple string, for example "x-y".
- The button ***Profile Plot*** opens a window with a selected interface grating profile.
- The extended method implies the additional ***Interface ***field which provides possibility to choose the interface for editing. The interface indexes start from “*0*” and finish with the index of the last layer.
- For the extended method by clicking the right mouse button at ***Interface*** field the user activates the *Popup Menu* for manipulating the interfaces grating profiles (copy, paste, etc.).
- The extended method implies additional button ***Remove Interface.*** This button is active if the layers adjacent to the interface have identical permittivity.

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