All-optical switching at the two-photon limit with interference-localized states

We propose a single-photon-by-single-photon all-optical switch concept based on interference-localized states on lattices and their delocalization by interaction. In its ’open’ operation, the switch stops single photons while allows photon pairs to pass the switch. Alternatively, in the ’closed’ operation, the switch geometrically separates single-photon and two-photon states. We demonstrate the concept using a three-site Stub unit cell and the diamond chain. The systems are modeled by Bose-Hubbard Hamiltonians, and the dynamics is solved by exact diagonalization with Lindblad master equation. We discuss realization of the switch using photonic lattices with nonlinearities, superconductive qubit arrays, and ultracold atoms. We show that the switch allows arbitrary ’ON’/’OFF’ contrast while achieving picosecond switching time at the single-photon switching energy with contemporary photonic materials.


I. INTRODUCTION
All-optical devices have the potential to change data transmission and processing, having faster speeds and lower power consumption compared to their electronic counterparts [1][2][3].The switch is an essential component that allows the control and the manipulation of signals in circuits, representing a logical AND gate, namely allowing a signal to pass only if a control signal is present.The implementation of all-optical switches can lead to the development of integrated and compact circuits [4].
Performing switching of light with only a single control photon allows operation at minimal energy, but it requires strong photon-photon interaction, a long-standing goal of quantum optics [5].Non-linear elements in an optical cavity can confine light and prolong the interaction time, allowing for larger effective photon-photon coupling [6].Examples of such cavity systems realising switching of many-photon light beams using only few control photons include organic molecules [7,8], rubidium-87 atoms [9][10][11], quantum dots [12][13][14][15], ultracold Rydberg or Cesium atoms [3,[16][17][18][19] among others.Switching a single-photon signal with a control light made of many photons is a complementary challenge, which was realized by exciton depletion at semiconducting quantum dots [20], for singlephoton transport of transmission-line-resonator arrays [21], and plasmon in nanowires [22].Switching a singlephoton signal with a single control photon represents a fundamental quantum limit, which has been proposed using a cavity QED system [23].
We approach single-photon-by-single-photon switching using interference-induced single-particle localized states, which have received interest in recent years in the context of flat bands [24].In these systems, the single-particle kinetic energy is suppressed while other energy scales, such as interaction, are relevant even if they are weak compared to single-particle ones.Importantly, the in- * paivi.torma@aalto.fiteraction can allow propagation of many-particle states while single particles remain localized [24][25][26][27], which can lead to superconductivity in flat band systems [28][29][30][31][32].
In this article, we propose a switching concept based on single-particle localization and interaction-induced delocalization of pairs of particles in photonic lattice models.Figure 1 illustrates the concept using a three-site model described with a Bose-Hubbard model.The signal photon enters the system and remains localized in a state around the input site, representing the 'OFF' state of the switch.If also a control photon is present, the photon pair can delocalize due to interaction, representing the 'ON' state of the switch.The switch can be operated as an closed or a open system.In the closed operation of the switch, the dynamics of the system is conservative, i.e. particle number is conserved, and solved using exact diagonalization techniques.The photons are geometrically separated from the initial state and can be collected once the maximal separation is reached.In the open operation of the switch, a sink is introduced to continuously deplete the photons from the system, and the corresponding dynamics is modeled by a Lindblad master equation.We consider the unit cell of a Stub lattice and a diamond chain as notable models offering localized single-particle states with alternative advantages.
The proposed switch operates inherently at the singlephoton-by-single-photon limit meaning that the input and control signals consist of no more than a single photon, respectively.In other words, the operation is at the purely quantum mechanical limit at the minimal switching energy in terms of the control signal, and does not work in the classical (mean-field) level.We show that the switching can be realized in principle at arbitrarily Figure 1.The switching concept illustrated with a system consisting of three sites, labeled A, B, and C. The wiggly arrow from the C site represents the presence of a sink with a decay rate γ.Empty circles denote empty sites while filled circles correspond to photon presence.The three-site system has an interference-localized state around the A site.If the control photon is 'OFF', the signal photon is trapped in the localized state, as shown in the left column representing the switch being 'OFF'.If the control photon is 'ON', the two photons can delocalize due to interactions, as shown in the right column representing the switch being 'ON'.The first row represents the input of the switch while the second and third rows depict the output in the closed (γ = 0) and open (γ ̸ = 0) operation, respectively, see main text for more information.
small interaction strengths between photons at the cost of increasing the switching time.Given the state-of-the-art Kerr nonlinearities in photonic materials, we show that the switching time can be as fast as picoseconds.
The article is structured as follows.Firstly, in Sec.II, we discuss general conditions for localization in a threesite model, and demonstrate the switching concept by using the notable special case of a single Stub lattice unit cell.We compare the single and the two-particle dynamics in both the closed and the open operation of the switch.Section III illustrates the switch in the diamond chain, which is known for its Aharonov-Bohm cages, and Sec.IV discusses potential experimental platforms to realize the switching concept.In Sec.V, we compare the switch to non-linear Mach-Zehnder interferometer and other switching paradigms.We discuss the results and conclude in Sec.VI.

II. SWITCHING WITH A THREE-SITE MODEL
A minimal switching scheme can be realized using the localized eigenstates of a three-site model.The general non-interacting Hamiltonian corresponding to the threesite model, shown in Fig. 1 with sites labeled A, B and C, is Ĥ0,three site = ij H 0,three site,ij b † i bj , where bi , b † i are annihilation and creation operators of particles at sites i ∈ {A, B, C} and the matrix is Without loss of generality, we set ϵ B = 0. Firstly, we see that single-site localization, for instance at the A site, yields disconnected sites, i.e. t BA = t CA = 0. Secondly, we find that the two-site localized state has the form |loc⟩ .= (α loc , β loc , 0), if and the amplitudes fulfill the condition Such localized state satisfies H 0,three site |loc⟩ = E loc |loc⟩ with energy Similar processes to construct localized states are used in flat-band lattice construction [47].Destructive interference on a three-state system is also behind the formation of dark states in the electromagnetically induced transparency phenomenon [48], that is relevant for all-optical switching by slowing light down or enhancing optical Kerr nonlinearities [6,49].
The three-site model contains notable solutions.The unit cell of the sawtooth lattice is obtained by setting The sawtooth lattice case is discussed in Appendix B. Furthermore, the unit cell of the Stub lattice is obtained by setting ϵ A = 0 and t AB = 0, i.e., A and B are disconnected.This case and its eigenstates are illustrated in Fig. 2 (a) and further discussed in the following due to its simplicity, positive hoppings and zero on-site energies.

A. The closed-operation dynamics
The system is described by a Bose-Hubbard model where U is the on-site interaction strength.The closed-operation dynamics of the switch is demonstrated with the Stub unit cell in Fig. 2. The input is located at site A while the output is comprised of the B and C sites.The single-particle localized state |loc⟩ has energy E loc = 0 and the two delocalized states |±⟩ have energies E ± = ±t AC r 2 AB + 1 = ±∆, see Fig. 2(a).We start by analysing the 'ON' state of the switch, that is when the initial state has two photons on the input A site.The initial state, expanded in the single-particle states, is For interactions U that are small compared to the energy gap ∆, we obtain that |loc, loc⟩ and |+, −⟩ describe a two-level system, with other eigenstates being stationary.In the limit of large r AB , the state |loc, loc⟩ is a good approximation of the input state, while |+, −⟩ is the output state.From this two-level description, the state dynamics consists of Rabi oscillations with frequency The Rabi oscillations of the photon pair is visible the upper panel of Figs.2(b) and (c).The half-period of such oscillation defines the switching time We notice that the switching time is only dependent on the interaction strength U and the ratio r AB .
The probability to find one or two photons at the output sites in the output state |+, −⟩, i.e. the 'ON' state of the switch, is given by P ON = 8/9, see Appendix A 5 for details.This theoretical prediction is shown in Fig. 2(d) as orange solid line, together with numerical data as green dots.
We now analyse the non-interacting one-photon case, i.e. the 'OFF' state of the switch.The dynamics of a single photon starting from the input A site, shows clear localization, see lower panel of Figures 2(b

) and (c).
There is however a finite probability over time to find the photon at the output B and C sites, given by This expression gives the switch's 'OFF' state leakage probability, which is shown as a pink solid line in the upper panel of Fig. 2(d), together with numerical data as violet dots.Importantly, from Eq. ( 7), we see that the ratio r AB can be used to minimize the false 'OFF' signal.In this way, the 'ON' versus 'OFF' switching contrast can be increased, see lower panel in Fig. 2(d).
In fact, by increasing the ratio r AB , the localized eigenstate is more weighted on the A than on the B site.However, in this case also the switching time t switch increases, see Eq. ( 6) and Fig. 2(e).
The behavior of the switching time as a function of U is further shown Fig. 2(f), where we see that t switch is optimal for intermediate values of the interaction U ≈ t AC .A more thorough dependence of t switch (U ) at large interactions is given in Appendix A 5.

B. The open-operation dynamics
The open-operation dynamics is modelled with a Lindblad master equation where Ln are the ladder operators and γ n are the rates corresponding to the connection to an external reservoir.For a sink on the C site, L = bC , and γ is the decay rate, and A is the input site, see Fig. 3(a).The open-operation dynamics of the switch with the Stub unit cell is illustrated in Figs.3(b) and (c).Similarly to the closed-operation dynamics, in the 'OFF' state the single photon remains mostly confined around the A site and only slightly at B, see lower panel in Fig. 3(b).Therefore, there is a very high probability P 1 of the single photon being found in the system, as it does not reach the sink, see lower panel in Fig. 3(c).
In the 'ON' state, the pair delocalizes due to the interaction, evolving according to the two-state dynamics, as in the close-operation case, where Rabi oscillations are dampened by the decay rate γ.However, when the pair reaches the sink, the system gets depleted, as shown in the upper panel of Fig. 3(b).Consequently, the probability P 2 of finding two photons in the switch goes to zero over time, while there is obviously an increasing probability P 0 of finding zero photons in the system, i.e. the switch is empty, see upper panel of Fig. 3(c).We also notice that probability P 1 of finding a single photon in the system plateaus due to a finite possibility of being stuck in the localized state.
In contrast to the closed operation, the success of the switching, i.e., a single photon exiting the system in the presence of the control photon, can be made as high as wanted.The 'OFF' signal can be limited by utilizing the ratio r AB to focus the initial state to the localized state.In fact, we observe that the 'ON' versus 'OFF' contrast increases with increasing r AB , as illustrated in the lower panel of Fig. 3(e).
In Figs.3(d), (e) and (f), we show the dependence of the switching time on the interaction strength U , the ratio r AB , and the decay rate γ respectively.The switching time t switch is defined as the time it takes for a photon to exit the system with probability above a certain threshold 1−ϵ, with ϵ = 10 −3 .In this open operation, the switching time depends quite a lot on the decay rate γ, opposed to the closed operation, where t switch is determined by the Rabi oscillations.
It can be shown that t switch has two opposing behaviors depending on the decay rate γ being small or large in comparison to the delocalization time-scale, see Appendix A 6.
In the small γ limit, it can be shown that the switching time is independent on the interactions see Appendix A 6 for details.When γ is large compared to the two-particle delocalization time scale, one can approximate the sink site to be empty at all times.In Appendix A 6, we show that this approximation leads to the following expression for the switching time, valid for small interactions This result is shown as the solid pink line in Fig. 3 (d) and in Fig. 3 (e).We see that increasing γ at this limit actually increases the switching time.The reason is that the sink operates so fast that all the photons ending up at the sink site get directly out from the system, while also the coherence between the two states decays, slowing the delocalization in direct proportion to γ.
When analysing the switching time behavior as a function of the interaction, we find that t switch is inversely proportional to U 2 at small interactions, see Eq. ( 10), but is directly proportional to U 2 at large interactions, see Fig. 3 (d) and Appendix A 6. Thus, the optimum is in the intermediate interaction range and the decay rate γ is the limiting factor.

III. SWITCHING WITH THE DIAMOND CHAIN
We now briefly consider the switch in the diamond chain, as it is a notable model that has been extensively studied for its interference-localized states known as Aharonov-Bohm cages [38, 40-44, 46, 50-55].The diamond chain is illustrated in Fig. 4(a) together with its eigenstates.When a π flux is inserted through the plaquette, the system supports only purely localized eigenstates.The bulk eigenstates are |±⟩ and |0⟩, with energies E = ±2J and E = 0 respectively, where J is the hopping amplitude between the sites in the chain.In addition, due to finite length of the chain, there are edge states |L±⟩ and |R±⟩ at energies E = ± √ 2J.The closed operation of the switching for the diamond chain is illustrated in Figs.4(b) and (c).For a successful switching, the input is prepared in the left edge state |L±⟩.The single photon remains perfectly localized in the left edge state while the photon pair oscillates between the opposite edge states.Two rhombi are needed to obtain perfect geometric separation of the edge states.Note that, in the diamond lattice, the switching contrast is perfect: the 'OFF' state does not have any contribution at the output.However, in comparison to the three-site system discussed above, the switching time is longer as the chain is longer.Fig. 4(d) depicts the switching time dependence on the interaction strength.The switching time is decreasing with interaction, being proportional to The open operation of the switching with the diamond chain is shown in Fig. 5.In contrast to the closed operation, the open operation needs only a single rhombus.Furthermore, the switching is successful already if the photons enter from a single site, e.g.site 1, rather than the edge state.This is due to the fact that the site only overlaps with the edge state localized around the site, and the photon remains stuck.This is seen in Fig. 5(b) as an oscillation between site 1 and sites 2 and 3, while site 4 remains empty.With two photons, instead, the photons delocalize towards the right edge, where they enter the sink and exit the system.A noteworthy difference to the Stub unit cell behavior shown in Fig. 3 is that both photons exit the system and do not remain stuck in the localized states.This highlights that, in the presence of interactions, photons move in pairs from one localized state to another.The switching contrast is perfect, see Fig. 5(c).The switching time is inversely proportional to the interaction strength and the decay rate in the small U and γ limit, respectively, as shown in Figs.5(d) and (e).For large U and γ, the switching time increases with U and γ, thus the optimal t switch is found for theintermediate values.

IV. EXPERIMENTAL REALIZATION
Main limiting factors in the realizations of a switch are the accurate realization of the interacting models and the achievement of sufficiently large optical nonlinearities.Pioneering works on how to enhance photon-photon interactions for switching include the use of dipolar gases and Rydberg blockade [16,[56][57][58] as well as electromagneticinduced transparency [17,48,49,59] and ways to interface atoms with optical fibers [60,61].While extensive efforts have been made in the ultracold gases community, miniaturized on-chip realizations in all-optical devices are in high demand and are only emerging.The switching concept proposed in this work can be realized in all-optical systems that allow simulating the Bose-Hubbard physics with various interaction strengths in the two-photon limit.
In order to utilize tight-binding models based on the interference-localized state, small deviations from the exact flux condition have a detrimental effect on the single-photon states, as shown in Appendix C. Advances in the realization of synthetic fluxes have made possible to study and realize Aharonov-Bohm caging models in circuit-QED lattices [36][37][38]62], photonic lattices [42,44,63,64] and ultracold lattices [45,46,65,66], However, the requirement of a flux can be avoided by using e.g. the Stub unit cell lattice instead of the diamond chain.Nevertheless, a challenge with the Stub unit cell realization of the switch is to eliminate the hopping amplitude between the A and B sites, as illustrated further in Appendix C.However, the Stub unit cell is not sensitive to other hopping amplitude imperfections.
On one hand, control of single microwave photons in circuit-QED devices is already a standard, and Fock state photon dynamics have been observed in Bose-Hubbard models [38,62,67].On the other hand, various downconversion techniques exist for producing single photons in the optical domain and their performance is constantly improving [68,69].These techniques can be used to realize the single-photon-by-single-photon switch for example in cavity-QED arrays [70], coupled waveguides [71], or micropillar lattices [63,72].
In the long run, provided that the single-photon manipulation is within reach, the switching concept presented in our work could be attainable in photonic crystals at arbitrarily low interaction strengths.In fact, since the localized states strongly confine the single photons, the switching is successful at any interaction if the interactioninduced delocalization time is shorter than the lifetime of the photons in the system.Moreover, the single-particle hopping parameters and the lattice geometry can be freely tuned in micro-and nanostructured optical materials.Therefore these systems offer a promising and flexible platform for implementing the models for the all-optical switch based on single-particle localized states.Besides photonic systems, ultracold atoms in optical lattices [46,[73][74][75] can also implement the switch, as the dynamics of single atoms and interacting atom pairs can be observed and manipulated by a quantum gas microscope [76,77].
To estimate the reachable switching times, let us evaluate the Hubbard interaction parameter using state-of-theart Kerr non-linear refractive index values.The Hamiltonian corresponding to the Kerr nonlinearity has the same form of the interaction term in Eq. ( 5) and is given by χn(n − 1), where n is the input photon number operator at the Kerr non-linearity.The constant χ, equivalent to U/2 in Eq. ( 5), is given by [78] where ω is the angular frequency of the photons, χ (3) is the third-order non-linearity of the Kerr material, ϵ 0 is the permittivity of vacuum, ϵ r is the relative permittivity of the material, and V eff is the mode volume in the cavity.
The connection between the third-order non-linearity χ (3)  and the non-linear refractive index n 2 is given by n 2 = χ (3) /(ϵ r ϵ 0 c), where c is the speed of light.Non-linear refractive indexes up to n 2 = 10 −9 m 2 /W have been reported for GaAs/GaAlAs quantum wells [79] and graphidyne/graphene heterostructures [80].Using Eq. (11) with the value of the GaAs/GaAlAs quantum wells at λ = 1343 nm laser with relative permittivity of 13 [79] and mode volume V eff = λ 3 , we obtain χ ≈ 10 −3 eV.For the Stub lattice unit cell in the closed operation where t switch ≈ 1/U in Eq. ( 6), this translates into a switching time t switch ≈ 10 −12 seconds, i.e. in the order of picoseconds.This value is substantially faster than the rate of single-photon sources [68,69,81].Similar estimates for the switching time from the interaction U can be made for circuit QED and ultracold atom systems.

V. COMPARISON TO OTHER TYPES OF SWITCHES
The Mach-Zehnder interferometer (MZI) is a renowned switch concept based on the destructive interference between two different optical paths [82].Due to its widespread usage, we now compare our switch concept to the MZI one, and illustrate the key differences.
The core principle of the MZI relies in using a control beam of intensity I to induce a phase shift between two arms of the interferometer via Kerr nonlinearities.Such phase shift is quantified as ∆ϕ = kLn 2 I for light of wavevector k travelling along an arm of length L with nonlinear refractive index n 2 , relatively to the other arm.The switch is on when ∆ϕ = π, because the signal is not transmitted due to destructive interference.Conversely, when the control beam is off, no phase difference is acquired and the signal is transmitted.
There are fundamental limitations for operating a MZI switch in the few-photon limit with coherent light [83].In fact, the intensity fluctuations of coherent light, relative to the mean intensity, are significantly larger in the few-photon limit.These fluctuations have dramatic consequences on the phase matching and hence the switching mechanism [84].In the low mean photon-number limit, the non-linearity only allows for a phase-shift that is at maximum equal to the mean photon number [83,84].
The MZI switch could work in the few-photon limit with Fock states of light, provided that the necessary π phase shift is achievable.We now illustrate such principle, calculating the action of the MZI on Fock states.We model each stage of the MZI as quantum operators; the photon can either be in arm 1 or 2, and the corresponding annihilation operators are b1 and b2 .The beam-splitter is described by the unitary operator ) [84].The non-linear Kerr element operator is , where χ ′ = χL/ℏnc and χ is given by Eq. ( 11), n2 = b † 2 b2 and nc = b † c bc is the photon number operator of the control beam [84].The allowed Fock states are |1, 0, 0⟩ and |0, 1, 0⟩ for a photon in arm 1 and 2, respectively, when the control photon is absent.In the presence of the control photon, the states are |1, 0, 1⟩ and |0, 1, 1⟩ for a photon in arm 1 and 2, respectively.In the basis spanned by these four states, the beam-splitter operator B is represented by and similarly, the Kerr non-linearity operator is given by where the phase shift caused by the self-modulation terms χn 2 2 , χn 2 c is not included as it can be compensated by the other arm.The overall effect of the MZI, where the phase shift is 4χ = π, is given by the following operator By acting this operator onto the Fock states |1, 0, 0⟩ and |0, 1, 0⟩, the MZI switches the output paths, while in the presence of the control photon for |1, 0, 1⟩ and |0, 1, 1⟩, the output ports are the same, up to a phase.Since the evolution is necessarily conserving, one can treat one of the outputs as a scrap-collector while the other acts as the primal output of the switch.The remaining question is what would the required features of the Kerr non-linearity be to achieve the appropriate phase-shift.In the Kerr operator K given above, we have required the effective phase-shift ∆ϕ = 4χ ′ to be π.Using χ ≈ 10 −3 obtained above for the heterostructure material GaAs/AlGaAs with the high Kerr parameter n 2 = 10 −9 m 2 /W [79], the necessary length L = ℏncπ/(4χ) is in the order of millimetres.Such lengthscale represents, for state-of-the-art materials, a fundamental limit for on-chip all-optical switches based on MZI.
Both the MZI and the single-particle localized switch discussed in this work are based on using destructive interference, but in a different way.In the MZI, one uses light-light effective interaction to attain a relative phase between its arms that realizes a destructive interference.However, in the localized-state switch, the interactions are used to break the destructive interference that localized the photons.On one hand, due to the localization, even a weak non-linearity allows switching in the single-particle localized switch if the delocalization time is faster than the system-losses by other means, since the interaction time is limited only by the losses.On the other hand, in the MZI the interaction time is limited by the length of the bulk non-linear component and the speed of light, requiring instead large intensity and aligning of the control pulse with the signal to sufficient precision.These facts render the MZI at the single-photon limit unpractical with currently existing materials, while the localized state switch can be realized as such with circuit QED systems and microstructured optical materials, as discussed above.
Other types of single-photon switch discussed in the Introduction rely on different realizations of the photonphoton interaction, usually enhancing the effect by placing the non-linear system in an optical cavity.However, our proposed switch paradigm is not dependent on the particular realization of the photon-photon non-linearity but is more a way to use these non-linearities in an effective way.Instead of having a non-linear element in a cavity and increasing the interaction time, one can realize the localized states of the flat-band system and allow photons to delocalize in a controlled way by interaction.
Our proposed switch is inherently single-photon-bysingle-photon, since the input and the control signals can consist of no more than a single photon, respectively.If the signal or control beam consists of many photons, the interaction would delocalize them from the lattice, resulting in a false signal.Even if the interaction could be turned on or off by other means, the delocalization time-scale would be much longer for many particles, see Appendix D. With the Stub unit cell, the photons delocalize to the output but do not perform a full population oscillation.Similarly, the seven-site diamond chain with odd photon number does not show population oscillation, while the even photon numbers do to some extend.However, even partial delocalization would lead to successful switching in the open operation, but with the technical problem that a control photon is not anymore effective in operating the switch.At the classical limit of many photons, considered in Appendix E, the delocalization does not occur or occurs very weakly, depending on the model.

VI. CONCLUSION
In this article, we have introduced a switching concept based on the single-particle localization in a lattice by destructive interference with coincident delocalization of correlated two-particle state.In other words, single photons remain trapped in a part of the system while a pair delocalizes.The proposed switching concept is purely quantum mechanical and operates only at the quantum limit of few photons.One can either continuously extract the photons from outside the localized state via a sink, which we call the open operation of the switch, or one can wait for photons to geometrically separate from the initial state and collect them instantaneously, which we call the closed operation.
We have demonstrated the switching scheme using the minimal three-sites Stub unit cell model , and the diamond chain.Based on analytical two-level models, we have found expressions for the switching time in terms of the Rabi oscillation frequency of the two interacting photons between opposite edges.Furthermore, we have found that the 'ON' versus 'OFF' contrast in the Stub unit cell is limited, whereas it is perfect for the diamond chain.However, the contrast in the Stub unit cell can be improved by tuning a geometric parameter that increases the overlap of the localized state on the input site.
We discussed how to realize the switching concept in various experimental platforms and compared with existing switches at the single-photon limit.We have estimated the achievable switching times in photonic systems to be in the order of picoseconds.This estimate is at par with most of the existing all-optical single-photon switch proposals, being limited by the photon-production rate of the existing single-photon sources.Nonetheless, as most proposals use light of many photons either as the control or the signal, there are limited direct comparisons for our single-photon-by-single-photon switch concept.

Appendix A: Subspace projections of the two-photon Hamiltonian
In the simple lattice systems we are considering, the non-interacting two-particle eigenstates appear in degenerate sets separated from other states by finite energy gaps.For instance, the Stub unit cell has the single-particle eigenenergies E loc = 0 and E ± = ±t AC √ r 2 + 1, which result in two degenerate two-particle eigenstates |loc, loc⟩ and |+−⟩ and other states at separate energies.At the low interaction limit, to first order in the interaction, the dynamics can be understood by dividing the initial state to its various non-interacting two-particle eigenstate components and considering evolution of the components independently.

Schrieffer-Wolff transformation
The projection to a non-interacting Hamiltonian subeigenspace is accomplished by the Schrieffer-Wolff transformation.The following review is based on Ref. [85].Let us assume that the system Hamiltonian is written as Ĥ = Ĥ0 + ϵ Ĥpert for some non-perturbed Hamiltonian Ĥ0 and a perturbation Ĥpert .Furthermore, let us assume that we have a subspace of the unperturbed Hamiltonian Ĥ0 with a collection of eigenenergies separated from others by a gap ∆.We denote the projection to this subspace by P 0 (P 2 0 = P 0 , the subscript 0 is to differentiate from the projection with respect to the total Hamiltonian) and the projection to the orthogonal subspace by Q 0 = 1 − P 0 .Furthermore, for a general operator X in the Hilbert space, we define operators O( X) = P 0 XQ 0 + Q 0 XP 0 and D( X) = P 0 XP 0 + Q 0 XQ 0 , which give the components of the operator X between the orthonormal subspaces and within them, respectively.
The central result behind the Schrieffer-Wolff transformation is the existence of a one-to-one correspondence between unperturbed and perturbed states, and the subspaces they span, when ϵ|| Ĥpert || < ∆/2.Here || Ĥpert || is the norm of the perturbation operator defined as the maximal factor by which it scales the norm of a state it operates on.The result is physically intuitive: if the perturbation is small enough, it cannot mix the states belonging to the orthogonal subspaces separated by a larger energy than twice the perturbation.The one-to-one correspondence is given as a unitary transformation Û , called the Schrieffer-Wolff transformation, from perturbed to unperturbed subspace, such that the perturbed subspace Hamiltonian can be expressed exactly in the basis of the respective non-perturbed eigenstates by Oftentimes, the exact transformation Û is difficult to determine but one can express it using a perturbation expansion.It can be shown that the Schrieffer-Wolff transformation can be written as Û = exp(i Ŝ), where Ŝ is a block-off-diagonal, Hermitian operator, that is, Ŝ = O( Ŝ) and Ŝ † = Ŝ.One develops the perturbation series by expanding Ŝ as a power series Ŝ = n ϵ n Ŝn and utilizing Baker-Campbell-Hausdorff formula exp(A)B exp( ] denotes that the commutator of B with A is taken n times in succession.We obtain The operators Ŝn are solved recursively by putting Ŝ0 = 0 and demanding at every order of ϵ that the expression is block-diagonal.Block-diagonality means that the submanifolds are not mixed -the very requirement of the Schrieffer-Wolff transformation.The zeroth order satisfies the condition automatically.At the first order, we obtain i[ Ŝ1 , Ĥ0 ] + O( Ĥpert ) = 0 where by taking the matrix elements with respect to the Ĥ0 eigenbasis |n⟩, we find ⟨n| Inserting this expression back to the expansion, we have Ĥeff,1 = P 0 Ĥpert P 0 .Thus, the first order perturbation is just the perturbation Hamiltonian projected to the subspace.Similarly, we have Ĥeff,2 = 1 2 P 0 [i Ŝ1 , O( Ĥpert )]P 0 , which, represented in the basis of the subspace P 0 eigenstates, is where n ′ is summed over the orthogonal complement of the subspace P 0 .In this work, we do not use higher order than two terms but they can be obtained in a similar manner.

Two-particle basis
In a system with single-particle quantum numbers α (e.g.orbital, location in an array of sites or single-particle eigenstate index), the two-particle states can be labeled β bγ bδ is is a two-particle interaction term.By using the Wick's theorem, one finds the matrix elements of single-particle term as and for the interaction term as In the site basis bi , b † i , where i is a site in an array, we consider site-local interaction , whose matrix elements in the two-particle basis are It is useful to consider the interaction in the eigenbasis of the single-particle Hamiltonian instead, defined by bn = i V * in bi , where V in diagonalizes the single particle Hamiltonian matrix In this basis, we have which can be inserted in Eq. (A5) to obtain the twoparticle state matrix elements.
3. Effective two-particle models at small interactions a. Stub lattice unit cell In Sec.II A, we have seen that for small enough U , the interaction acts as a perturbation to the non interacting eigenstates, given by |loc, loc⟩ , |+, −⟩ at E = 0, |loc, ±⟩ at AB + 1, the states |+, −⟩ and |loc, loc⟩ describe a system, isolated from the other eigenstates, which remain stationary.The interacting Hamiltonian can be projected onto the subspace spanned by the two states |+, −⟩ and |loc, loc⟩ through the Schrieffer-Wolff transformation.In this way, we get the following effective two-level Hamiltonian ) where the energy off-set of the two states δ and the overlap between the states t 12 are (A8)

