Expand this Topic clickable element to expand a topic
Skip to content
Optica Publishing Group

PyMoosh: a comprehensive numerical toolkit for computing the optical properties of multilayered structures

Open Access Open Access

Abstract

We present PyMoosh, a Python-based simulation library designed to provide a comprehensive set of numerical tools allowing the computation of essentially all optical characteristics of multilayered structures, ranging from reflectance and transmittance to guided modes and photovoltaic efficiency. PyMoosh is designed not just for research purposes, but also for use cases in education. To this end, we have invested significant effort in ensuring the user-friendliness and simplicity of the interface. PyMoosh has been developed in line with the principles of open science and considering the fact that multilayered structures are increasingly being used as a testing ground for optimization and deep learning approaches. We provide in this paper the theoretical basis at the core of PyMoosh, an overview of its capabilities, as well as a comparison between the different numerical methods implemented in terms of speed and stability. We are convinced such a versatile tool will be useful for the community in many ways.

© 2024 Optica Publishing Group

1. INTRODUCTION

In optics, multilayered structures have been studied extensively for more than a century. The very first effort at calculating the reflectance of multilayers dates back to the early work of Lord Rayleigh [1,2]. The subject has gained increasing attention in the middle of the 20th century when quarter-wave stacks (also called Bragg mirrors or 1D photonic crystals) were fabricated and fully understood for the first time [3]. An important contribution has been the formalism introduced by Abelès [4], which provided a deeper insight into the physical mechanisms behind the optical properties of multilayer systems, as well as a convenient mathematical framework for their calculation. In the years that followed, this formal approach was extended and successfully applied to periodic structures [57] and anisotropic media [8]. The resulting formalisms have been widely incorporated into optical textbooks [911].

The design of diverse optical filters, guided by physical intuition, emerged as early as 1958 [12], and thrived in the subsequent years, notably due to the works of Thelen [13,14] and Apfel [15]. The first computer program enabling the automation of optical filter design was published by Dobrowolski and Lowe in 1978 [16]. Given the versatility of multilayered structures, very efficient design methods have been conceived since then [17], requiring the reliable computing of the optical properties of increasingly complex filters. A direct application has been the wavelength division multiplexing technology, which allowed a substantial increase of the transcontinental optical connection bandwidth in the last decades. Today, optical filter design and fabrication contests [1820] are periodically organized, showing how powerful state-of-the-art techniques have become. In the late 20th century, multilayered structures gained renewed interest and became widespread due to advancements in fabrication techniques. Notably, two types of problems have received particular attention due to their practical importance: sensors based on surface plasmon resonances for the detection of biologically relevant molecules [21], and anti-reflective coatings used in photovoltaic devices [22]. In parallel, the increasingly complex problems associated with plasmonics [23], metamaterials [24], or nonspecular phenomena [25] have also made multilayer simulations more challenging, particularly due to the frequent need to include a large number of metallic layers in the structures.

Over the years, an increasing number of numerical tools have thus been proposed to compute the optical response of complex multilayers [2628], with a significant portion of them tailored for specific applications such as optical filters [29] or surface plasmon resonance (SPR) [30]. The demand for accurate and efficient computation of properties has grown significantly, while well-studied and understood structures serve as a testing ground for optimization techniques [31,32]. In the recent past, thanks to the fast computation methods, multilayer stacks have also often been used as large and cost-effective datasets for rapid testing of deep learning algorithms [3339]. Due to its relative simplicity, differentiable transfer matrix implementations have furthermore been used as actual part of deep learning models for accelerated training [40,41]. Because of this multiplication of objectives, the range of computed quantities of physical interest has also expanded.

Here, we introduce PyMoosh (Python-based multilayer optics optimization and simulation hub), a user-friendly and comprehensive set of numerical tools to compute as efficiently and as reliably as possible many optical properties of multilayered structures [42,43]. This includes reflectance and transmittance in any condition and with different state-of-the-art numerical methods, but also absorption and Poynting flux in any layer, 2D Green functions, and the computation of structure modes and their dispersion curves. Finally, PyMoosh is specifically designed to be used together with optimization tools. Developed in Python, PyMoosh is an open-source software aimed at maximizing usability. It is intended to be simple enough to be used for educational purposes, while also offering advanced features for research, with a particular focus on tackling demanding problems such as optimization and deep learning. It is the successor of Moosh, which was implemented in Octave/MATLAB [44].

This paper has a total of five sections. In the first section, we detail the different techniques included in PyMoosh to solve Maxwell’s equations in multilayered structures. PyMoosh specifically includes transfer and scattering matrices, the Abelès formalism, Dirichlet-to-Neumann (DtN) maps and the admittance formalism. The methods, all gathered and described in a single place for educational and convenience purposes, are compared in terms of computational costs and tested for reliability on common photonics problems. In a second section, we detail how the Poynting flux and absorption in each layer can be computed and explain the tools specific to photovoltaic problems that are implemented in PyMoosh. In a third section, we explain how the field inside the structure can be computed with high accuracy using scattering matrices. We demonstrate this for two example illuminations, namely an incoming beam and an oscillating line current source, placed at an arbitrary location inside the structure. The fourth section describes how resonant modes (leaky or guided) can be retrieved. The last section describes our general approach in terms of coding and implementation, along with a discussion of the motivations behind our choices. PyMoosh comes in fact with a very large number of examples, under the form of Jupyter Notebooks [45], which are used to illustrate its capabilities, and that may serve as starting points for applications of other users.

2. COMPUTING REFLECTANCE AND TRANSMITTANCE

Historically, and for understandable practical reasons, the focus of multilayer structure studies has been put on computing the reflectance and eventually the transmittance of a given structure for a given wavelength $\lambda$. This is equivalent to solving Maxwell’s equations in the structure for a time dependency ${e^{- i\omega t}}$, where $\omega = \frac{{2\pi c}}{\lambda}$ is the angular frequency of the electromagnetic wave. Since the structure is invariant by translation along the $x$ and $y$ axis, we choose without any loss of generality, to consider a ${e^{i{k_x}x}}$ spatial dependency with respect to $x$ and invariance along $y$ for all fields. In transverse electric (TE) [resp. transverse magnetic (TM)] polarization, ${E_y}$ (resp. ${H_y}$) satisfies the Helmholtz equation

$$\partial _z^2{E_y} + \left({\frac{{{\mu _r}{\epsilon _r}{\omega ^2}}}{{{c^2}}} - k_x^2} \right){E_y} = 0 $$
in any linear medium characterized by its relative permittivity ${\epsilon _r}$ and permeability ${\mu _r}$. While the contribution of ${\mu _r}$ is often neglected because natural materials do not involve any magnetic response at optical wavelengths (${\mu _r} \approx 1$ due to the small size of the Bohr radius in atoms [46]), metamaterials can be tailored to form materials with an effective magnetic response.

Because the ${k_x}$ spatial dependency is constant through the stack, in any layer $i$, the vertical ($z$) propagation constant of the field can be defined by

$${\gamma _i} = \sqrt {{\mu _i} {\epsilon _i} k_0^2 - k_x^2} ,$$
where ${k_0} = \frac{\omega}{c} = \frac{{2\pi}}{\lambda}$ and where we write the relative permeabilities and permittivities of the $i$-th layer’s material as ${\mu _i}$ and ${\epsilon _i}$.

The solution to Eq. (1) can be written in layer $i$ as

$$\left\{{\begin{array}{*{20}{l}}{{E_{y,i}}(z) = A_i^ + {e^{i{\gamma _i}(z - {z_i})}} + B_i^ + {e^{- i{\gamma _i}(z - {z_i})}} ,}\\[3pt]{{E_{y,i}}(z) = A_i^ - {e^{i{\gamma _i}(z - {z_{i + 1}})}} + B_i^ - {e^{- i{\gamma _i}(z - {z_{i + 1}})}} ,}\end{array}} \right.$$
where $A_i^ \pm$ (resp. $B_i^ \pm$) are defined as the amplitude of the upward propagating (resp. downward propagating) field in layer $i$, and the ${+}$ (resp. ${-}$) superscript indicates that the phase reference of each mode is taken at the top (resp. bottom) of layer $i$, as the equations show. Figure 1 represents these coefficients in the corresponding layers and close to their respective interfaces.
 figure: Fig. 1.

Fig. 1. Multilayer structure and definition of important variables. We consider the light coming from the top of the image. ${\epsilon _i}$ and ${\mu _i}$ are, respectively, the permittivity and the permeability of layer $i$. ${A_i}$ (resp. ${B_i}$) are defined as the amplitude of the upward propagating (resp. downward propagating) field in layer $i$, and the ${+}$ (resp. ${-}$) superscript indicates that the field value is taken at the top (resp. bottom) of layer $i$.

Download Full Size | PDF

The continuity conditions for the tangential electric and magnetic fields at each interface between layer $i$ and layer $i + 1$ lead to

$$A_i^ - + B_i^ - = A_{i + 1}^ + + B_{i + 1}^ + ,$$
$$\frac{{{\gamma _i}}}{{{\mu _i}}}(A_i^ - B_i^ -) = \frac{{{\gamma _{i + 1}}}}{{{\mu _i}}}(A_{i + 1}^ + - B_{i + 1}^ +) .$$

When the amplitude of the incident plane wave is taken to be equal to 1 ($B_0^ - = 1$) and there is no incoming light from below ($A_{N + 1}^ - = 0$), then the reflection and transmission coefficient are $A_0^ - = r$ and $B_{N + 1}^ + = t$, respectively. This means we have a system of $2(N + 1)$ continuity equations and $2N$ propagation equations for just as many unknowns (the four $A_i^ \pm$ and $B_i^ \pm$ coefficients of each layer $i \in [1;N]$, $A_0^ -$ and $B_{N + 1}^ +$). In theory, such a system could be solved numerically using classical algorithms. However, the corresponding matrix is sparse and contains figures with very different magnitudes so that classical approaches are numerically unstable, to the point that it often cannot be used for more than typically a few layers. Specific formalisms to solve this system of equations have therefore been developed and are presented below.

The TM polarization can be treated simply by changing ${\mu _i}$ into ${\epsilon _i}$ in the system above. We underline, however, that there is a $\pi$ phase in normal incidence for the reflection coefficient defined in TE and in TM polarization.

Now, because of Eq. (2), we need to discuss how the square root of a complex number is defined and how this may have an impact on the accuracy of the calculation. By default, on any computer, the phase of a complex number $\zeta$ is defined in ]${-}\pi ,\pi$], meaning that taking its square root thus produces a complex number with an argument in ]${-}\pi /{2},\pi /{2}$] (i.e., with a positive real part and arbitrary imaginary part). This determination of the square root can be changed manually, to obtain a positive imaginary part and arbitrary real part for instance, by taking the opposite of the result of the square root if the argument of $\zeta$ is negative. In any case, this introduces a cut in the complex plane, which cannot always be ignored.

