Very recently, a new topic has attracted a lot of attention from different physical communities working with lattices as a main framework for their studies. By using non standard geometries, different periodic lattices have been suggested to achieve the goal of localization without any linear or nonlinear impurity, and without any constraint on the level of power. Flat Band (FB) lattices possess a special linear spectrum where at least one of their linear bands is completely flat1. This implies that the modes belonging to this special band do not diffract at all and remain localized in space as long as the system length. It has been shown2 that 2D FB linear modes consist on line extended states which could reduce abruptly its size by judicious linear combinations in different directions of the lattice. Therefore, it is possible to create a completely coherent linear base composed of very localized states. For example, a Lieb lattice3,4,5,6 corresponds to a square depleted lattice, having three sites per unit cell, with two dispersive bands and one completely flat. Modes from this band have only four amplitudes different to zero, being therefore perfectly localized in space. A Kagome lattice7,8 is also an interesting example, where the localized modes consist of only six amplitudes different to zero. In all known FB systems, it is possible to find compact localized states, which occupy one or several unitary cells depending on the lattice geometry9. These states are also exact solutions at the nonlinear regime, but they are not necessarily stable1,10. Only few quasi one-dimensional FB systems have been experimentally explored. Two years ago, it was reported the observation of a localized state on a Diamond lattice, consisting on a localized mode presenting only two out of phase sites11 (which is indeed the smaller FB state known in any system up to now). Very recently, a Sawtooth lattice was tested experimentally12, showing how the absence of transport is related to the appearance of a FB. Theoretical studies on Sawtooth lattices also explore quantum topological excitations13 and Bose–Einstein condensation14. Polariton condensation was shown in 1D Lieb (Stub) lattices, in the context of micro-pillar optical cavities15. This was the first experimental observation of properties related to Stub lattices, although the isolated excitation of a localized FB state was not possible on that experimental context.

In this work, we study the fundamental properties of a Stub photonic lattice. For the first time to our knowledge, we are able to excite a FB Stub linear localized mode. This state propagates without suffering diffraction and can be combined with neighbor modes to generate arbitrary linear combinations. We explore the implementation of three basic logical operations using the simple and powerful properties of a Stub FB photonic lattice. By superposing two FB modes we are able to generate the following logical gates: AND, OR and XOR. We use the wave nature of FB modes to combine them using different phases and show its potential to develop novel all-optical logic gates.


A Stub photonic lattice consists of a main row with extra sites every two waveguides [see Fig. 1(a)]. Light evolution on this waveguide array occurs along the z direction, which is orthogonal to the transversal periodic Stub structure. Based on coupled-mode theory, we describe the light dynamics by means of discrete linear Schrödinger equations (1), what in this lattice geometry reads as:

$$-\,i\frac{d{a}_{n}}{dz}={V}_{v}{b}_{n},\quad -i\frac{d{c}_{n}}{dz}={V}_{h}({b}_{n+1}+{b}_{n}),\quad -i\frac{d{b}_{n}}{dz}={V}_{v}{a}_{n}+{V}_{h}({c}_{n}+{c}_{n-1}).$$
Figure 1
figure 1

(a) A Stub lattice configuration. (b) Linear bands for V h = 1, V v = 2. (b)-inset Amplitude profile of a Stub Flat Band compact state. Two FB states combined: (c1) in phase and (c2) out of phase amplitude profiles.

a n , b n and c n represent the amplitude of the fundamental electric field mode at different waveguides forming the unitary cell [composed of sites A, B and C in Fig. 1(a)]. We assume only nearest neighbors interactions, governed by horizontal V h and vertical V v coupling constants, which are originated from a weak overlap between the fundamental modes of adjacent waveguides. In general, these coefficients depend on the separation between two waveguides [d x or d y in Fig. 1(a)], but also on the direction of coupling depending on a given waveguide profile16. We consider an homogenous array such that all the individual waveguides have the same propagation constants, therefore we simply eliminated this dependence in model (1).

First of all, we solve model (1) using the stationary ansatz: ψ n (z) = ψ 0 exp i(k y nd y βz), with ψ n (z) = a n (z), b n (z), c n (z), depending on the particular waveguide position. This ansatz represents a plane wave travelling transversally in the array while propagating longitudinally along the z direction. k y represents the horizontal wave vector. By inserting this ansatz, we get the linear bands (dispersion relation):

$$\beta =0,\pm \sqrt{4{V}_{h}^{2}{\cos }^{2}({k}_{y}{d}_{y})+{V}_{v}^{2}}.$$

