Next Article in Journal
A Comprehensive Error Analysis of the Neutron Elliptical Cylindrical Mirror with High Gain
Previous Article in Journal
Dynamic Spatial Small-Target Simulation System with Long-Exit Pupil Distance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design and Optimization of Optical NAND and NOR Gates Using Photonic Crystals and the ML-FOLD Algorithm

by
Alireza Mohammadi
1,
Fariborz Parandin
2,
Pouya Karami
2 and
Saeed Olyaee
3,*
1
Department of Computer Engineering, Ker.C., Islamic Azad University, Kermanshah 6718997551, Iran
2
Department of Electrical Engineering, Ker.C., Islamic Azad University, Kermanshah 6718997551, Iran
3
Nano-Photonics and Optoelectronics Research Laboratory (NORLab), Shahid Rajaee Teacher Training University (SRTTU), Lavizan, Tehran 1678815811, Iran
*
Author to whom correspondence should be addressed.
Photonics 2025, 12(6), 576; https://doi.org/10.3390/photonics12060576
Submission received: 9 April 2025 / Revised: 4 June 2025 / Accepted: 4 June 2025 / Published: 6 June 2025

Abstract

:
The continuous demand for faster processing systems, driven by the rise of artificial intelligence, has exposed limitations in traditional transistor-based electronics, including quantum tunneling, heat dissipation, and switching delays due to challenges in further miniaturization. This study explores optical systems as a promising alternative, leveraging the speed of photons over electrons. Specifically, we design and simulate optical NAND and NOR logic gates using a two-dimensional photonic crystal structure with a square lattice. Symmetrical waveguides are used for the input paths to make the structure relatively more straightforward to fabricate. A key innovation is the ability to realize both gates within a single structure by adjusting the phases of the input sources. To optimize the phase parameters efficiently, we employ the ML-FOLD (Meta-Learning and Formula Optimization for Logic Design) optimization formula, which outperforms traditional methods and machine learning approaches in terms of computational efficiency and data requirements. Through finite-difference time-domain (FDTD) simulations, the proposed optical structure demonstrates successful implementation of NAND and NOR gate logic, achieving high contrast ratios of 4.2 dB and 4.8 dB, respectively. The results validate the effectiveness of the ML-FOLD method in identifying optimal configurations, offering a streamlined approach for the design of all-optical logic devices.

1. Introduction

Digital and computer systems have become an inseparable part of human life, with an ever-increasing demand for faster processors. This demand has surged even further following the advent and widespread adoption of artificial intelligence (AI) [1,2]. Modern digital systems rely on transistors for switching operations and information processing [3,4,5,6,7,8]. Over the years, the size of transistors has been progressively reduced; however, this continuous downsizing now faces significant challenges, making further reductions increasingly difficult and, in some cases, impractical. Consequently, this justifies the exploration of alternative methods and systems to replace transistors [9,10,11,12].
One promising alternative to electronic systems is the use of optical systems. In electronic devices, electrons are utilized for processing, whereas optical systems employ photons [13,14,15]. Photons travel significantly faster than electrons, resulting in a substantial increase in the speed of optical systems compared to their electronic counterparts. Among the suitable platforms for implementing optical devices, photonic crystals have garnered considerable attention from researchers in recent years [16,17,18,19]. The ability to control and guide light within compact structures is a key advantage of photonic crystals over other platforms for optical device implementation [20,21,22]. Photonic crystals have been utilized in developing optical sensors, photonic crystal lasers, and optical logic gates such as AND, OR, NAND, and NOR, in addition to logic circuits like half-adders, full-adders, multiplexers, and various other logical systems [23,24,25,26,27,28].
The design and optimization of all-optical logic gates present significant challenges, particularly in precisely tuning key parameters such as phase shift (φ), lattice constant, rod radius, and refractive index. Achieving optimal performance requires balancing multiple variables to maximize metrics like contrast ratio and minimize signal loss in photonic crystal-based structures [29,30]. Traditional optimization methods, such as finite-difference time-domain (FDTD) simulations, are computationally intensive and iterative, often demanding extensive numerical calculations to identify suitable configurations [31,32,33,34,35,36,37,38,39]. This complexity is compounded by the need to explore a multidimensional parameter space, making the process time-consuming and resource-heavy.
Optimizing all-optical logic gates requires precise tuning of parameters such as phase shift (φ), lattice constant, and rod radius to maximize performance metrics like contrast ratio. Traditional methods, such as FDTD simulations, are computationally intensive due to complex parameter spaces [29,30]. Advanced approaches using machine learning and evolutionary algorithms (e.g., genetic algorithms) offer improvements but face challenges, including large dataset requirements, hyperparameter tuning, and high computational costs [1,8,12].
In the base study [1,8], the ML-FOLD (Meta-Learning and Formula Optimization for Logic Design) algorithm was applied within a machine learning framework to optimize phase configurations for XOR, NOT, and OR gates, necessitating extensive training data. In contrast, our study employs ML-FOLD as a deterministic optimization formula, eliminating machine learning dependencies. We optimize NAND and NOR gates using simple arithmetic operations to compute the optimize_R metric, which evaluates phase configurations based on output powers.
Our contributions are (1) a single photonic crystal structure achieving both NAND and NOR functionalities via phase adjustments; (2) a deterministic ML-FOLD algorithm for efficient phase optimization without machine learning; (3) unlike [8], which focused on XOR, OR, and NOT gates, this study applies the ML-FOLD method to NAND and NOR gates using a unified photonic crystal design, demonstrating its broader applicability; and (4) we made the code and dataset publicly available for reproducibility.
This approach offers key advantages:
  • Low Data Needs: Requires minimal data compared to machine learning’s large datasets [1,8,12].
  • Simplified Process: Avoids hyperparameter tuning and iterative learning.
  • Efficiency: Uses basic arithmetic, outperforming iterative genetic algorithms.