Here, Eq. (3) indicates that changing the determination of the square root for $\gamma$ is equivalent to exchanging $A$ and $B$ for all the layers in the structure, so that this is not expected to change the result of the computation, as Eqs. (4) and (5) are unchanged by this permutation. However, it is clear that if ${\gamma _i}$ has a negative imaginary part, then these equations introduce positive real exponentials, which would amplify any numerical error made on their amplitude. We have made the choice to use ${\gamma _i}$ with positive imaginary parts in PyMoosh to maximize the stability of the code by using only decreasing exponential functions in all our calculations (especially the computation of the whole field; see below), inspired by what is done in RCWA [47,48]. The change we have brought to the determination of the square root for the surrounding medium has more importance and will be discussed later.

From there, there are different ways to eliminate all the unknowns to obtain the reflection or the transmission coefficients. The most common formalism is based on transfer matrices ($T$-matrices). However, a more physical and stable formalism consists in writing reflection and transmission coefficients for each layer or interface. This is the scattering matrix ($S$-matrix) method, widely used in more advanced simulation techniques where evanescent waves are ubiquitous. Since the work of Abelès [4], we also know that considering the impedance or admittance of each layer is a relevant approach. This approach can be translated both into a matrix formalism and into a recursive formula to compute how the admittance of a structure is modified by adding a supplementary layer [11]. Because these methods are not perfectly stable, DtN maps have been proposed more recently [49]. The DtN technique is related to the Abelès matrices formalism exactly in the same way that the scattering matrix formalism is related to the transfer matrix approach. In the following, we derive the main formalisms of these different approaches.

A. $T$-Matrices

Let us define ${\psi _i} = \frac{{{\gamma _i}}}{{{\mu _i}}}$ for all layers. For the interface between layers $i$ and $i + 1$, the continuity conditions in Eqs. (4) and (5) can be rewritten as