We plot the spectrum in Fig. 1(b) and observe two dispersive (and opposite in curvature) linear bands, and one completely flat at β = 0. b n amplitudes are always zero for the linear modes belonging to this band. For a Stub lattice, a compact linear state is composed of only three sites different to zero15. The relation between the amplitude at A and C sites is simply given by a = −V h c/V v [see Fig. 1(b)-inset, where the scale goes from a negative amplitude in black to a positive amplitude in yellow, passing by a zero green amplitude]. This relation comes from the necessary amplitude balance in order to cancel the transport at the connector site B 1.

One interesting and important feature of FB states is that they can be excited in any region of the lattice, as soon as the zero amplitude condition at surrounding sites B is fulfilled. The simultaneous excitation of compact states forms a coherent linear combination, which propagates without distortion along the z-direction. This allows us to transmit any combined pattern without any diffraction process, as the states forming this pattern have no diffraction at all (the slope of the FB is exactly zero). The simpler linear combination consists of two neighbor FB modes. They can be combined in phase or out of phase as Figs. 1(c1) and (c2) show, respectively. The main difference in terms of amplitudes is that the in-phase combination has a larger value at the central A-site, while the out of phase combination has a null amplitude at that position. In that sense, by linearly combining FB compact states we are able to compose different patterns that could be useful to transmite codified information along a given system, as we show below.


In order to test the validity of model (1) and the particular linear features of a Stub geometry, we fabricated a Stub lattice using a femtosecond laser writing technique16. Our lattice possesses a total of 77 elliptical waveguides, with 51 sites at the lower row and 26 at the upper one. The waveguide spacing is d x = d y = 20 μm. To visually test the quality of our lattice, we launch white light at the input facet and take a picture of the output profile using a CCD camera, as shown in Fig. 2(a). We clearly see that although d x = d y , the waveguide ellipticity generates an effective anisotropy in terms of coupling constants16; i.e, V v > V h . Figure 2(b) shows a compact view of our experimental setup. We use an Image Generator (IG) configuration (composed of a sequence of Spatial Light Modulators, polarizers and optics) to transform a broad red laser beam of 633 nm into a specific light pattern4. Using this configuration, we are able to generate different initial conditions – with amplitude and phase modulation – which are then imaged at the lattice input facet. Then, light propagates through a L = 10 cm long crystal and we obtain an image at the output facet by means of a standard CCD camera.

Figure 2
figure 2

(a) A microscope zoom of a Stub lattice. (b) Experimental setup. Output intensity profiles for different input excitations: (c) B-site, (d) three-sites in phase, and (e) three-sites out of phase. Circles in (c),(d) and (e) indicate the input positions.

We first study bulk transport in this lattice using a single-site excitation. This is performed by generating an image that illuminates an isolated bulk waveguide. In Fig. 2(c) we show the output spatial profile, after the excitation of a B-site at the bulk of the lattice (circle shows the input position). This initial condition only excites the dispersive part of the spectrum, due to the zero overlap with FB modes. We observe a rather symmetric transversal light distribution, including a characteristic discrete diffraction pattern3,4,5,6,8,11,12. Figure 2(c) shows the larger spatial spreading observed exciting this lattice. The excitation of single A or C sites shows a mixture between diffraction and localization, due to the excitation of the three linear bands of the system.

A second experiment consists on exciting a Stub FB compact mode. First of all, we prepare an image that illuminates only three sites of the lattice, without any phase modulation [see Fig. 2(d)]. After a propagation of 10 cm, we observe that some part of the energy remains at the input region but, also, some important part has diffracted across the lattice. This is expected because this input condition injects light at A and C sites and, therefore, a large part of the spectrum is effectively excited. Now, we use the same amplitude profile, but adding a staggered phase structure, mimicking the theoretical profile showed in Fig. 1(b)-inset. In Fig. 2(e) we show the excitation of this mode in a central region of the lattice. This image shows a dark background without any noticeable external waveguide excited. We observe a small difference in the amplitude of upper and lower rows due to a weak lattice anisotropy (bottom row amplitude must be larger due to V v > V h ). This is a direct confirmation that the dynamics of this lattice is well described by model (1) and that FB localized states exist stable on this lattice. Therefore, we are in good experimental conditions to propagate different composed Stub patterns and use this lattice as an optical code transmission system4,6,7,8.

