# Opal-Like Photonic Structuring of Perovskite Solar Cells Using a Genetic Algorithm Approach
## 3 Numerical Methods and Figure of Merits  
In order to assess the absorption properties of the different PSCs made of opal-like subunits, we have to solve Maxwell equations. A perfectly adapted numerical method for solving such a stratified and periodic photonic structure is the rigorous coupled wave analysis (RCWA) [44]. The total reflectance \(R\) and total transmittance \(T\) are calculated for each incident wavelength, and the global absorptance \(A\) is deduced from the conservation of energy. Numerical convergence is ensured if a sufficient number of plane waves is taken in order to reproduce the electric permittivity and EM fields developed in the truncated 2D Fourier series. Here, this convergence is verified using \(7\times 7\) plane waves along the \(x\) and \(y\) directions. In order to find the set of parameters that will provide the highest photon absorption over the considered wavelength range amongst the \(1.45\,\times 10^{9}\) possible combinations of the five parameters described in Table 1, we used a genetic algorithm (GA) optimization approach [45; 46; 47]. The idea consists of working with a population of \(n_{pop}=50\) individuals that represent possible solutions to the problem. Each individual is representative of given values for the parameters we seek to determine. A binary Gray code is used for the representation of these parameters [37; 47]. We refer by DNA to the chain of bits associated with the coding of the complete set of parameters and by fitness to the function we seek to maximize (the iQE, as explained in the next paragraph). We start with a random population. The \(n_{rand}\) less fit individuals are replaced by random individuals; they are transferred to the next generation (\(n_{rand}=0.1\times n_{pop}\times(1-p)\)), with \(p=|s-0.5|/0.5\) being a progress indicator and \(s\) the genetic similarity defined as the fraction of bits in the population whose value is identical to the best individual. We apply a rank-based roulette wheel selection on the remaining part of the population to select \(N=n_{pop}-n_{rand}\) parents (a given individual can be selected several times). For the two parents selected, we define two children for the next generation either (i) by a 1 point crossover of the parents' DNA (probability of 70%), or (ii) by a simple replication of the parents (probability of 30%). We apply binary mutations on the DNA of the children obtained by crossover (a binary mutation rate of 0.95/\(n_{bits}\) is used, where \(n_{bits}=33\) is the number of bits in the DNA). We finally establish a quadratic approximation of the fitness in the close neighborhood of the best individual at that time. The local optimum of this approximation (if acceptable) is injected in the next generation. After evaluation of the next generation, we apply elitism to make sure that the best solution was not lost. This strategy is repeated from generation to generation until a convergence criterion is met. We refer to our previous work for more details on this algorithm [37; 38]. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter Name** & **Minimum Value** & **Maximum Value** \\ \hline Thickness of the transparent conducting electrode & & \\ fluorine-doped tin oxide \(FTO\) layer \(t_{FTO}\) & 50 nm & 800 nm \\ Thickness of the uniform perovskite layer \(t_{uni}\) & 0 nm & 100 nm \\ Radius of the perovskite spheres \(R\) & 50 nm & 1100 nm \\ Thickness of the structured perovskite layer \(t_{struc}\) & 50 nm & 2200 nm \\ Thickness of the hole transporting spiro–OMeTAD layer \(t_{spiro}\) & 50 nm & 800 nm \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters considered for GA optimization of the perovskite solar cells (PSCs) and their range. As mentioned above, the main goal is the determination of optimal parameters in order to maximize the PSCs' absorption. Therefore, our fitness will be the so-called integrated quantum efficiency (iQE).