# Stimuli-Responsive Photonic Crystals
## 2 Theoretical Background  
First, we consider a multilayer of materials deposited on a substrate on one side (with refractive index \(n_{s}\)) and in contact with air (with refractive index \(n_{0}=1.000277\cong 1\)) on the other side. The transfer matrix method is exhaustively explained in the literature, such as in reference [9]. The transfer matrix for the \(k_{\text{th}}\) layer is given by [9]:  
\[M_{k}=\left[ \begin{array}{cc}cos\big{(}\frac{2\pi}{\lambda}n_{k}d_{k}\big{)} &-\frac{i}{p_{k}}sin\big{(}\frac{2\pi}{\lambda}n_{k}d_{k}\big{)}\\ -ip_{k}sin\big{(}\frac{2\pi}{\lambda}n_{k}d_{k}\big{)}&cos\big{(}\frac{2\pi}{ \lambda}n_{k}d_{k}\big{)}\end{array} \right] \tag{1}\]with \(\phi_{k}=\frac{2\pi}{\lambda}n_{k}d_{k}cos\alpha_{k}\) that is the light phase variation passing through the \(kth\) layer, \(n_{k}\) being the refractive index, \(d_{k}\) the thickness of the layer and \(cos\alpha_{k}\) the parameter that takes into account the light beam propagating through the layer with refractive index \(n_{k}\), related to the angle of incidence \(\theta_{0}\) (as displayed in Figure 1a) of the light on the structure:  
\[cos\alpha_{k}=\left[\mathbf{1}-\frac{n_{0}^{2}sin^{2}\phi_{0}}{n_{k}^{2}} \right]^{\frac{1}{2}} \tag{2}\]  
Figure 1: (**a**) Sketch of the one-dimensional photonic crystal (\(\phi_{0}\) is the angle of incidence of the light). Simulation of the angular dependent transmission spectrum of a 5 bilayer TiO\({}_{2}\)-SiO\({}_{2}\) nanoparticle-based photonic crystal for a transverse electric (TE) wave (**b**) and a transverse magnetic (TM) wave (**c**). For both the nanoparticle layers, the filling factor is 0.7. For a transverse electric (TE) wave, the parameter \(p_{k}\) in Equation (1) can be written as \(p_{k,TE}=n_{k}cosa_{k}\), while for a transverse magnetic (TM) wave \(p_{k,TM}=\frac{cosa_{k}}{n_{k}}\). The matrix product \(M=M_{1}\cdot M_{2}\dots M_{k}\dots M_{s}=\left[ \begin{array}{cc}m_{11}&m_{12} \\ m_{21}&m_{22}\end{array} \right]\) gives the matrix of the multilayer made of s layers. We can write the transmission coefficient t as  
\[\mathbf{t}=\frac{2\mathbf{p_{0}}}{(\mathbf{m_{11}}+\mathbf{m_{12}}\mathbf{p_{s}})\mathbf{p_{0}}+(\mathbf{m _{21}}+\mathbf{m_{22}}\mathbf{p_{s}})} \tag{3}\]  
For a transverse electric (TE) wave \(p_{0,\text{TE}}=n_{0}cosa_{0}\) and \(p_{s,TE}=n_{s}\bigg{[}1-\frac{n_{0}^{2}sin^{2}\theta_{0}}{n_{s}^{2}}\bigg{]}^ {\frac{1}{2}}\), while for a transverse magnetic (TM) wave \(p_{0,\text{TM}}=\frac{cosa_{0}}{n_{0}}\) and \(p_{s,TM}=\frac{\left[1-\frac{n_{0}^{2}sin^{2}\theta_{0}}{n_{s}^{2}}\right]^{ \frac{1}{2}}}{n_{s}}\). Finally, to calculate the light transmission of the multilayer photonic crystal we can use the following equation:  
\[\mathbf{T}=\frac{\mathbf{n_{0}}}{\mathbf{n_{s}}}|\mathbf{t}|^{2} \tag{4}\]  
If, in the spectral range of interest, the refractive index does not show a significant wavelength dependence, its value can be essentially considered as constant. Otherwise, we should consider the refractive index as a function of the wavelength. The refractive indexes of many materials are reported in the literature [10] and can be expressed with a Sellmeier equation. For example, the Sellmeier equation for silicon dioxide, which is widely employed for the fabrication of one-dimensional photonic crystals, is [11]:  
\[\mathbf{n_{SiO_{2}}^{2}}(\lambda)-\mathbf{1}=\frac{\mathbf{0.6961663\lambda^{2}}}{\lambda ^{2}-\mathbf{0.0684043^{2}}}+\frac{\mathbf{0.4079426\lambda^{2}}}{\lambda^{2}-\mathbf{0.1 162414^{2}}}+\frac{\mathbf{0.8974794\lambda^{2}}}{\lambda^{2}-\mathbf{0.896161^{2}}} \tag{5}\]  
For porous materials, we can determine the refractive index by employing the Maxwell-Garnett effective medium approximation [12; 13]:  
\[\varepsilon_{eff}=\varepsilon_{air}\frac{2(1-f)\varepsilon_{air}+(1+2f) \varepsilon_{material}}{2(2+f)\varepsilon_{air}+(1-f)\varepsilon_{material}} \tag{6}\]  
where \(\varepsilon_{material}\) is the dielectric constant of the material, \(\varepsilon_{air}\) is the dielectric constant of air and \(f\) is the filling factor.