Mathematics of RCWA

This section is for developers who want to understand the implementation of this package, for example, to implement their own manipulations on top of it or extend functionality. It follows the formulation laid out by Rumpf. This is intended as a reference for developers with a fairly advanced electromagnetics and mathematics background, and assumes a knowledge of electromagnetic modes, vectors, matrices, matrix multiplication, and vectors and matrices composed of other vectors and matrices.

Definitions and Conventions

Nx: number of harmonics along x-direction
Ny: number of harmonics along y-direction.
Ntot=NxNy: Total number of harmonics
nx: Used to index the x-harmonics. Ranges from negative to positive.
ny: Used to index the y-harmonics. Ranges from negative to positive.
E: Electric Field
H: Magnetic Field
s: Electtric field (Fourier) coefficient
u: Magnetic field (Fourier) coefficient
c: Mode coefficient
W: Electric field coefficient mode matrix
V: Magnetic field coefficient mode matrix

Layer “0” is the incident layer. Layer “1” is the layer closest to the incident region.

Fields and Field Coefficients

The formulation of rigorous coupled wave analysis involves decomposing the electric and magnetic fields into their plane wave components. Rather than working with the electric field Ex directly, we work instead with the field coefficients sx.

Ex(x,y,z)=nx=ny=sx(nx,ny,z)ej(kx(nx,ny)x+ky(nx,ny)y)

Where

kx(nx,ny)=kx,incidentnxT1,xnyT2,xky(nx,ny)=ky,incidentnxT1,ynyT2,y

where T1 and T2 are the lattice parameters of the photonic crystal under study. If a 1D grating is used, T2=0. For thin films, T1 is also zero, and only one harmonic needs to be represented - the incident harmonic.

Note that the field coefficients are, in general, a function of z.

Field Coefficients

The electric (s) and magnetic (u) field coefficients are internally represented by vectors which have both x- and y-components, and these are different for each. Taking just electric field coefficient vector in the i-th layer:

si(z)=[si,x(z)si,y(z)]

The length of the si,x and si,y vectors have length equal to Ntot, so the total length of the si vector is Ntot2. These vectors are indexed (nx,ny). For a Nx=3 and Ny=3 setup, the vector looks like this:

si,x=[si,x(1,1)si,x(1,2)si,x(1,3)si,x(2,1)si,x(2,2)si,x(2,3)si,x(3,1)si,x(3,2)si,x(3,3)]

The x-component of the zero-order harmonic corresponds to the field coefficient si,x(2,2).

These field coefficients are, in general, functions of the z-coordinate. This makes them awkward to work with directly, which is why we typically work with mode coefficients instead.

Mode Coefficients

Internally, this package typically works with mode coefficients, referred to using the symbol c. Forward-propagating mode coefficients inside the ith layer are represented with the symbol ci+ and backward-propagating mode coefficients inside the ith layer are represented with the symbol ci. Each mode has a single value of kz, the propagation constant in the z-direction. You could say this is what defines a mode. For planar films, the modes are always plane waves. For 1D- and 2D-photonic crystals, they require several plane waves (harmonics) to represent.

Just as with field coefficients, both the x- and y-components of the mode coefficients must be kept internally. As with the field coefficients, both forward- and backward-propagating mode coefficients are represented with the x-components followed by the y-components.

ci+=[ci,x+ci,y+]

ci,x+ and ci,y+ are vectors with length equal to the total number of harmonics (i.e. for a 2D photonic crystal if Nx=3 and Ny=3, then Ntot=NxNy=9, and the length of the total vector ci+ is 18.

Scattering Matrices couple Mode Coefficients

The scattering matrix for the ith layer relates the forward- and backward propagating mode coefficients between the ith and i+1th layer in the following way:

[cici+1+]=[Si,11Si,12Si,21Si,22][ci+ci+1]

This can be rearranged to solve for the i+1th mode coefficients given the ith mode coefficients.

Electric Field Coefficients

The mode coefficients in the ith layer can be related to directly to the x- and y-components of the electric fields (sx and sy) using the electric mode matrix, represented with the symbol W. This matrix takes the forward- and backward-traveling mode coefficients and converts them into the electric field coefficients. The values of kz for each mode are also needed, which are assembled diagonally along the λ matrix.

[si,xsi,y]=W.eλz.ci++W.eλz.ci

Magnetic Field Coefficients

Similarly, the mode coefficients in the ith layer can be related to the x- and y-components of the magnetic field coefficients ux and uy using the magnetic mode matrix, represented with the symbol V, along with, as before, the λ matrix.

[ui,xui,y]=V.eλz.ci++V.eλz.ci

Finding Mode coefficients inside an arbitrary layer

Once the scattering matrices for each layer Si are known, the incident mode coefficients s0 are known and the global scattering matrix Sglobal is known, the mode coefficients in an arbitrary layer can be calculated.

First, the mode coefficients in the incident region must be found. To do this, you can find the m. c0+ using the Wincident matrix and sincident vector (which contains the x- and y-components of the zero-order harmonic), and c0 can be calculated from the global scattering matrix. Note that sincident is not the same as s0, which also contains the reflected field coefficients.

c0+=Wincident1sincidentc0=Sglobal,11c0+

Then, by applying the formula below as many times as is required, mode coefficients within the desired layer can be found:

ci+1=Si,121ciSi,121Si,11ci+ci+1+=Si,21ci+1+Si,22ci+1

Find E/H Coefficients inside an arbitrary Layer

Once the mode coefficients have been found, the electric and magnetic field coefficients can be found as described previously. Note that at this point, the field coefficients will still be a function of the z coordinate.

Finding the electric and magnetic fields inside an arbitrary layer

Electric Fields

Once the electric field coefficients are known, the electric fields can be calculated using the formula above for a certain value of x and y, as a function of z.

First, the diagonal k-matrices Kx and Ky can be converted into vectors kx and ky. Then, the complex exponential can be evaluated element-wise directly:

evec=ej(kxx+kyy)

This is itself a vector with the same length as sx. The dot product (NOT inner product, there is no complex conjugation) of this vector and the exponential vector evec finally yields the x-component of the electric field. This may be repeated for the y-component as well, by dotting with the sy vector.

Ex(x,y,z)=evecsx