Introduction

Artificial neural networks (ANNs) are undergoing unprecedented growth, continually advancing the boundaries of artificial intelligence systems1. However, this rapid progress has also led to an exponential increase of energy consumption during the training process. Consequently, an alternative paradigm known as neuromorphic computing—aiming at developing hardware-level frameworks with significantly lower energy consumption—has attracted considerable attention2,3,4.

Photonics provide a promising platform in this context, leveraging the unique properties of light to meet growing computational demands5,6,7,8. By enabling remarkable processing speeds, high parallelism, and superior energy efficiency, photonic hardware can outperform conventional electronic architectures for certain specialized tasks, such as vector-matrix multiplications9,10 and solving nonlinear optimization tasks11.

A key element in neuromorphic computing is the activation function, which in photonic systems is commonly implemented through various nonlinear mechanisms such as optical bistability and saturable absorption9. Recent studies have also demonstrated that nonlinearity can be achieved through linear wave scattering12,13,14, presenting an alternative pathway for photonic activation functions.

Nevertheless, the aforementioned nonlinearities often require additional nonlinear or scattering materials, increasing overall design complexity. In contrast, micro- and nanolasers—notably in semiconductor media—offer intrinsic nonlinearities through gain saturation and nonlinear dispersive effects, compatible with photonic integration15. Semiconductor lasers have already been successfully demonstrated as efficient building blocks in neuromorphic computing. In a seminal work16, an edge-emitting device with feedback has been employed in a reservoir computing paradigm, which has been extended some years later to the nanoscale17. Vertical-cavity surface-emitting lasers have also been recently implemented in neuromorphic computing18 and deep learning approaches19. In addition, coupled nanolaser arrays have been proposed and theoretically investigated as pseudo-spins in Ising machines20. In this context, nanolasers emerge as particularly promising candidates for energy-efficient photonic neuromorphic computing owing to their ultra-low lasing thresholds21,22,23,24,25, which are attributed to the high quality factors (Q), ultra small mode volumes (V), and large spontaneous emission factors (β)15.

Recent advancements in nanoscale fabrication techniques now enable the creation of large-scale nanolaser networks, further broadening the potential of these devices for a variety of applications26,27. One particularly intriguing area is non-Hermitian topological photonics, where nanolaser arrays can be engineered to exploit symmetry and/or topological protection for robust, disorder-tolerant operation28,29,30,31. The integration of symmetry or topologically protected optical modes into neuromorphic computing architectures might pave a novel pathway toward the next generation of robust nanolaser-based ANNs.

In this work, we propose and experimentally realize a photonic neuromorphic computing architecture based on a small array of evanescently-coupled III–V semiconductor photonic crystal (PhC) nanolasers with embedded quantum wells. It has been shown that standard two-dimensional geometries—such as rectangular lattices—of coupled cavities with gain-loss perturbations exhibit various non-Hermitian symmetries, including parity-time symmetry30, non-Hermitian particle-hole (NHPH) symmetry32,33, and non-Hermitian chiral symmetry34. As a consequence, a symmetry-protected zero mode35 can be excited through an exceptional point (EP) bifurcation—a singularity where both eigenvalues and eigenvectors coalesce. Following on our pervious theoretical work36, here we experimentally show that our coupled nanolaser array functions as a nonlinear layer with recurrent coupling in an ANN architecture, where symmetry-protected zero modes serve as positive output for classification tasks. In particular, we will demonstrate that our system outperforms single-layer neural architectures by solving a non-convex problem such as the XNOR logical gate. Moreover, the inherent nonlinear properties of our system enhance its ability to process data and maintain robust performance for challenging conditions, particularly when class boundaries are overlapped in the feature space. This is experimentally verified by compressing the dimensionality of the input image in a handwritten digit classification problem, confirming that our system can satisfactorily perform on non-trivial—in the sense of non-convex—classification tasks. Although the concept of topologically protected modes for optical computing can be ideally applied in systems or networks featuring many protected modes, here we analyze a small-scale array consisting of four coupled nanolasers. Even if small in scale, such physical systems can serve as effective toy models to start exploring new technological perspectives. Notable examples are spintronic nano-oscillators37,38 and memristors39, which have been successfully leveraged for AI tasks, offering both energy- and footprint-efficient alternatives to large-scale architectures3.

