Design and simulation of a very fast and compact all-optical Full-Subtractor based on nonlinear effect in 2D photonic crystals

In this paper, by using the non-linear effects and also destructive and constructive interferences between waveguides, we have designed and simulated an all-optical full-Subtractor based on two-dimensional photonic crystals. The proposed Subtractor has a very simple structure which is composed of 33 × 31 silicon rods immersed in air in a square lattice and involves three input ports (bits) and an additional waveguide to exhaust the unwanted light. We imposed some defect rods to control the behavior of the light. The used non-linear material, is a doped glass with 1.4 × 10–14 m2/w non-linear refractive index which is very greater than the non-linearity refractive index of silicon, 3.46 × 10–20 m2/w. Since the proposed structure is very simple and compact, it can be applicable in optical integrated circuits and optical calculations.


Introduction
Photonic crystals (PCs) are a good candidate to design and fabricate the optical-gates in the range of the light wave wavelengths. PCs are periodic structures of dielectric materials which do not allow propagation of light in a range of wavelengths (Yablonovitch 1987). This feature of PCs is known as photonic bandgap (PBG) in which light in any angle and polarization is not allowed to propagate into them (Joannopoulos et al. 2011). As a result, in the photonic crystals optical waveguides, light can propagate without scattering and attenuating. Many all-optical gates have been proposed based on this phenomenon such as optical filters (Talebzadeh and Soroosh 2015a;Arjmand and Talebzadeh 2015), optical demultiplexers (Talebzadeh et al. 2016a(Talebzadeh et al. , b, 2017Goodarzi and Mir 2015;Talebzadeh and Soroosh 2015b) and optical gates (Derakhshan et al. 2018).
The combination of PCs with non-linear materials gave the opportunity to design all-optical gates with the desired features. Among these features is the possibility of integrating the all-optical systems on an all-optical chips. These chips can work in higher frequencies with lower consumption power compared to the nowadays silicon chips. Using the mentioned chips together with the optical interconnects would give the possibility of designing the modern all-optical computers with a much higher speed in digital calculations (Vali-Nasab et al. 2019;Zhu et al. 2019;Busch 2016).
One of the key blocks for calculation is subtraction operation. Up to our knowledge, any all-optical full-Subtractor have not been designed based on photonic crystals. However, many attempts were done on the half-subtraction (Moradi 2019;Askarian et al. 2019a;Namdari and Talebzadeh 2020;Parandin et al. 2017). Moradi et al., proposed an all-optical half-Subtractor based on 2-D PCs (Moradi 2019). Their proposed device consisted of 64 × 31 silicon rods in a hexagonal lattice with a lattice constant of 607 nm. They used doped glass as a non-linear material with a refractive index of 1.4 × 10 -14 m 2 /w (Moradi 2019). Askarian et al., proposed an all-optical half-Subtractor based on 2-D photonic crystals. They used beam interference to fulfill the behavior of their proposed system and controlled the light propagation by imposing two extra waveguides with different input powers (Askarian et al. 2019a). Namdari et al., proposed an all-optical half-Subtractor based on linear materials. They just used 20 × 20 silicon rods in a hexagonal lattice. In order to control the light, they imposed four defect rods in their structure (Namdari and Talebzadeh 2020). Parandin et al. proposed a half-Subtractor using photonic crystals with a lattice constant of a = 640 nm. Their basic structure consists of 19 × 19 dielectric rods in the air. They used different input powers for their input bits in a way that value for "y" bit laser is 1.5 times higher than the "x" bit and their input powers differ 20 degrees in their phases (Parandin et al. 2017). All of the mentioned literature reveals the need of designing an optical full-Subtractor. In this paper, we proposed an all-optical full-Subtractor based on two-dimensional photonic crystals. As far as we know, this is the first time that an all-optical Subtractor to be offered. We controlled the behavior of light by imposing just defect rods and one extra waveguide. We also utilized a ring resonator which can resonance based on the power it meets. The proposed gate is very simple and ultracompact. The rest of the paper is organized as follows: In Sect. 2, the photonic bandgap will be calculated and then the full-Subtractor structure will be introduced. In Sect. 3, the results will be investigated and compared with those of previous literature; finally, the conclusion and simulation results will be discussed in Sect. 4.

non-linear effects
An appropriate way to define the nonlinear effect or intensity-dependent refractive index is by means of the equation (Boyd 2019).
where n 0 and n 2 are the linear and non-linear refractive indices of the non-linear material respectively and I denotes the time-averaged intensity of the optical field. This feature is among the important properties of non-linear materials which can be applicable in designing optical systems. By increasing the magnitude of the input power, the refractive index of materials varies because of the third order polarization susceptibility by Boyd (2019): (1) n(I) = n 0 + n 2 I where χ (3) is the susceptibility, and c is the speed of light in the vacuum. This phenomenon is known as "Kerr effect" and occurs in high input fields (Williams and Prasad 1990) for materials with third order susceptibility, χ (3) , and is a nonlinear effect. We used of this occurrence in our proposed device.

PBG of the Subtractor
We used of plane wave expansion method to calculate the PBG of the basic structure (Johnson and Joannopoulos 2001;Bogaerts et al. 2012). After that we calculate the desired frequencies by solving the Maxwell equations in the frequency domain. The basic structure that is used to design involved of 33 × 31 silicon dielectric rods immersed in the air. The mentioned number of rods is due to the sufficient space to create the input and output paths of the structure according to the number of bits used in an all-subtractor. The radii of the rods and the lattice constant were 116 nm and 580 nm respectively. The effective refractive index of silicon is 3.46 at the central wavelength of 1550 nm (Green and Keevers 1995). We selected the lattice constant in a way that the PBG locates in the third communication window. The schematic diagram of the photonic band gap is shown in Fig. 1.
(2) n 2 = 12 2 n 2 0 c (3) Fig. 1 The band structure and PBGs of the basic proposed photonic crystals arrangement The band structure is calculated for TE polarization. As one can see in Fig. 1, there are two PBGs in the structure: 0.61 < a/λ < 0.66 and 0.31 < a/λ < 0.44. We selected the lower bandgap for our designing and based on the lattice constant of the proposed device, this bandgap is equal to 1310 nm < λ < 1870 nm which is located in the third communication window. Therefore, the wavelength of the applied light source must be chosen in the PBG range so that they cannot enter the structure unless through a path is created for them using linear defects. Therefore, the wavelength of 1550 nm in the desired range is suitable for this structure.

The proposed full-Subtractor
Analogous to the digital full-Subtractor, the optical full-Subtractor has three input ports we named them "A", and "B" for the input bits and "B in " for the input borrowed bit. It also has two output ports we named them "D" for the difference and "B out " for the output borrow bit. The truth table of a full-Subtractor is shown in Table 1. We do the subtraction operation as "A-B".
To design the Subtractor, first we created the input and output waveguides. The proposed all optical full Subtractor is consisted of the input (A, B and B in ) and output (D and B out ) waveguides, and the interface between them created inside the base structure of the PCs. As it can be seen from Fig. 2, the structure has three input bits and two output bits. The paths of lights are created by removing some of rods, proportional to the desired function. An extra waveguide, W2, is created below the "A" input bit to exhaust the idler signals and also to establish the symmetry in the inputs and the whole of the structure. It also synchronize the inputs for better interferences. A ring resonator, called R1, composed of non-linear materials (doped glass François et al. 1994), is created between the two W5 and W6 waveguides to construction coupling condition between them. The radii of the nonlinear doped glass rods that are highlighted by blue color in Fig. 2, are 58 nm, which we reached this amount after several times of trial and error as well as optimization. The ring resonator can resonate when the input power increases the threshold power that is needed for its excitation. The input power for all inputs is equal to 10 mW/μm 2 .
When the input port of "A" is off, the behavior of incoming light from "B" and "B in " ports are controlled by imposing additional R2 defect rods that can act as a filter for the input signals. The radii of these defects are 52 nm which is determined by numerical analysis and considering the optimal conditions for the normalized output powers by scanning  In the proposed structure, we considered the non-linear properties of silicon too.

Electric field distribution and spectrum response
The most commonly used method of calculating the propagation of light in a structure is the finite difference time domain (FDTD) method (Taflove 1995). We employed of 1550 nm Gaussian waves as inputs of RSoft software tool to study the propagation of light in eight different cases for our proposed structure based on the truth table of Subtractor (Table 1). Case 1 when there is no input light, we have no power in the structure, so the outputs are zero. It is equivalent to the first row of Table 1.
Case 2 when "A" = "B" = 0 and "B in " = 1, is equivalent to the second row of the truth table, the input light from B in propagates in W4 and W6 waveguides. When the input light reaches to the ring resonator (R1), it cannot provide the power needed for resonance and hence propagates toward the output ports. The normalized power at "D" and "B out " ports are 83% and 65% respectively and can be considered logically "1". The electric field distribution (EFD) and output spectrum of this case are shown in Fig. 3a and b respectively. However, we can see an amount of back propagation light in the input ports as loss.
Case 3 when "A" = "Bin" = 0 and "B" = 1, equivalent to the third row of the truth table, and is similar to case 2. The input light from "B" port cannot excite the ring resonator, so propagates toward the output ports. The normalized power at the output ports of "D" and "B out " are 83% and 65% respectively and can be considered as "1" logic. The EFD and output spectrum of this case are shown in Fig. 4a and b respectively.
Case 4 when "A" = 0 and "B" = "B in " = "1", is equivalent to the 4th row of Table 1. Here, the optical signals from the two input ports propagate in the W3 and W4 waveguides and reach to the ring R1 resonator. Now, the optical intensity is sufficient enough to excite the R1 resonator. It couples the optical signal, both to the output ports and to the W5 and exhaust it from W1 and W2 waveguides. Simultaneously, since the R1 Fig. 2 The schematic diagram of the proposed Full-Subtractor does not fully couple the light and a portion of light propagates to the output ports, the lights interfere destructively and cause no light to propagate to the "D" port. The role of defects, which are named R2, is seen in this case. They are responsible of creation a phase difference and hence constructive interference. Also they act as a filter. Consequently, the output normalized power in "D" and "B out " output ports are 5% and 92% respectively which can considered as "0" and "1" logically. The EFD and the output spectra in this case are shown in Fig. 5a and b respectively.
Case 5 "A" = 1 and "B" = "B in " = 0. This case is equivalent to the 5 th row of the Subtractor truth table which the input light propagates through W1 and reaches to W5. Because of its insufficient intensity, cannot excite R1 ring resonator. So 73% of its power is directed to "D" output port and the rest is exhausted from W3 and W4. R2 Defect rods play their filtering role here, too. These rods do not allow the light to propagate in the "B out " port. It is necessary to mention that the size and the location of these defect rods have been selected after many attempts in a try and error method. As a result, the normalized power in "D" and "B out " ports are 73% and 5% which can be considered as Fig. 3 a The EFD, and b Output spectrum of the proposed full-Subtractor related to the case "A" = "B" = "0" and "Bin" = "1" Fig. 4 a The EFD, and b Output spectrum of the proposed full-Subtractor related to the case "A" = "B in " = "0" and "B" = "1" Page 7 of 13 351 logically "1" and "0" respectively. The EFD and the spectrum response of this case are shown in Fig. 6a and b respectively and verify the simulation.
Case 6 when "A" = 1, "B" = 0, and "B in " = 1, is equivalent to the 6 th row of the Subtractor truth table. In this case, because there are two inputs, the power of media near R1 ring resonator is sufficient enough to resonate. As a result, ring fully couples the light to W3 and it exits from the structure. The normalized power in the "D" and "B out " are 6% and 2% respectively and can be considered logically "0". The EFD and the spectrum response of this case are shown in Fig. 7a and b respectively. Case 7 if "A" = "B" = "1" and "B in " = 0, is equivalent to the 7 th row of the truth table and is similar to case 6. Again we have two inputs and the power is high enough to resonance in the resonator. The ring couples the input optical power to W3 and it exits from the system. As a result, there would be no sufficient power at "D" and "B out " output ports. They are 6% and 2% respectively which can be considered logically "0". The EFD and spectrum response in this case are shown in the Fig. 8a and b respectively. Case 8 when "A" = "B" = "B out " = "1", we are in the last row of the truth table. In this case, the electric filed around the ring resonator is high enough. So it can resonate. Fig. 5 a The EFD and b Output spectrum of the proposed full-Subtractor related to the case "A" = "0" and "B" = "Bin" = "1" Fig. 6 a The EFD and b Output spectrum of the proposed full-Subtractor related to the case "A" = "1" and "B" = "Bin" = "0" However, the instructive interference of the coupled light with the third input port causes the light to propagate toward output ports. In this case the output power at the "D" and "B out " are 65% and 84% respectively and can be considered logically as "1". The EFD and spectrum response in this case are shown in Fig. 9a and b correspondingly.

Time response analysis
Nowadays technologies demand faster and more compact devices. Growing usage of internet at all over the world motivated the designer toward optical systems. As a result, all communications and calculations must be done optically and in a same frequency. The faster devices can improve the optical systems. Time response and device speed are among Fig. 7 a The EFD and b Output spectrum of the proposed full-Subtractor related to the case "A" = "1", "B" = "0", and "Bin" = "1" Fig. 8 a The EFD and b Output spectrum of the proposed full-Subtractor related to the case "A" = "B" = "1", and "Bin" = "0" the criteria used for evaluation of the optical device behavior. The simulation results for seven cases of the proposed all-optical full-Subtractor are shown in Fig. 10.
It can be seen from Fig. 10 that the full-Subtractor is very fast. The rise and fall time of Fig. 10a are 2.8 and 0.17 ps respectively. This fast response allows doing more calculations in a specific time. The complete details of rising and falling times for all operation states are listed in Table 2.
The performance of the proposed full-Subtractor can be further investigated by calculating the contrast ratio (CR) which is the ratio of output powers of logic '1' and logic '0' as following (Tang et al. 2014): where P 1 and P 0 in the above equation are the power values at the output port for logic '1' and logic '0', respectively. The average CR of the proposed half-Subtractor is greater than 10.35 dB. The details of the CR for all eight states are brought in Table 2.
So far, no Full-Subtractor construction or design has been reported, so a comparison has been made between our proposed design and the reported Half-Subtractor or Full-Adders. The results are shown in Table 3. It can be seen that the results of our work are better or comparable to the other reported works.

Conclusion
In this paper, as far as we known for the first time, we proposed a very simple device for realizing full-subtraction behavior in a two-dimensional photonic crystal structure. To fulfill subtraction behavior, first, we used 33 × 31 silicon rods immersed in the air in a square lattice with lattice constant of a = 580 nm. After that, we imposed some input and output waveguides, silicon defect rods, and one extra waveguide to the structure. Then we created a non-linear ring resonator to couple light. The role of defect rods are filtering and creating phase difference. The role of the extra output waveguide is to exhaust the light from the structure. The worst rise time and fall time of the device are 2.88 ps and 0.27 ps (3) CR = 10 log(P 1 ∕P 0 )