b. Single rhombus diamond chain
The eigenstates |L±, L±⟩, |L±, R±⟩ and |R±, R±⟩ are degenerate at energies E = ± √ 2t for + and −, respectively.Also, the states |L+, L−⟩, |R+, R−⟩, and |R±, L∓⟩ are degenerate with each other at the energy E = 0.One can directly show that the terms, which split a photon pair at an edge to two photons at the opposite edges are forbidden: In other words, the interaction allows only pairs to move from one edge to the another.Hence, at small interaction, Hamiltonian subspaces at E = ± √ 2t consists of two interaction-connected states |L±, L±⟩ and |R±, R±⟩ and a single interaction-disconnected state |L±, R±⟩ .Similarly, the subspace at E = 0 is formed by two mutually independent two-level systems: pairs of photons at the same edge: |L+, L−⟩ and |R+, R−⟩, and at the opposite edges: |L+, R−⟩ and |L−, R+⟩ .The effective two-level projections of the interaction Hamiltonian onto these subspaces are given by and The single-particle eigenstates |L ± L±⟩ and |R ± R±⟩ are degenerate similar to the single-rhombus system, forming an effective two-level system at small interactions.Since these states do not overlap directly, we need to calculate the second-order term in the Schrieffer-Wolff transformation to obtain an effective Hamiltonian.We note that, despite the state |L±, R±⟩ being degenerate with |L ± L±⟩ and |R ± R±⟩, the former is disconnected from the latter two states, because the interaction prevents splitting of the photon pair.The projected Hamiltonian is (A10)