FDTD simulations validate our approach, demonstrating high-accuracy NAND and NOR operations with superior contrast ratios, advancing efficient all-optical logic gate design.

2. Proposed Configuration for Realizing Optical NAND and NOR Gates

To implement optical NAND and NOR logic gates, a two-dimensional photonic crystal structure with a square lattice configuration is utilized. This structure exhibits a photonic bandgap under the transverse magnetic (TM) polarization, as depicted in the bandgap diagram presented in Figure 1.
Figure 1 shows that a photonic band gap is created in the structure in the normalized range of 0.28 to 0.42. Given that these values are related to a λ , the wavelength equivalent to this range can be calculated. This range is equivalent to 1.43   μ m < λ < 2.14   μ m .
Wavelengths that lie within this bandgap are restricted from propagating through the medium. The input signals are configured at a wavelength of 1.55 µm, which is located within the bandgap region of the designed structure. A comprehensive list of the structure’s physical specifications is provided in Table 1.
According to Table 1, it can be seen that the structure has a lattice constant of 0.6 µm, and the radius of the rods is R = 0.12 µm. The refractive index of air is shown as n1, and the refractive index of the rods is shown as n2, where n2 = 3.46. The proposed structure has dimensions such that the number of rods in the horizontal direction is 21 and in the vertical direction is 15.
By selectively removing specific rods, three waveguide paths are created to guide light from the input sources and a bias source into the structure. Additionally, another waveguide path is formed by removing further rods to direct light toward the output. Two defect rods, denoted as R1 and R2, are strategically placed at the ends of two waveguides to optimize the output power. The structural design utilized for implementing the proposed optical logic gates is shown in Figure 2. The phases of the laser sources are determined using the ML-FOLD optimization algorithm, which analyzes a small dataset of FDTD-simulated output powers to identify optimal configurations. The process involves calculating the optimization metric optimize_R (Equations (1) and (2)) for each phase pair, ranking them, and selecting the highest-scoring configuration, as detailed in Section 3.3. Specifically, for the NOR gate, the phases are set as φA = φB = 90°, while for the NAND gate, they are set as φA = 55° and φB = −170°.
Table 2 presents the logical states of the NAND and NOR gates. The simulation outcomes for the optical NAND and NOR gates, obtained through the FDTD method, are presented. These results include both the normalized output power and the optical power distribution across the structure, as illustrated in the corresponding figures.
Figure 2 illustrates the designed architecture for implementing optical NAND and NOR gates using a balanced configuration. The input channels are symmetrically arranged relative to each other, ensuring a mirrored structure with respect to the output channel. The bias signal, positioned between inputs A and B, maintains a constant phase of 0° across all scenarios to serve as a stable reference.
As shown in Figure 2, the two main inputs, A and B, are located on the left. The auxiliary input bias is also located between these two inputs. The role of the bias input is to provide output power when the main inputs are off. These three input paths are created for light propagation, which then intersect the waveguides. At the intersection of the waveguides, two rods are considered defect rods. These rods have a radius of R1 = R2 = 0.5R, where R is the radius of the other rods. The role of these defective rods is to control the optical power when light waves intersect and transmit it to the output.

3. Methods

This section outlines the methodology for optimizing all-optical NAND and NOR logic gates using a photonic crystal platform, focusing on determining optimal phase configurations (φA and φB) to achieve reliable logical operations.

3.1. Introduction to ML-FOLD Optimization

