Beam Deflector Optimization#
1D#
Figure 1: Optimization result of 1D beam deflector. (a) The deflection efficiencies are calculated for every iterations and this experiment is repeated 100 times with random starting points (b) Electric field distribution from the final structure}
In this example, we will optimize 1D beam deflector using AD with these options - 256 cells, FTO \(= 100\), \(\lambda_0=900 ~ nm\) and the deflection angle \(= 50^\circ\).
During the optimization, each cell can have non-binary refractive index values, leading to a gray-scale optimization. To obtain the final structure consisting of only silicon/air binary structures, an additional binary-push process is required. The initial structure for optimization is randomly generated so the each cell can have the refractive index value between of air and silicon under uniform distribution.
The Figure of Merit for this optimization process is set to the \(+1^{st}\) order diffraction efficiency, and the gradient is calculated by AD. The refractive indices are updated over multiple epochs using the ADAM optimizer [KB17] with the learning rate of 0.5.
The simulation sequence for analyzing the given structure.
# basic Setting
N_C = 256 # number of pixel / Layer
backend = 2 # Torch
device = 0
pol = 1 # 0: TE, 1: TM
n_I = 1.45 # n_incidence
n_II = 1 # n_transmission
### Core Parameters ###
wavelength = 900.
degree = 50.
theta = 0 * torch.pi / 180
# angle of incidence
phi = 0 * torch.pi / 180
# angle of rotation
thickness = torch.tensor([325.])
# thickness of each layer, from top to bottom.
period = wavelength / torch.sin(torch.tensor([degree])*torch.pi/180)
fourier_order = [80]
type_complex = torch.complex128
grating_type = 0
# grating type: 0 for 1D grating without rotation (phi == 0)
n1 = 1.0
n2 = 3.45
ucell_latent = torch.randn(1,1,256)
ucell_latent.requires_grad = True
ucell = (n2 - n1) * torch.sigmoid(ucell_latent) + n1
learning_rate = 0.5
opt = optim.SGD([ucell_latent],lr = learning_rate)
mee = meent.call_mee(backend=backend, grating_type=grating_type,
pol=pol, n_I=n_I, n_II=n_II, theta=theta,
phi=phi, fourier_order=fourier_order,
wavelength=wavelength, period=period,
ucell=ucell, thickness=thickness, type_complex=type_complex,
device=device, fft_type=0, improve_dft=True)
#optimization process
for epoch in range(epoches) :
de_ri, de_ti = mee.conv_solve()
loss = -de_ti[len(de_ti)//2 - 1]
loss.backward()
opt.step()
opt.zero_grad()
ucell = (n2 - n1) * torch.sigmoid(ucell_latent * (1 + epoch * 0.02)) + n1
mee.ucell = ucell
Figure 1a shows the deflection efficiency change by iteration. Two solid lines are averaged value of all the samples at the same iteration step. Shaded area is marked with \(\pm\) standard deviation from the average. The blue line (Before binarization) is the result of device with any real number between two refractive indices (silicon and air), which is non-practical, and the orange line (After binarization) is the final device composed of silicon and air. The best result we found is 89.4 %.
2D#
Figure 2: Optimization result of 2D beam deflector. (a) The schematic of 2D beam deflector and the final structure after optimization. (b) Convergence test of the initial structure. (c) Learning curve of structure optimization for 110 epochs. Spatial blurring and binary push is applied on each epoch (d) The electric field distribution of the optimized structure in XZ plane.#
Here, we demonstrate optimization of a 2D diffraction metagrating as shown in Figure 2a. Similar to the previous 1D diffraction metagrating, the 2D diffraction metagrating also consists of silicon pillars located on top of a silicon dioxide substrate. TM polarized wave with \(\lambda = 1000~nm\) is normally incident from the bottom of the substrate and the device is designed to deflect the incident light with deflection angle \(\theta = 60^\circ\) in \(X\)-direction. The device has a rectangular unit cell of period \(\lambda/\sin \theta \approx 1150~nm\) and \(\lambda/2 = 500~nm\) for the \(X\) and \(Y\)-axis, respectively. Moreover, the unit cell is gridded into \(256 \times 128\) cells which is either filled by air or silicon. The convergence of RCWA simulation for different number of Fourier harmonics are plotted in Figure 2b. Considering the trade-off between simulation accuracy and time, we set \(N_x = 13\) and \(N_y = 10\).
After 110 epochs of optimization, the final structure achieves an efficiency of 92 % and successfully deflects the incoming beam at a \(60^\circ\) angle (Figure 2d). The optimized structure and the learning curve are presented in Figure 2a and Figure 2c, respectively.
Diederik P. Kingma and Jimmy Ba. Adam: a method for stochastic optimization. 2017. arXiv:1412.6980.