Large interaction limit of two-particle lattice model
Let us assume a lattice model with hopping elements The two-particle eigenstates of the Hubbard term are the states |ij⟩ where one particle is at the site i and another at the site j with energy E = U i δ ij .If the interaction is large in comparison to the hopping, we utilize the Schrieffer-Wolff transformation as in Appendix A 1 to project to the subspace spanned by states |ii⟩, consisting of a doublon [85,86].Importantly, we observe that ⟨ii| Ĥ0 |ij⟩ = √ 2t ij , where the factor √ 2 arises due to normalization.The terms between different |ii⟩, up to first order in Ĥ0 , vanish since they require two-particle operations whereas there are single-particle terms.The second-order terms in the projection are At the lowest finite order, the Hamiltonian projected to the doublon states is the hopping Hamiltonian with modified hopping amplitudes and additional on-site potential.
a. Stub unit cell In the limit of large interaction, the hopping is a perturbation to the interaction Hamiltonian eigenstates.The interaction Hamiltonian for the three-site system has two sets of three degenerate eigenstates: |AA⟩ , |BB⟩ and |CC⟩ at energy E = U and |AB⟩ , |AC⟩ and |BC⟩ at E = 0.The Hamiltonian of the full system can be projected to the subspace spanned by on-site pairs by using the second order Schrieffer-Wolff transformation.Assuming further that U ≫ |r AB t AC | ≫ t AC , one obtains the effective two-state model In Eq. (A13) the energy off-set of the two states δ and the overlap between the states t 12 are At large interaction, a two-particle doublon moves in a lattice with the same geometry as the original one, but with modified hopping amplitudes J → 2J 2 /U and onsite energies ϵ i = j 2J 2 /U .While the on-site energies do not have any significant effect, the hopping amplitudes become real and positive so that the flux condition is lost.The system has degenerate single-particle eigenstates that are localized on the opposite corners.