In designing and optimizing all-optical logic gates—specifically the NAND and NOR gates explored in this study—accurately selecting the phase parameters (φA and φB) is crucial to ensure proper interference behavior and desired output power levels. Conventional optimization strategies, such as finite-difference time-domain simulations with repetitive parameter tuning or more sophisticated methods like machine learning and genetic algorithms, typically require substantial computational power and large volumes of data. To overcome these challenges, this work adopts the ML-FOLD optimization formula—an efficient and uncomplicated mathematical technique that avoids the need for iterative convergence or extensive training datasets. First introduced in [8], the ML-FOLD method is utilized here to determine the optimal phase settings.
The ML-FOLD algorithm is a deterministic optimization method that evaluates a predefined set of phase combinations to identify configurations maximizing the optimize_R metric, calculated from normalized output powers (Equations (1) and (2)). In this study, phase combinations (e.g., 0°, 45°, 90°, 180°, and 245° for NOR; 0°, ±45°, ±90°, ±180°, 55°, and −170° for NAND) were predefined based on symmetry, interference patterns, and prior FDTD simulation insights to cover a representative range of interference scenarios.

3.2. ML-FOLD Formula and Rationale

The ML-FOLD optimization algorithm employs a concise formula to assess the suitability of phase combinations based on the normalized output powers for the four logical states of a two-input logic gate. The optimization metric, termed o p t i m i z e _ R , slightly differs depending on the target logic gate due to their distinct truth tables. For the NOR gate, the formula is
o p t i m i z e _ R = preds A = 0 , B = 0 preds A = 1 , B = 0 × preds A = 0 , B = 1 × preds A = 1 , B = 1
For the NAND gate, it is adjusted to:
o p t i m i z e _ R = preds A = 0 , B = 0 × preds A = 1 , B = 0 × preds A = 0 , B = 1 preds A = 1 , B = 1
where
  • ( preds A = 1 , B = 0 ) : Output power when input A is active and B is inactive.
  • ( preds A = 0 , B = 1 ) : Output power when input A is inactive and B is active.
  • ( preds A = 1 , B = 1 ) : Output power when both inputs A and B are active.
  • ( preds A = 0 , B = 0 ) : Output power when both inputs A and B are inactive.
The rationale for these formulations aligns with the expected behavior of each gate:
  • NOR Gate: A high output (logical “1”) is required only when both inputs are off (A = 0, B = 0), with low outputs (logical “0”) for all other states. A high o p t i m i z e _ R value thus indicates a large preds_AB_0 relative to the product of the other outputs, favoring configurations where the (0,0) state is distinctly prominent.
  • NAND Gate: A low output (logical “0”) is expected only when both inputs are active (A = 1, B = 1), with high outputs (logical “1”) elsewhere. Here, a high o p t i m i z e _ R reflects a small preds_AB_1 relative to the product of the other outputs, highlighting configurations that effectively suppress the (1,1) state.
The use of multiplication and division amplifies differences in performance across the logical states, providing a robust indicator of optimality without necessitating complex computations.

3.3. Implementation of ML-FOLD

The ML-FOLD algorithm was implemented using Python (version 3.12), with Pandas (version 2.2) and NumPy (version 1.26) libraries to efficiently process the simulation data.
Two datasets were analyzed: one for the NOR gate with 16 phase combinations and another for the NAND gate with 17 phase combinations. Each dataset includes phase angles ( φ A   a n d   φ B ) and the corresponding normalized output powers for the four input states obtained from FDTD simulations of the photonic crystal structure.
The implementation process includes the following steps:
  • Data Preprocessing: The dataset is loaded into a Pandas DataFrame.
  • Metric Calculation: The ( optimize R ) value is computed for each configuration using the formula above.
  • Threshold Determination: A threshold for classification is established as 80% of the maximum o p t i m i z e _ R value ( t h r e s h o l d _ f r a c t i o n = 0.8 ). This dynamic approach adapts to the dataset’s range, though alternatives such as the median or a fixed value could be considered. (The thresholds of 73.17 (NOR) and 0.674 (NAND) were set at 80% of the maximum optimize_R values to visually distinguish near-optimal configurations in plots (e.g., Figure 3 and Figure 4). These thresholds are not essential, as ML-FOLD ranks configurations by optimize_R to identify the optimum without categorization.)
  • For the NOR gate, the maximum o p t i m i z e _ R was 91.46, resulting in a threshold of 73.17. For the NAND gate, the maximum was 0.843, yielding a threshold of 0.674.
  • Classification: Each configuration is assigned a classification based on its ( optimize R ) value relative to the threshold.
  • Final Stage: With the ranked results, we now have the best candidate, which has a high chance of being optimal, ready for final validation or implementation.
To visualize the optimization process, 3D scatter plots were generated for NOR and NAND gate datasets using Python and matplotlib. These plots show φ A   (x-axis, degrees), φ B (y-axis, degrees), and o p t i m i z e _ R (z-axis), with points colored green (“Optimal”, above threshold) or red (“Suboptimal”, below threshold). A blue plane marks the threshold (80% of max o p t i m i z e _ R ). “Optimal” points are annotated near their positions with phase pairs and o p t i m i z e _ R values, enhanced by white backgrounds with gray borders for readability.

4. Results