Results

General principle

The principle of our coupled nanolasers is illustrated in Fig. 1. For illustration purposes, we will focus on an image classification task. Let us consider an image of a handwritten “1” with dimensions Ix × Iy, where Ix and Iy represent the number of pixels in the x and y directions, respectively. The input matrix is then reshaped into a one-dimensional column vector, \({{{\bf{I}}}}^{{\prime} }\), consisting of m = Ix × Iy elements in total. The input information is subsequently encoded into the pump patterns P through a linear matrix M(p × m), specifically \({{\bf{P}}}(p\times 1)=| {{\bf{M}}}(p\times m){{{\bf{I}}}}^{{\prime} }(m\times 1)|\), where p is the total number of cavities on the photonic chip (see the insert below the hidden layer in Fig. 1). Finally, the pump pattern is projected onto the nanolaser array via a spatial light modulator (SLM). The coefficients of M are adjusted such that the optical spectrum—serving as the output layer—exhibits a lasing zero mode (interpreted as a positive response) when the digit “1” is presented. Conversely, for any other handwritten digit, the zero mode remains off, indicating a negative response36.

Fig. 1: Schematic of the system.
figure 1

The input digits are first reshaped into a one-dimensional vector, which is then encoded into a pump pattern through a matrix multiplication. The resulting pattern is projected onto the nanolaser array using a spatial light modulator. The emergence of the zero mode indicates a positive response.

Two key features are at the heart of our architecture. First, the nanolaser array acts as a hidden recurrent nonlinear layer of the optical ANN, enabling the system to tackle classification tasks—including non-convex problems, as will be shown in Sec. “XNOR logic gate”. Second, the semiconductor lasers inherently provide a nonlinear activation function through gain saturation, which plays an important role when feature-space boundaries are highly overlapped, as will be presented in Sec. “Binary classification”.

Symmetry protected zero modes

We consider a tight-binding arrangement of optical cavities, with on-site frequencies ωj, uniform losses κ and on-site gain rates gj. The corresponding Hamiltonian is given by:

$${H}_{jk}={K}_{jk}+[i({g}_{j}-\kappa )+{\omega }_{j}]{\delta }_{jk},$$
(1)

where δjk is the Kronecker-δ. For simplicity, we begin by assuming that all cavities share the same resonant frequency, which allows us to set ωj = 0 without loss of generality. In a square lattice, the evanescent wave coupling (K is real) is represented by

$${{\bf{K}}}=\left(\begin{array}{cc}0&{{\bf{T}}}\\ {{\bf{T}}}&0\end{array}\right).$$
(2)

Here, T represents an nA × nB matrix, where nA and nB denote the size of two sublattices; these are defined as the two subsets A and B of the array such that the couplings only link cavities belonging to different subsets (see the hidden layer in Fig. 1).

It is straightforward to verify that the Hamiltonian in the Hermitian limit (gj → 0) exhibits both chiral and particle-hole symmetry. Specifically, chiral—or sublattice—symmetry is characterized by the anticommutation relation \(\{{{\mathcal{C}}},{{\bf{H}}}\}=0\)34, while particle-hole (PH) symmetry is represented by the relation \(\{{{\mathcal{CT}}},{{\bf{H}}}\}=0\)35, where \({{\mathcal{C}}}\) denotes a unitary operator and \({{\mathcal{T}}}\) represents the time-reversal operator. As a result, these two symmetries give rise to a real eigenvalue spectrum symmetric about ϵ0 = 0. This is illustrated in Fig. 2a for the system considered in this work: four coupled optical cavities in a ring configuration. In such a system, sublattice A consists of cavities in the vertical direction (cavities 1 and 4), while sublattice B encompasses the horizontally oriented cavities (cavities 2 and 3).

Fig. 2: Evolution of eigenvalues in the complex plane under different symmetries.
figure 2

