## 2 Inverse Design of Silicon Photonics with Iterative Optimization Algorithms
### Optimization of Irregular Structures
\tag{7}\]  
By substituting Equations (6) and (7) into Equation (4) and making an equivalent transformation, we get the total FOM as in Equation (8):  
\[F(\mathbf{E},\mathbf{H})=\epsilon_{0}\delta\epsilon V\int_{D_{\rm s}}\text{d} ^{3}\mathbf{x_{s}}\mathbf{E}(\mathbf{x_{s}})2\text{Re}\int_{D_{\rm s}}\text{d} ^{3}\mathbf{x_{o}}[\mathbf{G}^{\mathbf{EP}}(\mathbf{x_{s}},\mathbf{x_{o}}) \frac{\partial f}{\partial\mathbf{E}(\mathbf{x_{o}})}-\mathbf{G}^{\mathbf{HP} }(\mathbf{x_{s}},\mathbf{xWith one forward simulation which calculates all the electric fields \(\mathbf{E}(\mathbf{x_{s}})\) and one inverse simulation which computes all the adjoint electric fields \(\mathbf{E^{A}}(\mathbf{x_{s}})\) in the design domain, the derivatives of total FOM to all the permittivity \(\epsilon_{s}\) can be obtained as Equation (10) suggested. As discussed before, there are two FOMs for PBS. For another FOM' which tries to guide TM mode to the second waveguide arm, the derivative of FOM' to permittivity \(\epsilon_{s}\) in the design domain is also calculated in similar way. The permittivity in the design domain is updated towards the direction of total gradient decent as in Equation (11):  
\[\epsilon_{s}^{new}=\epsilon_{s}^{old}+\alpha\left(\frac{\delta F}{\delta \epsilon_{s}}+\frac{\partial F\prime}{\partial\epsilon_{s}}\right), \tag{11}\]  
where \(\alpha\) is the updating rate. The updating process is repeated until the gradient is small enough. During the updating process, permittivity \(\epsilon_{s}\) is taken as a continuous variable for convenience of derivative calculation, which has to be discretized for real application scenarios. Both level-set [73] and density optimization [74] have been applied for discretization. In silicon platform, the design domain usually composes of silicon and silica (or air) with permittivity \(\epsilon_{1}\) and \(\epsilon_{2}\), respectively. The level-set method defines a continuous variable \(\varphi_{s}\) with values ranging from negative to positive. \(\varphi_{s}=0\) suggests the boundary between two materials and the discrete permittivity in the design domain is defined as in Equation (12):  
\[\epsilon_{s}= \begin{cases}\epsilon_{1},&\varphi_{s}\geq 0\\ \epsilon_{2},&\varphi_{s}<0\end{cases} . \tag{12}\]  
On the other hand, for density method, the values of continuous variable \(\varphi_{s}\) range from 0 to 1, and the permittivity in the design domain is expressed as in Equation (13):  
\[\epsilon_{s}=\epsilon_{2}+\varphi_{s}(\epsilon_{1}-\epsilon_{2}). \tag{13}\]  
Different from level-set method which is discretized after applying Equation (12), the density method would generate \"gray structures\" with continuous permittivity between \(\epsilon_{1}\) and \(\epsilon_{2}\). To further discretize permittivity, [PERSON] et al. proposed a discretization method by introducing self-biasing or neighbor-biasing [46]. In the example of PBS design, density method is adopted and the optimization process is shown in Figure 4b, where an initial random structure is finally optimized and discretized after 278 iterations. Apart from discretization of permittivity, minimal feature size control is also an important issue for irregular structures as the large DOF bring features with critical size too small to be fabricated. Different approaches are proposed to solve this issue, such as density filters [75], penalty functions [76], artificial damping [50] and morphological filters [77]. Recently, [PERSON] et al. introduced b-splines to control minimal feature size of irregular structures [78]. Instead of filtering out small features directly, this method transfers the design domain to lower space dimension composed of b-spline functions, which damps small features internally. In the example of PBS design, the optimized device geometry is shown in Figure 4c, where density adjoint method with b-spline function is adopted. Within the footprint of 2.4 \(\times\) 2.8 \(\upmu\)m\({}^{2}\), this optimized PBS splits TE and TM modes with over 90% transmission efficiency covering 420-nm wavelength range.