This section presents the outcomes of the optimization and simulation studies for the optical NOR and NAND gates. The analysis focuses on phase pair configurations, their corresponding optimization metrics (optimize_R), and the resulting output powers for all logical input states. The results are visualized in Figure 3 and Figure 4, which integrate 3D optimization plots with normalized optical power distributions for each gate, arranged vertically as generated by the provided Python script.

4.1. NOR Gate Optimization

The dataset comprised 16 phase pairs, with o p t i m i z e _ R ranging from 0.275 to 91.46.
Two configurations were classified as “Optimal”: (90°, 90°) with o p t i m i z e _ R = 75.76   a n d   ( 90 ° ,   180 ° ) with o p t i m i z e _ R = 91.46. The former aligns with this study’s reported NOR gate phases ( φ A = φ B = 90 ° ) , producing outputs (0.6, 0.22, 0.20, 0.18), which correspond to NOR logic (1, 0, 0, 0) using thresholds of 0.5 for “1” and 0.3 for “0”. Figure 3 visualizes this, with annotated optimal points above the threshold plane.

4.2. NAND Gate Optimization

The dataset included 17 phase pairs, with o p t i m i z e _ R ranging from 0.162 to 0.843.
One configuration was classified as “Optimal”: (55°, −170°) with o p t i m i z e _ R = 0.843 , precisely matching this study’s NAND gate phases. The outputs (0.6, 0.53, 0.53, 0.2) align with NAND logic (1, 1, 1, 0) using the same thresholds.
The formula accurately identifies a suppressed preds_AB_1 relative to the other states, validating its suitability for NAND optimization. Figure 4 illustrates this, with the annotated optimal point above the threshold.

4.3. Simulation Results for the Optical NOR Gate

To enhance clarity and enable more effective comparison across input states, the simulation results corresponding to the four logical combinations of the NOR gate have been integrated into Figure 5.
  • Scenario a (A = 0, B = 0): When both input sources are inactive, the output is solely driven by the bias source, resulting in a normalized output power of 0.6, interpreted as a logical “1”.
  • Scenario b (A = 0, B = 1): Activation of input B leads to destructive interference with the bias wave, reducing the output to 0.22, corresponding to a logical “0”.
  • Scenario c (A = 1, B = 0): Similarly, activation of input A yields an output of approximately 0.2, due to destructive interference.
  • Scenario d (A = 1, B = 1): When both inputs are active, combined destructive interference occurs, producing a minimal output of 0.18, also representing a logical “0”.

4.4. Simulation Outcomes of the Optical NAND Gate

Likewise, the simulation results of the NAND gate under all four logical input states are presented in an integrated Figure 6, allowing for a unified and comparative analysis.
  • Scenario a (A = 0, B = 0): The absence of both inputs results in output power driven by the bias source, reaching 0.6, interpreted as logical “1”.
  • Scenario b (A = 0, B = 1): With input B active, interference with the bias wave produces an output of 0.53, which is considered logical “1”.
  • Scenario c (A = 1, B = 0): Input A is active, leading to a similar output of 0.53 due to the same interference conditions.
  • Scenario d (A = 1, B = 1): Activation of both inputs results in strong destructive interference with the bias wave, reducing the output to 0.2, corresponding to a logical “0”.

5. Discussion

The ML-FOLD algorithm, as implemented in this study, primarily functions as a classification and ranking tool, evaluating a predefined set of phase combinations to identify optimal configurations for the NOR and NAND gates.
The ML-FOLD optimization method is built upon the inherent nonlinearity and sensitivity of optical interference patterns within photonic crystal waveguide structures. Specifically, the output power in such systems is not a linear function of the inputs; rather, it results from constructive and destructive interference effects influenced by phase differences. Because of this nonlinearity, small variations in phase can produce disproportionately large variations in output power, especially in critical states such as (A = 1, B = 1) for NAND or (A = 0, B = 0) for NOR. The ML-FOLD formula leverages this by applying a multiplicative ratio: the outputs that are desirable (i.e., should be maximized) are placed in the numerator, while those that must be suppressed (i.e., minimized) are placed in the denominator.
This formulation amplifies configurations where the desired outputs are significantly stronger than the undesired ones. For example, in the case of a NAND gate, the desired output is high for three of the four input conditions. Placing these high-output states in the numerator and the one low-output state (A = 1, B = 1) in the denominator magnifies the contrast between optimal and suboptimal phase configurations. This mechanism directly correlates with the physical goal: achieving sharp contrast between logic 1 and logic 0 across all input states with minimal power leakage or overlap.
In comparison to traditional optimization methods,
  • FDTD iterative sweeps are computationally expensive and scale poorly with the number of parameters, as they lack a closed-form assessment metric.
  • Genetic algorithms and ML models require extensive data and hyperparameter tuning, often leading to high computational costs and potential overfitting to simulation noise.
  • ML-FOLD, in contrast, relies on only a small set of simulation results and uses simple arithmetic operations, allowing for rapid, interpretable evaluation of phase configurations.