$$\begin{split}\left({\begin{array}{*{20}{c}}{A_{i + 1}^ +}\\{B_{i + 1}^ +}\end{array}} \right) &= {T_{i,i + 1}}\left({\begin{array}{*{20}{c}}{A_i^ -}\\{B_i^ -}\end{array}} \right)\\& = \frac{1}{{2{\psi _{i + 1}}}}\left({\begin{array}{*{20}{c}}{{\psi _i} + {\psi _{i + 1}}}&{{\psi _i} - {\psi _{i + 1}}}\\{{\psi _i} - {\psi _{i + 1}}}&{{\psi _i} + {\psi _{i + 1}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{A_i^ -}\\{B_i^ -}\end{array}} \right) ,\end{split}$$
which defines the ${ T}$-matrix for a given interface. The propagation relations linking $A_i^ - ,B_i^ -$ and $A_i^ + ,B_i^ +$, through the layer of height ${h_i}$ can be written as
$$\left({\begin{array}{*{20}{c}}{A_i^ -}\\{B_i^ -}\end{array}} \right) = C_i^{(T)}\left({\begin{array}{*{20}{c}}{A_i^ +}\\{B_i^ +}\end{array}} \right) = \left({\begin{array}{*{20}{c}}{{e^{- i{\gamma _i}{h_i}}}}&0\\0&{{e^{i{\gamma _i}{h_i}}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{A_i^ +}\\{B_i^ +}\end{array}} \right) ,$$
which defines the ${T}$-matrix for layer $i$. We underline that two exponential functions appear in the expression above. When the propagation constant ${\gamma _i}$ is complex, one of these two terms can be very small in front of the other, leading to floating point cancellation [50] and to numerical errors. The layer and interface matrices just need to be multiplied by each other to eliminate the unknowns corresponding to the field amplitude inside each layer, but this is what may produce the floating point cancellation
$$\left({\begin{array}{*{20}{c}}{A_{N + 1}^ +}\\{B_{N + 1}^ +}\end{array}} \right) = {T_{N,N + 1}}\prod\limits_{i = 0}^{N - 1} \left({C_i^{(T)}{T_{i,i + 1}}} \right)\left({\begin{array}{*{20}{c}}{A_0^ -}\\{B_0^ -}\end{array}} \right) .$$

From the transfer matrix,

$$T = {T_{N,N + 1}}\prod\limits_{i = 0}^{N - 1} \left({C_i^{(T)}{T_{i,i + 1}}} \right) ,$$
for the whole structure and we can retrieve coefficients $r = A_0^ - = - \frac{{{T_{01}}}}{{{T_{00}}}}$ and $t = B_{N + 1}^ + = r{T_{10}} + {T_{11}}$.

B. $S$-Matrices

Scattering matrices are simply another way to eliminate unknowns. The $S$-matrix formalism uses the same field definitions but rewrites the continuity conditions obtained from Eqs. (4) and (5) to link incoming fields at the interface $(A_i^ + ,B_{i + 1}^ -)$ with the outgoing fields $(A_{i + 1}^ - ,B_i^ +)$, giving the new interface matrices

$$\begin{split}\left({\begin{array}{*{20}{c}}{A_i^ -}\\{B_{i + 1}^ +}\end{array}} \right) &= {I_{i,i + 1}}\left({\begin{array}{*{20}{c}}{B_i^ -}\\{A_{i + 1}^ +}\end{array}} \right) \\&= \frac{1}{{{\psi _i} + {\psi _{i + 1}}}}\left({\begin{array}{*{20}{c}}{{\psi _i} - {\psi _{i + 1}}}&{2{\psi _{i + 1}}}\\{2{\psi _i}}&{{\psi _{i + 1}} - {\psi _i}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{B_i^ -}\\{A_{i + 1}^ +}\end{array}} \right).\end{split}$$

The propagation matrices are also modified to

$$\left({\begin{array}{*{20}{c}}{A_i^ +}\\{B_i^ -}\end{array}} \right) = C_i^{(S)}\left({\begin{array}{*{20}{c}}{B_i^ +}\\{A_i^ -}\end{array}} \right) = \left({\begin{array}{*{20}{c}}0&{{e^{i{\gamma _i}{h_i}}}}\\{{e^{i{\gamma _i}{h_i}}}}&0\end{array}} \right)\left({\begin{array}{*{20}{c}}{B_i^ +}\\{A_i^ -}\end{array}} \right) .$$

As we will see later, these propagation matrices, where both exponentials are identical, lead to a greater numerical stability. However, computing the matrix linking boundary conditions is no longer a straightforward matrix product, since the coefficients of a given layer are not on the same side of Eq. (10). Therefore, the relationship between the different $I$ and ${C^{(S)}}$ matrix equations can be written as

$$\left({\begin{array}{*{20}{c}}A\\B\end{array}} \right) = \left({\begin{array}{*{20}{c}}{{U_{00}}}&{{U_{01}}}\\{{U_{10}}}&{{U_{11}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}C\\D\end{array}} \right),\quad {\rm and}\,\,\, \left({\begin{array}{*{20}{c}}D\\E\end{array}} \right) = \left({\begin{array}{*{20}{c}}{{V_{00}}}&{{V_{01}}}\\{{V_{10}}}&{{V_{11}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}B\\F\end{array}} \right) ,$$
where the new matrix we want to define is
$$\left({\begin{array}{*{20}{c}}A\\E\end{array}} \right) = \left({\begin{array}{*{20}{c}}{{S_{00}}}&{{S_{01}}}\\{{S_{10}}}&{{S_{11}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}C\\F\end{array}} \right) .$$

We can define a “cascading” operation, computing $S$ as a function of $U$ and $V$ coefficients

$$S = \left({\begin{array}{*{20}{c}}{{U_{00}} + \frac{{{U_{01}}{V_{00}}{U_{10}}}}{{1 - {V_{00}}{U_{11}}}}}&{\frac{{{U_{01}}{V_{01}}}}{{1 - {V_{00}}{U_{11}}}}}\\[6pt]{\frac{{{U_{10}}{V_{10}}}}{{1 - {V_{00}}{U_{11}}}}}&{{V_{11}} + \frac{{{V_{10}}{U_{11}}{V_{01}}}}{{1 - {V_{00}}{U_{11}}}}}\end{array}} \right) .$$

Applying this computation iteratively on every interface and layer leads to the scattering matrix $S$ for the whole structure, written as

$$\left({\begin{array}{*{20}{c}}{A_0^ -}\\{B_{N + 1}^ +}\end{array}} \right) = S\left({\begin{array}{*{20}{c}}{B_0^ -}\\{A_{N + 1}^ +}\end{array}} \right) .$$

The reflection and transmission coefficient can be read directly, knowing $B_0^ - = 1 ,A_{N + 1}^ + = 0$: $r = {S_{00}} ,t = {S_{10}}$.

C. Abelès Formalism

Contrary to ${T}$-matrices and ${S}$-matrices, the Abelès formalism (as well as the following DtN formalism) uses only one ${E_y}$ field position in each layer, thus removing the need for propagation matrices. We will also therefore directly speak in terms of ${E_{y,i}}$ and $\partial z{E_{y,i}}$. Taking, for instance, the field on the upper side of the layers and using the field continuity, we can write

$$\left\{{\begin{array}{*{20}{l}}{{E_{y,i}}({z_i}) = A_i^ + + B_i^ + ,}\\{\partial z{E_{y,i}}({z_i}) = i{\gamma _i}(A_i^ + - B_i^ +) ,}\\{{E_{y,i + 1}}({z_{i + 1}}) = A_i^ + {e^{- i{\gamma _i}{h_i}}} + B_i^ + {e^{i{\gamma _i}{h_i}}} ,}\\{\partial z{E_{y,i + 1}}({z_{i + 1}}) = i{\gamma _i}(A_i^ + {e^{- i{\gamma _i}{h_i}}} - B_i^ + {e^{i{\gamma _i}{h_i}}}) .}\end{array}} \right.$$

These relations and the continuity conditions at the interface at ${z_{i + 1}}$ lead to the matrix equations

$$\begin{split}\left({\begin{array}{*{20}{c}}{{E_{y,i + 1}}}\\{\partial z{E_{y,i + 1}}}\end{array}} \right) &= {M_i}\left({\begin{array}{*{20}{c}}{{E_{y,i}}}\\{\partial z{E_{y,i}}}\end{array}} \right) \\[-3pt]&= \left({\begin{array}{*{20}{c}}{\cos ({\gamma _i}{h_i})}&{- \frac{{\sin ({\gamma _i}{h_i})}}{{{\gamma _i}}}}\\{{\gamma _i}\sin ({\gamma _i}{h_i})}&{\cos ({\gamma _i}{h_i})}\end{array}} \right)\left({\begin{array}{*{20}{c}}{{E_{y,i}}}\\{\partial z{E_{y,i}}}\end{array}} \right) .\end{split}$$

Once the matrix product $M = \prod\nolimits_i {M_i}$ is computed, the $r$ and $t$ coefficients are slightly more complicated to retrieve than for $T$-matrices and are written as

$${E_{y,N + 1}} = t,$$
$${E_{y,0}} = r + 1,$$
$$\partial z{E_{y,N + 1}} = - i{\gamma _{N + 1}}t,$$
$${\partial _z}{E_{y,0}} = i{\gamma _0}(r + 1).$$

D. DtN Formalism

Finally, just like the ${S}$-matrix formalism was the equivalent of ${T}$-matrices but using the incoming field on one side of the equation and the outgoing fields on the other, the DtN formalism is the equivalent of the Abelès formalism but keeping ${E_y}$ on one side of the equation and $\partial z{E_y}$ on the other, written as

$$\begin{split}\left({\begin{array}{*{20}{c}}{\partial z{E_{y,i}}}\\{{\partial _z}{E_{y,i + 1}}}\end{array}} \right) &= {N_{i,i + 1}}\!\left({\begin{array}{*{20}{c}}{{E_{y,i}}}\\{{E_{y,i + 1}}}\end{array}} \right) \\[-3pt]&= \left({\begin{array}{*{20}{c}}{\frac{{{\gamma _i}\cos ({\gamma _i}{h_i})}}{{\sin ({\gamma _i}{h_i})}}}&{- \frac{{{\gamma _i}}}{{\sin ({\gamma _i}{h_i})}}}\\[6pt]{\frac{{{\gamma _i}}}{{\sin ({\gamma _i}{h_i})}}}&{- \frac{{{\gamma _i}\cos ({\gamma _i}{h_i})}}{{\sin ({\gamma _i}{h_i})}}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{{E_{y,i}}}\\{{E_{y,i + 1}}}\end{array}} \right) \!.\end{split}$$

As with ${S}$-matrices, the complete structure matrix computation is not straightforward, and needs a cascading operation similar to the one used for ${S}$-matrices. To this end, if we call $A = {N_{i,i + 1}}$ and $B = {N_{i + 1,i + 2}}$, then the ${D_{i,i + 2}}$ matrix linking fields in layer $i$ and in layer $i + 2$ is given by

$${D_{i,i + 2}} = \left({\begin{array}{*{20}{c}}{{A_{00}} - \frac{{{A_{01}}{A_{10}}}}{{{A_{11}} - {B_{00}}}}}&{\frac{{{A_{01}}{B_{01}}}}{{{A_{11}} - {B_{00}}}}}\\[6pt]{- \frac{{{B_{10}}{A_{10}}}}{{{A_{11}} - {B_{00}}}}}&{{B_{11}} + \frac{{{B_{10}}{B_{01}}}}{{{A_{11}} - {B_{00}}}}}\end{array}} \right) .$$

For all other formalisms, we typically consider a superstrate of thickness 0, to have a phase reference exactly at the interface between the superstrate and the first layer of the structure. However, for the DtN formalism, as we can see in Eq. (22) this would lead to division by 0 in the first matrix. So, we choose an arbitrary thickness for the superstrate ($\lambda /100$ in the PyMoosh code) and compensate for the additional phase at the end of the computation.

E. Admittance Formalism

The admittance formalism is based on the Abelès formalism and its main advantage is to make computations of the structure’s reflectivity much faster. We define

$${\delta _i} = {\gamma _i}{h_i} = \frac{{2\pi}}{\lambda}{n_{{\rm eff},i}}{h_i} ,$$
with ${\gamma _i}$ as defined in Eq. (2) and ${n_{{\rm eff},i}} = {\gamma _i}/{k_0}$.

With the Abelès formalism [inverting Eq. (17)], we get

$$\left({\begin{array}{*{20}{c}}{{E_{y,i}}}\\[3pt]{{\partial _z}{E_{y,i}}}\end{array}} \right) = \left({\begin{array}{*{20}{c}}{\cos {\delta _i}}&{\frac{{\sin {\delta _i}}}{{{\gamma _i}}}}\\{- {\gamma _i}\sin {\delta _i}}&{\cos {\delta _i}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{{E_{y,i + 1}}}\\{{\partial _Z}{E_{y,i + 1}}}\end{array}} \right) .$$

We then define $X = \frac{{{\partial _z}{E_y}}}{{{E_y}}}$, and get

$$\left({\begin{array}{*{20}{c}}{\frac{{{E_{y,i}}}}{{{E_{y,i + 1}}}}}\\[7pt]{\frac{{{\partial _z}{E_{y,i}}}}{{{E_{y,i + 1}}}}}\end{array}} \right) = \left({\begin{array}{*{20}{c}}{\cos {\delta _i}}&{\frac{{\sin {\delta _i}}}{{{\gamma _i}}}}\\{- {\gamma _i}\sin {\delta _i}}&{\cos {\delta _i}}\end{array}} \right)\left({\begin{array}{*{20}{c}}1\\{{X_{i + 1}}}\end{array}} \right) .$$

Computing the matrix-vector product and dividing both rows, we get

$${X_i} = \frac{{{X_{i + 1}} - {\gamma _i}\tan {\delta _i}}}{{1 + \frac{{{X_{i + 1}}}}{{{\gamma _i}}}\tan {\delta _i}}} .$$

Let us define ${Y_i} = \frac{i}{{{k_0}}}{X_i}$, leading to

$${Y_i} = \frac{{{Y_{i + 1}} - i{n_{{\rm eff},i}}\tan {\delta _i}}}{{1 - i\frac{{{Y_{i + 1}}}}{{{n_{{\rm eff},i}}}}\tan {\delta _i}}} .$$

Then, we use ${Y_N} = {n_{{\rm eff},N}}$ as the initial condition and compute all ${Y_i}$, with the final reflection coefficient being for TE polarization

$${r_{{\rm TE}}} = \frac{{{n_{{\rm eff},0}} - {Y_0}}}{{{n_{{\rm eff},0}} + {Y_0}}} .$$

In TM, the difference is that $n_{{\rm eff},i}^{\rm (TM)} = n_i^2/{n_{{\rm eff},i}}$ and

$${r_{{\rm TM}}} = - \frac{{n_{{\rm eff},0}^{\rm (TM)} - {Y_0}}}{{n_{{\rm eff},0}^{\rm (TM)} + {Y_0}}} .$$

This formalism allows to compute only the reflectance of a structure, and is thus much less general than the methods described above. It can be, however, of particular interest for pedagogical reasons or in time-critical applications, given its simplicity and, as a direct consequence, its computational efficiency.

F. Comparing the Different Methods

Choosing the right method to compute the reflectance or transmittance of a structure depends on the context and whether stability or computational speed are particularly sought after. No method is both the fastest and the most stable. We have thoroughly tested the stability and estimated the efficiency of each of the methods as implemented in PyMoosh, to assist users in determining the most suitable approach for their specific needs.

1. Computational Speed

As can be guessed from the mathematical expressions above and as is shown Fig. 2, the computational time required for computing the reflectance of a given structure increases linearly with the number of considered layers. Also, as can be expected, the scattering matrix method is the slowest. It is typically twice as slow as the ${T}$-matrix or DtN methods. On the other hand, the Abelès formalism is twice as fast, but the most computationally efficient technique of all is the admittance formula. It is thus ideally suited for optimizing the reflectance of a multilayer. Alas, this technique is also the most prone to stability issues.

 figure: Fig. 2.

Fig. 2. Computation time of the $r$ and $t$ coefficients for all methods as a function of the number of layers in a stack, averaged over 500 runs. As exact computation times are heavily influenced by hardware capabilities, it remains important to prioritize the relative comparison between formalisms over these precise times.

Download Full Size | PDF

2. Numerical Stability

For a random dielectric structure, all formalisms can be considered stable, as the transmission can be expected to be relatively high. Numerical accuracy issues occur when evanescent waves are present, whether they are due to total internal reflection, the presence of metals, or if evanescent Bloch waves are excited in the bandgaps of Bragg mirrors. such Although such problems are unlikely for optical filters, evanescent waves are ubiquitous in prism couplers or plasmonic structures, not to mention photonic crystal-based structures.

The scattering matrix method has proven to be the most stable and accurate of all, regardless of the situation [28,47,48]. For this reason, we consider its results as our reference in all the following. Figures 35 show the absolute difference between the values given by the scattering matrix method and the other methods for the reflection and transmission coefficient in several cases. We explicitly discuss here the computation errors for TE illumination, but TM polarization faces roughly the same instabilities.

 figure: Fig. 3.

Fig. 3. (a) Absolute error between S-matrix (considered as our reference) and other formalisms. Transmission coefficient for a quarter-wave stack of materials $n = 1.2$ and $n = 1.5$ as a function of the total number of layers of the stack. (b) Schematic representation of the structure.

Download Full Size | PDF

 figure: Fig. 4.

Fig. 4. (a) Absolute error between the $S$-matrix (considered as our reference) and other formalisms. Transmission coefficient in a frustrated total internal reflection situation for a layer of air of width $D$ between materials of index $n = 1.5$. (b) Schematic representation of the structure.

Download Full Size | PDF

 figure: Fig. 5.

Fig. 5. (a) Absolute error between the $S$-matrix (considered as our reference) and other formalisms. Surface plasmon resonance coupler in the Kretschmann–Raether configuration with a prism of index $n = 1.5$ coupling to air through a silver layer of width $D$. (b) Schematic representation of the structure.

Download Full Size | PDF

The first case, depicted in Fig. 3, is a simple Bragg mirror, illuminated at an oblique incidence (15°) with a wavelength in the middle of the bandgap. As the number of layers increases, the transmission coefficient goes down to zero. As can be seen, the DtN and scattering matrix methods differ only by an error of the order of machine precision. Therefore, when the relative error stays the same, as the value of the transmission coefficient decreases, so does the absolute error. It can be seen however that the Abelès formalism and the $T$-matrix method are subject to numerical instability, which typically occurs for more than 150 layers. This means that these methods should be considered with caution when structures involve Bragg mirrors, for instance in microcavities [51] for which the transmission through the stack is crucial. It should also be noted that the TE case is slightly more stable than the TM case, when no magnetic materials are involved, and that the Abelès formalism is significantly more stable under normal incidence illumination.

The second case, depicted in Fig. 4, is a simple frustrated total internal reflection, i.e., a layer of air comprised between two layers of high index material $n = 1.5$, illuminated with a 42° incidence angle, slightly beyond the critical angle. When the air layer thickness is increased beyond a few wavelengths, the evanescent field within causes numerical instabilities for the ${T}$-matrices and the Abelès matrices, similar to what occurs for the Bragg mirror. This means these two algorithms should be avoided when simulating prism couplers, where evanescent waves occur. Above a thickness of 2 µm for the air layer, as the theoretical transmission tends toward zero, the DtN and ${S}$ matrix methods often agree down to machine precision, leading to a zero absolute numerical error. They differ only by a relative error of the order of machine precision in other cases.

As a final example, we consider a metallic (silver) layer comprised between an upper layer with a high index ($n = 1.5$) and air, which is a typical prism coupler for a surface plasmon in a Kretschmann–Raether configuration [52]. In the previous cases, we underline that the reflection coefficient is computed with no instability for ${ T},\;{S}$, Abelès, or DtN matrices, even when the transmission coefficient is unstable. However, as can be seen in Fig. 5, the admittance formula is not accurate for thin metallic layers, and while the instability is not exponential, the value computed is not at all accurate. This shows that the admittance formalism is most adapted to optical filters with no metallic layers. While this cannot be seen in the linear scale graph, shown in Fig. 5(a), the difference between the values computed using the three other methods is down to machine precision.

Despite their stability in these typical examples, ${S}$ and DtN matrices also have specific breaking points. For scattering matrices, when ${\gamma _i}/{\mu _i} \sim - {\gamma _{i + 1}}/{\mu _{i + 1}}$ (in TE polarization, but this also occurs in TM with ${\epsilon _i}$ instead of ${\mu _i}$), a division by zero occurs. This can only happen when lossless metamaterials are considered, which is not realistic, but is often studied for educational purposes (showing the ideal response of Pendry’s lens, for instance [53]). As for the DtN formalism, its better stability is due to the terms in $1/\!\sin$ and $1/\!\tan$, which are less prone to numerical errors than exponentials. However, there are still specific breaking points. For instance, for a layer of optical thickness $\lambda /2n$, where $n$ is the refractive index of the layer, in normal incidence, the argument of the $1/\!\sin$ is $\pi$, leading to a division by 0. As this may occur with any kind of transparent material, and it is typically used as a cavity in distributed-feedback lasers, for instance, the DtN formalism must be used with care.

3. Discussion

From the results above, it seems clear that scattering matrices should be the default choice when stability matters because it presents only very specific breaking points, and we underline that the supplementary computational effort is reasonable. Transfer matrices seem an obvious choice in the literature; however, our results show that the Abelès formalism is equivalently stable but twice as computationally efficient, while being no more complex to implement. When speed really matters, when no metal is present, and when the computation of reflectance is sufficient, the admittance formalism is a less explored but very interesting alternative, for instance, in the context of optimization [31] or for database generation for deep learning, being one order of magnitude more efficient than $S$-matrices. Finally, the DtN formalism is a good compromise for large multilayer stacks that may exhibit evanescent fields, as long as no $\lambda /2n$ layer is present. PyMoosh allows such choices to be made and to easily assess the accuracy of any method by comparing it to the $S$-matrix result.

3. COMPUTING ABSORPTION IN AN ARBITRARY LAYER

In many applications (e.g., sensing or photovoltaic stacks), knowing where the absorption takes place is of paramount importance. This requires computation of the field amplitudes $A_i^ \pm$ and $B_i^ \pm$ that are ignored when only reflectance is to be computed. This can be done in any of the four main formalisms, and the present section describes how these fields can be computed for the ${S}$-matrix and the Abelès formalisms, because they have been shown to be, respectively, the most stable and the fastest. The admittance formalism can obviously not be used because it is designed to only compute the external coefficients.

To compute how much of the incident power is absorbed in each layer, the PyMoosh library computes the (time-averaged) projection along the $z$ axis of the Poynting vector at the top of every layer $i$, ${N_i}$. This projected Poynting vector is proportional to the power flux through the top interface of the layer. Since we normalize all power by the incident power, then the difference in power given by the difference in Poynting vector ${{\cal A}_i} = {N_i}$ - ${N_{i + 1}}$ is the fraction of the incident power absorbed in layer $i$.

A. Abelès Matrices

With ${M_i}$ defined in Eq. (17), we can define $M_{\rm{tot}}^{(k)} = \prod\nolimits_{i = 1}^k {M_{i - 1}}$, which allows us to compute the fields in the structure by

$$\!\!\!\!\left({\begin{array}{*{20}{c}}{{E_{y,k}}}\\{{\partial _z}{E_{y,k}}}\end{array}} \right) = M_{\rm{tot}}^{(k)}\left({\begin{array}{*{20}{c}}{{E_{y,0}}}\\{{\partial _z}{E_{y,0}}}\end{array}} \right) = M_{\rm{tot}}^{(k)}\left({\begin{array}{*{20}{c}}{r + 1}\\{i(r - 1)\frac{{{\gamma _0}}}{{{\mu _0}}}}\end{array}} \right) .$$

Knowing this, the equation used to compute the Poynting vector at the top of one layer is

$${N_i} = \textbf{ Re}\!\left({- i{E_{y,i}}{\partial _z}E_{y,i}^*\frac{{{\mu _0}}}{{{\gamma _0}}}} \right) $$
in the TE case and where $\mu$ and ${\epsilon}$ are switched to get the TM case.

B. $S$-matrices

Using the cascading operation defined in Eq. (14), we can introduce the $\odot$ operator, where $A \odot B$ is the result of the cascading operation. This allows the partial scattering matrices ${U^{(k)}}$ and ${D^{(k)}}$ to be written more simply, corresponding to the scattering matrices of the incomplete structures

$$\left\{{\begin{array}{*{20}{l}}{{U^{(2i)}}}& = { C_0^{(S)} \odot C_1^{(S)} \odot {I_{12}} \odot C_2^{(S)}\ldots \odot {I_{i,i + 1}} ,}\\[3pt]{{U^{(2i + 1)}}}& = { C_0^{(S)} \odot C_1^{(S)} \odot {I_{12}} \odot C_2^{(S)}\ldots \odot C_{i + 1}^{(S)} ,}\\[3pt]{{D^{(2i)}}}& = { C_{N - i}^{(S)} \odot {I_{N - i,N - i + 1}}\ldots \odot C_N^{(S)} ,}\\[3pt]{{D^{(2i + 1)}}}& = { {I_{N - i - 1,N - i}} \odot C_{N - i}^{(S)}\ldots \odot C_N^{(S)} .}\end{array}} \right.$$
In the case when we consider the upper coefficients of layer $i$, this allows us to write
$$\left({\begin{array}{*{20}{c}}{A_0^ -}\\{B_i^ +}\end{array}} \right) = {U^{(2i)}}\left({\begin{array}{*{20}{c}}{B_0^ -}\\{A_i^ +}\end{array}} \right) ,$$
$$\left({\begin{array}{*{20}{c}}{A_i^ +}\\{B_N^ +}\end{array}} \right) = {D^{(2N - 2i)}}\left({\begin{array}{*{20}{c}}{B_i^ +}\\{A_N^ +}\end{array}} \right) .$$

The same can be written for the lower coefficients using the odd index $2i + 1$. The idea here is that if we assume an incoming plane wave from above with a unity amplitude (i.e., $B_0^ - = 1$ and $A_N^ + = 0$), we can use the intermediate matrix that usually appear when calculating the cascading formula to retrieve the unknowns

$$\begin{split}\left({\begin{array}{*{20}{c}}{A_i^ +}\\{B_i^ +}\end{array}} \right) &= \frac{1}{{1 - U_{11}^{(2i)}D_{00}^{(2N - 2i)}}}\\&\quad\times\left({\begin{array}{*{20}{c}}{U_{10}^{(2i)}}&{U_{11}^{(2i)}D_{01}^{(2N - 2i)}}\\[6pt]{U_{10}^{(2i)}D_{00}^{(2N - 2i)}}&{D_{01}^{(2N - 2i)}}\end{array}} \right)\left({\begin{array}{*{20}{c}}{B_0^ -}\\{A_N^ +}\end{array}} \right) .\end{split}$$

Again, using the odd index $2i + 1$ instead of $2i$ allows the retrieval of the $A_i^ -$ and $B_i^ -$ coefficients.

The equation used to compute the Poynting vector at a given interface, using the corresponding coefficients, is

$${N_i} = \textbf{ Re}\!\left({\frac{{\gamma _i^*{\mu _0}}}{{\mu _i^*{\gamma _0}}}{{(A_i^ + - B_i^ +)}^*} (A_i^ + + B_i^ +)} \right) ,$$
where $\gamma$ is defined in Eq. (2), for the TE case. For the TM case, simply replace ${ \epsilon}$ with $\mu$ as usual.

C. Applications to Solar Cells

Solar cells can most often be modelized as a multilayered structure. Once the absorption in the active part ${{\cal A}_{\rm{active}}}$ is computed for the whole spectrum, it can be converted into an estimate of the short-circuit current ${j_{\rm{sc}}}$ delivered by the cell under standard illumination (an AM1.5 solar spectrum) assuming a unity quantum yield and using [54]

$${j_{\rm{sc}}} = \int {{\cal A}_{\rm{active}}}(\lambda)\frac{{dI}}{{d\lambda}}\cdot \frac{{{\rm e}\lambda}}{{{\rm hc}}} {\rm d}\lambda ,$$
where $\frac{{dI}}{{d\lambda}}$ is the spectral intensity for the AM1.5 spectrum per wavelength, $e$ is the charge of the electron, $h$ is Planck’s constant, and $c$ is the speed of light. The efficiency of the device can then be computed as the ratio of the short-circuit current over the maximum achievable current for the considered spectral window.

Because of how important this type of application is, there are functions in PyMoosh specifically designed to simulate photovoltaic multilayers, considering the photon density of the solar spectrum and the conversion efficiency of solar cells.

Figure 6(a) shows the photon density of the visible solar spectrum, received on the Earth, as included in the PyMoosh library. Figure 6(b) shows the absorptance of two structures: one that is a single layer of amorphous silicon (aSi) of 1 µm thickness, and a second structure with an additional dielectric anti-reflecting (AR) layer on top ($n = 1.5$, $h = \lambda /4n$, $\lambda = 600\,{\rm nm}$). These absorptance curves show that bulk aSi already has an absorptance of about 50%, and that a single AR coating can improve this absorptance to more than 85% for half of the visible spectrum.

 figure: Fig. 6.

Fig. 6. (a) Photon spectral density (photons per wavelength unit) of the AM1.5 visible solar spectrum. (b) Absorptance in the active layers of two different basic solar cells ($S$-matrix). 1 µm of SiA bulk with or without adding a layer of optical index $n = 1.5$ and thickness $\lambda /4n$ with $\lambda = 600\,{\rm nm}$.

Download Full Size | PDF

4. FIELD COMPUTATION

While reflectance or the transmittance spectra are among the most represented quantities, it is highly informative to be able to compute the electric or magnetic fields inside a structure in response to an illumination, either with an incoming beam, or when a source is placed in the structure. The magnetic field is especially relevant for all situations involving metals. The computational cost is less of a concern in such a situation, while the numerical stability is crucial. We thus use the ${ S}$-matrix method in that context, and the technique explained above to compute all the intermediate coefficients $A_i^ \pm$ and $B_i^ \pm$. The electric (resp. magnetic) field in TE (resp. TM) polarization can be written, assuming $x = 0$ and for a single incident plane wave, as

$${E_{y,i}}(x = 0,z) = A_i^ - {e^{i{\gamma _i}(z - {z_{i + 1}})}} + B_i^ + {e^{- i{\gamma _i}(z - {z_i})}} .$$

Using this expression and the determination of the square root mentioned above (positive imaginary part), presents the advantage that, since all the coefficients are computed with the best possible accuracy, all the exponentials are decreasing away from the interfaces. No numerical error can thus be amplified.

A. Illumination with a Gaussian Beam

A Gaussian beam can be written as a superposition of plane waves. In TE polarization, the ${E_y}$ field in layer $i$ can be written as

$$\begin{split}{E_{y,i}}(x,z) &= \frac{1}{{2\pi}}\int {{\cal E}_0}({k_x})\\&\quad\times\left({A_i^ - {e^{i{\gamma _i}(z - {z_{i + 1}})}} + B_i^ + {e^{- i{\gamma _i}(z - {z_i})}}} \right) {e^{i{k_x}x}}{\rm d}{k_x} ,\end{split}$$
where the amplitude is a Gaussian, we get
$${{\cal E}_0}\!\left({{k_x}} \right) = \frac{w}{{2\sqrt \pi}}{e^{- \frac{{{w^2}}}{4}{{\left({{k_x} - n{k_0}\sin {\theta _0}} \right)}^2}}}{e^{- i{k_x}{x_0}}} ,$$
for a Gaussian beam centered at ${x_0}$, ${\theta _0}$ being the central incidence angle, and $w$ is the waist of the beam. The refractive index of the upper medium is noted as $n$. We underline that the definition of $w$ above is standard for the study of nonspecular phenomena [55,56], but that this means $w$ is the waist along the $x$ axis and not the minimum waist of the beam perpendicularly to the propagation direction ($w^\prime $). There is a $\cos \theta$ factor between these two definitions: $w^\prime = w/\!\cos \theta$. For small angles of incidence this has little importance, but for grazing angles it should be considered.

In Pymoosh, the field is computed for each given ${k_x}$ in all the layers using Eq. (39) and for all the points defined in the vertical discretization. Then, the full field at different horizontal positions is computed by multiplying this vertical vector by ${e^{i{k_x}x}}$ for all the values of $x$ included in the horizontal discretization. The computed fields for each plane wave ${k_x}$ are subsequently multiplied by the corresponding complex amplitude ${{\cal E}_0}({{k_x}})$ [see Eq. (41)] and all the plane wave contributions are summed, leading to the calculation given by Eq. (40). Importantly, as the number of incidence angles (and thus ${k_x}$ values) is finite and thus discretized, the resulting field is consequently periodic. The period is what is called the window size $d$. If $\Delta {k_x}$ is the difference between two successive values of ${k_x}$, we have the relation $d = \frac{{2\pi}}{{\Delta {k_x}}}$. The number of plane waves is chosen such that the amplitude for the maximum and minimum wavevectors given by Eq. (41) is smaller than 1% and has thus no impact on the final field image.

The exact same procedure can be applied to obtain images corresponding to ${H_x}$ and ${H_z}$ in TE polarization, calculated as

$${H_x}(x = 0,z) = - \frac{{{\gamma _i}}}{{\omega {\mu _i}}}\big({A_i^ - {e^{i{\gamma _i}(z - {z_{i + 1}})}} - B_i^ + {e^{- i{\gamma _i}(z - {z_i})}}} \big) ,$$
$${H_z}(x = 0,z) = \frac{{{k_x}}}{{\omega {\mu _i}}}\big({A_i^ - {e^{i{\gamma _i}(z - {z_{i + 1}})}} + B_i^ + {e^{- i{\gamma _i}(z - {z_i})}}} \big) ,$$
And, for TM polarization, $H$ and $E$, $\mu$ and ${ \epsilon}$ must be exchanged. Theoretically, a minus sign should also be added in front of all the expressions, adding a global phase shift of $\pi$. Since the phase origin is arbitrary, we did not take it into account in the code.
 figure: Fig. 7.

Fig. 7. Schematic representation of the field values surrounding the source.

Download Full Size | PDF

B. Current Line Source

It is relatively simple to compute the field corresponding to a source of oscillating current $I$, invariant in the $y$ direction, in TE polarization (the electric field, hence the oscillation direction along the infinite axis), even in a complex multilayered structure. The equation that must be solved inside the homogeneous layer where the source is placed can be written as

$$\frac{{{\partial ^2}{E_y}}}{{\partial {z^2}}} + \frac{{{\partial ^2}{E_y}}}{{\partial {x^2}}} + {\epsilon _i}{\mu _i}k_0^2{E_y} = - i\omega {\mu _0}{\mu _i}I\delta (x - {x_s},z) ,$$
with $\delta$ as the Dirac function, if we assume that the source is placed in $({x_s},0)$. Because of the invariance of the problem, taking the Fourier transform in the $x$ direction yields
$$\frac{{{\partial ^2}{{\tilde E}_y}}}{{\partial {z^2}}} + ({\epsilon _i}{\mu _i}k_0^2 - k_x^2){\tilde E_y} = - i\omega {\mu _0}{\mu _i}I\delta (z) {e^{i{k_x}{x_s}}} .$$
This means that while ${\tilde E_y}$ is continuous its derivative is not, but it undergoes a jump equal to ${-}i\omega {\mu _0}{\mu _i}I{e^{i{k_x}{x_s}}}$. We assume a single source in layer ${i_s}$, above which the field can be written as
$${\tilde E_{y,{i_s}}}\!(z) = A_{{i_s}}^ + {e^{i{\gamma _{{i_s}}}z}} + B_{{i_s}}^ + {e^{- i{\gamma _{{i_s}}}z}} ;$$
below, it is
$${\tilde E_{y,{i_s}}}(z) = A_{{i_s}}^ - {e^{i{\gamma _{{i_s}}}z}} + B_{{i_s}}^ - {e^{- i{\gamma _{{i_s}}}z}} ,$$
where ${\gamma _{{i_s}}} = \sqrt {{\epsilon _{{i_s}}}{\mu _{{i_s}}}k_0^2 - k_x^2}$. The continuity of ${\tilde E_y}$ and the jump in its derivative lead to
$$A_{{i_s}}^ + + B_{{i_s}}^ + = A_{{i_s}}^ - + B_{{i_s}}^ - ,$$
$$A_{{i_s}}^ + - B_{{i_s}}^ + = A_{{i_s}}^ - - B_{{i_s}}^ - - \frac{{i\omega {\mu _0}{\mu _{{i_s}}}}}{{{\gamma _{{i_s}}}}}I{e^{i{k_x}{x_s}}} .$$

Now, it is always possible to write that $B_{{i_s}}^ + = {r_u}A_{{i_s}}^ +$ and $A_{{i_s}}^ - = {r_d}B_{{i_s}}^ -$, whatever the surrounding of the source. The coefficients ${r_d}$ and ${r_u}$ are simply found in the scattering matrix corresponding to the part of the structure below (respectively above) the source, as in Eq. (36). A simple representation of these fields and the contribution of the line source is presented in Fig. 7. A straightforward calculation yields an expression for the coefficients representing the wave amplitudes traveling into directions, respectively, upward ($A_{{i_s}}^ +$) and downward ($B_{{i_s}}^ -$) from the source, written as

$$A_{{i_s}}^ + = \frac{{- i{e^{i{k_x}{x_s}}}}}{{1 - {r_u} + (1 + {r_u})\frac{{1 - {r_d}}}{{1 + {r_d}}}}}\frac{1}{\gamma} ,$$
$$B_{{i_s}}^ - = \frac{{- i{e^{i{k_x}{x_s}}}}}{{1 - {r_d} + (1 + {r_d})\frac{{1 - {r_u}}}{{1 + {r_u}}}}}\frac{1}{\gamma} .$$

These two coefficients represent the amplitudes of the plane waves excited by the source, and, as can be clearly seen, both depend highly on the surroundings through ${r_d}$ and ${r_u}$, which means the surroundings do influence the source itself. This allows the computation of the field above and under the source when no other incoming light is considered. Practically, we use Eq. (40) with amplitude ${{\cal E}_0}({k_x})$ unity for all the values of ${k_x}$.

5. GUIDED MODES TRACKING

It is extremely useful to be able to find the electromagnetic modes of a multilayered structure, whether these modes are strictly guided or leaky. Both types of modes correspond to a solution of the system of equations evoked above [see Eqs. (4) and (5)] without any illumination ($B_0^ - = A_N^ + = 0$), meaning the determinant of the system must be zero [57] (i.e., a zero of the dispersion relation).

The dispersion relation also corresponds to a zero of the determinant of ${S^{- 1}}$ or a pole of $S$, where $S$ is the scattering matrix of the whole structure. We underline, however, that this does not work for a single interface and the surface plasmon modes. Note that the determinant of an interface scattering matrix is always equal to ${-}{1}$.

A solution of the dispersion relation is also a pole of the reflection coefficient in the ${k_x}$ complex plane because it corresponds to the existence of a solution or an outgoing wave without any incoming plane wave, and thus a diverging reflection coefficient. Obtaining the guided modes in this way works in the general case, including the case of only a single interface. It is therefore the approach implemented in PyMoosh.

The solutions of the dispersion relation, and thus the poles of the reflection coefficient, can generally be found either for a real value of the wavevector ${k_x}$ and a complex value of the frequency $\omega$ (the imaginary part representing the typical lifetime of the mode) or for a real value of the frequency $\omega$ and a complex value of the wavevector ${k_x}$ (the imaginary part representing the typical propagation distance of the mode before leaking). In PyMoosh we have, so far, made the latter choice. However, the default choice for the computation of the complex square root is not adequate for finding the solution of the dispersion relation. Given the physical meaning of the imaginary part of the poles, it is, most of the time [56], positive. The determination of the square root has to be modified to make the poles appear [58] and the default choice is to consider that the phase of ${k_z}$ should be comprised between ${-}\pi /5$ and $4\pi /5$. This allows, in most cases, the poles to be seen correctly and the complex plane close to them to be explored.

 figure: Fig. 8.

Fig. 8. (a) Dispersion of the guided modes of a 2000 nm thick slab of dielectric with a refractive index $n = 1.5$ in air, plotted as the effective wavelength of the mode as a function of the wavelength in vacuum in a manner similar to [59]. (b) Corresponding field profiles of the six modes with lowest effective index.

Download Full Size | PDF

To find the guided modes, we define a minimum and a maximum effective index, defining bounds on the wavevectors. Then we start from a set of points regularly placed on the real axis between these values for ${k_x}$ and run a steepest descent over $\frac{1}{{|r|}}$ using a finite difference scheme to estimate the gradient of the function. Steepest descent algorithms are typically employed to locate any minima, but here we leverage the fact that the minima correspond to zeroes, to determine when the algorithm should stop. Several of the initial points will converge to the same pole, and only the unique poles are kept. While this technique is probably not the most efficient nor the most advanced, it has proven relatively reliable so far.

Once the modes have been found, their profiles can be computed. An evanescent wave with a unity amplitude at the first interface is assumed. The rest of the mode is reconstructed using scattering matrices. Any inaccuracy in the determination of ${k_x}$ will result in a discontinuity at the first interface. Figure 8(b) presents the modes found in a 2000 nm thick slab of dielectric with a refractive index $n = 1.5$ in air.

It is often practical to obtain the dispersion curve (i.e., the values of the wavevector of a given mode for different frequencies). In PyMoosh, once the modes have been found for the largest considered frequency, they can be tracked using steepest descents while the frequency changes. An example is shown in Fig. 8(a). We begin with the smallest wavelength so that no mode appears during the sweep; however, modes do disappear when they reach a cut-off.

6. CODE DESIGN PRINCIPLES

PyMoosh has been developed with the core principles of open science in mind. The choice of Python as the programming language plays a central role: Python packages are extremely easy to find and install through the use of the PyPI repository [60]. Python is often called good glue, thanks to its ability to interface other programming languages seamlessly. Moreover, modern repositories such as GitHub [61], being partly social networks, combined with the GNU General Public License, allow the accessibility and reusability of the code to be maximized. Our approach thus aligns with the principles of the FAIR data framework, which underscore the importance of making data and methods findable, accessible, interoperable, and reusable, which is the FAIR data approach [62].

The code architecture was chosen with simplicity of use in mind, especially for researchers and physicists in photonics. Although Python is an object-oriented language, we intentionally minimized the use of objects to facilitate code comprehension for nonprogramming experts. For convenience, some parts such as material handling are implemented as classes, but we emphasize that the part concerning materials can be used and expanded upon completely independently from the rest of the code. Finally, due to the inherent ease of implementation in Python, some interesting numerical optimizations that could be deemed fundamental (e.g., parallel computing) are left entirely in the hands of the user.

Our code is highly versatile, which may initially disorient some users, especially those who are not familiar with Python. To address this, in addition to this tutorial, we have provided extensive documentation and illustrated various use cases using Jupyter Notebooks (a beginner’s guide to simulation and another for optimization) and then specific use cases: surface plasmon resonance, total internal reflection, photovoltaics devices, ellipsometry problems, Green function computation, use of various formalisms, guided mode representation and tracking, Prism couplers, photonic crystals, and managing materials. A sample of the results these notebooks provide is shown in Fig. 9. Jupyter Notebooks have gained significant popularity, particularly in the context of open science [45], making them an accessible and user-friendly tool for exploring and utilizing our code. Finally, we illustrate possible applications for deep learning training dataset generation by a set of open source, extensive Python notebook examples, which are exhaustively discussed in a recent tutorial article [63,64].

 figure: Fig. 9.

Fig. 9. PyMoosh use case examples. (a) and (b) Ellipsometry results $\frac{{{r_p}}}{{{r_s}}} = \tan (\phi){e^{{i\Delta}}}$ for a layer of $n = 1.33$ and width 400 nm on top of a gold substrate. (c) Mode profiles for two coupled waveguides of index $n = 1.5$, width 1.2 µm and separated by 300 nm of air. (d) Bulk 1 µm aSi cell absorbance in two cases. Simple anti-reflective coating (ARC): 100 nm layer of $n = 1.5$ as shown in Fig. 6(b). Complex ARC: optimized six-layer Bragg mirror and impedance matching layers above and below (see notebook). (e) Surface plasmon resonance excitation with a prism in Kretschmann configuration: Prism is made out of BK7 on top of a 55 nm layer of gold illuminated at 45.5° and $\lambda = 600\,{\rm nm}$. (f) Electric field intensity of a current source encased in a layer of width 1 µm and $\epsilon = 1.4 + 0.1i$ at $\lambda = 600\,{\rm nm}$.

Download Full Size | PDF

7. CONCLUSION

In conclusion, we have presented PyMoosh, a user-friendly Python tool for the analysis and design of photonic multilayers. PyMoosh has been developed with open science principles in mind to make it genuinely findable, accessible, interoperable and reusable. With its comprehensive set of features, numerical stability, readiness for optimization and deep learning problems, and its extensive set of examples, we hope our platform will be adopted by the community at large to build upon. Already used in teaching and research, PyMoosh offers a versatile platform for studying the rich physics of multilayered structures, particularly those incorporating metallic or metallic-like layers. In a subsequent publication, we aim to demonstrate how PyMoosh can be seamlessly integrated with advanced optimization algorithms and optimization libraries and that its features allow for an efficient exploration of inverse design problems [63,65]. Future plans include incorporating more advanced material descriptions, such as spatial dispersion in metals [66,67], to further expand the capabilities of PyMoosh. We are dedicated to continuously improving PyMoosh and welcome any suggestions and contributions from the community.

Funding

Agence Nationale de la Recherche (16-IDEX-0001, ANR-22-CE24-0002, p20010).

Acknowledgment

A.M. is an Academy CAP 20-25 chair holder. He acknowledges the support received from the Agence Nationale de la Recherche of the French government. This work was supported by the International Research Center “Innovation Transportation and Production Systems” of the Clermont-Ferrand I-SITE CAP 20-25. P.R.W. acknowledges the support of the French Agence Nationale de la Recherche (ANR), and from the Toulouse high performance computing facility CALMIP.

Disclosures

The authors declare no conflicts of interest.

Data availability

Data underlying the results presented in this paper are available in [42]. The full code related to this paper is available in [43].

REFERENCES

1. J. W. Strutt, “On the propagation of waves through a stratified medium, with special reference to the question of reflection,” Proc. R. Soc. Lond. A 86, 207–226 (1912). [CrossRef]  

2. J. W. Strutt, “On the reflection of light from a regularly stratified medium,” Proc. R. Soc. Lond. A 93, 565–577 (1917). [CrossRef]  

3. A. Macleod, “The quarterwave stack: 1. Early history,” Bulletin, Society of Vacuum Coaters, Issue Summer (2012), pp. 22–27.

4. F. Abelès, “La théorie générale des couches minces,” J. Phys. Radium 11, 307–309 (1950). [CrossRef]  

5. P. Yeh, A. Yariv, and C.-S. Hong, “Electromagnetic propagation in periodic stratified media. I. General theory,” J. Opt. Soc. Am. 67, 423–438 (1977). [CrossRef]  

6. A. Yariv and P. Yeh, “Electromagnetic propagation in periodic stratified media. II. Birefringence, phase matching, and x-ray lasers,” J. Opt. Soc. Am. 67, 438–447 (1977). [CrossRef]  

7. P. Yeh, A. Yariv, and A. Y. Cho, “Optical surface waves in periodic layered media,” Appl. Phys. Lett. 32, 104–105 (1978). [CrossRef]  

8. P. Yeh, “Optics of anisotropic layered media: a new 4× 4 matrix algebra,” Surf. Sci. 96, 41–53 (1980). [CrossRef]  

9. M. Born and E. Wolf, Principles of Optics: Electromagnetic Theory of Propagation, Interference and Diffraction of Light (Elsevier, 2013).

10. P. Yeh, Optical Waves in Layered Media (Wiley Online Library, 2006).

11. H. A. Macleod, Thin-Film Optical Filters (CRC Press, 2017).

12. P. Baumeister, “Design of multilayer filters by successive approximations,” J. Opt. Soc. Am. 48, 955–958 (1958). [CrossRef]  

13. A. Thelen, “Equivalent layers in multilayer filters,” J. Opt. Soc. Am. 56, 1533–1538 (1966). [CrossRef]  

14. A. Thelen, “Design of optical minus filters,” J. Opt. Soc. Am. 61, 365–369 (1971). [CrossRef]  

15. J. H. Apfel, “Optical coating design with reduced electric field intensity,” Appl. Opt. 16, 1880–1885 (1977). [CrossRef]  

16. J. Dobrowolski and D. Lowe, “Optical thin film synthesis program based on the use of Fourier transforms,” Appl. Opt. 17, 3039–3050 (1978). [CrossRef]  

17. A. V. Tikhonravov and M. K. Trubetskov, “Development of the needle optimization technique and new features of optilayer design software,” Proc. SPIE 2253, 10–20 (1994). [CrossRef]  

18. D. Poitras, L. Li, M. Jacobson, et al., “Manufacturing problem contest [invited],” Appl. Opt. 56, C1–C10 (2017). [CrossRef]  

19. J. D. T. Kruschwitz, V. Pervak, J. Keck, et al., “Optical interference coating design contest 2016: a dispersive mirror and coating uniformity challenge,” Appl. Opt. 56, C151–C162 (2017). [CrossRef]  

20. J. D. T. Kruschwitz, V. Pervak, and J. Keck, “Results of the OIC 2019 design problem challenge,” in Optical Interference Coatings Conference (OIC) 2019, OSA Technical Digest (Optica Publishing Group, 2019), paper TC.1.

21. M. Bocková, J. Slabý, T. Špringer, et al., “Advances in surface plasmon resonance imaging and microscopy and their biological applications,” Annu. Rev. Anal. Chem. 12, 151–176 (2019). [CrossRef]  

22. H. K. Raut, V. A. Ganesh, A. S. Nair, et al., “Anti-reflective coatings: A critical, in-depth review,” Energy Environ. Sci. 4, 3779–3804 (2011). [CrossRef]  

23. S. I. Bozhevolnyi and T. Søndergaard, “General properties of slow-plasmon resonant nanostructures: nano-antennas and resonators,” Opt. Express 15, 10869–10877 (2007). [CrossRef]  

24. P. Shekhar, J. Atkinson, and Z. Jacob, “Hyperbolic metamaterials: fundamentals and applications,” Nano Converg. 1, 1–17 (2014). [CrossRef]  

25. R. Pollès, M. Mihailovic, E. Centeno, et al., “Leveraging beam deformation to improve the detection of resonances,” Phys. Rev. A 94, 063808 (2016). [CrossRef]  

26. C. C. Katsidis and D. I. Siapkas, “General transfer-matrix method for optical multilayer systems with coherent, partially coherent, and incoherent interference,” Appl. Opt. 41, 3978–3987 (2002). [CrossRef]  

27. A. Luce, A. Mahdavi, F. Marquardt, et al., “TMM-Fast, a transfer matrix computation package for multilayer thin-film optimization: Tutorial,” J. Opt. Soc. Am. A 39, 1007–1013 (2022). [CrossRef]  

28. M. M. Bay, S. Vignolini, and K. Vynck, “PyLlama: A stable and versatile Python toolkit for the electromagnetic modelling of multilayered anisotropic media,” Comput. Phys. Commun. 273, 108256 (2022). [CrossRef]  

29. S. Larouche and L. Martinu, “Openfilters: open-source software for the design, optimization, and synthesis of optical filters,” Appl. Opt. 47, C219–C230 (2008). [CrossRef]  

30. E. B. Costa, E. P. Rodrigues, and H. A. Pereira, “SIM-SPR: An open-source surface plasmon resonance simulator for academic and industrial purposes,” Plasmonics 14, 1699–1709 (2019). [CrossRef]  

31. M. A. Barry, V. Berthier, B. D. Wilts, et al., “Evolutionary algorithms converge towards evolved biological photonic structures,” Sci. Rep. 10, 12024 (2020). [CrossRef]  

32. H. Wankerl, C. Wiesmann, L. Kreiner, et al., “Directional emission of white light via selective amplification of photon recycling and Bayesian optimization of multi-layer thin films,” Sci. Rep. 12, 5226 (2022). [CrossRef]  

33. Z. Liu, D. Zhu, S. P. Rodrigues, et al., “Generative model for the inverse design of metasurfaces,” Nano Lett. 18, 6570–6576 (2018). [CrossRef]  

34. R. Unni, K. Yao, and Y. Zheng, “Deep convolutional mixture density network for inverse design of layered photonic structures,” ACS Photonics 7, 2703–2712 (2020). [CrossRef]  

35. P. Dai, Y. Wang, Y. Hu, et al., “Accurate inverse design of Fabry–Perot-cavity-based color filters far beyond sRGB via a bidirectional artificial neural network,” Photonics Res. 9, B236–B246 (2021). [CrossRef]  

36. P. Dai, K. Sun, X. Yan, et al., “Inverse design of structural color: Finding multiple solutions via conditional generative adversarial networks,” Nanophotonics 11, 3057–3069 (2022). [CrossRef]  

37. Z. Wang, Y. C. Lin, K. Zhang, et al., “EllipsoNet: Deep-learning-enabled optical ellipsometry for complex thin films,” arXiv, arXiv:2210.05630 (2022). [CrossRef]  

38. A. Luce, A. Mahdavi, H. Wankerl, et al., “Investigation of inverse design of multilayer thin-films with conditional invertible neural networks,” Mach. Learn. Sci. Technol. 4, 015014 (2023). [CrossRef]  

39. T. Ma, H. Wang, and L. J. Guo, “OptoGPT: a foundation model for inverse design in optical multilayer thin film structures,” arXiv, arXiv:2304.10294 (2023). [CrossRef]  

40. J. Jiang and J. A. Fan, “Multiobjective and categorical global optimization of photonic structures based on ResNet generative neural networks,” Nanophotonics 10, 361–369 (2020). [CrossRef]  

41. S. Liu, X. Chen, and S. Liu, “Smart ellipsometry with physics-informed deep learning” (2023).

42. A. Moreau, “PyMoosh,” GitHub, 2023, https://github.com/AnMoreau/PyMoosh.

43. A. Moreau, “PyMoosh,” Zenodo, 2023, https://doi.org/10.5281/zenodo.10261964.

44. J. Defrance, C. Lemaître, R. Ajib, et al., “Moosh: a numerical Swiss army knife for the optics of multilayers in Octave/Matlab,” J. Open Res. Software 4, 13 (2016). [CrossRef]  

45. B. M. Randles, I. V. Pasquetto, M. S. Golshan, et al., “Using the Jupyter notebook as a tool for open science: An empirical study,” in ACM/IEEE Joint Conference on Digital Libraries (JCDL) (IEEE, 2017), pp. 1–2.

46. H. Giessen and R. Vogelgesang, “Glimpsing the weak magnetic field of light,” Science 326, 529–530 (2009). [CrossRef]  

47. P. Lalanne and G. M. Morris, “Highly improved convergence of the coupled-wave method for TM polarization,” J. Opt. Soc. Am. A 13, 779–784 (1996). [CrossRef]  

48. G. Granet and B. Guizal, “Efficient implementation of the coupled-wave method for metallic lamellar gratings in TM polarization,” J. Opt. Soc. Am. A 13, 1019–1023 (1996). [CrossRef]  

49. T. J. Hughes, “Multiscale phenomena: Green’s functions, the Dirichlet-to-Neumann formulation, subgrid scale models, bubbles and the origins of stabilized methods,” Comput. Methods Appl. Mech. Eng. 127, 387–401 (1995). [CrossRef]  

50. J.-M. Muller, N. Brisebarre, F. De Dinechin, et al., Handbook of Floating-Point Arithmetic (Springer, 2018).

51. D. D. Solnyshkov, G. Malpuech, P. St-Jean, et al., “Microcavity polaritons for topological photonics,” Opt. Mater. Express 11, 1119–1142 (2021). [CrossRef]  

52. E. Kretschmann and H. Raether, “Notizen: radiative decay of non radiative surface plasmons excited by light,” Z. Naturforsch. A 23, 2135–2136 (1968). [CrossRef]  

53. J. B. Pendry, “Negative refraction makes a perfect lens,” Phys. Rev. Lett. 85, 3966–3969 (2000). [CrossRef]  

54. R. Santbergen, J. Goud, M. Zeman, et al., “The AM1. 5 absorption factor of thin-film solar cells,” Sol. Energy Mater. Sol. Cells 94, 715–723 (2010). [CrossRef]  

55. T. Tamir, “Nonspecular phenomena in beam fields reflected by multilayered media,” J. Opt. Soc. Am. A 3, 558–565 (1986). [CrossRef]  

56. R. Polles, A. Moreau, and G. Granet, “Light wheel buildup using a backward surface mode,” Opt. Lett. 35, 3237–3239 (2010). [CrossRef]  

57. R. Petit, Ondes électromagnétiques en radioélectricité et en optique (1989).

58. R. E. Smith, S. Houde-Walter, and G. Forbes, “Mode determination for planar waveguide using the four-sheeted dispersion relation,” IEEE J. Quantum Electron. 28, 1520–1526 (1992). [CrossRef]  

59. M. Khaywah, A. Potdevin, F. Réveret, et al., “Large and versatile plasmonic enhancement of photoluminescence using colloidal metallic nanocubes,” J. Phys. Chem. C 125, 7780–7790 (2021). [CrossRef]  

60. M. Valiev, B. Vasilescu, and J. Herbsleb, “Ecosystem-level determinants of sustained activity in open-source projects: A case study of the PyPI ecosystem,” in Proceedings of the 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (2018), pp. 644–655.

61. V. Cosentino, J. Luis, and J. Cabot, “Findings from GitHub: methods, datasets and limitations,” in Proceedings of the 13th International Conference on Mining Software Repositories (2016), pp. 137–141.

62. T. Tanhua, S. Pouliquen, J. Hausman, et al., “Ocean fair data services,” Front. Mar. Sci. 6, 440 (2019). [CrossRef]  

63. A. Khaireh-Walieh, D. Langevin, P. Bennet, et al., “A newcomer’s guide to deep learning for inverse design in nano-photonics,” Nanophotonics 12, 4387–4414 (2023). [CrossRef]  

64. P. R. Wiecha, “A newcomer’s guide to deep learning for inverse design in nano-photonics,” 2023, https://gitlab.com/wiechapeter/newcomer_guide_dl_inversedesign.

65. P. Bennet, D. Langevin, C. Essoual, et al., “An illustrated tutorial on global optimization in nanophotonics,” arXiv, arXiv:2309.09760 (2023). [CrossRef]  

66. A. R. Melnyk and M. J. Harrison, “Theory of optical excitation of plasmons in metals,” Phys. Rev. B 2, 835 (1970). [CrossRef]  

67. J. Benedicto, R. Polles, C. Ciracì, et al., “Numerical tool to take nonlocal effects into account in metallo-dielectric multilayers,” J. Opt. Soc. Am. A 32, 1581–1588 (2015). [CrossRef]  

Data availability

Data underlying the results presented in this paper are available in [42]. The full code related to this paper is available in [43].

42. A. Moreau, “PyMoosh,” GitHub, 2023, https://github.com/AnMoreau/PyMoosh.

43. A. Moreau, “PyMoosh,” Zenodo, 2023, https://doi.org/10.5281/zenodo.10261964.

Cited By

Optica participates in Crossref's Cited-By Linking service. Citing articles from Optica Publishing Group journals and other participating publishers are listed here.

Alert me when this article is cited.


Figures (9)

Fig. 1.
Fig. 1. Multilayer structure and definition of important variables. We consider the light coming from the top of the image. ${\epsilon _i}$ and ${\mu _i}$ are, respectively, the permittivity and the permeability of layer $i$. ${A_i}$ (resp. ${B_i}$) are defined as the amplitude of the upward propagating (resp. downward propagating) field in layer $i$, and the ${+}$ (resp. ${-}$) superscript indicates that the field value is taken at the top (resp. bottom) of layer $i$.
Fig. 2.
Fig. 2. Computation time of the $r$ and $t$ coefficients for all methods as a function of the number of layers in a stack, averaged over 500 runs. As exact computation times are heavily influenced by hardware capabilities, it remains important to prioritize the relative comparison between formalisms over these precise times.
Fig. 3.
Fig. 3. (a) Absolute error between S-matrix (considered as our reference) and other formalisms. Transmission coefficient for a quarter-wave stack of materials $n = 1.2$ and $n = 1.5$ as a function of the total number of layers of the stack. (b) Schematic representation of the structure.
Fig. 4.
Fig. 4. (a) Absolute error between the $S$-matrix (considered as our reference) and other formalisms. Transmission coefficient in a frustrated total internal reflection situation for a layer of air of width $D$ between materials of index $n = 1.5$. (b) Schematic representation of the structure.
Fig. 5.
Fig. 5. (a) Absolute error between the $S$-matrix (considered as our reference) and other formalisms. Surface plasmon resonance coupler in the Kretschmann–Raether configuration with a prism of index $n = 1.5$ coupling to air through a silver layer of width $D$. (b) Schematic representation of the structure.
Fig. 6.
Fig. 6. (a) Photon spectral density (photons per wavelength unit) of the AM1.5 visible solar spectrum. (b) Absorptance in the active layers of two different basic solar cells ($S$-matrix). 1 µm of SiA bulk with or without adding a layer of optical index $n = 1.5$ and thickness $\lambda /4n$ with $\lambda = 600\,{\rm nm}$.
Fig. 7.
Fig. 7. Schematic representation of the field values surrounding the source.
Fig. 8.
Fig. 8. (a) Dispersion of the guided modes of a 2000 nm thick slab of dielectric with a refractive index $n = 1.5$ in air, plotted as the effective wavelength of the mode as a function of the wavelength in vacuum in a manner similar to [59]. (b) Corresponding field profiles of the six modes with lowest effective index.
Fig. 9.
Fig. 9. PyMoosh use case examples. (a) and (b) Ellipsometry results $\frac{{{r_p}}}{{{r_s}}} = \tan (\phi){e^{{i\Delta}}}$ for a layer of $n = 1.33$ and width 400 nm on top of a gold substrate. (c) Mode profiles for two coupled waveguides of index $n = 1.5$, width 1.2 µm and separated by 300 nm of air. (d) Bulk 1 µm aSi cell absorbance in two cases. Simple anti-reflective coating (ARC): 100 nm layer of $n = 1.5$ as shown in Fig. 6(b). Complex ARC: optimized six-layer Bragg mirror and impedance matching layers above and below (see notebook). (e) Surface plasmon resonance excitation with a prism in Kretschmann configuration: Prism is made out of BK7 on top of a 55 nm layer of gold illuminated at 45.5° and $\lambda = 600\,{\rm nm}$. (f) Electric field intensity of a current source encased in a layer of width 1 µm and $\epsilon = 1.4 + 0.1i$ at $\lambda = 600\,{\rm nm}$.

Equations (51)

Equations on this page are rendered with MathJax. Learn more.

z 2 E y + ( μ r ϵ r ω 2 c 2 k x 2 ) E y = 0
γ i = μ i ϵ i k 0 2 k x 2 ,
{ E y , i ( z ) = A i + e i γ i ( z z i ) + B i + e i γ i ( z z i ) , E y , i ( z ) = A i e i γ i ( z z i + 1 ) + B i e i γ i ( z z i + 1 ) ,
A i + B i = A i + 1 + + B i + 1 + ,
γ i μ i ( A i B i ) = γ i + 1 μ i ( A i + 1 + B i + 1 + ) .
( A i + 1 + B i + 1 + ) = T i , i + 1 ( A i B i ) = 1 2 ψ i + 1 ( ψ i + ψ i + 1 ψ i ψ i + 1 ψ i ψ i + 1 ψ i + ψ i + 1 ) ( A i B i ) ,
( A i B i ) = C i ( T ) ( A i + B i + ) = ( e i γ i h i 0 0 e i γ i h i ) ( A i + B i + ) ,
( A N + 1 + B N + 1 + ) = T N , N + 1 i = 0 N 1 ( C i ( T ) T i , i + 1 ) ( A 0 B 0 ) .
T = T N , N + 1 i = 0 N 1 ( C i ( T ) T i , i + 1 ) ,
( A i B i + 1 + ) = I i , i + 1 ( B i A i + 1 + ) = 1 ψ i + ψ i + 1 ( ψ i ψ i + 1 2 ψ i + 1 2 ψ i ψ i + 1 ψ i ) ( B i A i + 1 + ) .
( A i + B i ) = C i ( S ) ( B i + A i ) = ( 0 e i γ i h i e i γ i h i 0 ) ( B i + A i ) .
( A B ) = ( U 00 U 01 U 10 U 11 ) ( C D ) , a n d ( D E ) = ( V 00 V 01 V 10 V 11 ) ( B F ) ,
( A E ) = ( S 00 S 01 S 10 S 11 ) ( C F ) .
S = ( U 00 + U 01 V 00 U 10 1 V 00 U 11 U 01 V 01 1 V 00 U 11 U 10 V 10 1 V 00 U 11 V 11 + V 10 U 11 V 01 1 V 00 U 11 ) .
( A 0 B N + 1 + ) = S ( B 0 A N + 1 + ) .
{ E y , i ( z i ) = A i + + B i + , z E y , i ( z i ) = i γ i ( A i + B i + ) , E y , i + 1 ( z i + 1 ) = A i + e i γ i h i + B i + e i γ i h i , z E y , i + 1 ( z i + 1 ) = i γ i ( A i + e i γ i h i B i + e i γ i h i ) .
( E y , i + 1 z E y , i + 1 ) = M i ( E y , i z E y , i ) = ( cos ( γ i h i ) sin ( γ i h i ) γ i γ i sin ( γ i h i ) cos ( γ i h i ) ) ( E y , i z E y , i ) .
E y , N + 1 = t ,
E y , 0 = r + 1 ,
z E y , N + 1 = i γ N + 1 t ,
z E y , 0 = i γ 0 ( r + 1 ) .
( z E y , i z E y , i + 1 ) = N i , i + 1 ( E y , i E y , i + 1 ) = ( γ i cos ( γ i h i ) sin ( γ i h i ) γ i sin ( γ i h i ) γ i sin ( γ i h i ) γ i cos ( γ i h i ) sin ( γ i h i ) ) ( E y , i E y , i + 1 ) .
D i , i + 2 = ( A 00 A 01 A 10 A 11 B 00 A 01 B 01 A 11 B 00 B 10 A 10 A 11 B 00 B 11 + B 10 B 01 A 11 B 00 ) .
δ i = γ i h i = 2 π λ n e f f , i h i ,
( E y , i z E y , i ) = ( cos δ i sin δ i γ i γ i sin δ i cos δ i ) ( E y , i + 1 Z E y , i + 1 ) .
( E y , i E y , i + 1 z E y , i E y , i + 1 ) = ( cos δ i sin δ i γ i γ i sin δ i cos δ i ) ( 1 X i + 1 ) .
X i = X i + 1 γ i tan δ i 1 + X i + 1 γ i tan δ i .
Y i = Y i + 1 i n e f f , i tan δ i 1 i Y i + 1 n e f f , i tan δ i .
r T E = n e f f , 0 Y 0 n e f f , 0 + Y 0 .
r T M = n e f f , 0 ( T M ) Y 0 n e f f , 0 ( T M ) + Y 0 .
( E y , k z E y , k ) = M t o t ( k ) ( E y , 0 z E y , 0 ) = M t o t ( k ) ( r + 1 i ( r 1 ) γ 0 μ 0 ) .
N i =  Re ( i E y , i z E y , i μ 0 γ 0 )
{ U ( 2 i ) = C 0 ( S ) C 1 ( S ) I 12 C 2 ( S ) I i , i + 1 , U ( 2 i + 1 ) = C 0 ( S ) C 1 ( S ) I 12 C 2 ( S ) C i + 1 ( S ) , D ( 2 i ) = C N i ( S ) I N i , N i + 1 C N ( S ) , D ( 2 i + 1 ) = I N i 1 , N i C N i ( S ) C N ( S ) .
( A 0 B i + ) = U ( 2 i ) ( B 0 A i + ) ,
( A i + B N + ) = D ( 2 N 2 i ) ( B i + A N + ) .
( A i + B i + ) = 1 1 U 11 ( 2 i ) D 00 ( 2 N 2 i ) × ( U 10 ( 2 i ) U 11 ( 2 i ) D 01 ( 2 N 2 i ) U 10 ( 2 i ) D 00 ( 2 N 2 i ) D 01 ( 2 N 2 i ) ) ( B 0 A N + ) .
N i =  Re ( γ i μ 0 μ i γ 0 ( A i + B i + ) ( A i + + B i + ) ) ,
j s c = A a c t i v e ( λ ) d I d λ e λ h c d λ ,
E y , i ( x = 0 , z ) = A i e i γ i ( z z i + 1 ) + B i + e i γ i ( z z i ) .
E y , i ( x , z ) = 1 2 π E 0 ( k x ) × ( A i e i γ i ( z z i + 1 ) + B i + e i γ i ( z z i ) ) e i k x x d k x ,
E 0 ( k x ) = w 2 π e w 2 4 ( k x n k 0 sin θ 0 ) 2 e i k x x 0 ,
H x ( x = 0 , z ) = γ i ω μ i ( A i e i γ i ( z z i + 1 ) B i + e i γ i ( z z i ) ) ,
H z ( x = 0 , z ) = k x ω μ i ( A i e i γ i ( z z i + 1 ) + B i + e i γ i ( z z i ) ) ,
2 E y z 2 + 2 E y x 2 + ϵ i μ i k 0 2 E y = i ω μ 0 μ i I δ ( x x s , z ) ,
2 E ~ y z 2 + ( ϵ i μ i k 0 2 k x 2 ) E ~ y = i ω μ 0 μ i I δ ( z ) e i k x x s .
E ~ y , i s ( z ) = A i s + e i γ i s z + B i s + e i γ i s z ;
E ~ y , i s ( z ) = A i s e i γ i s z + B i s e i γ i s z ,
A i s + + B i s + = A i s + B i s ,
A i s + B i s + = A i s B i s i ω μ 0 μ i s γ i s I e i k x x s .
A i s + = i e i k x x s 1 r u + ( 1 + r u ) 1 r d 1 + r d 1 γ ,
B i s = i e i k x x s 1 r d + ( 1 + r d ) 1 r u 1 + r u 1 γ .
Select as filters


Select Topics Cancel
© Copyright 2024 | Optica Publishing Group. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.