Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

1024 J. Opt. Soc. Am. A / Vol. 13, No.

5 / May 1996 Lifeng Li

Formulation and comparison of two recursive


matrix algorithms for
modeling layered diffraction gratings

Lifeng Li
Optical Sciences Center, University of Arizona, Tucson, Arizona 85721

Received July 20, 1995; revised manuscript received November 13, 1995; accepted December 4, 1995
Two recursive and numerically stable matrix algorithms for modeling layered diffraction gratings, the S-matrix
algorithm and the R-matrix algorithm, are systematically presented in a form that is independent of the
underlying grating models, geometries, and mountings. Many implementation variants of the algorithms
are also presented. Their physical interpretations are given, and their numerical stabilities and efficiencies
are discussed in detail. The single most important criterion for achieving unconditional numerical stability
with both algorithms is to avoid the exponentially growing functions in every step of the matrix recursion.
From the viewpoint of numerical efficiency, the S-matrix algorithm is generally preferred to the R-matrix
algorithm, but exceptional cases are noted.  1996 Optical Society of America

1. INTRODUCTION of arbitrary profile, depth, and permittivity. Chateau


and Hugonin8 proposed an algorithm, with the coupled-
As research in the field of diffraction gratings advances wave method, to model surface relief and volume gratings
and the range of grating applications widens, the struc- made of lossless and lossy dielectric materials. Montiel
tures of gratings become more complicated than before. and Nevière9 applied the R-matrix algorithm to the dif-
One of many new types of gratings that are finding more ferential method and thereby eliminated “the numerical
applications is layered gratings. For example, multi- instabilities that have plagued the differential theory in
layer thin films were deposited onto photoresist surface- TM polarization during the past 20 years (Ref. 9, p. 3241).
relief gratings to make high-efficiency, all-dielectric Recently Li10 applied the R-matrix algorithm to the dif-
reflection gratings,1 and coating polycarbonate lamellar ferential formalism of Chandezon et al. (the C method)
gratings with a layer of MgF2 was proposed as a means and thus removed a formerly existing limitation of the
of making broadband antireflection structures.2 Per- C method. The same goal was later achieved by Cotter
haps the most extreme cases of layered gratings are the et al.11 using a scattering-matrix approach (S-matrix
Bragg – Fresnel gratings for use in x-ray spectroscopy3 and algorithm). The S-matrix algorithm was also used by
the photonic band-gap materials.4 On the other hand, Maystre4 in an electromagnetic study of photonic band
in some grating models even a grating that consists of a gaps by the integral method. Additionally, Li12 showed
single periodically corrugated surface is treated numeri- that under certain conditions the S-matrix algorithm
cally as a layered structure. In this paper the term (which, unfortunately, was referred to there as the
layered gratings will be used broadly to refer to both R-matrix algorithm) and the Bremmer series algorithm
physically and numerically layered periodic structures. are equivalent. Very recently Moharam et al.13 pre-
All numerical methods for analyzing layered gratings sented another stable algorithm, which they call the
face a common difficulty associated with the exponential enhanced transmission matrix approach. For references
functions of the spatial variable in the direction perpen- concerning the applications of the S-matrix and R-matrix
dicular to the grating plane. This difficulty is indicative algorithms to problems of wave propagation and scatter-
of many problems of wave propagation and scattering in ing outside the field of diffraction gratings, the reader
layered systems, and it is exacerbated by the fact that may consult the reference list in Ref. 12.
accurate numerical analysis of gratings usually requires Now there exist many stable numerical algorithms
a large number of eigenmodes. Recently this numerical and several variants of implementation, expressed with
difficulty has been overcome by many authors.4 – 15 First, different terminologies and applied to different grating
Pai and Awada5 presented a Bremmer series method, models. There are obvious similarities and subtle differ-
based on the modal analysis with Fourier expansions, for ences among these algorithms and their variants. Their
dielectric gratings of arbitrary profile and groove depth advantages and disadvantages, as well as interrelation-
in TE polarization. At the same time, DeSandre and ships, have not been addressed in the literature. The
Elson6 presented an extinction-theorem analysis of purpose of this paper is to provide a systematic and
diffraction anomalies in multilayer-coated shallow grat- unified presentation of the S-matrix and R-matrix al-
ings by using the R-matrix propagation algorithm. gorithms, independent of the underlying grating models
Later, Li7 applied the R-matrix algorithm to the classical (integral, differential, modal, etc.) being used and the in-
modal method and enabled the latter to treat gratings cidence conditions (TE, TM, or conical mount), and to

0740-3232/96/051024-12$10.00  1996 Optical Society of America


Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1025

compare these two algorithms in terms of their physi- We abstract a layered grating structure by a series of
cal interpretations, numerical stabilities, and numerical parallel straight lines, each representing a real or numeri-
efficiencies. Some results presented here have already cal, straight or curved interface, depending on the profile
appeared in the literature, but many intricate details of the medium interface and the grating model being used
are new. [see Fig. 2(a)]. For example, suppose that for the layered
The algorithmic structure of the S-matrix and R-matrix grating shown in Fig. 1 we use the classical modal method
algorithms is recursive, and the matrix dimension in the to treat the rectangular profile, the same method with a
recursion is independent of the number of layers. Mean- three-layer approximation to treat the triangular profile,
while, there exist stable and nonrecursive algorithms, for the differential method with a three-slice decomposition to
example, those in Refs. 14 and 15. In these algorithms treat the asymmetrical smooth profile, and the C method
the field amplitudes in all layers are solved together from to treat the top three profiles. Then, in Fig. 2(a), n ­ 15,
a large linear system of equations whose matrix dimen- 2 for the rectangular profile, 4 for the triangular profile,
sion is proportional to the number of the layers. The 4 for the asymmetrical smooth profile, and 6 for the top
nonrecursive algorithms and the recursive algorithm of three profiles. The permittivities in Fig. 2(a) may be ei-
Moharam et al.,13 which has a structure different from ther constants or periodic functions of x, depending on the
that of the S-matrix and R-matrix algorithms, are not spatial region and the grating model. Media 0 and n 1 1
considered in this paper. are two semi-infinite homogeneous media. The dashed
In what follows, first the framework is laid down, in line in medium 0 is a numerical interface. It can be ar-
Section 2, for the development in the subsequent sections
by defining the notation and the basis functions. The
S-matrix algorithm and the R-matrix algorithm are pre-
sented in Sections 3 and 4, respectively. The presenta-
tions are arranged as parallel as possible for the two
algorithms to bring out their similarities. Several vari-
ants of the two algorithms are then given in Section 5.
In Section 6 the two algorithms are compared in terms
of their numerical stabilities and efficiencies. Finally, in
Section 7 some remarks are made that are specific to the
applications of the algorithms to several grating models.

2. BACKGROUND FRAMEWORK
Fig. 1. General layered grating. All periodic medium inter-
A. Layer Abstraction faces share a common period, but otherwise they are arbitrary.
Figure 1 depicts a multilayer surface-relief grating. We
assume that the profiles of all medium interfaces have
the same periodicity in the x direction and that they are
invariant in the z direction. We say that two adjacent
interfaces are separable if a line y ­ constant can be
drawn between them without crossing either interface;
otherwise, we say that they are nonseparable. Thus the
bottom three interfaces in Fig. 1 are separable, and the
top three are not.
The S-matrix and R-matrix algorithms are applicable
to all grating models, but here the discussion will be re-
stricted to the classical modal method, the C method,
the coupled-wave method, and the differential method.
When it is not necessary to make the distinction, the first
three methods will be referred to collectively as the modal
methods, because they all rely on finding eigenmodes of
Maxwell’s equations. The classical modal method and
the coupled-wave method approximate a continuous pro-
file by a stack of lamellar gratings, as illustrated in the
triangular grating in Fig. 1. This numerical approxima-
tion effectively introduces a number of numerical layer
interfaces. The differential method does not use the
multilayer lamellar grating approximation, but for nu-
merical purposes it decomposes a grating profile into thin
horizontal slices, thus also creating numerical layer inter-
faces. If two adjacent medium interfaces have identical Fig. 2. Abstract layered grating structure, where the horizontal
functional form and amplitude, the C method does not lines represent either actual material interfaces or numerical
interfaces. The fields in each layer can be represented either
require any numerical layer interface; otherwise, one nu- (a) as a superposition of upward- and downward-propagating
merical interface may be needed between the two medium and decaying waves or ( b) as a superposition of two sets of
interfaces.16,17 orthogonally polarized eigenmodes.
1026 J. Opt. Soc. Am. A / Vol. 13, No. 5 / May 1996 Lifeng Li

bitrarily close to interface 0. The thickness of layer p C. Boundary Conditions


will be denoted by hp . In this subsection we affix the equation numbers of all
equations that apply only to the u –d basis functions
B. Basis Functions with a letter a, and those that apply only to the U – V
When a modal method is used to analyze layer p in basis functions with a letter b. The same convention will
Fig. 2(a), the fields there are represented by superposi- be used for the formulas of the S-matrix and R-matrix
tions of the eigenmodes. We assume that the eigenmodes algorithms in Sections 3, 4, and 5.
in all layers share a common Floquet exponent, which is In the modal methods, when the boundary conditions
determined by the incident plane wave. The eigenvalue are matched along interface p, we generally get an equa-
s pd
spectrum s s pd , having elements lm , can be partitioned tion of form
s pd s pd1 s pd2
such that s ­ s <s , where " # " #
s p11d
us p11d s yp 1 0d s pd
us pd s yp 2 0d ,
s s pd6 ­ hlsmpd ; s pd
Re lm 1 Im lsmpd _ 0, s pd
lm [ s s pd j . W ­W (2a)
ds p11d s yp 1 0d ds pd s yp 2 0d
(1)
where W s pd and W s p11d are square matrices. Further-
In general, for any numerical truncation, s s pd1 and s s pd2
more, by virtue of the modal fields,
have the same number of elements. The dependence of
" # " #
the eigenmodes on y, i.e., the y-dependent basis functions, us pd s yp 2 0d us pd s yp21 1 0d ,
s pd6 s pd6 s pd
is given by expfilm yg, where lm [ s s pd6 . (Here y ­f (3a)
ds pd s yp 2 0d ds pd s yp21 1 0d
should be replaced by u if the C method is used; how-
ever, for simplicity we will ignore this minor difference.) where
s pd1
Thus we call an eigenmode corresponding to lm an up 2 3
s pd2 s pd1
wave, and that corresponding to lm a down wave. In expsilm hp d 0
particular, in the two semi-infinite regions and the ho- f s pd ­4 s pd2
5, (4a)
0 expsilm hp d
mogeneous regions between the separable medium inter-
faces, the eigenmodes are simply the Rayleigh modes. In and the exponential functions represent diagonal matrices
Fig. 2(a) the upward and downward arrows schematically (henceforth, all quantities with a subscript m represent
represent the up wave and down waves, and the boldface diagonal matrices). Thus we obtain a recursive relation
letters u and d denote the column vectors whose elements for the field amplitudes
are the wave amplitudes. Once the eigenmodes are de- " # " #
termined everywhere, the grating problem reduces to a us p11d s yp 1 0d s pd
us pd s yp21 1 0d ,
problem of determining the mode amplitudes. ­ t̃ (5a)
s pd1 s pd1
ds p11d s yp 1 0d ds pd s yp21 1 0d
Alternatively, we can choose cosslm yd and sinslm yd
as the basis functions, which is always possible because where
s pd2 s pd1
lm ­ 2lm with the classical modal method and the
coupled-wave method and with the C method when the t̃s pd ­ ts pd f spd , (6)
grating profile is symmetrical. We use U and V to denote
the amplitudes of the modes that use this basis function with
set. The physical meaning of these amplitudes is clear:
for example, if U is proportional to the z component of the ts pd ­ W s p11d21 W s pd . (7)
electric field, then V is proportional to the x components
of the magnetic field, as schematically shown in Fig. 2( b). The matrices ts pd and t̃s pd can be fittingly called interface
From a mathematical point of view, the derivative of a and layer t matrices, respectively. Note that ts pd is of
U mode is a V mode, and vice versa. For the modal meth- order Os1d.18
ods, both the exponential (or u – d) basis functions and the If the U – V basis functions are used to match the bound-
trigonometrical (or U – V) basis functions can be used. ary conditions, we have, correspondingly,
In the differential method, one does not seek the eigen- " # " #
U s p11d s yp 1 0d U s pd s yp 2 0d ,
solutions of Maxwell’s equations. Instead, one numeri- W s p11d ­ W s pd
s2bd
cally integrates U from one interface to another, where U V s p11d s yp 1 0d V s pd s yp 2 0d
" # " #
is a column vector whose elements are the Fourier expan- U s pd s yp 2 0d U s pd s yp21 1 0d ,
s pd
sion coefficients of the z component of the electromagnetic ­f s3bd
V s pd s yp 2 0d V s pd s yp21 1 0d
fields. The numerical integration procedure gives the
values of U and V ­ dUydy as functions of y. Clearly, f s pd ­
the U – V basis functions described here correspond to 2 3
s pd s pd s pd
the U – V basis functions described in the preceding para- 4 cossl m h p d h m sinsl m h d
p 5,
s pd21 s pd s pd s4bd
graph. Thus the schematic diagram in Fig. 2( b) applies 2hm sinslm hp d cosslm hp d
to the differential method as well. It is possible to have " # " #
U s p11d s yp 1 0d s pd
U s pd s yp21 1 0d .
a set of u – d basis functions for the differential method ­ t̃ s5bd
if suitable linear combinations are made.9 It is impor- V s p11d s yp 1 0d V s pd s yp21 1 0d
tant to realize that, although the basis functions for the s pd
differential method do not have an explicit y dependence, In Eq. (4b), hm is a constant independent of hp , and for
their y dependence is asymptotically the same as that of simplicity the plus sign has been dropped from the su-
s pd1
the basis functions in the modal methods. perscript of eigenvalue lm . Also, the same notation
Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1027

W, f, and t is used with the two different basis function


sets. This, however, is not a problem because the context
will tell to which basis the matrices are referring. From
now on, the amplitude vectors without an explicit argu-
ment stand for the vectors that are evaluated at the lower
bound of the layer. For example, us pd ; us pd s yp21 1 0d.
At this point, it is most natural and mathematically
simplest to proceed with solving the grating problem by
the so-called T-matrix algorithm, which is obtained by re-
peated use of Eq. (5a) or Eq. (5b). However, it is well
known that the T-matrix algorithm, with either of the ba- Fig. 3. Schematic diagrams for alternative interpretations of
(a) the S matrix and ( b) the R matrix. In Fig. 3(a), I and O
sis function sets, is numerically unstable when the total stand for inputs to and outputs from the system represented
layer thickness of the grating structure and the matrix by the square box. In Fig. 3( b), i and v stand for currents
dimension are large.7 This numerical instability is gen- and voltages at the terminals of the circuit represented by the
erally attributed to the presence of the growing expo- square box.
nential functions in the algorithm. Fundamentally, the
cause of instability is a classic one: loss of significant To link the waves in two adjacent layers, we can define
digits when one is computing a small number by subtract- an interface s matrix, ss pd , and a layer s matrix, s̃s pd , as
ing two large numbers by a computer of finite precision. follows:
Symbolically, it is a case of ` 2 ` ­ Os1d. It should be " # " #
emphasized that the numerical instability of the T-matrix us p11d s yp 1 0d s pd
us pd s yp 2 0d ,
algorithm cannot be eased or removed by simply reduc- ­s (10a)
ds pd s yp 2 0d ds p11d s yp 1 0d
ing the individual layer thicknesses without lowering the " # " #
total thickness, because the T-matrix algorithm accumu- us p11d s pd us pd
­ s̃ , s11ad
lates the magnitudes of the exponential functions as the ds pd ds p11d
layer t matrices are multiplied together.
or
" # 2 3" #
3. S-MATRIX ALGORITHM us p11d s pd s pd
t̃uu r̃ud 5 us pd .
­ 4 s pd s pd (12a)
The S-matrix algorithm uses the exponential basis func- ds pd r̃du t̃dd ds p11d
tions. For any 0 # p # n, it seeks a stack S matrix, S s pd ,
that links the waves in layer p 1 1 and medium 0 in this
way: The physical interpretations of ss pd and s̃s pd are similar
s pd s pd
" # " # to that of S s pd . Note that t̃uu and t̃dd , because of the
us p11d s pd us0d .
notation of their subscripts, cannot be confused with the
­S (8a) t matrix defined in Section 2. The layer s matrix is re-
ds0d ds p11d
lated to the interface s matrix by
Before moving on, it is important to describe the physical " # 2 3
meaning of the S matrix. For this purpose we rewrite s pd1
1 0 expsilm hp d 05,
S s pd in a two-by-two block form: s̃s pd ­ s pd2 ss pd 4
0 exps2ilm hp d 0 1
" # 2 3" # (13a)
s pd s pd
us p11d Tuu Rud 5 us 0d
­ 4 s pd s pd
. (9a)
ds0d Rdu Tdd ds p11d and the interface s matrix is in turn related to the inter-
face t matrix by
The significance of the subscripts u and d becomes evident 2 3
s pd s pd s pd21 s pd s pd s pd21
once the reader mentally carries out the matrix-vector t 2 t12 t22 t21 t12 t22 5 .
multiplication on the right-hand side of the equation. As ss pd ­ 4 11 s pd21 s pd s pd21 (14a)
2t22 t21 t22
a rule in this paper, the use of subscripts u and d is
an automatic indication that the submatrix belongs to a
Note that all four entries in Eq. (14a) contain the inverse
matrix in the S-matrix algorithm. The choice of letters s pd s pd
of submatrix t22 . For this reason we call t22 the pivotal
R and T, instead of S, makes the physical meanings of the
submatrix.
four submatrices of S s pd self-explanatory. For example,
s pd s pd From Eqs. (8a) and (11a), the set of recursion formulas
Tuu and Rud are the transmission matrix and reflection
for the stack S matrix are
matrix that give the upward wave amplitudes in layer
p 1 1 resulting from the transmission of the upward h i
s pd s pd s p21d s pd 21 s p21d
incident waves in medium 0 and from the reflection of Tuu ­ t̃uu 1 2 Rud r̃du Tuu ,
the incident downward waves in layer p 1 1, respectively, h i
s pd s pd s pd s p21d s pd s p21d 21 s pd
by the whole stack below layer p 1 1. Alternatively, the Rud ­ r̃ud 1 t̃uu Rud 1 2 r̃du Rud t̃dd ,
first p layers of the layered grating can be viewed as a h i 21
s pd s p21d s p21d s pd s p21d s pd s p21d
linear four-terminal network. Matrix S s pd operates on Rdu ­ Rdu 1 Tdd r̃du 1 2 Rud r̃du Tuu ,
the two sets of inputs to generate the two sets of outputs, h i 21
s pd s p21d s pd s p21d s pd
Tdd ­ Tdd 1 2 r̃du Rud t̃dd . (15a)
as shown schematically in Fig. 3(a).
1028 J. Opt. Soc. Am. A / Vol. 13, No. 5 / May 1996 Lifeng Li

The S-matrix recursion can be initialized by setting ings that contain multiple planar interfaces but only one
" # periodically modulated interface.19
s21d
1 0 , To link the fields in two adjacent layers, we can define
S ­ (16a)
0 1 an interface r matrix, r s pd , and a layer r matrix, r̃ s pd , as
follows:
or, equivalently, by setting S s0d ­ ss0d . " # " #
The form of the factors enclosed by the square brack- U s p11d s yp 1 0d s pd
V s p11d s yp 1 0d ,
­ r (10b)
ets in Eq. (15a) is such that the inverse matrices can be U s pd s yp 2 0d V s pd s yp 2 0d
readily expanded, at least formally, into a geometrical se- " # " #
U s p11d s pd V
s p11d
.
ries in terms of the product of the two reflection matrices. ­ r̃ s11bd
This fact naturally gives rise to the multiple-reflection in- U s pd V s pd
terpretation of the S-matrix recursion formulas.12 (It is
The layer r matrix is related to the interface r matrix by
quite unfortunate that in Ref. 12 the S-matrix algorithm
was incorrectly called the R-matrix algorithm.) Because s pd s pd s pd s pd
r̃11 ­ r11 2 r12 z s pd r21 ,
of the elegant form of the inverse matrices, Eqs. (15a) will h i
s pd s pd
be called the normalized S-matrix recursion formulas. r̃12 ­ r12 z s pd hms pd
csc lsmpd hp ,
Equations (8a) – (16a) constitute the basic ingredients h i
s pd s pd s pd s pd
of the S-matrix algorithm. In most grating problems the r̃21 ­ hm csc lm hp z s pd r21 ,
h i h i
quantities of interest are the field amplitudes leaving the s pd s pd
r̃22 ­ hm cot lsmpd hp 2 hm s pd
csc lsmpd hp
grating structure in the two outer media, i.e., usn11d and h i
ds0d . They are simply given by 3 z s pd hms pd
csc lm s pd
hp , (13b)
" # 2 snd
3" #
us n11d 4 T snd
R ud 5 us0d . where
­ uu
snd snd (17a) h i 21
ds0d Rdu Tdd ds n11d s pd
z s pd ­ r22 1 hm
s pd
cotslsmpd hp d . (13b0 )
In particular, if there are no incident waves in medium
0 sus0d ­ 0d, For a proof of Eq. (13b), see Appendix A. Here we have
s pd
excluded the possibility that accidentally lm hp ­ lp,
snd
us n11d ­ Rud dsn11d , where l is an integer. The interface r matrix is in turn
snd related to the interface t matrix by
ds0d ­ Tdd dsn11d . (18a) 2 3
s pd s pd21 s pd s pd s pd21 s pd
t t t 2 t t t
r s pd ­ 4 s pd21 5.
11 21 12 11 21 22
The numerical stability of the S-matrix algorithm (14b)
s pd21 s pd
is rooted in the construction of the layer s matrix. t21 2t21 t22
The problem-causing, growing exponential function,
s pd2
expsilm hp d, that was originally in the t̃ matrix, is From Eqs. (13b) and (14b) it is clear that r̃ s pd is of order
now inverted in Eq. (13a). Since ss pd is of order Os1d, so Os1d. Alternatively, we can use the layer t matrix to
is s̃s pd . Furthermore, the submatrices of s̃s pd appear in express the layer r matrix:
the recursion formulas only as additive or multiplicative 2 3
s pd s pd21 s pd s pd s pd21 s pd
t̃ t̃ t̃ 2 t̃ t̃ t̃
terms. Thus the S matrices remain of order Os1d, and r̃ s pd ­ 4 s pd21 5.
11 21 12 11 21 22
s pd21 s pd
(14b0 )
the numerical stability of the algorithm is ensured. t̃21 2t̃21 t̃22
s pd s pd
4. R-MATRIX ALGORITHM In Eqs. (14b) and (14b0 ) t21 and t̃21 are the pivotal sub-
s pd
The R-matrix algorithm uses the trigonometrical basis matrices. In some cases it is possible that t21 ; 0, but
s pd
functions. For any 0 # p # n, it seeks a stack R matrix, then t̃21 fi 0. In fact, such a case can be utilized bene-
R s pd , that links the fields in layer p 1 1 and medium 0 ficially (see Appendix B).
in this way: From Eqs. (8b) and (11b) the set of recursion formulas
" # " # for the stack R matrix are
U s p11d s pd V
s p11d
. s pd s pd s pd s pd
­ R (8b) R11 ­ r̃11 2 r̃12 Z s pd r̃21 ,
U s0d V s0d
s pd s pd s p21d
R12 ­ r̃12 Z s pd R12 ,
The R matrix can be physically interpreted as field s pd s p21d s pd
impedance or field admittance (the ratio of the tangential R21 ­ 2R21 Z s pd r̃21 ,
component of the E field to the tangential component of s pd s p21d s p21d s p21d
R22 ­ R22 1 R21 Z s pd R12 , (15b)
the H field or its inverse). For example, in TE polariza-
tion, because U and V correspond to the E and H fields, where
respectively, R s pd plays the role of field impedance. An s pd s p21d 21
alternative interpretation of Eq. (8b) can be made, with Z s pd ­ sr̃22 2 R11 d . (15b0 )
the aid of Fig. 3( b), in terms of currents and voltages in The R-matrix recursion can be initialized by setting
an electrical circuit. Here, if U is identified with the
voltages and V with the currents, or vice versa, then R s pd R s0d ­ r̃ s0d . (16b)
is the electrical impedance or admittance. The concept
of impedance has been used previously in modeling grat- Unlike their counterparts in the S-matrix algorithm,
Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1029

Eqs. (15b) do not readily subject themselves to an intui- three steps: the definitions and derivations of the layer
tive physical interpretation. Nonetheless, to preserve t matrices, the layer s (or r) matrices, and the stack S
the formal symmetry between the two algorithms, we (or R) matrices. Although from a theoretical point of
shall call Eqs. (15b) the normalized R-matrix recursion view the introduction of the layer t matrices and the
formulas. layer s (or r) matrices has made the presentation system-
Starting with Eq. (16b), repeated use of Eqs. (15b) until atic, from a practical point of view the use of one of the
p ­ n leads to two kinds of layer matrices can be eliminated, as demon-
" # 2 s nd s nd
3" # strated below.
U sn11d 4 R R 12 5 V
sn11d
. The S-matrix recursion can be accomplished by use
­ 11
s nd s nd (17b)
U s0d R21 R22 V s0d of the t matrices directly, without the layer s matrices.
From Eqs. (5a), (6), and (9a) we can easily derive a set of
Suppose that U s0d ­ us0d 1 ds0d , V s0d ­ us0d 2 ds0d , U sn11d ­ nonnormalized S-matrix recursion formulas by using the
usn11d 1 dsn11d , and V sn11d ­ usn11d 2 dsn11d , which is al- interface t matrix:
ways possible by definition. Then from Eq. (17b) we get h i
s pd s pd s pd s pd s pd s p21d
the linear system that determines the out-going diffrac- Tuu ­ t11 2 Rud t21 f1 Tuu ,
tion amplitudes in the top and bottom media: h ih i 21
2 3" s pd s pd s pd s pd s pd
s nd s nd
# Rud ­ t12 1 t11 V s pd t22 1 t21 V s pd ,
s n11d
4 1 2 R 11 R12 5 u s pd s p21d s pd s pds p21ds pd
s nd
2R21 1 1 R22
s nd
ds0d Rdu ­ Rdu 2 Tdd t21 f1 Tuu ,
2 3" h i
# s pd s p21d s pd21 s pd s pd s pd 21
s nd s nd Tdd ­ Tdd f2 t22 1 t21 V , (19a)
4 21 2 R11 R12 5 ds n11d .
­ s nd s nd (18b)
2R21 21 1 R22 us0d where
s pd s p21d
The R-matrix algorithm is also immune to the numeri- V s pd ­ f1 Rud f2s pd21 , (19a0 )
cal difficulties associated with growing exponential func- s pd
and f6 are the two diagonal submatrices in Eq. (4a). Of
tions. This is because the submatrices of r̃ s pd are all of
course, Eqs. (19a) and (15a) are algebraically equivalent.
order Os1d, and they appear in the recursion formulas
Note that the above equations have been written in terms
Eqs. (15b) and (15b0 ) only as additive and multiplicative
of the interface t matrices, instead of the layer t matrices,
terms. The former fact is evident when Eq. (13b) is used s pd
to construct the layer r matrices. It is not so obvious and the appearance of f6 has been arranged properly
if Eqs. (14b0 ) are used, however; in fact, in this case the so that there are no exponentially growing functions in
R-matrix algorithm is only conditionally stable. the formulas. This measure avoids possible numerical
It can be shown that Eq. (14b0 ) and Eqs. (13b) are overflow and ensures numerical stability of the S-matrix
s pd algorithm.
algebraically equivalent. Therefore the submatrix r̃12 , s pd
as given by Eq. (14b0 ), should be mathematically pro- If we set f6 ­ 1 in Eqs. (19a) and (19a0 ) and replace
s pd all interface t submatrices by layer t submatrices, we ob-
portional to cscslm hp d, which tends to 0 as m ! ` and
s pd tain the nonnormalized S-matrix recursion formulas by
hp ! `. On the other hand, the first term of r̃12 in using the layer t matrix:
s pd s pd s pd s pd s pd s pd
Eq. (14b0 ) is t̃12 ­ t11 hm sinflm hp g 1 t12 cosflm hp g, h i
s pd s pd s pd s pd s pd s p21d
which tends to `. Thus the second term of r̃12 must also Tuu ­ t̃11 2 Rud t̃21 Tuu ,
tend to ` as m ! ` and hp ! `. Clearly this mathe- h ih i
s pd s pd s pd s p21d s pd s pd s p21d 21
matical arrangement presents a serious numerical prob- Rud ­ t̃12 1 t̃11 Rud t̃22 1 t̃21 Rud ,
lem. When the absolute values of the imaginary parts s pd s p21d s pd s pd
s p21d
s pd Rdu ­ Rdu 2 Tdd t̃21 Tuu ,
of lm hp are large, the numerically calculated matrix ele- h i
s pd s pd s p21d s pd s pd s p21d 21
ments of r̃12 by Eq. (14b0 ) may not be small, as a result Tdd ­ Tdd t̃22 1 t̃21 Rud . (20a)
of round-off errors. Let Ls pd be the maximum of the ab-
solute values of the imaginary parts of all eigenvalues for The use of this set of recursion formulas should be avoided
a given matrix truncation. As a rule of thumb, when whenever possible, because the matrix to be inverted is a
expfLs pd hp g , 1015 , the numerical problem described sum of an exponentially growing matrix and an exponen-
above begins to arise (double precision is assumed here). tially decaying matrix.
To avoid the problem one has to choose the layer thick- The R-matrix recursion can also be accomplished with
ness so that expfLs pd hp g ,, 1015 . Therefore the R-matrix use of the t matrices directly, without the layer r matrices.
algorithm is conditionally stable when Eq. (14b0 ) is used. From Eqs. (5b), (6), and (8b) we can easily derive a set of
Fortunately, unlike the T-matrix algorithm, here the mag- nonnormalized R-matrix recursion formulas by using the
nitudes of the exponential functions do not accumulate. layer t matrix:
Therefore lowering the individual layer thickness is an h ih i
s pd s pd s pd s p21d s pd s pd s p21d 21
effective remedy for the numerical instability caused by R11 ­ t̃12 1 t̃11 R11 t̃22 1 t̃21 R11 ,
h i
the use of Eq. (14b0 ). s pd s pd s pd s pd
R12 ­ t̃11 2 R11 t̃21 R12 ,
s p21d

h i
s pd s p21d s pd s pd s p21d 21
5. VARIANTS OF IMPLEMENTATION R21 ­ R21 t̃22 1 t̃21 R11 ,
A. Variation in Matrix Manipulation s pd s p21d s pd s pd s p21d
R22 ­ R22 2 R21 t̃21 R12 . (20b)
In Sections 3 and 4 the S-matrix and R-matrix algorithms
were systematically presented. The presentation took Since Eqs. (20b) are algebraically equivalent to Eqs. (15b),
1030 J. Opt. Soc. Am. A / Vol. 13, No. 5 / May 1996 Lifeng Li

the R matrices obtained this way are mathematically of B. Variation in Recursion Order
order Os1d. Numerically, however, devastating round-off The S-matrix and R-matrix recursions do not have to be
errors could occur if the numerical layer thicknesses are performed in the order indicated in Sections 3 and 4. In
set too high. The reason is the same as the one given at other words, one does not have to start the calculation
the end of Section 4 for the possible numerical instability from medium 0 and work step by step up to medium
resulting from the use of Eq. (14b0 ). Specifically, the n 1 1. For the normalized recursions this point can be
s pd
expression of R12 in Eqs. (20b) is of type ` 2 ` ­ Os1d. best illustrated by the use of Redheffer’s start product.20
Thus Eqs. (20b) also give a conditional stable implemen- Let a, b, and c be 2N 3 2N matrices. Then the star
tation of the R-matrix algorithm. The unconditional product of a and b, in the S-matrix algorithm, is defined as
" # " # " #
auu aud buu bud buu s1 2 aud bdu d21 auu bud 1 buu aud s1 2 bdu aud d21 bdd ,
p ­ s23ad
adu add bdu bdd adu 1 add bdu s1 2 aud bdu d21 auu add s1 2 bdu aud d21 bdd

stable, nonnormalized R-matrix recursion formulas ob- where aud , bud , etc., are N 3 N submatrices. Similarly,
tained by using the interface t matrix are given in we define the star product of a and b in the R-matrix
Appendix C. algorithm as
We recall that in Subsection 2.C we formally derived " # " #
the layer t matrix from the boundary equation, Eq. (2a) or a11 a12 b11 b12
Eq. (2b). In fact, in at least two important cases Eq. (5a) ?
a21 a22 b21 b22
or Eq. (5b) is obtained without the aid of Eq. (2a) or " #
Eq. (2b). The first case is the classical modal method in b11 2 b12 sb22 2 a11 d21 b21 b12 sb22 2 a11 d21 a12 .
­
which matrix ts pd is obtained directly by projecting the 2a21 sb22 2 a11 d21 b21 a22 1 a21 sb22 2 a11 d21 a12
functional boundary equations onto a natural basis func- (23b)
tion set,7 and the second case is the differential method
in which matrix t̃s pd is obtained from a numerical inte-
It can be shown that the star multiplications are associa-
gration procedure.9 In these cases the use of the non-
tive, i.e., that
normalized recursion formulas may be beneficial because
they require fewer matrix operations.
In the C method and the coupled-wave method the a p sb p cd ­ sa p bd p c , (24a)
boundary equations (2a) or (2b) are an integral step of a ? sb ? cd ­ sa ? bd ? c . (24b)
the numerical treatment. In this case we can bypass the
t matrix and derive the s (or r) matrix directly from
In the remainder of this section, for simplicity, I will
the boundary equations. Writing the two W matrices in
mention only the S-matrix recursion. The results for the
Eq. (2a) in a two-by-two form, and rearranging the terms
R-matrix recursion can be obtained by obvious substitu-
slightly, we have
tions.
In terms of star products, the S-matrix algorithm can
2 3" #
s p11d s pd be succinctly expressed as
4W11 2W12 5 us p11d s yp 1 0d
s p11d s pd
W21 2W22 ds pd s yp 2 0d
2 3" S snd ­ h· · · fss̃s0d p s̃s1d d p s̃s2d g p · · ·j p s̃snd . (25a)
s pd s p11d
#
s pd
W
­ 4 s pd11 2W 12 5 u s yp 2 0 . (21a)
s p11d
ds p11d s yp 1 0d However, because of the associativity of the star multipli-
W21 2W22
cation, the product can be regrouped as follows:

Therefore from Eq. (10a), S snd ­ s̃s0d p h· · · p fs̃sn22d p ss̃sn21d p s̃snd dg · · ·j . (26a)

2 321 2 3 Equation (26a) describes the S-matrix recursion in the


s p11d s pd s pd s p11d
W 2W12 5 4W11 2W12 reverse order, starting from medium n 1 1 and moving
s s pd
­ 4 11
s p11d s pd s pd s p11d
5. (22a)
W21 2W22 W21 2W22 downward to medium 0.
The associativity of the S-matrix recursion can be used
advantageously to save computation effort or to increase
The layer s matrix, s̃s pd , then follows immediately from computation speed. Suppose that a large number of cal-
Eq. (13a). Similarly the interface r matrix, r s pd , can be culations are to be carried out for a grating with a vary-
derived directly from boundary equation (2b); i.e., ing parameter that affects only the jth layer, for fixed j.
Then the S-matrix recursion can be performed like this:
2 321 2 3
s p11d s pd s p11d s pd
W 2W11 5 42W12 W12 5 . S snd ­ fs̃s0d p · · · p s̃s j 21d g p s̃s j d p fs̃s j 21d p · · · p s̃snd g , (27a)
r s pd
­ 4 11
s p11d s pd s p11d s pd (22b)
W21 2W21 2W22 W22
where the two recursions inside the square brackets are
performed just once and then are used repeatedly to form
The layer r matrix, r̃ s pd , then follows immediately from a star product with the changing s̃s j d . If the grating cal-
Eq. (13b). culation is done on a computer capable of parallel pro-
Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1031

cessing, then the s̃ matrices can be grouped pairwise to B. Numerical Efficiencies


increase the computation speed. In this subsection we consider the numerical efficiencies
of different variants of the S-matrix and R-matrix algo-
rithms. More specifically, we estimate the number of al-
6. COMPARISONS gebraic operations that each variant takes to compute the
Having systematically addressed the S-matrix and outgoing diffraction amplitudes usn11d and ds0d , assuming
R-matrix algorithms and their variants, we are now that the W matrices in the boundary equations have been
ready to make some comparisons. As mentioned in Sec- obtained.
tions 3 and 4, the S matrices are related to the physical As is evident from the presentations in Sections 3 and
concept of reflection and transmission, and the R ma- 4, after the S-matrix recursion is completed, usn11d and
trices are related to the physical concept of impedance ds0d are readily given in a solved form. However, with the
and admittance. Furthermore, the normalized S-matrix R-matrix algorithm the completion of the R-matrix recur-
recursion formulas can be readily interpreted in terms of sion only gives a system of linear equations that has yet
multiple reflections, but the R-matrix recursion formulas to be solved to yield usn11d and ds0d . This initial compari-
and the nonnormalized S-matrix recursion formulas are son is already in favor of the S-matrix algorithm.
not easily interpreted in physical terms. In what follows We now take a closer look at the structure of the ma-
we compare the numerical stabilities and efficiencies of trix recursion formulas. We say that a subset of the four
the two algorithms. submatrices of S s pd is a closed set with respect to the
S-matrix recursion if every element of the set is deter-
mined by the elements in the same set. Thus S s pd has
A. Numerical Stabilities four closed proper subsets:
Both the S-matrix and R-matrix algorithms are inher-
ently stable because the S matrices and the R matrices s pd s pd s pd s pd s pd
are both mathematically of order Os1d. However, there hRud j, hRud , Tdd j, hRud , Tuu j,
s pds pd s pd
are subtle numerical differences between them. In gen- hRud , Tuu , Tdd j . (28a)
eral the S-matrix algorithm is much easier to work with
than the R matrix algorithm. If there are incident plane waves in both media 0 and
The implementation of the S-matrix algorithm is mostly n 1 1, then from Eq. (17a) the S-matrix recursion of
worry free ( but see Subsection 7.D), thanks to its use of all four submatrices has to be performed. Suppose that
the exponential basis functions. All s and S matrices are s pd s pd
us0d ­ 0; then only the recursion of hRud , Tdd j is neces-
of order Os1d, not only mathematically but also numer- sn11d s0d
sary if both u and d are needed, and only the recur-
ically [we assume that Eqs. (20a) are not used]. Thus s pd
sion of Rud is necessary if only usn11d is needed. We call
there is no limit in layer thickness. The possibility of
the recursions above the full, half, and quarter S-matrix
numerical overflow associated with the exponential func-
recursions, respectively.
tions is eliminated because only the decreasing exponen-
Similarly, R s pd also has four closed proper subsets:
tial functions are evaluated. Underflow can happen, but
it is not a problem for most compilers. Additionally, the s pd s pd s pd s pd s pd
s pd
occurrence of lm hp ­ lp is not a problem at all. hR11 j, hR11 , R12 j, hR11 , R21 j,
s pd s pd s pd
The implementation of the R-matrix algorithm requires hR11 , R12 , R21 j . (28b)
special treatment. Although all r and R matrices are of
order Os1d mathematically, they may not be so numeri- With the R-matrix algorithm, if both usn11d and ds0d are
cally. When the factorization of the layer t matrix into needed, the full matrix recursion has to be performed even
the product of the interface t matrix and the diagonal ma- when us0d ­ 0. If ds0d is not needed and us0d ­ 0, then
trix f is possible, one should use Eqs. (C1) and (C2) below s pd
quarter R-matrix recursion with R11 is possible, but the
to perform the nonnormalized recursion or use Eqs. (13b)
R matrix has to be initialized by
to compute r̃ s pd if the normalized recursion is to be used.
When the factorization is impossible, as is the case for " #
the differential method, the numerical layer thicknesses s21d
1 0 .
R ­ (29b)
should be kept sufficiently low that the computation of 0 21
s pd s pd
r̃12 by Eq. (14b0 ) or of R12 by Eq. (20b) will not suffer
s pd s pd s pd
significant loss of accuracy. There is also a minor tech- With this initialization, R12 ­ R21 ­ 0 and R22 ­ 21
nical complication. Functions cot and csc that admit a for all p.
complex argument are not intrinsic functions in most com- Finally, we shall provide operation counts per grat-
pilers. Thus the programmer has to write cot and csc as ing layer for the variants of the two recursive matrix al-
user-defined functions, using either the sine and cosine gorithms that have been presented in this paper. The
functions or the exponential functions. In doing so, care operation counts will be given in units of flops.21 The
has to be taken to avoid overflow. In principle, the ac- counts do not include the effort in assembling the W ma-
s pd
cidental occurrence of lm hp ­ lp is a problem for the trices and in solving the final linear system to yield usn11d
R-matrix algorithm. In practice, it is highly unlikely and ds0d . For convenience, we shall consider only the
that the equality holds for l fi 0 with high precision; operations that are proportional to N 3 , where N is the
therefore the singularity never poses serious numerical truncation order, the dimension of the submatrices. The
problems. Of course, one should judicially avoid hp ­ 0, method of counting is based on well-established rules21 :
which is an uninteresting case, anyway. suppose that A, B, and C are N 3 N nonsparse matri-
1032 J. Opt. Soc. Am. A / Vol. 13, No. 5 / May 1996 Lifeng Li

Table 1. Operation Counts (in N 3 Flops) per Grating Layer for


Different Variants of the S-Matrix and R-Matrix Algorithms
Operation Counts
Algorithm Number Algorithm Stability Full Half Quarter

1a W ---. t ----. s ----. s̃ ----


. S Unconditional 76/3 20 19
2a W ---. t ----. S Unconditional 19 15 14
3a W ----. s ----. s̃ ----
. S Unconditional 64/3 16 15
4a W ---. t̃ ----
. S Conditional 19 15 14
1b W ---. t ----
. r ----. r̃ ----. R Unconditional 25 — 21
2b W ---. t ----. R Unconditional 23 — 15
3b W ----. r ----
. r̃ ----. R Unconditional 21 — 17
4b W ---. t̃ ----. r̃----
. R Conditional 21 — 17
5b W ---. t̃ ----. R Conditional 19 — 14

ces; then AB 1 C, A21 , and A21 B 1 C take N 3 , N 3 , and totically the same in the two cases. The first few rows of
(4/3)N 3 flops, respectively. Tables 1, 2, and 3 in Ref. 9 clearly indicate that if the nu-
The results are summarized in Table 1 where imple- merical layer thicknesses are not kept low, the R-matrix
mentation variants of the S-matrix and R-matrix algo- algorithm fails when applied to the differential method.
rithms that have been described in Sections 3, 4, and 5 are The R-matrix algorithm that is used in Ref. 9 is
represented symbolically. For example, W ---. t ----. S algorithm 4b in Table 1 of this paper, which takes
represents the variant of the S-matrix algorithm that (31 /3)N 3 flops per layer for the full-matrix recursion.
uses Eq. (7) to compute the interface t matrix and then It can be improved slightly by using algorithm 5b, which
uses Eqs. (19a) to perform the S-matrix recursion. The takes (25/3)N 3 flops per layer. Instead, if the u – d ba-
broken arrows indicate that in some grating models the sis functions and algorithm 4a are used, significant im-
t matrices are obtained without using the W matrices. provement can be achieved. The operation count for the
In this case, (32 /3)N 3 flops should be subtracted from S-matrix algorithm is only (13/3)N 3 flops per layer for
the operation counts in Table 1. The subheadings of the half-matrix recursion. Furthermore, the extra work
the last three columns stand for full-, half-, and quarter- of solving the final system of linear equations, Eq. (17b),
matrix recursions, respectively. Since the half-matrix is avoided.
recursion of the R matrices serves no useful purpose, the
corresponding operation counts are not given. Clearly, C. R-Matrix Algorithm and Classical Modal Method
algorithms 2a and 3a are the most efficient, assuming In the classical modal method,7 thanks to the orthogonal-
that we start with the W matrices. ity of the modal functions and the fact that the pivotal
s pd
submatrix t21 ; 0, not only are the t matrices obtained
analytically without the W matrices, but the r matri-
7. REMARKS ces can also be determined analytically from the t matri-
A. Algorithm of Chateau and Hugonin ces without numerical inversion of the pivotal submatrix.
It is easy to see that the algorithm proposed by Chateau The result is the most efficient variant of the R-matrix
and Hugonin,8 except for the notational differences, is algorithm, which can be symbolized simply as r̃ ----. R.
algorithm 2a in Table 1 for the special case in which us0d ­ Only one of the four submatrices of r̃ s pd takes N 3 flops to
0. It is one of the most efficient variants of the general construct; the rest involve only N 2 processes. Thus the
S-matrix algorithm, but it can be slightly improved. In overall operation counts are only (22/3)N 3 and (10/3)N 3
Ref. 8 each of the three factors of the layer t matrix per layer for the full- and quarter-matrix recursions,
[see Eqs. (6) and (7)] is passed through the recursion respectively.
formula separately. So the operation count, including
D. S-Matrix Algorithm and Classical Modal Method
the inversion of W s p11d , is (50/3)N 3 for the half-recursion.
The S-matrix algorithm can be applied to the classi-
In comparison, the use of product t ­ W s p11d21 W s pd in
cal modal method, the most efficient variant being algo-
Eq. (19a) costs 15N 3 flops.
rithm 2a of Table 1. The combination of the S-matrix
B. R-Matrix Algorithm and Differential Method algorithm and the classical modal method has a peculiar
For the differential method it is natural to use the problem, which I shall describe below.
R-matrix algorithm because here the U – V basis is the In the classical modal method, the t matrices that use
natural basis. The factorization of the layer t matrices the exponential basis functions can also be obtained ana-
is unavailable in the differential method, so the applica- lytically without the W matrices, but the s matrices in
tion of the R-matrix starts with the layer t matrices. As general cannot. Without going into any detail, suffice it
explained in Sections 4 and 5, use of the t̃ matrix in the to say that the elements of ts pd at a numerical interface
R-matrix algorithm makes the stability of the algorithm are all of the form
conditional. Although the modal methods were assumed Z s p11d
when we analyzed the cause of numerical instability cl sxdfp sxdcns pd sxddx , (30)
of Eq. (14b0 ), the conclusion applies to the differential
s p11d
method as well, because the basis functions are asymp- where the integration is over one grating period, cl
Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1033

s pd
and cn are modal functions in layers p 1 1 and p, re- 8. SUMMARY
spectively, and fp is a function that depends only on the The mathematical formulations of the S-matrix and
permittivity distribution of the two layers. In what fol- R-matrix algorithms have been systematically presented.
lows, we consider the evaluation of Eq. (30) under a spe- The presentation is given in a unified fashion, indepen-
cific set of conditions: (1) the permittivity distributions dent of underlying grating models, grating geometries,
in two adjacent layers are symmetrical with respect to and grating mountings. The physical interpretations of
the origin of the x axis, (2) the grating is in the first-order the algorithms are illustrated. In addition, many vari-
Littrow mount, and (3) N ­ 2M 1 1, where M is a natu- ants of the algorithms are presented and their numerical
ral number. Under condition (1), fp is a symmetrical stabilities and efficiencies analyzed.
s p11d s pd
function. Under condition (2), cl and cn are either The S-matrix and R-matrix algorithms are inherently
symmetrical or antisymmetrical functions. Thus if inte- stable because they avoid the appearance of the expo-
gers l and n correspond to modal functions of different nentially growing submatrices in the recursion formulas.
parities, the corresponding t matrix element is identi- However, to further ensure that the algorithms be uncon-
cally zero. In the classical modal method, one normally ditionally stable, effort should be made to avoid the expo-
indexes the eigenvalues in the order of increasing absolute nentially growing submatrices in the intermediate steps,
s pd s pd
values. Let Ne and No be the numbers of even and i.e., in the calculation of the layer s or r submatrices.
odd eigenvalues, respectively. Numerical experiments Whenever the factorization, as given in Eq. (6), of the
show that, under condition (2) and for a given truncation layer t matrix is possible, the interface t matrix should
s pd s pd s pd s pd
order N ­ Ne 1 No , Ne and No never differ by be used directly in the constructions of layer s (or r) ma-
s pd trix or in the nonnormalized S-matrix (or R-matrix) re-
more than 1. Thus under condition (3), either Ne ­ M
s pd s pd s pd cursion. When factorization is impossible, the S-matrix
and No ­ M 1 1, or Ne ­ M 1 1 and No ­ M. It
s pd s p11d and R-matrix algorithms are stable under the condition
can be easily shown that if Ne fi Ne then all sub-
s pd that the layer thicknesses and the truncation order be
matrices of ts pd , in particular the pivotal submatrix t22 ,
kept low, as quantified at the end of Section 4.
are mathematically singular. Numerically, the condi-
s pd s p11d The comparative study of the two matrix algorithms
tion Ne fi Ne does often occur; therefore algorithm presented here seems to favor the S-matrix algorithm.
1a of Table 1 cannot be applied to the classical modal The physical interpretation of the S matrix in terms of re-
method when conditions (1), (2), and (3) are met simul- flections and transmissions is more intuitive than that of
taneously. It can be verified numerically that the ma- the R matrix in terms of the impedance and admittance.
trix sum that is to be inverted in Eqs. (19a) sometimes The exponential basis functions adopted by the S-matrix
becomes numerically ill-conditioned under the above algorithm are numerically much easier to handle than the
three conditions; therefore algorithm 2a fails too, even trigonometrical basis functions adopted by the R matrix
though it does not involve the inversion of the pivotal algorithm. Based on the operation counts, the S-matrix
s pd
submatrix t22 . algorithm is more efficient than the R-matrix algorithm.
Fortunately, the singular matrix problem described Many implementation variants of the algorithms are
above can be easily avoided by the use of an even trun- presented in this paper. The variants that use all in-
cation order. If N ­ 2M, then the characteristics of termediate matrices, algorithms 1a and 1b in Table 1,
the eigenvalue distribution automatically guarantee that are the least efficient ones. They have only pedagogical
s pd s pd
Ne ­ No ­ M. value. The variants that bypass some of the interme-
Another interesting difference between the R-matrix diate matrices, for example, algorithms 2a, 3a, and 2b,
algorithm and the S-matrix algorithm, as they are applied are the most efficient ones. However, as exemplified in
to the classical modal method, is that the law of energy Section 7, which algorithm and variant are more efficient
conservation (in the case of dielectric gratings) is satisfied often depends on the grating model being used. It is the
automatically by the former, but it is satisfied only with hope of the author that the information provided here will
increasing truncation orders by the latter. enable the reader to apply the most efficient algorithm to
the grating model at his or her disposal.
E. Other Possibilities
The essence of the R-matrix and S-matrix algorithms is APPENDIX A
to avoid the presence of the growing exponential functions To derive Eq. (13b), let us imagine that layer p is a sum
in the matrix manipulations. In this spirit, several other of two layers. the first layer has zero thickness, with
stable algorithms have recently been presented in the the layer t and r matrices given by Eqs. (7) and (14b),
literature. For example, Montiel and Nevière9 presented respectively. The second layer has thickness hp , but it
an algorithm that they called the R 0 -matrix algorithm. does not cross a material boundary. Its equivalent layer
In view of the current paper, it can be considered an t matrix is just f s pd , given by Eq. (4b). Denoting the
S-matrix algorithm that uses the U – V basis functions. equivalent layer r matrix corresponding to f s pd by r̂ s pd ,
In Ref. 10 the R-matrix algorithm was used with the from Eq. (14b) we have
exponential basis functions (maybe it can be called the
2 3
S 0 -matrix algorithm?). The scattering-matrix approach s pd s pd s pd s pd
of Cotter et al.11 is essentially algorithm 2a of Table 1, r̂ s pd
­ 42hm cotslm hp d hm cscslm hp d 5 .
(A1)
s pd s pd s pd s pd
except that their t matrix is the inverse of the t matrix 2hm cscslm hp d hm cotslm hp d
in this paper. Clearly there are many other possibilities,
but it is pointless to enumerate all of them. Equations (15b) can be viewed as a set of rules that
1034 J. Opt. Soc. Am. A / Vol. 13, No. 5 / May 1996 Lifeng Li

combine matrix r̃ s pd in relation an intermediate R matrix, R̂ s pd , which is given by


" # " # s pd s pd s pd s pd
U s p11d s pd V
s p11d
R̂11 ­ 2 hm cotslm hp d 1 h m cscslsmpd hp d
­ r̃ (A2)
U s pd V s pd 3 v s pd hm
s pd s pd
cscslm hp d ,
s pd s pd s pd s p21d
R̂12 ­ hm cscslm hp dv s pd R12 ,
and matrix R s p21d in relation
s pd s p21d
R̂21 ­ R21 v s pd hm
s pd
cscslsmpd hp d ,
" # " #
U s pd s p21d V
s pd s pd
R̂22 ­
s p21d
R22 1
s p21d s p21d
R21 v s pd R12 , (C1)
­R (A3)
U s0d V s0d
where
s pd
to obtain matrix R in relation s p21d 21
v s pd ­ fhm
s pd
cotslsmpd hp d 2 R11 g . (C10 )
" # " #
U s p11d s pd V
s p11d
.
­ R (A4) Clearly, all submatrices of R̂ s pd are of order Os1d and
U s0d V s0d
numerically stable. To complete the nonnormalized
R-matrix recursion using the interface t matrix, we need
Here we have only to use Eqs. (20b) again, this time replacing R s p21d
" # " # by R̂ s pd and t̃s pd by ts pd . The result is
U s p11d s yp 1 0d V s p11d s yp 1 0d ,
­r s pd
(A5) h ih i
s pd s pd s pd s pd s pd s pd s pd 21
U s pd s yp 2 0d V s pd s yp 2 0d R11 ­ t12 1 t11 R̂11 t22 1 t21 R̂11 ,
" # " # h i
s pd
U s yp 2 0d V s pd s yp 2 0d , s pd s pd s pd s pd s pd
­ r̂ s pd
(A6) R12 ­ t11 2 R11 t21 R̂12 ,
U s pd s yp21 1 0d V s pd s yp21 1 0d h i
s pd s pd s pd s pd s pd 21
R21 ­ R̂21 t22 1 t21 R̂11 ,
and what we want is the matrix in s pd s pd s pd s pd s pd
R22 ­ R̂22 2 R21 t21 R̂12 . (C2)
" # " #
U s p11d s yp 1 0d s pd
V s p11d s yp 1 0d .
­ r̃ (A7) ACKNOWLEDGMENTS
U s pd s yp21 1 0d V s pd s yp21 1 0d
This research was supported by the Optical Data Stor-
Through comparison of Eqs. (A2) – (A4) with Eqs. (A5) – age Center, University of Arizona, and by the advanced
(A7), it is evident that the two sets of equations have Technology Program of the U.S. Department of Com-
identical algebraic structures. Therefore Eqs. (13b) can merce through a grant to the National Storage Industry
be obtained from Eqs. (15b) provided that r s pd , r̂ s pd , and Consortium.
r̃ s pd are identified with r̃ s pd , R s p21d , and R s pd , respectively.
REFERENCES AND NOTES
APPENDIX B 1. L. Li and J. Hirsh, “All-dielectric high-efficiency reflection
s pd gratings made with multilayer thin film coatings,” Opt. Lett.
When t21; 0, which happens in the classical modal 20, 1349 – 1351 (1995).
method, Eq. (14b) cannot be used to compute r s pd , but in 2. C. Heine and R. H. Morf, “Submicrometer gratings for solar
s pd s pd energy applications,” Appl. Opt. 34, 2476 – 2482 (1995).
this case for sure t22 6; 0. Suppose that t22 is nonsingu-
s pd 3. M. Nevière, “Bragg – Fresnel multilayer gratings: electro-
lar and lm hp fi lp, then Eq. (14b0 ) can be used to derive magnetic theory,” J. Opt. Soc. Am. A 11, 1835 – 1845 (1994).
the layer r matrix. After some simple algebra, we have 4. D. Maystre, “Electromagnetic study of photonic band gaps,”
Pure Appl. Opt. 3, 975 – 993 (1994).
5. D. M. Pai and K. A. Awada, “Analysis of dielectric gratings
r̃ s pd ­ of arbitrary profiles and thicknesses,” J. Opt. Soc. Am. A 8,
2 3 755 – 762 (1991).
s pd s pd s pd s pd s pd21 s pd s pd s pd
4ft12 2 t11 hm cotslm hp dgt22 t11 hm cscslm hp d 5 . 6. L. F. DeSandre and J. M. Elson, “Extinction-theorem anal-
s pd s pd s pd21 s pd s pd ysis of diffraction anomalies in overcoated gratings,” J. Opt.
2hm cscslm hp dt22 hm cotslm hp d
Soc. Am. A 8, 763 – 777 (1991).
(B1) 7. L. Li, “Multilayer modal method for diffraction gratings
of arbitrary profile, depth, and permittivity,” J. Opt. Soc.
Am. A 10, 2581 – 2591 (1993).
This expression of r̃ s pd , like Eqs. (13b), contains no expo- 8. N. Chateau and J. P. Hugonin, “Algorithm for the rigorous
nentially growing functions, and therefore is suitable for coupled-wave analysis of grating diffraction,” J. Opt. Soc.
the unconditionally stable R-matrix recursion. Am. A 11, 1321 – 1331 (1994).
9. F. Montiel and M. Nevière, “Differential theory of gratings:
extension to deep gratings of arbitrary profile and permit-
APPENDIX C tivity through the R-matrix propagation algorithm,” J. Opt.
Soc. Am. A 11, 3241 – 3250 (1994).
Similarly to the treatment in Appendix A, we consider 10. L. Li, “Multilayer-coated diffraction gratings: differential
that each of the two factors in Eq. (6) corresponds to a method of Chandezon et al. revisited,” J. Opt. Soc. Am. A
11, 2816 – 2828 (1994).
layer, one with zero thickness and the other with the full 11. N. P. K. Cotter, T. W. Preist, and J. R. Sambles, “Scattering-
thickness hp . Substituting f s pd for t̃s pd in Eqs. (20b), and matrix approach to multilayer diffraction,” J. Opt. Soc.
making some simple algebraic rearrangement, we obtain Am. A 12, 1097 – 1103 (1995).
Lifeng Li Vol. 13, No. 5 / May 1996 / J. Opt. Soc. Am. A 1035

12. L. Li, “Bremmer series, R-matrix propagation algorithm, topics in extending the C method to coated gratings with
and numerical modeling of diffraction gratings,” J. Opt. Soc. different profiles,” Pure Appl. Opt. 5, 141 – 156 (1996).
Am. A 11, 2829 – 2836 (1994). 18. The statement “matrix A is of order O(1)” means that every
13. M. G. Moharam, D. A. Pommet, E. B. Grann, and T. K. element of A is of order O(1). In the context of this paper
Gaylord, “Stable implementation of the rigorous coupled- saying that a matrix is of order O(1) means that it contains
wave analysis for surface-relief gratings: enhanced trans- no exponentially growing functions with respect to layer
mission matrix approach,” J. Opt. Soc. Am. A 12, 1077 – 1086 thickness and matrix truncation order.
(1995). 19. A. K. Cousins and S. C. Gottschalk, “Application of the
14. M. G. Moharam and T. K. Gaylord, “Diffraction analysis impedance formalism to diffraction gratings with multiple
of dielectric surface-relief gratings,” J. Opt. Soc. Am. 72, coating layers,” Appl. Opt. 29, 4268 – 4271 (1990).
1385 – 1392 (1982). 20. R. Redheffer, “Difference equations and functional equations
15. R. H. Morf, “Exponentially convergent and numerically effi- in transmission-line theory,” in Modern Mathematics for the
cient solution of Maxwell’s equations for lamellar gratings,” Engineer, E. F. Beckenbach, ed. (McGraw-Hill, New York,
J. Opt. Soc. Am. A 12, 1043 – 1056 (1995). 1961), Chap. 12, pp. 282 – 337.
16. G. Granet, J. P. Plumey, and J. Chandezon, “Scattering by 21. G. H. Golub and C. F. Van Loan, Matrix Computations
a periodically corrugated dielectric layer with non-identical (Johns Hopkins University Press, Baltimore, 1983), Chap. 3,
faces,” Pure Appl. Opt. 4, 1 – 5 (1995). p. 30, and Chap. 4, p. 52.
17. L. Li, G. Granet, J. P. Plumey, and J. Chandezon, “Some

You might also like