The ML-FOLD algorithm exhibits exceptional efficiency in pinpointing optimal phase parameters with minimal data—16 and 17 points for NOR and NAND gates, respectively—compared to the extensive datasets typically required by machine learning models. Its arithmetic simplicity (multiplication and division) bypasses the computational burden of iterative methods like genetic algorithms, enabling rapid analysis on standard hardware. The threshold-based classification enhances decision-making clarity, although the selection of 80% as the fraction could be further optimized based on specific performance criteria, such as contrast ratio. Moreover, this method proves particularly advantageous when evaluating numerous configurations—e.g., 50 to 100 potential designs for a logic gate—enabling researchers to efficiently pinpoint the most promising candidates amidst uncertainty, thereby streamlining the optimization process.
The disparity in o p t i m i z e _ R ranges between the NOR gate (0.275–91.46) and the NAND gate (0.162–0.843) may indicate differences in simulation conditions or formula sensitivity, meriting additional scrutiny. Nonetheless, the precise alignment between ML-FOLD’s “Optimal” classifications and this study’s reported phases—(90°, 90°) for NOR and (55°, −170°) for NAND—underscores its practical applicability.
The results obtained are summarized in Table 3. This table shows the structure’s different input and output states in NOR and NAND gate modes. This table shows the output power (binary equivalent) in each state. The contrast ratio (CR) parameter is also calculated in this table. This parameter is expressed as the relationship C R = 10 × l o g P 1 , m i n P 0 , m a x representing the power difference between high and low logic states.
To show the advantage of the proposed structure over previous research, Table 4 can be seen. This table lists the important parameters of photonic crystal-based NAND/NOR gates, and the results obtained from the structure are compared with previous papers.
Table 4 compares the important parameters of NAND and NOR gates. The structure proposed in [35] is large and unsuitable for optical integrated circuits. It also has a relatively long stability time. Another structure presented in [36] can only be used as a NAND gate. It is also large in size and has a long stability time. The all-optical logic gates in [37] have a low power in the logic 1 state and a low CR.
Although the all-optical logic gates reported in [38] are small, the power in logic 1 is very weak, and the CR of the structure is very low. Also, its stability time is very long. In the gates of [39], the structure size is large, and the power in logic 1 is also very low. Its stability time is also long. The structure proposed in this study, in which the ML-FOLD algorithm has been used in its design, has a relatively small size and suitable powers in logic 0 and 1. The advantage of this structure over other structures is its very low stability time, which can be used in high-speed optical integrated circuits.

6. Conclusions

In this study, optical NAND and NOR gates were effectively designed and simulated within a unified two-dimensional photonic crystal framework by carefully tuning the input phase parameters. The use of the ML-FOLD optimization formula has proven to be highly efficient, requiring only a small set of simulation data points to identify optimal phase configurations, thereby circumventing the computational burdens associated with traditional optimization techniques. Our results confirm that the proposed structure accurately performs the logical operations for both gates, as evidenced by the normalized output powers aligning with the expected logical states. The disparity in the optimization metric ranges between the NOR and NAND gates suggests potential areas for further investigation, such as refining the formula’s sensitivity or exploring additional structural parameters. Nonetheless, the precise alignment of the ML-FOLD-identified optimal phases with those reported in this study underscores the method’s practical applicability. This research contributes to the advancement of all-optical logic devices, paving the way for faster and more efficient computing systems. Future work may focus on experimental validation of the simulated designs and extending the approach to more complex logic circuits.

Author Contributions

A.M. and P.K. designed and performed simulations, analyzed data, and drafted the manuscript. F.P. supervised, verified, reviewed, and edited the manuscript. S.O. verified and edited the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Shahid Rajaee Teacher Training University under grant number 5973.84.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The datasets generated and analyzed during the current study are publicly available on GitHub at https://github.com/alirezamohamadiam/ML-FOLD-NAND-NOR. (accessed on 5 May 2025).

Code Availability Statement