Now, we combine two close FB states. As these modes have an amplitude and phase structure, we can combine them using in phase and out of phase composition. The FB state located to the left is called ϕ L [see Fig. 3(a)] and the one located to the right is called ϕ R [see Fig. 3(b)]. We could generate infinite linear combinations depending on the coefficients in front of these states: αϕ L + βϕ R , with \(\alpha ,\beta \in {\mathbb{R}}\). This linear combination will be coherent along the propagation coordinate z, because both states belong to the same band, having the same propagation constant (frequency) β = 0. For simplicity, we consider two symmetric linear combinations: ϕ L  ± ϕ R [as sketched in Fig. 1(c)]. Experimentally, we study these composed states by generating input patterns having the corresponding amplitude and phase modulation. Figure 3(c) and (d) show the output profiles for in phase and out of phase combinations, respectively, after a propagation of 10 cm. Although we observe very low intensity peaks at surrounding sites (due to the high contrast used for these images), this is not affecting the predominant composed profile (the input image composition could always have some asymmetries in amplitudes and phases, that could excite part of the dispersive spectrum). When there is an in phase combination, we observe the constructive interference at the central upper site as showed in Fig. 3(c), with a very large intensity at this position. On the other hand, we observe a destructive interference at this site for an out of phase linear combination, as showed in Fig. 3(d).

Figure 3
figure 3

Output intensity profiles for (a) ϕ L and (b) ϕ R states, and for (c) in phase and (d) out of phase FB mode combination.

All-optical FB gates

Some efforts have been focused on performing non-diffractive image transmission schemes using FB systems4,6,7,8, although no logical operations have been suggested yet. Over the last two decades, various all-optical logic gates with and without semiconductor optical amplifiers (SOA) have been proposed, reflecting the demand to overcome the speed limit of electronic devices17. For example, all-optical NAND-NOT-AND-OR gates were proposed using optical fibers presenting gain and losses18. Interestingly, most of these previous studies tend focus on proposing quantum optical gates setups19,20,21, more than classical ones. Moreover, lattices have being poorly studied to implement logical operations in the linear regime, where most of the applications really operate due to power constraints. Therefore, the ability of FB lattices to support linear localized states, which can be combined to form completely coherent – time and space – configurations, appears as an important problem to be explored in more detail in the future, in order to propose concrete all-optical solutions.

In Fig. 3 we observe three intensity levels at the central upper position site: low (background level), middle (single excitation) and large (in-phase combination) intensities. These three options give us the possibility to use the combination of ϕ L and ϕ R states to perform a number of well known logical operations. We suggest to use these states as left and right input signals in our gates, and define the intensity at the center top site as the output channel. For example, an “OR gate” gives 0 only when no signal is measured at the output. Therefore, as showed in Fig. 4(a), exciting only ϕ L or only ϕ R or an in phase combination ϕ L + ϕ R , we exactly generate an OR gate using the FB modes of our Stub lattice. As the intensity at the output channel (indicated by a circle) could have a low, middle or large value, we can also differentiate this at the output by filtering this amount. To generate an “AND gate”, we use exactly the same inputs as before, but now defining a threshold for the output to be considered as 1. We simply define that middle or lower intensities correspond to a 0, while the large intensity generated by ϕ L + ϕ R is defined as an output 1 [see Fig. 4(b)]. Finally, we generate a “XOR gate” by using the same inputs than before, but now considering an out of phase linear combination ϕ L ϕ R [see Fig. 4(c)]. Therefore, when measuring a middle intensity at the center top site, we will define an output equal to 1. This will occur when inputs are injected only independently, as XOR gate works. If no modes or both are injected in an out of phase linear combination, the center top site will have a zero or very low amplitude, corresponding to a 0 at the output channel.

Figure 4
figure 4

Truth tables for (a) OR, (b) AND and (c) XOR gates. Output experimental images are also showed, together with their corresponding inputs from the tables.

In order to quantitatively characterize the gate success probabilities for OR, AND, and XOR gates we plot in Fig. 5 the normalized transversal intensity measured at the output channel waveguide. We obtain a general background (0,0), three different peaks, and a subtracted background (1,1). We use two standard quantities to estimate the possibility of a realistic implementation of these three gates: the extinction ratio (ER), defined as the ratio between the peak intensity of defined “1” and “0” values (I 1 and I 0, respectively): ER ≡ I 1/I 0; and the Margin of Error (ME) or Tolerance, defined as the difference between these peaks: ME ≡ I 1I 0. The obtained values are shown as a table in Fig. 5-inset. We obtain reasonably larger ER values for OR and XOR gates, due to the contrast of defined peaks with an almost zero background. The ER value for an AND gate is low (1.79), due to the comparison between middle and large peaks; more specifically, the peak intensity of (1,1) inputs and that of (0,1),(1,0) inputs should be resolved for the AND operation. On the other hand, the Tolerance values are essentially the same for all gates with ME ≈ 0.4, indicating that our gates are defined by three levels of intensity (low, middle and large) as described before, with a simple relation between these peaks. Using this information, we define two measurement Thresholds (T), in order to experimentally determine when the output channel is a “0” or a “1” logic output. We arbitrarily define these measurement Thresholds as 20% and 60% of the maximum intensity for OR-XOR and AND gates, respectively, as shown in Fig. 5. Considering all these parameters, OR and XOR FB gates have a better probability of a successful operation, compared to AND gates.