a In the Hermitian limit, both particle-hole and chiral symmetry lead to a symmetric eigenvalue spectrum around ϵ = 0. We call the two cavity subsets colored in blue and red sublattices A and B, respectively. b Pumping sublattice B (red cavities) triggers spontaneous PH symmetry restoration at an EP, giving rise to the zero mode. c Including the carrier-induced frequency shift breaks PH symmetry but leaves non-Hermitian chiral symmetry intact, i.e., the eigenvalues are symmetric around shifted origin \({\epsilon }_{0}^{{\prime} }=\frac{{\Delta }_{A}+{\Delta }_{B}}{2}\). By introducing sublattice detuning to compensate for this shift, the system again realizes an EP, along with the zero mode. Here in the simulations, we take K1 = −1.5, K2 = −1, κ = 1 and α = 3. In (b and c) only sublattice B is pumped; the rectangles and diamonds indicate the spectra at gB = 0, gB = 1.25, and gB = 1.5, respectively. The stars in (b) and (c) mark the location of the exceptional points.

In the non-Hermitian regime (gj ≠ 0), however, the eigenvalues become generally complex, and these two symmetries yield distinct consequences: chiral symmetry enforces eigenvalue spectrum satisfying ϵn = −ϵm, whereas NHPH symmetry leads to eigenvalues satisfying \({\epsilon }_{n}=-{\epsilon }_{m}^{*}\), where * denotes complex conjugation. Thus, zero modes remain at ϵ = 0 under chiral symmetry, while NHPH symmetry allows for modes to evolve along the imaginary axis of the complex plane—i.e., satisfying \({{\rm{Re}}}[\epsilon ]=0\)—over the entire range of spatial perturbations induced by the pump beams40. In the non-Hermitian four coupled cavity ring with all the cavities having the same resonant frequency, the zero mode arises from NHPH symmetry, which manifests through spontaneous symmetry restoration at an EP bifurcation, as shown in Fig. 2b. In other words, once these zero modes are formed, they have the same resonant frequency as a single cavity mode, independent of the pump beam. Exploiting these symmetry-protected zero modes can enhance robustness against structural coupling disorders and pump perturbations, making them promising candidates for implementing resilient optical neuromorphic computing systems36.

It is important to point out, however, that in active III–V semiconductor materials, nonlinear dispersive effects significantly modify these underlying symmetries. Specifically, the refractive index changes in response to variations in the charge-carrier population (electrons and holes), leading to the pump-induced cavity frequency shift modeled by the terms αgj, where α is the Henry—also called linewidth enhancement—factor. Consequently, pumping one of the sublattices (e.g., gA = 0 and gB ≠ 0) introduces carrier-induced sublattice detuning, explicitly breaking the NHPH symmetry and prohibiting the formation of both EPs and zero modes. To compensate for the frequency shift, one must introduce a linear detuning41 which, in the present case, red-shifts sublattice B, satisfying ωA–ωB = 2αK1K2. This condition can be achieved in a PhC ring-like coupled nanocavity geometry, as shown in Fig. 3c. In such a design, we engineer the coupling difference by means of a design parameter, K1K2 ~ 70 GHz, while relying on the intrinsic sublattice detuning, ωAωB ≈ 500 GHz. Taking these considerations into account, the final Hamiltonian can be expressed as:

$${{\bf{H}}}=\left(\begin{array}{cccc}{\Delta }_{A}&0&{K}_{1}&{K}_{2}\\ 0&{\Delta }_{A}&{K}_{2}&{K}_{1}\\ {K}_{1}&{K}_{2}&{\Delta }_{B}&0\\ {K}_{2}&{K}_{1}&0&{\Delta }_{B}\end{array}\right)$$
(3)

Where ΔA,B = ωA,B + αgA,B + i(gA,B − κ). We can verify that this Hamiltonian exhibits non-Hermitian chiral symmetry34, which, as shown in Fig. 2c, enforces an eigenvalue spectrum symmetric about the shifted origin \({\epsilon }_{0}^{{\prime} }\) of the complex plane, where \({\epsilon }_{0}^{{\prime} }=\frac{{\Delta }_{A}+{\Delta }_{B}}{2}\) varies with the pump power. With the previously described linear sublattice detuning, the system can satisfy the EP condition and subsequently excite a zero mode warranted by the non-Hermitian chiral symmetry.

Fig. 3: Non-convex classification and experimental setup.
figure 3

a Definitions of the convex and non-convex regimes. b Illustration of the XNOR problem. The dots represent the input-output states of an XNOR gate, the solid line denotes the decision boundary (hyperplane) achievable by a single-layer perceptron and the dashed lines represent the decision boundaries obtained by a multilayer ANN. The positive responses (output = 1) are marked in orange, and the negative responses (output = 0) are marked in green. Clearly, the single-layer perceptron is unable to correctly represent this non-convex classification task. c Experimental setup. Two representative system responses are shown on the left: the top panel corresponds to a positive response, characterized by lasing of the quasi-zero modes, whereas the lower panel demonstrates a negative response, in which the zero mode remains off. On the right side, representative pump patterns generated using the SLM are depicted, with white circles indicating the cavity positions. The schematic of the coupled cavity array is shown at the bottom of the figure, where the boxes highlight the photonic barriers engineered to introduce asymmetric couplings (hole radii modification: −17%).

For classification purposes, we categorize pump patterns that effectively excite the central two modes—i.e., quasi-zero modes—as positive inputs, while those that trigger side-mode lasing are classified as negative inputs (see the spectrum in the output layer of Fig. 1). A detailed eigenvalue analysis for different pump patterns is provided in the Supplementary Note 2.

XNOR logic gate

As discussed in the previous section, our coupled cavity arrays cannot be mapped into a single-layer of optical neurons without intra-layer couplings. Otherwise saying, it cannot be mapped to a Perceptron. As a matter of fact, the chiral symmetry dictates that the ring array can be decomposed as two layers (or sublattices)—the chiral partners, featuring inter-layer couplings. As such, it may in principle solve different tasks including convex—where any two points in the region can be connected by a straight line that lies fully in that region—as well as non-convex classification problems (see Fig. 3a). Noticeably, while the convex classification tasks do not necessarily require hidden layers, non-convex problems do42. In the following, we demonstrate the capability of our nanolaser array as a recurrent nonlinear hidden layer of an optical ANN architecture to implement a XNOR logic gate—a fundamental non-convex classification problem that cannot be solved by a single-layer perceptron—schematically illustrated in Fig. 3b. This provides experimental evidence that our nanolaser array can effectively tackle non-trivial classification tasks.

Our photoluminescence (PL) experimental configuration is depicted in Fig. 3c (a detailed discussion about the setup can be found in the “Methods”). We bias our nanolaser array in order to excite a lasing zero mode, realized by means of a specific SLM-induced pump pattern (P1 = P4 = 4.1 μW and P2 = P3 = 5.7 μW). We recall that this lasing zero mode is warranted by the underlying non-Hermitian chiral symmetry. We assign the pump powers in cavities 1 and 4 as the input ports I1 and I2 of the XNOR gate (detailed photoluminescence experimental results can be found in the Supplementary Note 3). Specifically, we define:

$${I}_{1,2}=\left\{\begin{array}{ll}0,\quad &{P}_{1,4}=4.1\mu {{\rm{W}}}\\ 1,\quad &{P}_{1,4}=8.2\mu {{\rm{W}}}\end{array}\right.$$
(4)

I1 and I2 take the same binary values, i.e., 0 (1) if the respective pump power is 4.1μW (8.2μW). Meanwhile, the pump power in cavity 2 and 3 remain fixed. Note that in this simplified binary classification task, the reshaping operation shown in Fig. 1 is not necessary.

To confirm our nanolaser array’s ability to represent the XNOR logic gate in a systematic way, we continuously vary the pump powers in cavities 1 and 4 and monitor the status of the zero mode. To quantify the output, we define an intensity ratio between the zero-mode laser and the other modes as follows:

$$R=\frac{\int{m}_{z}d\lambda }{\int{m}_{b}d\lambda+\int{m}_{r}d\lambda }$$
(5)

where mz denotes the intensity of the zero mode or the quasi-zero mode, mb and mr represent the intensities of the blue-most and red-most modes, respectively (see Fig. 3c for notation). This ratio characterizes the output state: if R > 2.5 we assign a positive response, indicating the dominance of the zero mode; otherwise, if R ≤ 2.5, we categorize the output as negative.

Figure 4a shows the experimental results. Notably, the positive regions—where the ratio R > 2.5—are predominantly localized near the diagonal corners of the parameter space (highlighted in yellow). This clearly demonstrates that our nanolaser array effectively encodes the two-state XNOR output, thus providing direct experimental evidence of its capability to solve non-convex classification tasks. Additionally, Fig. 4b illustrates four representative input-output configurations corresponding precisely to the entries in Fig. 3b, successfully reproducing the XNOR truth table. It can be observed that the selected zero modes (O = 1) have significantly different spectra in the two cases (blue and black traces in Fig. 4b). This is due to the bias we set, that excites a zero mode with large intensity ratio in the absence of extra inputs—i.e., at large pump imbalance—, while R decreases for simultaneous active input ports since the zero-mode approaches the EP.

Fig. 4: Experimental demonstration of the XNOR gate.
figure 4

a Experimental results. The positive responses, which are represented in yellow, are localized in the diagonal corners. b Four typical input-output responses are illustrated.

Binary classification

To fully unlock the capabilities of our nanolaser array for more challenging tasks, we employ a machine learning algorithm to optimize the system’s performance. Namely, we carefully adjust the coefficients of the matrix M based on the linear eigenvalue problem of the laser array36, i.e., diagonalizing the H-matrix (Eq. (3)). Such a theoretical description of the laser system can be considered as a piecewise linear modeling: we solve the eigenmode problem until a given mode reaches the lasing threshold; further pump increase above threshold is assumed to result in gain clamping, and therefore the single lasing mode frequency also gets clamped. Such piecewise linear model—which includes the carrier-induced refractive index change, but rules out mode switching and other nonlinear dynamical effects (see Supplementary Note 6 for a discussion)—serves as a digital twin of the experiment. It not only accurately predicts which mode lases first but also significantly reduces computational time, allowing the efficient calculation of the matrix M.

Let us recall the operation principle: pump patterns associated with the positive-class samples excite the zero modes, while those corresponding to negative-class samples excite other modes. Specifically, we employ an in silico optimization algorithm to determine the elements of matrix M in a way that maximizes agreement between predictions and ground truth. Full details of the algorithm are provided in ref. 36. To mitigate overfitting, we train the algorithm on 75% of the dataset and validate its performance on the remaining 25%.

Iris dataset

To demonstrate the feasibility of this approach, we begin with a widely recognized benchmark: the Iris dataset43. This dataset contains 150 measurements of 4 geometric features for three Iris species: Setosa, Versicolor, and Virginica. For consistency, we normalize each feature to have zero mean and unit variance.

Once the matrix M for the Iris dataset is determined using the linear Hamiltonian, we first numerically evaluate the performance of our optical ANN by calculating the eigenvalues of Eq. (3). The results, shown in Table 1, include accuracy—defined as the fraction of correctly classified samples—and the F1 score, a widely used metric for overall effectiveness, defined by: \({{\rm{F1}}}=2\times \frac{{{\rm{Precision}}}\times {{\rm{Recall}}}}{{{\rm{Precision}}}+{{\rm{Recall}}}}\), where Precision is the fraction of correctly predicted positive classifications among the samples predicted as positive, and Recall is the fraction of correctly predicted positive classifications among all actual positive samples44. Although both accuracy and F1 vary according to the specific flower species being classified, our algorithm maintains consistently high performance across all classes in simulation.

Table 1 Performance comparison of simulation and experiment for the Iris dataset

We further use the fitted M elements to experimentally evaluate the classification performance. As in the in silico case, the performance varies depending on the specific flower being classified, as shown in Table 1. Notably, the experimental results closely match their simulated counterparts, building confidence on the digital twin model used here, that accurately captures the nanolaser array’s behavior within the operational regime.

Notably, for the Setosa class, our classifier achieves an accuracy of 100% both in simulations and experiments. This perfect classification is attributed to the clear separability of Setosa from the other classes in the feature space, as illustrated in Fig. 5a. Consequently, even the single-layer perceptron is sufficient to reliably distinguish this class. On the other hand, the Versicolor and Virginica classification regions slightly overlap, featuring a nonlinear boundary (dashed line in Fig. 5a), which makes it difficult for a single-layer perceptron to resolve this inherently non-convex classification problem. In contrast, our nanolaser-based architecture, benefiting from its intrinsic nonlinearity and recurrent couplings, still achieves robust performance, demonstrating its ability to handle complex classification tasks effectively.

Fig. 5: Visualization of the feature space using principal component analysis (PCA).
figure 5

a Iris dataset showing that Setosa is clearly separated from the rests, while Versicolor and Virginica exhibit some overlap. The dashed line represents the non-convex boundary. b and c present the handwritten digits dataset, illustrating two clusters representing digits “0” and “1” at different image resolutions. The decreasing dimensionality (from 8 × 8 to 2 × 2) leads to significant overlap between classes.

Compressed handwritten digit

To further assess the computational boundaries of our system, we evaluate its performance on a highly compressed handwritten digits dataset. This more challenging test case induces severe information loss, resulting in substantial class overlap within the feature space, thereby making the classification task more difficult. Such problems typically require nonlinear classifiers to achieve reasonable performance. In our system, the intrinsic nonlinearity—stemming from gain saturation in the nanolaser array—together with the non-convex classification capabilities demonstrated above, enables effective handling of this non-trivial classification task (a detailed comparison between linear classifiers and our nanolaser array is provided in the Supplementary Note 4).

To further illustrate our approach, we focus on handwritten zeros (“0”) and ones (“1”), which constitute two well-separated classes for high-enough image resolution. To introduce confusion between classes in the classification problem, we compress the input features from 64 (corresponding to an 8 × 8 image) down to 4, representing a 2 × 2 image. The experimental results are illustrated in Fig. 6, where we compare the performance of our nanolaser array both in experiments (marked by hexagrams) and in simulations (marked by blue crosses) with other nonlinear classifiers, including a 2 × 2 artificial neural network (ANN, marked by orange diamonds; see details in Supplementary Note 5) and a random forest (RF, marked by purple triangles). We also include a simple single-layer perceptron (marked by yellow triangles) for comparison.

Fig. 6: Performance of different classifiers as a function of the input-data size.
figure 6

Lines with symbols: numerical computations, and stars: experimental results. Yellow line with triangles: perceptron; orange line with diamonds: a bilayer ANN; blue line with crosses: nanolaser below-threshold model (digital twin); purple line with triangles: random forest.

At relatively high resolutions, all classifiers achieve nearly 100% accuracy because a hyperplane can readily separate the data in a high-dimensional feature space (see Fig. 5b). However, as the input dimensionality decreases, classifier accuracy declines. At extremely low resolution—where the input is reduced to just 4 features—the boundaries between the two classes significantly overlap (see Fig. 5c), causing single-layer linear classifiers, such as the perceptron, to fail in achieving reliable performance. In this regime, the presence of the nonlinear hidden layer with recurrent couplings becomes essential for maintaining classification accuracy. Notably, our nanolaser array performs comparably to nonlinear classifiers, particularly when the input information is highly compressed, thereby demonstrating its capability to process low-dimensional data efficiently using only four nonlinear neurons.

Furthermore, a noticeable drop in accuracy is observed for the 4 × 2 input configuration. This drop, due to a mode switch that occurs above the lasing threshold (a detailed explanation is provided in the Supplementary Note 6), reflects limitations in our setup and analysis procedures. Future implementations could mitigate this effect by imposing additional constraints on the pump distributions or by employing full nonlinear model (Supplementary Note 1) in training procedures.

Discussion

In this work, we propose and experimentally demonstrate a photonic neuromorphic computing architecture utilizing symmetry-protected modes in coupled III–V semiconductor nanolaser arrays. By engineering the optical materials to exploit EP bifurcations, we could excite symmetry-protected zero modes, which serve as robust outputs for classification tasks. Moreover, the intrinsic nonlinear response—arising from gain saturation and the amplitude-phase coupling of the semiconductor nanolasers—combined with the recurrent couplings in the hiddden layer, enables the array to efficiently handle non-convex tasks, such as the XNOR logic gate.

We further evaluated our system using a highly compressed handwritten digit dataset, where severe dimensionality reduction causes significant overlap between classes, thereby necessitating a nonlinear classification scheme beyond single-layer architectures. Our experimental results demonstrate that the nanolaser array maintains reliable accuracy even under extreme input compression, effectively classifying low-resolution data with only four nonlinear neurons. These findings highlight the potential of symmetry-protected optical modes in the nanolaser arrays for energy-efficient, compact, and robust neuromorphic computing systems capable of tackling non-trivial computing tasks. Since the number of final modes in the output layer can, in principle, be relatively small (eventually matching the number of classes in future developments), then the number of coupled units in the nanolaser layer does not need to scale up significantly if restricted to the neural networks’ final readout layers. In other words, we do not require large coupled cavity arrays to realize symmetry protected modes. What can—and should, in most cases—be large is the problem’s dimensionality, which is given, e.g., by the number of input pixels in an image classification problem. While this is in general desirable to ease classification, in some cases the input information is limited. This is what Fig. 6 shows: increasing dimensionality actually improves performance in general, because a hyperplane can always be found to classify data. Still, for limited input data—i.e., highly compressed datasets—the recurrent nanolaser layer outperforms other algorithms like the Perceptron.

The classification tasks addressed in this work can be regarded as minimal yet non-trivial problems that serve as benchmarks. When facing more complex tasks, we would naturally attempt to scale up the nanolaser array to Nx × Ny, where this product could be over one hundred for realistic implementations. Within this planar approach, we may mention an interesting avenue to achieve multilayer architectures: the possibility of having multiple sets of nanocavity arrays connected to one or more common waveguides, which act as tunable links (e.g., via thermal effects) between different hidden layers. In addition, III–V technology also enables potential solutions for signal amplification within those waveguides, if required, for example, in the case of consecutive layers of nanolaser arrays in deep neural networks. A key aspect is the network connectivity, which not only supports optimal problem solving but also reduces hidden layer dimensionality through symmetry-protected laser modes. This is a completely open question and, in our opinion, a most interesting one that deserves further investigation.

Let us finally discuss the performance of our device in terms of robustness, energy consumption and speed. Regarding tolerance to fabrication imperfections, a slight dispersion of cavity-frequencies can be mitigated by the strong inter-cavity couplings, while the impact of coupling disorder can be assumed negligible because of the fundamental symmetry-protection of zero modes36. In terms of energy consumption, our PhC nanolaser threshold is about 3–4 μW average pump power for a single nanolaser operating at 10 MHz repetition rate, and  ~ 100 ps pump-pulse duration, which corresponds to 4 mW pump peak-power; besides, the electronic lifetime is about 200 ps. This represents a consumed energy of E0 ~ 1 pJ per pulse, which scales as N × E0 for N-coupled nanolasers. For comparison, state-of-the art electrically pumped PhC nanolasers consume about 1–10 μW of electrical pump power24, leading to an almost three order of magnitude reduction in energy consumption, eventually showcasing the strong potential of these devices. Regarding speed, while 200 ps is the ultimate limit, additional time delays coming from the in-silico matrix multiplications substantially impact the operation time. An interesting prospect is to replace the in-silico linear operations by 2D passive meta-surfaces, enabling the all-optical implementation of these linear transformation functions36.

In conclusion, we have demonstrated that symmetry and/or topologically protected modes in nanolaser arrays—functioning as a readout nonlinear layer within optical ANN architectures—can facilitate classification tasks. This approach naturally accommodates high-dimensional feature spaces and leverages small-to-medium scale coupled laser networks. Crucially, it opens new avenues for addressing complex problems without the need for significantly scaling the number of nonlinear neurons.

Methods

Sample fabrication

The four coupled PhC nanolasers are fabricated in an Indium Phosphide membrane, with four embedded InGa0.17As0.76P quantum wells. The detailed geometric parameters we used in the experiments are: lattice constant, a = 414 nm, the radii of the air hole is r0 = 0.266a. The coupling difference is introduced by modifying the barrier hole size according to rb = (1 + h)r0, with h = −17%, and the thickness of the slab is d = 265 nm.

Experimental setup

In our setup, the pump source is a pulsed laser operating at 783 nm with a 10 MHz repetition rate to minimize thermal effects. The total pump power is then controlled by means of an acousto-optic modulator. The SLM is operated in amplitude-modulation mode, wherein a half-wave plate is rotated by 22.5° to maximize contrast between the pump pattern and the background. Several representative pump patterns are illustrated on the right of Fig. 3. The patterned beam is then projected onto the sample through a microscope objective (100 × magnification, 0.95 N.A.), while the emitted light is collected by the same objective and spectrally resolved using a spectrometer.