The source code used for implementing the ML-FOLD optimization in this study is also available on GitHub at https://github.com/alirezamohamadiam/ML-FOLD-NAND-NOR.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Parandin, F.; Karami, P.; Mohamadi, A. Machine learning-driven optimization of photonic crystal structures for superior optical NOR gate performance. Appl. Opt. 2024, 63, 6666–6673. [Google Scholar] [CrossRef]
  2. Reuther, A.; Michaleas, P.; Jones, M.; Gadepally, V.; Samsi, S.; Kepner, J. AI and ML accelerator survey and trends. In Proceedings of the 2022 IEEE High Performance Extreme Computing Conference (HPEC), Waltham, MA, USA, 19–23 September 2022; IEEE: New York, NY, USA, 2022; pp. 1–10. [Google Scholar]
  3. Yablonovitch, E. Photonic crystals. J. Mod. Opt. 1994, 41, 173–194. [Google Scholar] [CrossRef]
  4. Brunner, D.; Shastri, B.J.; Qadasi, M.A.A.; Ballani, H.; Barbay, S.; Biasi, S.; Zhang, W. Roadmap on Neuromorphic Photonics. arXiv 2025, arXiv:2501.07917. [Google Scholar]
  5. Hazra, S.; Mukhopadhyay, S. Implementation of all-optical tristate Pauli X, Y and Z gates based on two-dimensional photonic crystal. Optoelectron. Lett. 2024, 20, 346–352. [Google Scholar] [CrossRef]
  6. Jalali Azizpour, M.R.; Soroosh, M.; Dalvand, N.; Seifi-Kavian, Y. All-Optical Ultra-Fast Graphene-Photonic Crystal Switch. Crystals 2019, 9, 461. [Google Scholar] [CrossRef]
  7. Rafiee, E. Bio-sensing applications of a 2:1 photonic crystal multiplexer. Sci. Rep. 2025, 15, 16840. [Google Scholar] [CrossRef]
  8. Mohammadi, A.; Parandin, F.; Karami, P. The ML-FOLD Method: Meta-Learning and Formula Optimization for All-Optical XOR, OR, and NOT Logic Gates. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5115354 (accessed on 5 May 2025).
  9. Joannopoulos, J.D.; Villeneuve, P.R.; Fan, S. Photonic crystals. Solid State Commun. 1997, 102, 165–173. [Google Scholar] [CrossRef]
  10. Djavid, M.; Dastjerdi, M.H.T.; Philip, M.R.; Choudhary, D.D.; Pham, T.T.; Khreishah, A.; Nguyen, H.P. Photonic crystal-based permutation switch for optical networks. Photonic Netw. Commun. 2018, 35, 90–96. [Google Scholar] [CrossRef]
  11. Rafiee, E.; Abolghasemi, F. An all-optical 1*2 de-multiplexer based on two-dimensional nonlinear photonic crystal ring resonators. Optoelectron. Lett. 2024, 20, 23–27. [Google Scholar] [CrossRef]
  12. Karami, P.; Mohamadi, A.; Parandin, F. Enhancing integrated optical circuits: Optimizing all-optical NAND and NOR gates through deep learning and machine learning. Opt. Quantum Electron. 2024, 57, 73. [Google Scholar] [CrossRef]
  13. Maleki, M.J.; Soroosh, M. An ultra-fast all-optical 2-to-1 digital multiplexer based on photonic crystal ring resonators. Opt. Quantum Electron. 2022, 54, 397. [Google Scholar] [CrossRef]
  14. Rafiee, E.; Afkhami, M. Design of an all-optical compact 2*1 multiplexer based on 2D photonic crystal ring resonators. Opt. Quantum Electron. 2024, 56, 283. [Google Scholar] [CrossRef]
  15. O′Halloran, M.; Conceicao, R.C.; Byrne, D.; Glavin, M.; Jones, E. FDTD modeling of the breast: A review. Prog. Electromagn. Res. B 2009, 18, 1–24. [Google Scholar] [CrossRef]
  16. Gangwar, R.K.; Pathak, A.K.; Kumar, S. Recent progress in photonic crystal devices and their applications: A review. Photonics 2023, 10, 1199. [Google Scholar] [CrossRef]
  17. Maleki, M.J.; Soroosh, M.; Akbarizadeh, G. A compact high-performance decoder using the resonant cavities in photonic crystal structure. Opt. Quantum Electron. 2023, 55, 852. [Google Scholar] [CrossRef]
  18. Serajmohammadi, S.; Alipour-Banaei, H.; Mehdizadeh, F. All optical decoder switch based on photonic crystal ring resonators. Opt. Quantum Electron. 2015, 47, 1109–1115. [Google Scholar] [CrossRef]
  19. Parandin, F.; Olyaee, S.; Heidari, F.; Soroosh, M.; Farmani, A.; Saghaei, H.; Karimzadeh, R.; Maleki, M.J.; Askarian, A.; Rahimi, Z.; et al. Recent advances in all-optical half-subtractor and full-subtractor based on photonic crystal platforms. J. Opt. Commun. 2024, 45, 2589–2618. [Google Scholar] [CrossRef]
  20. Swarnakar, S.; Kumar, S.; Sharma, S. Design of All-optical Half-subtractor Circuit Device using 2-D Principle of Photonic Crystal Waveguides. J. Opt. Commun. 2019, 40, 195–203. [Google Scholar] [CrossRef]
  21. Zhu, C.; Tian, L.; Cheng, W.; Gu, Z. Bio-inspired photonic crystals: Tailoring the dielectric building blocks to control the light propagation. BMEMat 2024, 2, e12056. [Google Scholar] [CrossRef]
  22. Huang, Y.; Shi, M.; Yu, A.; Xia, L. Design of multifunctional all-optical logic gates based on photonic crystal waveguides. Appl. Opt. 2023, 62, 774–781. [Google Scholar] [CrossRef]
  23. Mukherjee, B.; Kumar, V.D.; Gupta, M. A novel Hemispherical Dielectric Resonator Antenna on an Electromagnetic Band Gap substrate for broadband and high gain systems. Int. J. Electron. Commun. (AEU) 2014, 68, 1185–1190. [Google Scholar] [CrossRef]
  24. Rafiee, E.; Rafiei, E. Hypercholesterolemia diagnosis by a biosensor based on photonic crystal PANDA structure. Opt. Rev. 2024, 31, 87–93. [Google Scholar] [CrossRef]
  25. Rathi, S.; Swarnakar, S.; Kumar, S. Design of One-Bit Magnitude Comparator using Photonic Crystals. J. Opt. Commun. 2017, 40, 363–367. [Google Scholar] [CrossRef]
  26. Sharifi, H.; Maleknejad, M. Multi-functional all-optical photonic crystal logic gate using nonlinear directional coupler. Opt. Quantum Electron. 2021, 53, 673. [Google Scholar] [CrossRef]
  27. Surendar, A.; Asghari, M.; Mehdizadeh, F. A novel proposal for all-optical 1-bit comparator using nonlinear PhCRRs. Photonic Netw. Commun. 2019, 38, 244–249. [Google Scholar] [CrossRef]
  28. Firouzimoghaddam, A.; Sharifi, H. All-optical photonic crystal logic gates and functions based on threshold logic. J. Comput. Electron. 2025, 24, 10. [Google Scholar] [CrossRef]
  29. Rafiee, E. Photonic Crystal based Biosensor for Diagnosis of Kidney Failure and Diabetes. Plasmonics 2024, 19, 439–445. [Google Scholar] [CrossRef]
  30. Rachana, M.; Swarnakar, S.; Babu, M.R.; Swetha, P.M.; Rangaiah, Y.P.; Krishna, S.V.; Kumar, S. Optimization of an all-optical three-input universal logic gate with an enhanced contrast ratio by exploiting a T-shaped photonic crystal waveguide. Appl. Opt. 2022, 61, 8162–8171. [Google Scholar] [CrossRef]
  31. Farmani, A.; Mir, A.; Irannejad, M. 2D-FDTD simulation of ultra-compact multifunctional logic gates with nonlinear photonic crystal. J. Opt. Soc. Am. B 2019, 36, 811–818. [Google Scholar] [CrossRef]
  32. Swarnakar, S.; Palacharla, V.; Muduli, A.; Kumar, S. Design and optimization of photonic crystal based all-optical logic gate with enhanced contrast ratio. Opt. Quantum Electron. 2023, 55, 623. [Google Scholar] [CrossRef]
  33. Askarian, A.; Akbarizadeh, G.; Fartash, M. A novel proposal for all optical half-subtractor based on photonic crystals. Opt. Quantum Electron. 2019, 51, 264. [Google Scholar] [CrossRef]
  34. Wang, C.; Guo, X.; Wu, X. Electrically tunable graded photonic crystal lens based on graphene plasmons. Sci. Rep. 2024, 14, 26169. [Google Scholar] [CrossRef] [PubMed]
  35. Shaik, E.; Rangaswamy, N. Realization of all-optical NAND and NOR logic functions with photonic crystal based NOT, OR and AND gates using De Morgan’s theorem. J. Opt. 2018, 47, 8–21. [Google Scholar] [CrossRef]
  36. Rebhi, S.; Najjar, M. A new design of a photonic crystal ring resonator based on Kerr effect for all-optical logic gates. Opt. Quantum Electron. 2018, 50, 358. [Google Scholar] [CrossRef]
  37. Masoud, A.M.; Ahmed, I.S.; El-Naggar, S.A.; Asham, M.D. Design and simulation of all-optical logic gates based on two-dimensional photonic crystals. J. Opt. 2022, 51, 343–351. [Google Scholar] [CrossRef]
  38. Singh, J.J.; Dhawan, D.; Gupta, N. 2D photonic crystal hexagonal ring resonator-based all-optical logic gates. Opt. Laser Technol. 2023, 165, 109624. [Google Scholar] [CrossRef]
  39. Vadukanathan, A.; Suyambrakasam, G.; Sivaraj, P. Design of all-optical NOR and NAND gate using hybrid material corner scatters in photonic crystal ring resonators. Phys. Scr. 2025, 100, 045527. [Google Scholar] [CrossRef]