Figure 5
figure 5

Normalized transversal intensity at the output channel, for the combinations indicated in the horizontal axis. Inset: Table indicating ER and ME for OR, AND, and XOR gates. Full lines indicate defined thresholds T, while dashed lines indicate different level of power.

An important element to be considered on a realistic implementation of FB based optical gates is the consideration of energy losses. Our experiment was performed on a Silica glass chip, and the losses of written waveguides on this substrate are considered to be of the order of 0.4 dB/cm at 633 nm16. This implies that in our experiments, considering a crystal with a propagation length of L = 10 cm, the output power is around 40% of the input power. However, when we implement a logic circuit with a concatenated structure consisting of several layers of gates inside the crystal substrate, modern fabrication techniques allow us to make the whole structure shorter. Therefore, it would be possible to guarantee the correct operation of the whole circuit, by properly adjusting the length of the concatenated structure and the power of the input signals so that the power of the final output signals is high enough to be distinguished by the chosen detector. Additionally, the accumulated optical phase when light is propagating in between two consecutive gates will be just constant for all propagating channels, as soon as this distance is kept equal for all of them.

Different approaches for logical operations such as linear optical gates22,23,24 and reversible collision-based gates25 have been proposed, showing the possibility to implement logic gates in a linear realm of the underlying physics. However, in order to implement a full gate operation, the introduction of a nonlinear response or discrete manifestation is required in the measurement process. A good example of this is known in the field of linear quantum computing, in particular the Knill-Laflamme-Milburn (KLM) concept26, where all gates are linear by definition. The nonlinearity only appears in the measurement process, where photons need to interact based on the existence of a detector. In other words, the KLM scheme induces an effective interaction (i.e., a nonlinearity) between photons by making projective measurements with photodetectors. Our optical gate operation, based on the excitation of individual or combinations of FB modes, is completely linear; the nonlinearity or discreteness is imposed only on the process of considering a threshold in the intensities of the output waveguides, as we have described in the analysis of Fig. 5.


In conclusion, we have been able to experimentally excite the linear FB modes of a Stub photonic lattice. We have clearly contrasted the localization features of this state with respect to bulk transport. The linear superposition of two neighbor FB modes was observed, considering an in phase and out of phase combination. Our experiments were performed on a L = 10 cm long crystal having 77 waveguides, but similar results may be observable in shorter and smaller arrays (the FB localization properties rely on very discrete features of the lattice, where only few unitary cells are necessary for observing the described phenomenology1). This is a very important aspect when considering a reduction of the system size for concrete applications. Additionally, the femtosecond writing technique16 also allows the possibility to write complex arrays in order to perform concatenated operations and, also, to prepare complex input conditions27,28. We proposed and experimentally demonstrated a novel basic design of all-optical logic gates by the use of FB Stub states as input channel to perform three logical operations, based on a single and combined excitation. The feasibility of gate operations was evaluated based on experimental observations. Our design is still in an early phase of development and evaluation of its numerical properties, such as operating speed and integration capacity. Our proposed all-optical logic gates, however, have promising potentials to produce core units to implement various all-optical systems for optical signal processing. This is certainly important when looking for concrete applications of photonic lattices in optical computing.


Sample fabrication

The photonic lattice used in our experiment was fabricated using the femtosecond laser writing technique16. By focusing a laser beam on a silica chip, we are able to locally modify the refractive index. Then, we translate the chip at fixed velocity and create a complete waveguide inside the chip. Depending on the transversal pattern of the specific lattice, we repeat this procedure on several positions and fabricate a full photonic system.

Image generation

We generate specific input conditions by a setup called “Image Generator (IG)”. This setup consists of a sequence of several optical elements described as follows: We first expand a laser beam in order to cover completely the screen of a transmission spatial light modulator (SLM). By setting two polarizers, we optimize the amplitude modulation response of this SLM and create a given light pattern. In our experiments, this pattern consists on several light spots located on specific positions depending on the studied lattice. Then, we modulate only in phase this pattern using a reflective SLM. After this point, we obtain a light pattern which is already modulated in amplitude and phase. Finally, by using different optics and a 10× microscope objective (MO), we decrease the size of the pattern in order to match the specific dimensions of the lattice. To calibrate this, we install a beam splitter before the MO and take an image on a CCD camera using the reflected light on this facet. By launching white light on the output facet, we are able to observe the waveguide positions and check the dimensions of the generated image. Finally, we take several images of the output facet by installing after the sample another 10× MO and a second CCD camera.

Data availability

The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.