Closed-operation switching time from two-state model dynamics
With the localized states, we oftentimes find that the non-interacting two-photon states form collections of (nearly) degenerate states.In this work, especially two-state behavior is found to be prominent.Here we repeat the standard two-state system calculation in order to introduce our notation and for easy reference.
Let us consider a two-level system spanned by states |1⟩ and |2⟩ with Hamiltonian whose eigenenergies are where we have defined the 'detuning' δ = ϵ 2 − ϵ 1 and the Rabi frequency Ω = (δ/2) 2 + |t 12 | 2 .We label the eigenstates by |+⟩ , |−⟩ for the plus and minus energy, respectively.The eigenstates components (α ± , β ± ) are obtained as and Let us assume that at time t = 0, the system is in the state |1⟩.General time dependence is given by The switching time can be extracted from the dynamics by noting that the Rabi oscillation separates photons from the input to the output.In other words, the switching time is the half-period of the Rabi oscillation t switch = π/2Ω.

a. Stub unit cell
At small interaction, the effective two-level model for Stub unit cell, given by Eq. (A7), results in the Rabi frequency Ω = 3/2U r 2 AB /(1 + r 2 AB ) 2 .The half-period of the oscillation gives the switching time The Rabi frequency of two-state model for Stub lattice unit cell at large interaction Eq. (A13) is Ω = 3 2 t 2 AC /U , which sets the switching time at large interactions shown in Fig. 2 (f) of the main text.In contrast to the small interaction limit, the switching time at large interactions depends on the single-particle hopping amplitude t AC but does not depend on the ratio r AB .
Combining the observations on the interaction strength dependence of the switching time, we see that the switching time is optimal around an intermediate U , the optimal value being dependent on r AB .
b. Single-rhombus system with π flux Solving this model with the initial state |AA⟩ leads to density time-evolution n A (t) = cos 4 (2J 2 τ /U ), n D (t) = sin 4 (2J 2 t/U ), and n B (t) = n C (t) = sin 2 (2J 2 t/U ) cos 2 (2J 2 t/U ).The oscillation of particledensity between the opposite edges is Rabi-like but with fourth-order sine and cosine functions.This dynamics was considered in Ref. [38] for a circuit QED experiment, where simulations agree with our results.

Open operation switching time from two-state model with losses
Let us consider the aforementioned two-level system with an additional third level |3⟩ into which the state |2⟩ decays according with a decay constant γ.The Hamiltonian is represented by the matrix in such basis by and, similarly, the jump operator describing the decay is The Lindblad master equation for the density matrix ρ is The Hamiltonian term is where δ = ϵ 1 − ϵ 2 .The Lindblad term is (A28) From these equations, we note that the terms ρ 13 , ρ 31 , ρ 23 , and ρ 32 will remain zero if they are initially zero.The equations for the remaining density matrix elements can be expressed in terms of the Liouville-Fock space consisting of vector representations of the density matrices ρ .= (ρ 11 , ρ 12 , ρ 21 , ρ 22 , ρ 33 ) T .The Lindblad equation can be represented in this basis by the matrix equation d dt ρ = Lρ, where a. Large γ limit In the limit γ ≫ Ω, one can neglect the ρ 22 term since it decays fast and is initially zero.Similarly, we see from the above equation that (assuming t 12 to be real for simplicity, but similar argument can be made in general) dRe(ρ 12 )/dt = δIm(ρ 12 ) − γ/2Re(ρ 12 ) and accordingly, due to the fast decay and small source term, Re(ρ 12 ) will remain negligible since we assume that ρ 12 (t = 0) = 0. .(A30) The sawtooth lattice belongs to the class of flat band systems where the tight-binding hopping amplitudes are purely positive while the destructive interference is due to the eigenstate itself having relative phases from one site to another.Its three-site version is among the threesite models with localized states considered in Sec.II.In general, the sawtooth lattice comprises of unit cells with two sites, labeled A and B, in a sawtooth formation as shown in Fig. 6 (a).If the direct hopping B sites vanishes and if t AB = √ 2t AA , the system possesses localized states.As a finite-size effect, the chain contains exponentially localized edge states, which become perfectly localized if one adds an edge potential V B = t AA on the edge A sites of the system.
If we use the sawtooth lattice flat-band condition t AB = t BC = √ 2t AC in Eq. ( 2), we find that ϵ A = t AC , which is the boundary potential resonance condition [87].Indeed, Eq. ( 4) gives E loc = 2t AC , the flat band energy.The localized eigenstate is Assuming ϵ C = t AC for symmetry, we find E ± = ±2t AC , while the eigenvectors are , 1) T /2. Figure 6 presents the switching dynamics of the sawtooth lattice with three and five sites.In both cases, one observes similar population oscillation between the opposing edge sites of the system as we observed for the Stub unit cell and the diamond chain.The limiting feature is observed in the Fig. 6 (b): the single-photon dynamics starting from the initial state with the photon the site 1 causes significant part of the population to delocalize, which is unwanted.This cannot remedied in other ways than what we essentially have done with the Stub lattice, that is, to optimize the hopping parameters to localize the left edge state more on the input site.Another mitigation could be to initialize the system in the edge state rather than edge site, which might be difficult in experiments due to relative phases of the edge state.However, the population oscillation to the opposite edge is not perfect even at this case.
The oscillatory nature of the two-photon dynamics hint that one can understand the system by projecting to a subspace of the single-particle Hamiltonian eigenstates at small interaction or the interaction eigenstates at the large interaction.In the sawtooth, the non-interacting two-particle states are |loc, loc⟩, |loc, +⟩, and |++⟩ at E = 4t AC , |loc, −⟩ and |+−⟩ at E = 0 and |−−⟩ at E = −4t AC .Gathering these results in a matrix, and assuming uniform interaction, we can project the Hamiltonian onto the basis |++⟩ , |+loc⟩ , |loc, loc⟩ and obtain We have three states where two are approximately degenerate while the third one is off-set.This explains why the observed dynamics is more complicated in comparison to the diamond chain and the Stub unit cell, where one could understand the dynamics with a two-state model.However, one can extract the approximate switching time by considering the pair of states with equal diagonal elements, |++⟩ and |loc, loc⟩ to obtain the Rabi frequqency.The large-interaction limit of the dynamics follows similarly.and 4).On obtains the flat-band condition of the lattice by putting tAB = √ 2tAA.Furthermore, the edge-states localize if one sets the boundary potential VB = tAA at the edge sites.In the following, time is in units of 1/tAA.The photon numbers are also normalized to 1. Panels (b) to (h) show the dynamics of a three-site sawtooth ladder (i.e., a triangle) with sites 1, 2, and 3, with VB at sites 1 and 3; panels (i) and (j) consider the complete system shown in panel (a).Panel (b) shows the single-photon dynamics starting at the site 1, showing partial delocalization to the site 3.The interaction is chosen as U = tAA and photons are initially at the site 1.Population oscillation with some high-frequency noise occurs.Panels (e) and (f) show the same dynamics as (c) and (d) but with photons initially in the localized left-edge state, which reduces the high-frequency noise.Panels (g) and (h) show the large interaction two-photon dynamics at U = 10tAA starting with photons at site 1, but otherwise same parameters as panels (c) and (d).The oscillations have higher amplitude and occur at faster frequency than at the smaller interaction.Panels (i) and (j) show the two-unit cell dynamics with the same parameters and setting as panels (c) and (d).The population oscillation frequency is decreased., and (c), the flux is put to 0.93π, 0.95π, and 0.98π, respectively, assuming single photon initially at the left edge state.One observes similar oscillations between the two edges as with finite interaction with two photons.Panel (d) shows the two-photon dynamics at 0.95π flux at U = J, which, together with Fig. 3, shows that the imperfection on the flux does not have effect on the interaction if the interaction delocalization time is faster than the flux off-set delocalization time.Panels (e)-(h) demonstrate the effect of having hopping between A and B sites of the Stub unit cell at rAB = −5.Panel (e) shows the effect on the single particle dynamics of tAB = 0.1tAC, the effect being small oscillations in the populations but not increasing the average zero-photon probability.Panels (f), (g), and (h) show the effect of tAB = 0, 0.05tAC, 0.1tAC on the two-photon dynamics.At small tAB the effect is very minute while suddenly at 0.1tAC the maximal probability of finding particles on the sites B and C reduces significantly.two-photon case, is not present.Nevertheless, the photon number fluctuations over time increase with photon number.
For the diamond chain, the oscillatory dynamics of photons moving together from an edge to the opposite one is observed for even photon number, while the odd photon number resembles the Stub unit cell shown above.However, the time-scale of the oscillation is substantially longer than with the two-photon oscillations.
The difference between the diamond chain and Stub unit cell and the is that the former strictly allows only pair movement while in the latter single-particle processes can occur due to the presence of non-localized states.This, explains the diamond chain odd photon number different behavior.
The dynamics observed at the multiphoton initial states would allow switching since part of the photons can be found at the output sites of the systems.Also, the delocalization time is quick.However, switching is difficult to arrange with more than one photon signal due to the fact that if there are multiple photons, they tend to delocalize even without the control photon.Thus, one would need to device another way to control the switch e.g.turn the interaction on and off, which is not experimentally practical.Another issue for the closed operation of the switching is the large fluctuations of the expected photon number over time, so one would need to be very precise when to deplete the system.This would not, however, be a problem in the open operation of the switch.The panels (e)-(h) present the 3, 4, 5, and 6 particle dynamics on the two-rhombi diamond chain.For the Stub unit cell we find that the coherent population oscillatory dynamics observed with two photons is not present.However, part of the photons delocalize: the photon number fluctuations seem to increase with photon number.In the case of the diamond chain, we find that the odd particle number does not result in particle oscillation from an edge to another while the even photon number does. Figure 9. Closed-operation dynamics in the classical limit.The interaction does not delocalize the states at all in the either of the initial state configurations of the diamond lattice.For the sawtooth and stub lattices, the delocalization is exponential, resulting in a weak signal at the right edge.

Figure 2 .
Figure 2. Switching in the closed operation with the Stub unit cell.(a) The Stub unit cell, where A is the input site, and B and C are the output sites.The single-particle eigenstates |loc⟩ and |±⟩ are also represented, with the sizes of the filled circles corresponding to the relative sizes of the wavefunciton amplitudes.(b) The site-resolved normalized particle number as function of time with two and one initial photon at the input site respectively in the upper and lower panel.Single photon remains stuck in the localized state but the interacting photon pair undergoes a Rabi-type oscillation between the input and the output sites.Parameters are rAB = −5 and U = tAC.(c) The probability to observe n = {0, 1, 2} photons at the output sites with respect to time.Parameters as in (b).(d) The probability of finding one or two photons at the output sites at time t switch in the 'ON' and 'OFF' state with respect to rAB for U = tAC (upper panel), and the switching contrast, defined as the 'ON' versus 'OFF' signal (lower panel).(e) The switching time t switch with respect to the ratio rAB at U = tAC .(f) The interaction strength U dependence of t switch at rAB = −5.

Figure 3 .
Figure 3. Switching in the open operation with the Stub unit cell.(a) The switch input is at site A and the output is at site C with losses γ.(b) The site-resolved normalized particle number with two (upper panel) and one (lower panel) initial photons at the input site with respect to time.Parameters are: γ = 0.1tAC, rAB = −5 and U = tAC.(c) The probability to observe n = {0, 1, 2} photons in the system for one (upper panel) and two (lower panel) photons with respect to time.Parameters are the same as in (b).(d) The switching time with respect to the interaction strength U .We define t switch as the time after which the probability to observe two particles in the system is below a certain threshold ϵ = 10 −3 .Parameters are as in (b).(e) Switching time and the 'ON' versus 'OFF' contrast as a function of rAB.(f) The switching time dependency on the decay rate γ.

Figure 4 .
Figure 4. Closed operation of the switch with a diamond chain.(a) The diamond chain, consisting of two rhombi with a π flux.We show the bulk eigenstates |±⟩ and |0⟩ with energies E± = ±2J and E0 = 0, respectively, while the edge states |L/R±⟩ have energies E L/R± = ± √ 2J.(b) The site-resolved normalized particle number with two (upper panel) or one (lower panel) initial photons at the left edge state |L±⟩ .Here U = J.(c) The probability of finding n = {0, 1, 2} photons at the right edge, consisting of sites 5, 6, and 7, over time.Parameters are the same as in panel (b).(d) The interaction strength U dependence of the switching time t switch .One sees monotonous decrease with increasing U .

Figure 5 .
Figure 5.The open operation of the switch with a single rhombus of the diamond chain.(a) The site 1 acts as the input, and the site 4 as the output, where the sink with decay rate γ is located.(b) The site-resolved normalized particle number with two (upper panel) and one (lower panel) initial photon at the input site with respect to time.Here U = γ = J.(c) The probability to observe n = {0, 1, 2} photons in the system with respect to time for two initial photons (upper panel) and one initial photon (lower panel).(d) The switching time t switch dependence on the interaction strength U .The threshold is set at ϵ = 10 −3 .(e) The decay rate γ dependence of the switching time.

Figure 6 .
Figure 6.Switching using the sawtooth lattice.(a) The sawtooth lattice consists of sites of type A (1, 3, and 5) and B (2,and 4).On obtains the flat-band condition of the lattice by putting tAB = √ 2tAA.Furthermore, the edge-states localize if one sets the boundary potential VB = tAA at the edge sites.In the following, time is in units of 1/tAA.The photon numbers are also normalized to 1. Panels (b) to (h) show the dynamics of a three-site sawtooth ladder (i.e., a triangle) with sites 1, 2, and 3, with VB at sites 1 and 3; panels (i) and (j) consider the complete system shown in panel (a).Panel (b) shows the single-photon dynamics starting at the site 1, showing partial delocalization to the site 3.The interaction is chosen as U = tAA and photons are initially at the site 1.Population oscillation with some high-frequency noise occurs.Panels (e) and (f) show the same dynamics as (c) and (d) but with photons initially in the localized left-edge state, which reduces the high-frequency noise.Panels (g) and (h) show the large interaction two-photon dynamics at U = 10tAA starting with photons at site 1, but otherwise same parameters as panels (c) and (d).The oscillations have higher amplitude and occur at faster frequency than at the smaller interaction.Panels (i) and (j) show the two-unit cell dynamics with the same parameters and setting as panels (c) and (d).The population oscillation frequency is decreased.

Figure 7 .
Figure 7. Sensitivity to parameter imperfections.Panels (a)-(d) demonstrate the effect of having off-set from the π-flux condition at the two-rhombi diamond chain.On panels (a), (b), and (c), the flux is put to 0.93π, 0.95π, and 0.98π, respectively, assuming single photon initially at the left edge state.One observes similar oscillations between the two edges as with finite interaction with two photons.Panel (d) shows the two-photon dynamics at 0.95π flux at U = J, which, together with Fig.3, shows that the imperfection on the flux does not have effect on the interaction if the interaction delocalization time is faster than the flux off-set delocalization time.Panels (e)-(h) demonstrate the effect of having hopping between A and B sites of the Stub unit cell at rAB = −5.Panel (e) shows the effect on the single particle dynamics of tAB = 0.1tAC, the effect being small oscillations in the populations but not increasing the average zero-photon probability.Panels (f), (g), and (h) show the effect of tAB = 0, 0.05tAC, 0.1tAC on the two-photon dynamics.At small tAB the effect is very minute while suddenly at 0.1tAC the maximal probability of finding particles on the sites B and C reduces significantly.

Figure 8 .
Figure 8. Multiphoton dynamics.The panels (a)-(d) present the time-evolution of 3, 4, 5, and 6 particle dynamics on the Stub unit cell, starting from all the photons on the A site, labeled site 1.The panels (e)-(h) present the 3, 4, 5, and 6 particle dynamics on the two-rhombi diamond chain.For the Stub unit cell we find that the coherent population oscillatory dynamics observed with two photons is not present.However, part of the photons delocalize: the photon number fluctuations seem to increase with photon number.In the case of the diamond chain, we find that the odd particle number does not result in particle oscillation from an edge to another while the even photon number does.
Effectively, we are left with two real variables, ρ 11 and Im(ρ 12 ) with equations