Figure 1. Diagram of the normalized photonic bandgap.
Figure 1. Diagram of the normalized photonic bandgap.
Photonics 12 00576 g001
Figure 2. Symmetrical waveguide paths for embedding inputs and outputs.
Figure 2. Symmetrical waveguide paths for embedding inputs and outputs.
Photonics 12 00576 g002
Figure 3. Three-dimensional plot of NOR gate optimization. ϕ a (x, degrees), ϕ b (y, degrees), o p t i m i z e _ R (z). Green (“ O p t i m a l ,   73.17 ), red (“Suboptimal”). Blue plane at threshold. Annotated optimal points with backgrounds.
Figure 3. Three-dimensional plot of NOR gate optimization. ϕ a (x, degrees), ϕ b (y, degrees), o p t i m i z e _ R (z). Green (“ O p t i m a l ,   73.17 ), red (“Suboptimal”). Blue plane at threshold. Annotated optimal points with backgrounds.
Photonics 12 00576 g003
Figure 4. Three-dimensional plot of NAND gate optimization. ϕ a (x, degrees), ϕ b (y, degrees), o p t i m i z e _ R (z). Green ( O p t i m a l ,   0.674 ) , red (“Suboptimal”). Blue plane at threshold. Annotated optimal point with background.
Figure 4. Three-dimensional plot of NAND gate optimization. ϕ a (x, degrees), ϕ b (y, degrees), o p t i m i z e _ R (z). Green ( O p t i m a l ,   0.674 ) , red (“Suboptimal”). Blue plane at threshold. Annotated optimal point with background.
Photonics 12 00576 g004
Figure 5. Normalized optical power distributions for the NOR gate under all logical input states: (a) A = 0, B = 0; (b) A = 0, B = 1; (c) A = 1, B = 0; (d) A = 1, B = 1.
Figure 5. Normalized optical power distributions for the NOR gate under all logical input states: (a) A = 0, B = 0; (b) A = 0, B = 1; (c) A = 1, B = 0; (d) A = 1, B = 1.
Photonics 12 00576 g005
Figure 6. Normalized optical power distributions for the NAND gate under all logical input states: (a) A = 0, B = 0; (b) A = 0, B = 1; (c) A = 1, B = 0; (d) A = 1, B = 1.
Figure 6. Normalized optical power distributions for the NAND gate under all logical input states: (a) A = 0, B = 0; (b) A = 0, B = 1; (c) A = 1, B = 0; (d) A = 1, B = 1.
Photonics 12 00576 g006
Table 1. Characteristics of the initial photonic crystal design.
Table 1. Characteristics of the initial photonic crystal design.
ParameterIndexValue
Lattice Constanta0.6 µm
Radius of RodsR0.12 µm
Refractive Index of Backgroundn11
Refractive Index of Rodsn23.46
Number of Rods-21 × 15
Table 2. Logical states of NOR and NAND gates.
Table 2. Logical states of NOR and NAND gates.
ABNANDNOR
0011
0110
1010
1100
Table 3. Summary of results obtained in different input modes.
Table 3. Summary of results obtained in different input modes.
Input StateNOR Output
(Binary Equivalent)
CR (NOR)NAND Output
(Binary Equivalent)
CR
(NAND)
000.6 (1)4.80.6 (1)
010.2 (0)0.53 (1)4.2
100.2 (0)0.53 (1)
110.18 (0)0.2 (0)
Table 4. Comparison of the proposed structure parameters with previous gates.
Table 4. Comparison of the proposed structure parameters with previous gates.
Ref.TypeSize (µm2)P0,maxP1,minCR (dB)Stable Time (ps)
[35]NAND3900.150.505.180.67
NOR3900.200.5140.67
[36]NAND3960.280.754.256
[37]NAND980.170.4340.32
NOR980.210.433.10.32
[38]NAND560.240.290.853.33
NOR560.240.290.853.33
[39]NAND2800.030.115.62.5
NOR2800.040.349.22.5
This workNAND1000.200.534.20.32
NOR1000.200.604.80.32
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Mohammadi, A.; Parandin, F.; Karami, P.; Olyaee, S. Design and Optimization of Optical NAND and NOR Gates Using Photonic Crystals and the ML-FOLD Algorithm. Photonics 2025, 12, 576. https://doi.org/10.3390/photonics12060576

AMA Style

Mohammadi A, Parandin F, Karami P, Olyaee S. Design and Optimization of Optical NAND and NOR Gates Using Photonic Crystals and the ML-FOLD Algorithm. Photonics. 2025; 12(6):576. https://doi.org/10.3390/photonics12060576

Chicago/Turabian Style

Mohammadi, Alireza, Fariborz Parandin, Pouya Karami, and Saeed Olyaee. 2025. "Design and Optimization of Optical NAND and NOR Gates Using Photonic Crystals and the ML-FOLD Algorithm" Photonics 12, no. 6: 576. https://doi.org/10.3390/photonics12060576

APA Style

Mohammadi, A., Parandin, F., Karami, P., & Olyaee, S. (2025). Design and Optimization of Optical NAND and NOR Gates Using Photonic Crystals and the ML-FOLD Algorithm. Photonics, 12(6), 576. https://doi.org/10.3390/photonics12060576

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop