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

Ville A. J. Pyykkönen  Department of Applied Physics, Aalto University School
of Science, FI-00076 Aalto, Finland  Grazia Salerno  Department of Applied
Physics, Aalto University School of Science, FI-00076 Aalto, Finland  Jaakko
Kähärä  Department of Applied Physics, Aalto University School of Science,
FI-00076 Aalto, Finland  Institute for Atmospheric and Earth System
Research/Physics, Faculty of Science, University of Helsinki, FI-00014
Helsinki, Finland  Päivi Törmä<EMAIL_ADDRESS>Department of Applied
Physics, Aalto University School of Science, FI-00076 Aalto, Finland

###### Abstract

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.
Non-linear elements in an optical cavity can confine light and prolong the
interaction time, allowing for larger effective photon-photon coupling.
Examples of such cavity systems realising switching of many-photon light beams
using only few control photons include organic molecules [5, 6], rubidium-87
atoms [7, 8, 9], quantum dots [10, 11, 12, 13], and ultracold Rydberg or
Cesium atoms [14, 15, 3]. Switching a single-photon signal with a control
light made of many photons is a complementary challenge, which can be realized
for instance by exciton depletion at semiconducting quantum dots [16] and for
single-photon transport of transmission-line-resonator arrays [17]. Switching
a single-photon signal with a single control photon represents a fundamental
quantum limit, which has been proposed using a cavity QED system [18].

We approach single-photon-by-single-photon switching using the concept of
interference-induced single-particle localization, which has received interest
in recent years in the context of flat bands [19]. 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 interaction can allow propagation of many-particle
states while single particles remain localized [19, 20, 21, 22], which can
lead to superconductivity in flat band systems [23, 24, 25, 26, 27].

The interference-localized states are also at play in the context of Aharanov-
Bohm cages, where the (artificial) magnetic flux localizes the single
particles and leads to the emergence of a flat dispersion. The dice lattice
[28] and the diamond chain [29] are examples of Aharonov-Bohm cages that have
been realized in superconducting nanowires [30], circuit lattices [31, 32] and
also in photonic lattices [33, 34, 35].

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. Such a switch is inherently all-optical at the
single-photon-by-single-photon limit and has no classical counterpart. Figure
1 illustrates the concept using a three-site model. The signal photon enters
the system and remains localized in a state around the input site. If also a
control photon is present, the photon pair can delocalize due to interaction.
Thus, the presence of a control photon represents the ’ON’ state of the
switch. In contrast, in the absence of the control photon, the signal photon
remains trapped in the localized state, representing the ’OFF’ state of the
switch. Furthermore, depending on the physical realization, the switch can be
operated either in open or in closed mode. In the open mode, a sink is
introduced in order to output the photons. In the closed mode, the photons are
geometrically separated from the initial state by the closed dynamics of the
system. The photons can be collected once the maximal separation is reached.

The switch is described with a Bose-Hubbard model. In the open mode of the
switch, the dissipation through a sink is modeled by a Lindblad master
equation. The time-evolution of the system is solved using exact
diagonalization. We demonstrate the switching operation using the unit cell of
a Stub lattice and a diamond chain, notable models offering localized single-
particle states with alternative advantages.

The proposed switch operates inherently at the single-photon-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. We demonstrate that the switch does not work in the classical
(mean-field) level. We show that the switching can be realized in principle at
arbitrarily small interaction strengths between photons at the cost of
increasing the switching time. For a given single-particle model, the
switching time is optimized when the interaction is at the order of the
single-photon hopping amplitude. Given the present Kerr-type nonlinearities
for photons 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 three-site 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. In order to illustrate the
generality of the switching concept, Sec. III illustrates the switch by the
means of the diamond chain, which is known for its Aharonov-Bohm cages. In
Sec. IV, we discuss simple theoretical models to understand the switch
dynamics and give expressions for the switching time and contrast at various
limits. Section V discusses potential experimental platforms to realize the
switching concept. In Sec. VI, we compare the switch to non-linear Mach-
Zehnder interferometer and other switching paradigms. We discuss the results
and conclude in Sec. VII.

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 $\gamma$. Empty circles denote empty
sites while filled circles correspond to photon presence. The three-site
system has a single-particle state localized around the A site. In the absence
of the control photon, the signal photon is captured in the localized state,
as shown in the left column representing the ’OFF’ state. In the presence of a
control photon, the two photons can delocalize together due to interactions
and propagate through, as shown in the right column representing the ’ON’
state. The first row represents the input of the switch while the second and
third rows depict the output in the closed and open operation, respectively.

##  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 three-site model, shown in Fig. 1 with sites labeled A, B and C, is

$\hat{H}_{0,\mathrm{three\leavevmode\nobreak\
site}}=\sum_{ij}H_{0,\mathrm{three\leavevmode\nobreak\
site},ij}\hat{b}_{i}^{\dagger}\hat{b}_{j}\leavevmode\nobreak\ ,$ (1)

where $\hat{b}_{i},\hat{b}_{i}^{\dagger}$ are annihilation and creation
operators of particles at sites $i\in\\{\mathrm{A,B,C}\\}$ and the matrix is

$H_{0,\mathrm{three\leavevmode\nobreak\
site}}=\begin{pmatrix}\epsilon_{\mathrm{A}}&-t_{\mathrm{AB}}&-t_{\mathrm{AC}}\\\
-t_{\mathrm{BA}}&\epsilon_{\mathrm{B}}&-t_{\mathrm{BC}}\\\
-t_{\mathrm{CA}}&-t_{\mathrm{CB}}&\epsilon_{\mathrm{C}}\end{pmatrix}\leavevmode\nobreak\
.$ (2)

Without loss of generality, we set $\epsilon_{B}=0.$ Firstly, we see that
single-site localization, for instance at the A site, yields disconnected
sites, i.e. $t_{\mathrm{BA}}=t_{\mathrm{CA}}=0$. We demand that the eigenstate
with two-site localization is of the form
$\ket{\mathrm{loc}}\doteq(\alpha_{\mathrm{loc}},\beta_{\mathrm{loc}},0)$,
obtaining three concurrent determinant equations that are satisfied for a non-
trivial solution by having

$\epsilon_{\mathrm{A}}=t_{AB}\left(\frac{t_{\mathrm{BC}}}{t_{\mathrm{AC}}}-\frac{t_{\mathrm{AC}}}{t_{\mathrm{BC}}}\right)\leavevmode\nobreak\
.$ (3)

The localized state energy $H_{0,\mathrm{three\leavevmode\nobreak\
site}}\ket{\mathrm{loc}}=E_{\mathrm{loc}}\ket{\mathrm{loc}}$ is

$E_{\mathrm{loc}}=\frac{t_{\mathrm{AB}}t_{\mathrm{BC}}}{t_{\mathrm{AC}}}\leavevmode\nobreak\
.$ (4)

Furthermore, the respective amplitudes of the localized state on the sites A
and B fulfill the condition

$r_{\mathrm{AB}}\equiv\frac{\alpha_{\mathrm{loc}}}{\beta_{\mathrm{loc}}}=-\frac{t_{\mathrm{BC}}}{t_{\mathrm{AC}}}\leavevmode\nobreak\
,$ (5)

where we have defined the ratio $r_{\mathrm{AB}}$. Similar processes to
construct localized states are used in flat-band lattice construction [36].
Destructive interference on a three-state system is also behind the formation
of dark states in the context of electromagnetically induced transparency
[37].

This simple general model contains notable solutions. The unit cell of the
Stub lattice is obtained by setting $\epsilon_{\mathrm{A}}=0$ and
$t_{\mathrm{AB}}=0$, that is, direct connection between the sites A and B is
cut. The localized state energy also vanishes $E_{\mathrm{loc}}=0$. This case
and its eigenstates are illustrated in Fig. 2 (a). Furthermore, the unit cell
of the sawtooth lattice [38] is obtained by setting
$\epsilon_{A}=t_{AC}=t_{AB}/\sqrt{2}=t_{BC}/\sqrt{2}$ and is considered in the
Appendix B. Importantly, one is able to achieve localized states with purely
positive hopping amplitudes and without on-site potential differences between
sites. In these solutions, the localizing destructive interference occurs due
to relative phases of the state amplitudes rather than the phases in the
hopping amplitudes.

In the following, we demonstrate the switching by the Stub unit cell due to
its simplicity, positive hoppings and zero on-site energies. Furthermore, we
will see below that it offers tunability by the ratio $r_{\mathrm{AB}}$
between the amplitudes of the sites A and B in the localized state. The
sawtooth lattice is discussed in Appendix B.

Figure 2: Switching in the closed mode 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 are also represented, with the sizes of the filled
circles corresponding to the relative sizes of the wavefunciton amplitudes.
The localized state $\ket{\mathrm{loc}}$ has energy $E=0$ and two delocalized
states $\ket{\pm}$ have energies $E=\pm
t_{\mathrm{AC}}\sqrt{r_{\mathrm{AB}}^{2}+1}$. (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. 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
$r_{\mathrm{AB}}=-5$ and $U=t_{\mathrm{AC}}$ (c) The probability to observe
$n=\\{0,1,2\\}$ photons at the output sites with respect to time. The
switching time $t_{\mathrm{switch}}$ is given by the time when
$P_{1+2}^{\mathrm{B+C}}$ is maximum, i.e. at half-period of the Rabi
oscillation. Parameters are the same as in (b). (d) The probability of finding
one or two photons at the output sites at time $t_{\mathrm{switch}}$ in the
’ON’ and ’OFF’ state with respect to $r_{\mathrm{AB}}$ for
$U=t_{\mathrm{AC}}$. (e) The switching time $t_{\mathrm{switch}}$ with respect
to the ratio $r_{\mathrm{AB}}$ at $U=t_{\mathrm{AC}}$ . (f) The interaction
strength $U$ dependence of $t_{\mathrm{switch}}$ at $r_{\mathrm{AB}}=-5$. The
theory lines in (d)-(f) are based on simple models of the dynamics and are
explained in Sec. IV.

###  II.1 The closed dynamics

We model the system by a tight-binding Bose-Hubbard model with on-site
interaction

$\hat{H}=\sum_{i}\epsilon_{i}\hat{n}_{i}-\sum_{ij}t_{ij}\hat{b}_{i}^{\dagger}\hat{b}_{j}+\sum_{i}U_{i}\hat{n}_{i}(\hat{n}_{i}-1)/2\leavevmode\nobreak\
,$ (6)

where $i$ labels the lattice sites,
$\hat{n}_{i}=\hat{b}_{i}^{\dagger}\hat{b}_{i}$ are the number operators on
sites $i$, $\epsilon_{i}$ are the on-site energies, $t_{ij}$ are the hopping
amplitudes between sites, and $U_{i}$ are the on-site interaction strengths.

The closed dynamics of the switch is demonstrated with the Stub unit cell in
Fig. 2. The switch input is located at site A while the output is comprised of
the B and C sites. Figures 2 (b) and (c) show the dynamics starting from an
initial state with either a single photon or a photon pair located at the
input site. While the single photon remains confined, the photon pair
oscillates between the input and the output sites. The half-period of the
oscillation defines the switching time $t_{\mathrm{switch}}$.

Figures 2 (d)-(f) describe the switching time $t_{\mathrm{switch}}$ and the
switching contrast dependence on the system parameters. The limiting feature
of the Stub unit cell is that the localized state is not perfectly situated at
the A site, which is impossible without disconnecting the A site from the
others. However, the issue can be mitigated with increasing the ratio
$r_{\mathrm{AB}}$, that is by increasing $t_{BC}$ while keeping $t_{AB}$
constant. This has the effect to focus the localized eigenstate more on the A
site than the B one, which in turn increases the ON versus OFF output signal
contrast, since the overlap of the initial state with non-localized states
becomes smaller. However, also the switching time $t_{\mathrm{switch}}$
increases with increasing $r_{\mathrm{AB}}$. Furthermore, the maximal output
probability at the ’ON’ state is bound from above at large $r_{\mathrm{AB}}$
due to imperfect geometrical separation by the population oscillation. We see
that the switching time $t_{\mathrm{switch}}$ is optimal for intermediate
values of the interaction $U\approx t_{\mathrm{AC}}$. The parameter
dependencies are thoroughly analyzed in Sec. IV.

###  II.2 The open dynamics

The open dynamics is modelled with a Lindblad master equation

$\dot{\hat{\rho}}=-\frac{i}{\hbar}[\hat{H},\hat{\rho}]+\sum_{n}\gamma_{n}\left(\hat{L}_{n}\hat{\rho}\hat{L}_{n}^{\dagger}-\frac{1}{2}\left\\{\hat{L}_{n}^{\dagger}\hat{L}_{n},\hat{\rho}\right\\}\right)\leavevmode\nobreak\
,$ (7)

where $\hat{L}_{n}$ are the ladder operators and $\gamma_{n}$ are the rates
corresponding to the connection to an external reservoir. We will focus on
having a sink on the site C of the system, in which case
$\hat{L}=\hat{b}_{\mathrm{C}}$ and $\gamma$ is the decay rate. The open
operation of the Stub unit cell switch is illustrated in Fig. 3. In contrast
to the closed operation, the output of the open operation is at the sink site
C, while the input is at site A as before, as shown in Fig. 3 (a). Example of
the dynamics of the system are shown in Fig. 3 (b) and (c), starting with the
photons at the input site A. Similarly to the closed dynamics, the single
photon remains confined mostly around the A site and slightly at B, see lower
panel in Fig. 3 (b). The contribution at the C site is small, resulting in a
very small probability of the photon entering the sink in the absence of the
control photon. In contrast, a pair delocalizes due to the interaction and
ends up at the sink site with finite probability, thus depleting the system,
as shown in the upper panel in Fig. 3 (b). The two-particle probability goes
to zero over time in Fig. 3 (c). The switching time $t_{\mathrm{switch}}$ is
defined as the time it takes for a photon to exit the system with probability
above a certain threshold $1-\epsilon$, with $\epsilon=10^{-3}$. While the
two-photon probability depletes, the single-photon probability plateaus due to
the possibility of a photon remaining stuck in the localized state.

In contrast to the closed case, the success of the switching, that is, 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_{\mathrm{AB}}$ to focus the initial state to the localized state. In fact,
we observe that the ’ON’ versus ’OFF’ contrast increases with increasing
$r_{\mathrm{AB}}$, however at the price of increasing $t_{\mathrm{switch}}$,
as illustrated in Fig. 3 (e).

The dependence of the switching time on the interaction strength $U$, the
ratio $r_{\mathrm{AB}}$, and the decay rate $\gamma$ are shown in Figs 3 (d),
(e) and (f), respectively. The switching time is inversely proportional to
$U^{2}$ at small interactions, and directly proportional to $U^{2}$ at large
interactions. Thus, similarly to the closed switch operation, the optimum is
in the intermediate interaction range. The $r_{\mathrm{AB}}$ dependence on the
switching time increases more steeply than in the closed case. With respect to
the decay rate, the switching time is optimized at some intermediate values:
as expected at the small $\gamma$, the switching time decreases inversely
proportionally to $\gamma$ but increases at larger values since the losses
effect the dynamics. A deeper understanding to the found behavior is given
below in Section IV.

Figure 3: Switching in the open mode with the Stub unit cell. (a) The switch
input is at site A and the output is at site C with losses $\gamma$. (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. Here
$\gamma=0.1t_{\mathrm{AC}}$, $r_{AB}=-5$ and $U=t_{\mathrm{AC}}$. (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 $t_{\mathrm{switch}}$ with respect to
the interaction strength $U$, defined as the time after which the probability
to observe two particles in the system is below a threshold
$\epsilon=10^{-3}$. The other parameters are as in (b). (e) Switching time and
the ’ON’ versus ’OFF’ contrast of the switch with respect to
$r_{\mathrm{AB}}$. (f) The switching time $t_{\mathrm{switch}}$ dependency on
the decay rate $\gamma$. The theory predictions on panels (d)-(f) are
explained in Sec. IV.

##  III Switching with the Diamond chain

We now consider the diamond chain with a synthetic $\pi$ flux, which is a
notable model that has been extensively studied for Aharonov-Bohm caging [33,
34, 35, 39, 40, 31]. The diamond chain is illustrated in Fig. 4 (a) together
with its eigenstates. It contains subsequent rhombi or ’diamonds’. When a
$\pi$ flux is inserted through the rhombi, the system supports only purely
localized eigenstates. This occurs because the $\pi$ flux is equivalent to
perfect destructive interference between the two paths of a particle from the
pivot site to the next one in the rhombus. The bulk eigenstates are
$\ket{\pm}$ and $\ket{0}$, with energies $E=\pm 2J$ and $E=0$ respectively,
where $J$ is the hopping amplitude between the sites in the chain. These bulk
states are known as the Aharonov-Bohm cage states. In addition, due to finite
length of the chain, there are edge states $\ket{L\pm}$ and $\ket{R\pm}$ at
energies $E=\pm\sqrt{2}J$.

The closed mode 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 $\ket{L\pm}$ rather than in the first site 1. 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: in fact, in a single rhombus the left and right
edge state overlap. 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, the switching time is longer
with the corresponding interaction strengths as the chain is longer. An
important feature is that, in the case of two photons initially at the same
edge, the probability of finding the photons separated to opposite edges is
very small: the interaction allows pair transport but the single-particle
transport between the localized states is quenched. Fig. 4 (d) depicts the
switching time dependence on the interaction strength. The switching time is
decreasing with interaction, being proportional to $U^{-2}$.

The open mode of the switching with the diamond chain is demonstrated in Fig.
5. In contrast to the closed operation, the open mode can also operate on a
single rhombus of the diamond chain. Furthermore, the switching is successful
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
states localized around the site: the photon remains stuck at the
corresponding two edge states. 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 to 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, as
demonstrated in Sec. IV. The switching contrast is perfect, see Fig. 5 (c).
The switching time is inversely proportional to the interaction strength $U$
and the decay rate $\gamma$ at the small $U$ and $\gamma$, respectively, as
shown in Figs. 5 (d) and (e). At large $U$ and $\gamma$, the switching time
increases with the increase of $U$ or $\gamma$. Thus, optimal switching time
is found in the intermediate values, similarly to the Stub unit cell case.

Figure 4: Closed switching with a diamond chain. (a) The diamond chain
consisting of two rhombi with a $\pi$ flux and its eigenstates. We show the
bulk eigenstates $\ket{\pm}$ and $\ket{0}$ with energies $E_{\pm}=\pm 2J$ and
$E_{0}=0,$ respectively, while the edge states $\ket{\mathrm{L/R}\pm}$ have
energies $E_{\mathrm{L/R}\pm}=\pm\sqrt{2}J$. (b) The site-resolved normalized
particle number with two (upper panel) or one (lower panel) initial photons at
the left edge state $\ket{\mathrm{L}\pm}.$ (c) The probability of finding
$n=\\{0,1,2\\}$ photons at the right edge, consisting of sites 5, 6, and 7,
over time for two photons (upper panel) and one photon (lower panel).
Parameters are the same as in (b). (d) The interaction strength $U$ dependence
of the switching time $t_{\mathrm{switch}}.$ One sees monotonous decrease with
increasing $U$. The theory prediction at small $U$ is explained in Sec. IV.
Figure 5: The open switching mode 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 $\gamma$ 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. (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). The parameters and
the initial conditions are the same as in (b). (d) The switching time
$t_{\mathrm{switch}}$ dependence on the interaction strength $U$. The
threshold is set at $\epsilon=10^{-3}.$ (e) The decay rate $\gamma$ dependence
of the switching time $t_{\mathrm{switch}}.$ The theory predictions on panels
(d)-(e) are explained in Sec. IV.

##  IV Understanding the switch dynamics

Understanding the dynamics of the simple systems we have considered so far
provides insight into further design, optimization and limitation of the
realization of the switch. Here, we consider the two cases of Sec. II and Sec.
III, respectively, the Stub unit cell and the diamond chain. The single-photon
dynamics of these models is straightforward due to the specific localization
properties. The two-photon case is analyzed in the limits of small or large
interaction strength $U$ and decay rate $\gamma$ in comparison to the energy
scales of the dynamics, where we obtain effective two-state models.

Before discussing the dynamics of the single photons and photon pairs, we note
that the many-photon dynamics does not in general allow similar geometric
separation as the two-photon limit, 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 mode, 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, we have
shown that the delocalization is not allowed by interaction and the switching
cannot occur. We conclude that the proposed switching concept operates only at
the quantum limit of few photons.

###  IV.1 Closed dynamics of the Stub unit cell

The initial state at the Stub unit cell is chosen to have photons at the A
site, acting as the input site. In the non-interacting one-photon case, i.e.
the ’OFF’ state of the switch, the probability over time to find the photon at
the output consisting of B or C is
$P_{\mathrm{output}}^{\mathrm{OFF}}=1-(r_{\mathrm{AB}}^{2}+\cos(E_{+}t))^{2}/(r_{\mathrm{AB}}^{2}+1)^{2}$.
The period of the cosine term is much shorter than the interaction
delocalization time-scale, and we can effectively approximate this probability
by its time-average

$\langle
P_{\mathrm{output}}^{\mathrm{OFF}}\rangle=(1/2+2r_{\mathrm{AB}}^{2})/(r_{\mathrm{AB}}^{2}+1)^{2}.$
(8)

This expression gives the switch’s ’OFF’ state leakage probability, which is
shown as a pink solid line in Fig. 2 (d). Importantly, from Eq. (8), we see
that the ratio $r_{\text{AB}}$ can be used to minimize the false ’OFF’ signal.

####  IV.1.1 Small interactions

We now consider the closed dynamics in the ’ON’ state of the switch in the
limit of small $U$. In this limit, the interaction acts as a perturbation to
the non-interacting eigenstates given by
$\ket{\mathrm{loc},\mathrm{loc}},\ket{+,-}$ at $E=0$, $\ket{\mathrm{loc},\pm}$
at $E=\pm t_{AC}\sqrt{r_{\mathrm{AB}}^{2}+1}$ and $\ket{\pm,\pm}$ at $E=\pm
2t_{AC}\sqrt{r_{\mathrm{AB}}^{2}+1}$. The initial state, expanded in these
states, is
$\ket{\mathrm{A,A}}=\frac{1}{r_{\mathrm{AB}}^{2}+1}\big{(}r_{\mathrm{AB}}^{2}\ket{\mathrm{loc,loc}}+r_{\mathrm{AB}}\ket{\mathrm{loc},+}+r_{\mathrm{AB}}\ket{\mathrm{loc},-}+\frac{1}{2}\ket{+,+}+\frac{1}{2}\ket{-,-}+\frac{1}{\sqrt{2}}\ket{+,-}\big{)}\leavevmode\nobreak\
.$ In the limit of large $r_{\mathrm{AB}}$, the state $\ket{\mathrm{loc,loc}}$
dominates, making it approximately the input state.

We notice that $\ket{\mathrm{loc},\mathrm{loc}}$ and $\ket{+,-}$ are
degenerate states while other states have distinct energies. Thus, for
interactions $U$ that are small compared to the energy gap
$t_{AC}\sqrt{r_{\mathrm{AB}}^{2}+1}$ between the states we obtain that, up to
first order in $U$, $\ket{\mathrm{loc,loc}}$ and $\ket{+,-}$ describe a two-
level system, with other eigenstates being stationary. By projecting the
interacting Hamiltonian onto the subspace spanned by $\ket{+,-}$ and
$\ket{\mathrm{loc},\mathrm{loc}}$ through the Schrieffer-Wolff transformation,
we get the following effective two-level Hamiltonian

$H^{\text{eff}U\ll
t_{\mathrm{AC}}}_{\mathrm{Stub}}=\frac{U}{(1+r_{\mathrm{AB}}^{2})^{2}}\begin{pmatrix}1+r_{\mathrm{AB}}^{2}+r_{\mathrm{AB}}^{4}&\sqrt{2}r_{\mathrm{AB}}^{2}\\\
\sqrt{2}r_{\mathrm{AB}}^{2}&1+r_{\mathrm{AB}}^{4}\end{pmatrix},$ (9)

see details in Appendix A.1 and A.2. In Eq. (9) the energy off-set of the two
states $\delta$ and the overlap between the states $t_{12}$ are

$\delta=\frac{Ur_{AB}^{2}}{(1+r_{AB}^{2})^{2}},\qquad
t_{12}=\frac{\sqrt{2}Ur_{AB}^{2}}{(1+r_{AB}^{2})^{2}}$ (10)

From this two-level description, we see that the dynamics consists of Rabi
oscillations between the states $\ket{\mathrm{loc,loc}}$ and $\ket{+,-}$ with
frequency
$\Omega=\frac{3}{2}\frac{Ur_{\mathrm{AB}}^{2}}{(1+r_{\mathrm{AB}}^{2})^{2}},$
see Appendix A.3. Therefore, as $\ket{\mathrm{loc,loc}}$ is the input state,
we treat $\ket{+,-}$ as an output state. In fact, the probability to find one
or two photons at the output sites in the state $\ket{+,-}$ is given by
$P_{+-,1+2}^{\mathrm{B+C}}=(r_{\mathrm{AB}}^{2}+1/2)/(r_{\mathrm{AB}}^{2}+1)$,
which is approximated by unity. The probability of finding the photons at the
output in the ’ON’ state of the switch is thus found to be
$P_{+-,\mathrm{max}}=8/9$, as derived from the two-level model in Eq. (9), see
Appendix A.3 for details. This theoretical prediction is shown in Fig. 2 (d)
as orange solid line.

The switching time is given by the half-period of the Rabi oscillation

$t_{\mathrm{switch}}=\frac{\pi(1+r_{\mathrm{AB}}^{2})^{2}}{3Ur_{\mathrm{AB}}^{2}}.$
(11)

This equation was used to obtain the theory predictions in Figs. 2 (e)-(f).
The switching time is only dependent on the interaction $U$ and the ratio
$r_{\mathrm{AB}}.$

####  IV.1.2 Large interactions

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:
$\ket{\mathrm{AA}},\ket{\mathrm{BB}}$ and $\ket{\mathrm{CC}}$ at energy $E=U$
and $\ket{\mathrm{AB}},\ket{\mathrm{AC}}$ and $\ket{\mathrm{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, as
shown in Appendix A.5. Assuming further that $U\gg|r_{\mathrm{AB}}t_{AC}|\gg
t_{AC}$, one obtains the effective two-state model

$H^{\text{eff}}_{U\gg
t_{\mathrm{AC}},\text{Stub}}=\begin{pmatrix}2t_{\mathrm{AC}}^{2}/U&\sqrt{2}t_{\mathrm{AC}}^{2}/U\\\
\sqrt{2}t_{\mathrm{AC}}^{2}/U&t_{\mathrm{AC}}^{2}/U\\\
\end{pmatrix}\leavevmode\nobreak\ .$ (12)

In Eq. (12) the energy off-set of the two states $\delta$ and the overlap
between the states $t_{12}$ are

$\delta=\frac{t_{AC}^{2}}{U},\qquad t_{12}=\frac{\sqrt{2}t_{AC}^{2}}{U}$ (13)

The Rabi frequency of such model is $\Omega=\frac{3}{2}t_{\mathrm{AC}}^{2}/U$,
which sets the switching time at large interactions

$t_{\mathrm{switch}}=\frac{\pi U}{3t_{\mathrm{AC}}^{2}}$ (14)

shown in Fig. 2 (f). In contrast to the small interaction limit, the switching
time at large interactions depends on the single-particle hopping amplitude
$t_{\mathrm{AC}}$ but does not depend on the ratio $r_{\mathrm{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_{\mathrm{AB}}.$

###  IV.2 Open dynamics of the Stub unit cell

In the two-state approximation, the switching time $t_{\mathrm{switch}}$ of
the open realization has two opposing behaviors depending on $\gamma$ being
small or large in comparison to the delocalization time-scale, see Appendix
A.4. However, the two-state approximation breaks down if even larger $\gamma$
is considered. We don’t discuss this limit.

In the small $\gamma$ limit, the main effect of the decay is to dampen the
Rabi oscillation. As a consequence, it can be shown that the switching time is

$t_{\mathrm{switch}}\approx-\ln(\epsilon)\frac{\delta^{2}+4|t_{12}|^{2}}{2\gamma|t_{12}|^{2}}\leavevmode\nobreak\
,$ (15)

where $\epsilon$ is the two-particle probability threshold set for the
switching time, see Appendix A.4.

For the Stub lattice, by inserting the small $U$ two-state model parameters
given by Eq. (10) in Eq. (15), we obtain the following switching time

$t_{\mathrm{switch}}=-9\ln(\epsilon)/4\gamma\,,$ (16)

which is shown as the solid blue line in Fig. 3 (f).

In the limit of large $U$ and large $r_{\mathrm{AB}}$, we use instead Eq. (13)
and obtain again $t_{\mathrm{switch}}=-9\ln(\epsilon)/4\gamma$. This result
emphasizes the independence of the switching time with respect to the
interaction strength in the limit of small $\gamma$.

When $\gamma$ is large compared to the two-particle delocalization time scale,
one can approximate the sink site to be always empty. In Appendix A.4, we show
that this approximation leads to the following expression for the switching
time

$t_{\mathrm{switch}}\approx-\ln(\epsilon)\frac{\gamma}{4t_{12}^{2}}\leavevmode\nobreak\
.$ (17)

Similarly as above, for small interactions, we insert Eq. (10) in Eq. (17) and
find

$t_{\mathrm{switch}}=-\frac{\ln(\epsilon)\gamma(1+r_{\mathrm{AB}}^{2})^{4}}{8r_{\mathrm{AB}}^{4}U^{2}}.$
(18)

This result is shown as the solid pink line in Fig. 3 (d) and in Fig. 3 (e).
We see that increasing $\gamma$ 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 $\gamma.$ At small $r_{\mathrm{AB}}$, the two-state approximation is not
valid at the considered interaction: we can observe the deviation in Fig. 3
(e).

In the large $U$ limit, we insert Eq. (13) in Eq. (17) and find

$t_{\mathrm{switch}}=-\frac{\ln(\epsilon)\gamma U^{2}}{8t_{\mathrm{AC}}^{4}},$
(19)

which is shown as the solid blue line in Fig. 3 (d).

At the intermediate $U$, as shown in Fig. 3 (d), the switching time is not
strongly dependent on $U$. This behavior is explained by the fact that
$\gamma$ is not comparably large to the delocalization time anymore and the
small $\gamma$ limit with weak dependence on $U$ becomes relevant.

###  IV.3 Dynamics of the diamond chain

####  IV.3.1 Open dynamics

Similarly to the Stub unit cell, we can understand the two-particle dynamics
of the diamond chain by projecting the Hamiltonian to the initial-state energy
manifold by using the Schrieffer-Wolff transformation.

Focusing first on the four-site rhombus with $\pi$ flux the eigenstates
$\ket{L\pm,L\pm}$, $\ket{L\pm,R\pm}$ and $\ket{R\pm,R\pm}$ are degenerate at
energies $E=\pm\sqrt{2}t$ for $+$ and $-$, respectively. Also, the states
$\ket{L+,L-}$, $\ket{R+,R-}$, and $\ket{R\pm,L\mp}$ 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:
$\braket{L\pm,L\pm}{\hat{H}_{\mathrm{int}}}{L\pm,R\pm}=\braket{R\pm,R\pm}{\hat{H}_{\mathrm{int}}}{R\pm,L\pm}=0$
and
$\braket{R\pm,L\mp}{\hat{H}_{\mathrm{int}}}{R+,R-}=\braket{R\pm,L\mp}{\hat{H}_{\mathrm{int}}}{L+,L-}=0$.
In other words, the interaction allows only pairs to move from one edge to the
another. Hence, at small interaction, Hamiltonian subspaces at
$E=\pm\sqrt{2}t$ consists of two interaction-connected states
$\ket{L\pm,L\pm}$ and $\ket{R\pm,R\pm}$ and a single interaction-disconnected
state $\ket{L\pm,R\pm}.$ Similarly, the subspace at $E=0$ is formed by two
mutually independent two-level systems: pairs of photons at the same edge:
$\ket{L+,L-}$ and $\ket{R+,R-}$, and at the opposite edges: $\ket{L+,R-}$ and
$\ket{L-,R+}.$ The effective two-level projections of the interaction
Hamiltonian onto these subspaces are given by

$H_{\mathrm{U\gg J,rhombus}}^{L\pm L\pm,R\pm R\pm}=\begin{pmatrix}3U/8&U/8\\\
U/8&3U/8\\\ \end{pmatrix}$ (20)

and
$H_{\mathrm{int,rhombus}}^{L+L-,R+R-}=H_{\mathrm{int,rhombus}}^{L+R-,L-R+}=2H_{\mathrm{int,rhombus}}^{L\pm
L\pm,R\pm R\pm}$ .

The switching time in various limits can be determined similarly to the Stub
unit cell. We note that the single-rhombus system is relevant only for the
open mode of the switching, being impractical for the closed mode as discussed
in Sec. III. The comparison between the theory prediction and the numerical
solution can be found in Fig. 5 (d) as a function of the interactions. At
small $U$, the switching time is inversely proportional to $U^{2}$, which we
find by combining the effective two-state model with Eq. (17). At intermediate
$U$, it is independent on the interaction, as for the Stub unit cell. The
$\gamma$ dependence theoretical prediction is shown in Fig. 5 (e). As with
Stub unit cell, the two-state models are not valid at large $\gamma$ in
comparison to the system hopping amplitude $J$. Overall, the parameter
dependencies of the switching time are similar with the open switching by the
single-rhombus diamond chain the Stub lattice.

####  IV.3.2 Closed dynamics

The 7-site two-rhombi system operating in the closed mode, considered in
Section III, has more complex dynamics than the single rhombus owing to its
larger number of states. Consequently, the initial state of a single site does
not lead to clear population oscillation. However, starting from an edge state
enables the occurrence of such oscillations. In fact, even in this longer
chain, the single-particle eigenstates $\ket{L\pm L\pm}$ and $\ket{R\pm R\pm}$
remain degenerate, 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 $\ket{L\pm,R\pm}$ being
degenerate with $\ket{L\pm L\pm}$ and $\ket{R\pm R\pm}$, the former is
disconnected from the latter two states, because the interaction prevents
splitting of the photon pair. The projected Hamiltonian is

$H_{U\gg J,\text{2
rhombi}}^{\text{eff}}=\frac{U^{2}}{256\sqrt{2}J}\begin{pmatrix}-23&6\\\
6&-23\end{pmatrix}\leavevmode\nobreak\ .$ (21)

The corresponding theory predictions for the switching time dependence on the
interaction strength $U$ is shown in Fig. 4 (d), where the switching time is
found to be proportional to $U^{-2}.$ Note the different dependence in
comparison to the closed switching with Stub lattice, which has the switching
time proportional to $U^{-1}$. The key difference between these two cases lies
in the direct overlap of the edge states on opposite edges. In the diamond
case, the edge states do not overlap directly, whereas in the Stub case, the
input and output do.

Another important difference between the diamond chain and the Stub unit cell
for the operation as a switch is the behavior of the parameter $\delta$ in the
two-state approximation. In the diamond chain, $\delta$ vanishes, whereas it
remains finite for the Stub. Consequently, in contrary to the Stub unit cell,
the diamond chain has a unit probability of being found in either of the two
states, ensuring the ’ON’ output. In contrast, the Stub unit cell incurs into
slight losses. Furthermore, regardless of whether the initial state has
photons on an edge state or a single edge site, the probability of one-photon
output vanishes exactly, guaranteeing no false signals for the ’OFF’ state.
This property is evident if the initial state has photons on an edge state,
but it also holds for the initial state of a single edge-site, as the latter
state only overlaps with the edge states on that edge and no other states.
Accordingly, the switching ’ON’ versus ’OFF’ contrast is perfect for the
diamond chain. This is demonstrated in Fig. 4 (c) for the closed dynamics and
in Fig. 5 (c) for the open dynamics. Furthermore, in the diamond chain open
mode, the pair exits the system with certainty, whereas in the Stub unit cell
one of the photons could remain trapped. This difference arises from the fact
that, as demonstrated earlier, pair-breaking processes are prohibited in the
diamond chain. In contrast, in the Stub unit cell, the state $\ket{+,-}$ is
only approximately localized, allowing the interaction to move a single
particle between this state and the localized state
$\ket{\mathrm{loc},\mathrm{loc}}.$

At large interaction, a two-particle doublon moves in a lattice with the same
geometry as the original one, but with modified hopping amplitudes $t_{ij}\to
2|t_{ij}|^{2}/U$ and on-site energies $\epsilon_{i}=\sum_{j}2|t_{ij}|^{2}/U$,
see Appendix A.5. While the on-site energies do not have any significant
effect, the hopping amplitudes become real and positive so that the flux is
lost. In the case of the two-rhombi lattice this leads to complicated
dynamics, rendering the geometric separation necessary for the closed mode
switching impossible. However, in the case of single rhombus, the system has
degenerate single-particle eigenstates that are localized on the opposite
corners. Solving this model with the initial state $\ket{\mathrm{AA}}$ leads
to density time-evolution $n_{A}(t)=\cos^{4}(2J^{2}\tau/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
particle-density between the opposite edges is Rabi-like but with fourth-order
sine and cosine functions. This dynamics was considered in Ref. [31] for a
circuit QED experiment, where simulations agree with our results.

##  V Experimental realization

The proposed switching concept can be realized in systems that allow
simulating the Bose-Hubbard physics with various interaction strengths in the
two-photon limit. Main limiting factors in the realizations of the switch are
the accurate realization of the interacting models and the Fock state
preparation. For instance, while the synthetic flux required in the diamond
chain has been achieved in circuit-QED lattices [41], photonic lattices [42,
43] and ultracold lattices [44, 45, 46], deviations from the exact flux
condition delocalize the single-photon states as shown in Appendix C. 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 was observed in Bose-
Hubbard models [47, 41, 31]. On the other hand, various down-conversion
techniques exist for producing single photonics in the optical domain and
their performance is constantly improving [48, 49]. These techniques can be
used to realize the single-photon-by-single-photon switch for example in
cavity-QED arrays [50], coupled waveguides [51], or micropillar lattices [52,
42].

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 interaction-induced 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 [53, 54, 55, 56] 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 [57, 58].

In order to give an idea of the reachable switching times, let us give an
estimation for the Hubbard interaction parameter given the state-of-the-art
values for Kerr non-linear refractive index materials. In graphene, the non-
linear refractive index is $10^{-11}\mathrm{m^{2}/W}$ [59] while GaAs/GaAlAs
quantum wells have non-linear refractive index reported at
$10^{-9}\leavevmode\nobreak\ \mathrm{m^{2}/W}$ [60]. Similarly,
graphidyne/graphene heterostructures have had reports of non-linear refractive
index up to $10^{-9}\leavevmode\nobreak\ \mathrm{m^{2}/W}$ [61]. The
Hamiltonian corresponding to the Kerr nonlinearity has the same form of the
interaction term in Eq. (6) and is given by $\chi\hat{n}(\hat{n}-1)$, where
$\hat{n}$ is the input photon number operator at the Kerr non-linearity and
$\chi$, equivalent to $U/2$ in Eq. (6), is a constant given by [62]

$\chi=\frac{3\hbar^{2}\omega^{2}\chi^{(3)}}{4\epsilon_{0}\epsilon_{r}^{2}V_{\mathrm{eff}}}$
(22)

where $\omega$ is the angular frequency of the photons, $\chi^{(3)}$ is the
third-order non-linearity of the Kerr material, $\epsilon_{0}$ is the
permittivity of vacuum, $\epsilon_{r}$ is the relative permittivity of the
material, and $V_{\mathrm{eff}}$ is the mode volume in the cavity. The
connection between the third-order non-linearity $\chi^{(3)}$ and the non-
linear refractive index $n_{2}$ is given by
$n_{2}=\chi^{(3)}/n_{0}^{2}\epsilon_{0}c,$ where $n_{0}=\sqrt{\epsilon_{r}}$
is the refractive index of the material and $c$ is the speed of light. Using
the value of $10^{-9}\leavevmode\nobreak\ \mathrm{m^{2}/W}$ for the
GaAs/GaAlAs quantum wells at $\lambda=1343$ nm laser with relative
permittivity of 13 [60] and mode volume $V_{\mathrm{eff}}=\lambda^{3}$, we
obtain the coupling of $\chi\approx 10^{-3}$ eV. Using the results of
switching realizations above, e.g. the Stub lattice unit cell at switching
time of the order of $1/U$, translates into $t_{\mathrm{switch}}\approx
10^{-12}$ seconds, i.e. the order of picoseconds switching time. This is
substantially faster than the rate of single-photon sources [48, 49, 63]. In
circuit QED and ultracold atom systems, one can evaluate the switching time
similarly from the interaction $U$.

##  VI Comparison to other types of switches

Typical all-optical switch designs are based on the nonlinear Kerr effect
which controls the interference between two optical paths as in a Mach-Zehnder
interferometer (MZI) [64]. Light of the wavevector $k$ propagates through the
two arms of the MZI, and in one arm the nonlinear refractive index $n_{2}$
depends on the light intensity. The light that propagates along one arm of
length $L$ gets a phase shift $\Delta\phi=kLn_{2}I$ compared to the light that
propagates in the other arm; the intensity $I$ is modulated via a control beam
[64]. When the control beam is on, such that $\Delta\phi=\pi$, the two light
paths destructively interfere and the signal is not transmitted. Conversely,
when the control beam is off the signal is transmitted. However, for a given
non-linear refractive index $n_{2}$, the switch will not work in the few-
photon limit with coherent light, as there is a fundamental limit to the
intensity [65]. In fact, the intensity fluctuations of coherent light relative
to the mean intensity are significantly larger for the few-photon limit, with
dramatic consequences on the phase matching, which decreases the quality of
the interference and hence the switching mechanism [66]. In the low mean
photon-number limit, the non-linearity allows only a phase-shift that is at
maximum equal to the mean photon number [65, 66].

In contrast to the coherent state light, the photon number fluctuations are
not present in Fock states and the switching in a NLMZI can be achieved if one
obtains the necessary $\pi$ phase shift. Concretely, assuming that the input
annihilation operators are $\hat{b}_{1},\hat{b}_{2}$ for inputs 1 and 2,
respectively, of the NLMZI, we may represent their evolution in terms of
unitary operators. A beam-splitter can be described by the unitary operator
$\hat{B}=\exp(i\pi[\hat{b}_{1}^{\dagger}\hat{b}_{2}+\hat{b}_{2}^{\dagger}\hat{b}_{1}])$
[66]. The effect of the Kerr non-linearity on the arm 2 is given by the
operator
$\hat{K}=\exp(-i\chi^{\prime}[\hat{n}_{2}^{2}+\hat{n}_{c}^{2}]-4i\chi^{\prime}\hat{n}_{2}\hat{n}_{c})$,
where $\chi^{\prime}=\chi L/\hbar nc$ with $\chi$ given by Eq. (22), is a
dimensionless constant describing the Kerr coupling,
$\hat{n}_{2}=\hat{b}_{2}^{\dagger}\hat{b}_{2}$ is the photon number operator
at branch 2 of the NLMZI and $\hat{n}_{c}=\hat{b}_{c}^{\dagger}\hat{b}_{c}$ is
the photon-number operator of the control beam [66]. Now, let us assume that a
single photon enters the ports 1 or 2, and zero or one photons enter the
control. The allowed states are $\ket{1},\ket{2},\ket{1c}$, and $\ket{2c}$. In
this basis, the beam-splitter operator $\hat{B}$ is represented by

$B=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1&0&0\\\ -1&1&0&0\\\ 0&0&1&1\\\
0&0&-1&1\\\ \end{pmatrix}$ (23)

and similarly, the Kerr non-linearity operator is given by (let us not include
the phase shift caused by the self-modulation terms
$\chi\hat{n}_{2}^{2},\chi\hat{n}_{c}^{2}$ since these can be compensated in
the other arm)

$K=\begin{pmatrix}1&0&0&0\\\ 0&1&0&0\\\ 0&0&1&0\\\ 0&0&0&e^{-4i\chi}\\\
\end{pmatrix}.$ (24)

As an overall effect to of the NLMZI, if we have $4\chi=\pi$, we obtain the
transformation

$BKB=\begin{pmatrix}0&1&0&0\\\ -1&0&0&0\\\ 0&0&1&0\\\ 0&0&0&-1\\\
\end{pmatrix}\leavevmode\nobreak\ ,$ (25)

that is, if the control photon is absent, the operator switches the ports
while at its presence 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 element
unitary transformation above, the effective phase-shift assuming a state with
single signal and single control photon is given by
$\Delta\phi=4\chi^{\prime}.$ In order to estimate the necessary length of the
nonlinear element for the switching, we use the third-order non-linearity
$\chi$ based on the heterostructure material GaAs/AlGaAs with the high Kerr
parameter $n_{2}=10^{-9}$ m2/W [60]. This gives the necessary length of the
element at the order of millimetres.

Both the NLMZI and the single-particle localized switch discussed in this work
are based on using destructive interference, but in a different way. In the
NLMZI, 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 NLMZI 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 NLMZI 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 switches discussed in the Introduction rely on
different realizations of the photon-photon 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 that way, one can realize the localized states
of the flat-band system in many ways and allow photons to delocalize in a
controlled way by interaction.

##  VII Discussion and 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. 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. The system is described by a Bose-Hubbard model and solved
using exact diagonalization and a Lindblad master equation. Moreover, we have
also considered the localized Aharonov-Bohm cages of a diamond chain as
another model realizing the switch. In both systems, the closed dynamics
consists of oscillation of the two photons between the opposite edges,
allowing the geometric separation of the closed switch operation. For the open
switch operation in the presence of a sink, the two-photon states are
dissipated while the single-photon states remain localized.

We have found analytical two-level models explaining the Rabi-type
oscillations. Based on such models, we have found expressions for the
switching time and the ’ON’ versus ’OFF’ contrast. In the closed operation,
for small particle interaction compared to single-particle hopping, the
switching time depends on a system-dependent geometric factor and the
interaction strength. The same is true for the open operation at large
$\gamma$, while at small $\gamma$ the switching time is independent of the
interaction strength. 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.

The proposed switch is inherently single-photon-by-single-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, it
turns out that the delocalization time-scale is much longer for many
particles, as we demonstrate in Appendix D. However, partial switching can be
achieved at such cases. At the classical limit, the delocalization does not
occur or occurs very weakly, depending on the model, which we demonstrate in
Appendix E. Thus, the switch operation is purely quantum mechanical at the
fundamental limit.

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.
Finally, we showed that the localized state switch is distinct from the non-
linear Mach-Zehnder interferometer, which is the archetypal all-optical
switching device.

###### Acknowledgements.

This work was supported by Academy of Finland under Project No. 349313. VAJP
acknowledges financial support by the Jenny and Antti Wihuri Foundation. GS
has received funding from the European Union’s Horizon 2020 research and
innovation programme under the Marie Skłodowska-Curie grant agreement No.
101025211 (TEBLA).

##  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_{\mathrm{loc}}=0$ and $E_{\pm}=\pm t_{AC}\sqrt{r^{2}+1}$,
which result in two degenerate two-particle eigenstates
$\ket{\mathrm{loc},\mathrm{loc}}$ and $\ket{+-}$ 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.

###  A.1 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.
[67]. Let us assume that the system Hamiltonian is written as
$\hat{H}=\hat{H}_{0}+\epsilon\hat{H}_{\mathrm{pert}}$ for some non-perturbed
Hamiltonian $\hat{H}_{0}$ and a perturbation $\hat{H}_{\mathrm{pert}}$.
Furthermore, let us assume that we have a subspace of the unperturbed
Hamiltonian $\hat{H}_{0}$ with a collection of eigenenergies separated from
others by a gap $\Delta$. We denote the projection to this subspace by $P_{0}$
$(P_{0}^{2}=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 $\hat{X}$ in
the Hilbert space, we define operators
$\mathcal{O}(\hat{X})=P_{0}\hat{X}Q_{0}+Q_{0}\hat{X}P_{0}$ and
$\mathcal{D}(\hat{X})=P_{0}\hat{X}P_{0}+Q_{0}\hat{X}Q_{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 $\epsilon||\hat{H}_{\mathrm{pert}}||<\Delta/2$.
Here $||\hat{H}_{\mathrm{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 $\hat{U}$, 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

$\hat{H}_{\mathrm{eff}}=P_{0}\hat{U}(\hat{H}_{0}+\epsilon\hat{H}_{\mathrm{pert}})\hat{U}^{\dagger}P_{0}\leavevmode\nobreak\
.$ (26)

Oftentimes, the exact transformation $\hat{U}$ 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 $\hat{U}=\exp(i\hat{S})$,
where $\hat{S}$ is a block-off-diagonal, Hermitian operator, that is,
$\hat{S}=\mathcal{O}(\hat{S})$ and $\hat{S}^{\dagger}=\hat{S}.$ One develops
the perturbation series by expanding $\hat{S}$ as a power series
$\hat{S}=\sum_{n}\epsilon^{n}\hat{S}_{n}$ and utilizing Baker-Campbell-
Hausdorff formula $\exp(A)B\exp(-A)=\sum_{n}\frac{1}{n!}[A,^{n}B]$, where
$[A,^{n}B]\equiv[A,[A,\dots,[A,B]\dots]]$ denotes that the commutator of $B$
with $A$ is taken $n$ times in succession. We obtain

$\begin{split}&\exp(i\hat{S})(\hat{H}_{0}+\epsilon\hat{H}_{\mathrm{pert}})\exp(-i\hat{S})\\\
=&\sum_{n}\frac{i^{n}}{n!}[\hat{S},^{n}\hat{H}_{0}+\epsilon\hat{H}_{\mathrm{pert}}]\\\
=&\sum_{nm}\frac{i^{n}}{n!}\epsilon^{nm}[\hat{S}_{m},^{n}\hat{H}_{0}]+\frac{i^{n}}{n!}\epsilon^{nm+1}[\hat{S}_{m},^{n}\hat{H}_{\mathrm{pert}}]\leavevmode\nobreak\
.\\\ \end{split}$ (27)

The operators $\hat{S}_{n}$ are solved recursively by putting $\hat{S}_{0}=0$
and demanding at every order of $\epsilon$ that the expression is block-
diagonal. Block-diagonality means that the sub-manifolds 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[\hat{S}_{1},\hat{H}_{0}]+\mathcal{O}(\hat{H}_{\mathrm{pert}})=0$ where by
taking the matrix elements with respect to the $\hat{H}_{0}$ eigenbasis
$\ket{n}$, we find
$\braket{n}{\hat{S}_{1}}{m}=i\braket{n}{\mathcal{O}(\hat{H}_{\mathrm{pert}})}{m}/(E_{n}-E_{m})$.
Inserting this expression back to the expansion, we have
$\hat{H}_{\mathrm{eff},1}=P_{0}\hat{H}_{\mathrm{pert}}P_{0}$. Thus, the first
order perturbation is just the perturbation Hamiltonian projected to the
subspace. Similarly, we have
$\hat{H}_{\mathrm{eff},2}=\frac{1}{2}P_{0}[i\hat{S}_{1},\mathcal{O}(\hat{H}_{\mathrm{pert}})]P_{0}$,
which, represented in the basis of the subspace $P_{0}$ eigenstates, is

$\displaystyle\braket{n}{\hat{H}_{\mathrm{eff},2}}{m}=-\frac{1}{2}$
$\displaystyle\sum_{n^{\prime}\in
Q_{0}}\left(\frac{1}{E_{n}-E_{n^{\prime}}}-\frac{1}{E_{n^{\prime}}-E_{m}}\right)$
$\displaystyle\braket{n}{\hat{H}_{\mathrm{pert}}}{n^{\prime}}\braket{n^{\prime}}{\hat{H}_{\mathrm{pert}}}{m}\leavevmode\nobreak\
,$ (28)

where $n^{\prime}$ 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.

###  A.2 Two-particle basis

In a system with single-particle quantum numbers $\alpha$ (e.g. orbital,
location in an array of sites or single-particle eigenstate index), the two-
particle states can be labeled by a list of the occupied quantum numbers and
taking into account the indistinguishability by
$\ket{\alpha\beta}=N_{\alpha\beta}\hat{b}_{\alpha}^{\dagger}\hat{b}_{\beta}^{\dagger}\ket{0}$,
where $\ket{0}$ is the vacuum state,
$\hat{b}_{\alpha}^{\dagger},\hat{b}_{\alpha}$ are creation and annihilation
operators, and $N_{\alpha\beta}=1$ if $\alpha\neq\beta$ and
$N_{\alpha\beta}=1/\sqrt{2}$ if $\alpha=\beta.$ We are interested in a second-
quantized Hamiltonian $\hat{H}=\hat{H}_{0}+\hat{H}_{\mathrm{int}}$, where
$\hat{H}_{0}=-\sum_{\alpha}t_{\alpha\beta}\hat{b}_{\alpha}^{\dagger}\hat{b}_{\beta}$
is a single-particle term and
$\hat{H}_{\mathrm{int}}=\sum_{\alpha\beta\gamma\delta}U_{\alpha\beta\gamma\delta}\hat{b}_{\alpha}^{\dagger}\hat{b}_{\beta}^{\dagger}\hat{b}_{\gamma}\hat{b}_{\delta}$
is is a two-particle interaction term. By using the Wick’s theorem, one finds
the matrix elements of single-particle term as

$\begin{split}&H_{0,\alpha\beta\gamma\delta}\\\
=&\braket{\alpha\beta}{\hat{H}_{0}}{\gamma\delta}\\\
=&-N_{\alpha\beta}N_{\gamma\delta}(t_{\alpha\delta}\delta_{\beta\gamma}+t_{\alpha\gamma}\delta_{\beta\delta}+t_{\beta\gamma}\delta_{\alpha\delta}+t_{\beta\delta}\delta_{\alpha\gamma})\end{split}$
(29)

and for the interaction term as

$\begin{split}&H_{\mathrm{int},\alpha\beta\gamma\delta}\\\
=&N_{\alpha\beta}N_{\gamma\delta}(U_{\alpha\beta\gamma\delta}+U_{\beta\alpha\gamma\delta}+U_{\alpha\beta\delta\gamma}+U_{\beta\alpha\delta\gamma}).\end{split}$
(30)

In the site basis $\hat{b}_{i},\hat{b}_{i}^{\dagger},$ where $i$ is a site in
an array, we consider site-local interaction
$\hat{H}_{\mathrm{int}}=\sum_{i}U_{i}\hat{b}_{i}^{\dagger}\hat{b}_{i}^{\dagger}\hat{b}_{i}\hat{b}_{i}/2$,
whose matrix elements in the two-particle basis are
$H_{\mathrm{int},ijkl}=\delta_{ij}\delta_{ik}\delta_{il}U_{i}.$ It is useful
to consider the interaction in the eigenbasis of the single-particle
Hamiltonian instead, defined by $\hat{b}_{n}=\sum_{i}V_{in}^{*}\hat{b}_{i}$,
where $V_{in}$ diagonalizes the single particle Hamiltonian matrix
$H_{0,ij}=\sum_{n}V_{in}\Lambda_{nn}V_{jn}^{*}.$ In this basis, we have

$U_{nmop}=\sum_{i}U_{i}V_{in}^{*}V_{im}^{*}V_{io}V_{ip}/2\leavevmode\nobreak\
,$ (31)

which can be inserted in Eq. (30) to obtain the two-particle state matrix
elements.

###  A.3 Two-state model

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 $\ket{1}$ and $\ket{2}$
with Hamiltonian

$\hat{H}\doteq\begin{pmatrix}\epsilon_{1}&t_{12}\\\ t_{12}^{*}&\epsilon_{2}\\\
\end{pmatrix},$ (32)

whose eigenenergies are

$E_{\pm}=\epsilon_{1}+\delta/2\pm\Omega\leavevmode\nobreak\ ,$ (33)

where we have defined the ’detuning’ $\delta=\epsilon_{2}-\epsilon_{1}$ and
the Rabi frequency
$\Omega=\sqrt{(\delta/2)^{2}+|t_{12}|^{2}}\leavevmode\nobreak\ .$ We label the
eigenstates by $\ket{+},\ket{-}$ for the plus and minus energy, respectively.
The eigenstates components $(\alpha_{\pm},\beta_{\pm})$

are obtained as

$\alpha_{\pm}=\frac{|t_{12}|}{\sqrt{|t_{12}|^{2}+(\delta/2\pm\Omega)^{2}}}$
(34)

and

$\beta_{\pm}=\frac{|t_{12}|}{t_{12}}\frac{\delta/2\pm\Omega}{\sqrt{|t_{12}|^{2}+(\delta/2\pm\Omega)^{2}}}\leavevmode\nobreak\
.$ (35)

Let us assume that at time $t=0$, the system is in the state $\ket{1}$.
General time dependence is given by

$\begin{pmatrix}\braket{1}{\psi(t)}\\\
\braket{2}{\psi(t)}\end{pmatrix}=\exp[-i(\epsilon_{1}+\delta/2)t]\begin{pmatrix}\cos(\Omega
t)+i\delta\sin(\Omega t)/2\Omega\\\ -it_{12}^{*}\sin(\Omega
t)/\Omega\end{pmatrix}$ (36)

and the probabilities are

$\begin{pmatrix}P_{1}(t)\\\
P_{2}(t)\end{pmatrix}=\begin{pmatrix}1-|t_{12}|^{2}\sin^{2}(\Omega
t)/\Omega^{2}\\\ |t_{12}|^{2}\sin^{2}(\Omega
t)/\Omega^{2}\end{pmatrix}\leavevmode\nobreak\ .$ (37)

The resulting behavior is Rabi oscillations with Rabi frequency
$\Omega=\sqrt{(\delta/2)^{2}+|t_{12}|^{2}}$. The maximum probability of
observing state $\ket{2}$, provided that the initial state is $\ket{1}$ is
$|t_{12}|^{2}/\Omega^{2}=1/(1+(\delta/2)^{2}/|t_{12}|^{2}).$

###  A.4 Two-state model with losses

Let us consider the aforementioned two-level system with an additional third
level $\ket{3}$ into which the state $\ket{2}$ decays according with a decay
constant $\gamma$. The Hamiltonian is represented by the matrix in such basis
by

$\hat{H}=\begin{pmatrix}\epsilon_{1}&t_{12}&0\\\ t_{12}^{*}&\epsilon_{2}&0\\\
0&0&0\\\ \end{pmatrix}\leavevmode\nobreak\ .$ (38)

and, similarly, the jump operator describing the decay is

$\hat{L}=\begin{pmatrix}0&0&0\\\ 0&0&0\\\
0&1&0\end{pmatrix}\leavevmode\nobreak\ .$ (39)

The Lindblad master equation for the density matrix $\hat{\rho}$ is

$\frac{\mathrm{d}\hat{\rho}}{\mathrm{d}t}=-i[\hat{H},\hat{\rho}]+\gamma\left(\hat{L}\hat{\rho}\hat{L}^{\dagger}-\frac{1}{2}\left\\{\hat{L}^{\dagger}\hat{L},\hat{\rho}\right\\}\right)\leavevmode\nobreak\
.$ (40)

The Hamiltonian term is

$\begin{split}&-i[\hat{H},\hat{\rho}]\\\
=&\begin{pmatrix}-it_{12}\rho_{21}+it_{12}^{*}\rho_{12}&-i\delta\rho_{12}+it_{12}(\rho_{11}-\rho_{22})&0\\\
i\delta\rho_{21}-it_{12}^{*}(\rho_{11}-\rho_{22})&-it_{12}^{*}\rho_{12}+it_{12}\rho_{21}&0\\\
0&0&0\\\ \end{pmatrix}\leavevmode\nobreak\ ,\end{split}$ (41)

where $\delta=\epsilon_{1}-\epsilon_{2}.$ The Lindblad term is

$\hat{L}\rho\hat{L}^{\dagger}-\frac{1}{2}\left\\{\hat{L}^{\dagger}\hat{L},\hat{\rho}\right\\}=\begin{pmatrix}0&-\rho_{12}/2&0\\\
-\rho_{21}/2&-\rho_{22}&-\rho_{23}/2\\\ 0&-\rho_{32}/2&\rho_{22}\\\
\end{pmatrix}\leavevmode\nobreak\ .$ (42)

From these equations, we note that the terms
$\rho_{13},\,\rho_{31},\,\rho_{23},$ and $\rho_{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
$\hat{\rho}\doteq(\rho_{11},\rho_{12},\rho_{21},\rho_{22},\rho_{33})^{T}$. The
Lindblad equation can be represented in this basis by the matrix equation
$\frac{\mathrm{d}}{\mathrm{d}t}\rho=L\rho$, where

$L=\begin{pmatrix}0&it_{12}^{*}&-it_{12}&0&0\\\
it_{12}&-i\delta-\gamma/2&0&-it_{12}&0\\\
-it_{12}^{*}&0&i\delta-\gamma/2&it_{12}^{*}&0\\\
0&-it_{12}^{*}&it_{12}&-\gamma&0\\\ 0&0&0&\gamma&0\\\ \end{pmatrix}$ (43)

####  A.4.1 Large $\gamma$ limit

In the limit $\gamma\gg\Omega$, one can neglect the $\rho_{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)
$\mathrm{d}\mathrm{Re}(\rho_{12})/\mathrm{d}t=\delta\mathrm{Im}(\rho_{12})-\gamma/2\mathrm{Re}(\rho_{12})$
and accordingly, due to the fast decay and small source term,
$\mathrm{Re}(\rho_{12})$ will remain negligible since we assume that
$\rho_{12}(t=0)=0.$ Effectively, we are left with two real variables,
$\rho_{11}$ and $\mathrm{Im}(\rho_{12})$ with equations

$\frac{\mathrm{d}}{\mathrm{d}t}\begin{pmatrix}\rho_{11}\\\
\mathrm{Im}(\rho_{12})\\\ \end{pmatrix}=\begin{pmatrix}0&-2t_{12}\\\
t_{12}&-\gamma/2\end{pmatrix}\begin{pmatrix}\rho_{11}\\\
\mathrm{Im}(\rho_{12})\\\ \end{pmatrix}.$ (44)

We obtain a second-order differential equation for $\mathrm{Im}(\rho_{12})$:

$\mathrm{Im}(\ddot{\rho}_{12})+\frac{\gamma}{2}\mathrm{Im}(\dot{\rho}_{12})+2t_{12}^{2}\mathrm{Im}(\rho_{12})=0\,.$
(45)

With an ansatz $\mathrm{Im}(\rho_{12})=A\exp(rt)$, we get the equation for $r$

$r^{2}+\frac{\gamma}{2}r+2t_{12}^{2}=0\leavevmode\nobreak\ ,$ (46)

which has the solution

$r_{\pm}=-\frac{\gamma}{4}\pm\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}}\leavevmode\nobreak\
.$ (47)

Thus, the solution for the element $\mathrm{Im}(\rho_{12})$ is, using the
initial conditions,

$\begin{split}&\mathrm{Im}(\rho_{12})(t)=t_{12}\exp\left(-\frac{\gamma}{4}t\right)\\\
&\begin{cases}\sinh\left[\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}}t\right]/\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}},&\mathrm{if\leavevmode\nobreak\
}\gamma^{2}>32t_{12}^{2}\\\
\sin\left[\sqrt{2t_{12}^{2}-\frac{\gamma^{2}}{16}}t\right]/\sqrt{32t_{12}^{2}-\frac{\gamma^{2}}{16}},&\mathrm{if\leavevmode\nobreak\
}\gamma^{2}<32t_{12}^{2}\end{cases}\leavevmode\nobreak\ .\end{split}$ (48)

Accordingly, we obtain the remaining density matrix element by
$\rho_{11}=\gamma\mathrm{Im}(\dot{\rho}_{12})/2t_{12}+\mathrm{Im}(\rho_{12})/t_{12}$
as,

$\begin{split}\rho_{11}(t)=\exp\left(-\frac{\gamma}{4}t\right)&\Bigg{(}\cosh\left[\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}}t\right]\\\
&+\frac{\gamma}{4}\frac{\sinh\left[\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}}t\right]}{\sqrt{\frac{\gamma^{2}}{16}-2t_{12}^{2}}}\Bigg{)}\leavevmode\nobreak\
,\end{split}$ (49)

and similarly with $\cos$ and $\sin$ if $\gamma^{2}<32t_{12}^{2}$. However,
since we assumed $\gamma\gg t_{12},\delta$, we can write
$\sqrt{\gamma^{2}/16-2t_{12}^{2}}\approx\gamma/4-4t_{12}^{2}/\gamma.$ Thus, we
have

$\begin{split}&\exp(-\gamma t/4)\cosh(\sqrt{\gamma^{2}/16-2t_{12}^{2}}t)\\\
\approx&\frac{1}{2}\exp(-4t_{12}^{2}t/\gamma)+\frac{1}{2}\exp(-\gamma
t/2+4t_{12}^{2}t/\gamma)\,,\end{split}$ (50)

and similarly for the $\sinh$ but with a minus sign in front of the second
term. Hence, we have the approximate form

$\rho_{11}(t)=\exp\left(-\frac{4t_{12}^{2}}{\gamma}t\right)\,.$ (51)

We note directly that, given a tolerance $\epsilon$, the decay time is
proportional to $\gamma$ and inversely proportional to $t_{12}^{2}.$ In the
context of the switch considered in the main text, the switching time is given
by

$t_{\text{switch}}=-\ln(\epsilon)\frac{\gamma}{4t_{12}^{2}}\leavevmode\nobreak\
,$ (52)

which is the Eq. (15) in the main text.

####  A.4.2 Small $\gamma$ limit

Let us consider the limit where the Rabi frequency is substantially faster
than the decay rate, that is, $\Omega\gg\gamma$, and we have damped Rabi
oscillations. The probability to find the system in the states $\ket{1}$ and
$\ket{2}$ is $P(t)\equiv P_{1}(t)+P_{2}(t)$, which decays over time due to the
sink. The decay of $P(t)$ has to be proportional to $P_{2}(t)$:
$\frac{\mathrm{d}P}{\mathrm{d}t}=-\gamma P_{2}(t).$ Moreover, since the decay
is slow, the evolution of the probabilities $P_{1}$ and $P_{2}$ still follows
approximately the undamped dynamics given by Eq. (37) but with the decay of
the probability $P(t)$ taken into account. Then, the ratio
$P_{2}(t)/P(t)=|t_{12}|^{2}\sin^{2}(\Omega t)/[(\delta/2)^{2}+|t_{12}|^{2}]$,
leading to the equation

$\frac{\mathrm{d}P}{\mathrm{d}t}=-\frac{4\gamma|t_{12}|^{2}}{\delta^{2}+4|t_{12}|^{2}}\sin^{2}(\Omega
t)\,P\leavevmode\nobreak\ $ (53)

with the initial condition $P(t=0)=1.$ Solution to this equation is

$P(t)=\exp\left[-\frac{2\gamma|t_{12}|^{2}}{\delta^{2}+4|t_{12}|^{2}}\left(t-\frac{\sin(2\Omega
t)}{2\Omega}\right)\right]\leavevmode\nobreak\ .$ (54)

From this, the time it takes for the system to deplete beneath a given
threshold $\epsilon$ is given as the solution of

$t-\frac{\sin(2\Omega
t)}{2\Omega}=-\ln(\epsilon)\frac{\delta^{2}+4|t_{12}|^{2}}{2\gamma|t_{12}|^{2}}.$
(55)

For the switch considered in the main text, Eq. (55) sets the switching time
$t_{\text{switch}}$. Since the sine term on the left-hand side of the equation
is small, we can neglect it giving the equation

$t_{\text{switch}}=-\ln(\epsilon)\frac{\delta^{2}+4|t_{12}|^{2}}{2\gamma|t_{12}|^{2}}\leavevmode\nobreak\
,$ (56)

where now $\epsilon$ represents the switching threshold. This equation is Eq.
(15) in the main text, and it specifies that the switching time is inversely
proportional to $\gamma$ and not dependent on the interaction. In fact, both
$t_{12}$ and $\delta$ scale similarly with the interaction strength $U$.

###  A.5 Large interaction limit of two-particle lattice model

Let us assume a lattice model with hopping elements
$\hat{H}_{0}=\sum_{ij}t_{ij}\hat{b}_{i}^{\dagger}\hat{b}_{j}$ and onsite
Hubbard interaction
$\hat{H}_{\mathrm{int}}=\sum_{i}U_{i}\hat{b}_{i}^{\dagger}\hat{b}_{i}^{\dagger}\hat{b}_{i}\hat{b}_{i}/2$.
The two-particle eigenstates of the Hubbard term are the states $\ket{ij}$
where one particle is at the site $i$ and another at the site $j$ with energy
$E=U_{i}\delta_{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 $\ket{ii}$, consisting of a doublon
[67, 68]. Importantly, we observe that
$\braket{ii}{\hat{H}_{0}}{ij}=\sqrt{2}t_{ij}$, where the factor $\sqrt{2}$
arises due to normalization. The terms between different $\ket{ii}$, up to
first order in $\hat{H}_{0}$, vanish since they require two-particle
operations whereas there are single-particle terms. The second-order terms in
the projection are

$\hat{H}_{\mathrm{int},ii,jj}^{\mathrm{proj.}}=t_{ij}^{2}\left(\frac{1}{U_{i}}+\frac{1}{U_{j}}\right)$
(57)

for $i\neq j$ and

$\hat{H}_{\mathrm{int},ii,ii}^{\mathrm{proj.}}=\sum_{j}2\frac{|t_{ij}|^{2}}{U_{j}}\leavevmode\nobreak\
.$ (58)

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.

##  Appendix B Sawtooth lattice

Another prominent system that allows the switching concept proposed in this
work is the sawtooth lattice. 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 three-site 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}=\sqrt{2}t_{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_{\mathrm{AA}}$ on the edge A sites of the system.

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
$t_{\mathrm{AB}}=\sqrt{2}t_{\mathrm{AA}}$. Furthermore, the edge-states
localize if one sets the boundary potential $V_{B}=t_{\mathrm{AA}}$ at the
edge sites. In the following, time is in units of $1/t_{\mathrm{AA}}$. 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 $V_{B}$ 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=t_{\mathrm{AA}}$ 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=10t_{\mathrm{AA}}$ 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.

If we use the sawtooth lattice flat-band condition
$t_{AB}=t_{BC}=\sqrt{2}t_{AC}$ in Eq. (3), we find that $\epsilon_{A}=t_{AC}$,
which is the boundary potential resonance condition [38]. Indeed, Eq. (4)
gives $E_{\mathrm{loc}}=2t_{AC}$, the flat band energy. The localized
eigenstate is $\ket{\psi_{\mathrm{loc}}}\doteq(\sqrt{2},-1,0)^{T}/\sqrt{3}$.
Assuming $\epsilon_{C}=t_{AC}$ for symmetry, we find $E_{\pm}=\pm 2t_{AC}$,
while the eigenvectors are $\ket{\psi_{+}}\doteq(1,\sqrt{2},-3)^{T}/2\sqrt{3}$
and $\ket{\psi_{-}}\doteq(1,\sqrt{2},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
$\ket{\mathrm{loc},\mathrm{loc}}$, $\ket{\mathrm{loc},+}$, and $\ket{++}$ at
$E=4t_{AC}$, $\ket{\mathrm{loc},-}$ and $\ket{+-}$ at $E=0$ and $\ket{--}$ at
$E=-4t_{AC}$. Gathering these results in a matrix, and assuming uniform
interaction, we can project the Hamiltonian onto the basis
$\ket{++},\ket{+\mathrm{loc}},\ket{\mathrm{loc},\mathrm{loc}}$ and obtain

$H_{\mathrm{int,sawtooth}}=\frac{U}{9}\begin{pmatrix}\frac{43}{8}&-\frac{1}{4}&1\\\
-\frac{1}{4}&2&1\\\ 1&1&5\end{pmatrix}\leavevmode\nobreak\ .$ (59)

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, $\ket{++}$ and $\ket{\mathrm{loc,loc}}$ to obtain the Rabi
frequqency. The large-interaction limit of the dynamics follows similarly.

##  Appendix C Sensitivity analysis

In the Stub unit cell and the diamond chain models, we have assumed specific
properties for the parameters in order to have localized states. Specifically,
for the Stub unit cell we required that $t_{AB}=0$, i.e. the A and B sites do
not have mutual direct hopping, while for the diamond chain we have included a
$\pi$ flux.

Figure 7: Sensitivity to parameter imperfections. Panels (a)-(d) demonstrate
the effect of having off-set from the $\pi$-flux condition at the two-rhombi
diamond chain. On panels (a), (b), and (c), the flux is put to
$0.93\pi,0.95\pi$, and $0.98\pi$, 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\pi$ 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 $r_{\mathrm{AB}}=-5$.
Panel (e) shows the effect on the single particle dynamics of
$t_{\mathrm{AB}}=0.1t_{\mathrm{AC}}$, 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
$t_{\mathrm{AB}}=0,0.05t_{\mathrm{AC}},0.1t_{\mathrm{AC}}$ on the two-photon
dynamics. At small $t_{\mathrm{AB}}$ the effect is very minute while suddenly
at $0.1t_{\mathrm{AC}}$ the maximal probability of finding particles on the
sites B and C reduces significantly.

In Fig. 7 (a)-(c) we note that the single-particle dynamics follows a Rabi-
type oscillation between the edges if the flux is slightly off-set from $\pi.$
For successful switching we need to prepare the flux so that this oscillation
is slower than the interaction-induced delocalization. We show in Fig. 7 (d)
that the two-photon dynamics are not sensitive to slight inaccuracies in the
flux if the interaction is strong enough to cause faster delocalization than
the imperfection on the flux.

The flux-deviation effect can be understood by the following arguments. For
the diamond chain, we note that in a single rhombus, deviations from the $\pi$
flux directly couple the left and right edge states. If the difference to the
$\pi$ flux is small enough, the perturbation mixes $\ket{L+}$ and $\ket{R+}$
together, for instance, but not the other states, up to first order in the
deviation. With direct calculation, we find the coupling between the states to
be
$(\exp(i\phi)-1)J\braket{L+}{\hat{b}_{2}^{\dagger}\hat{b}_{4}}{R+}\approx|\phi|J\sqrt{2}/4$,
which causes Rabi oscillations between the edges. Similarly, in the two
rhombus case, since the left and right edge states are not directly coupled,
we find that the coupling is given by the second-order Schrieffer-Wolff
transformation as $\phi^{2}J\sqrt{2}/8.$

For the Stub unit cell, the direct connection between sites A and B is found
to be robust in terms of the single-particle localization, as shown in Fig. 7
(e). However, we find that the two-particle dynamics delocalization to the
other edge becomes imperfect with increasing hopping between A and B sites.
For instance, at the considered ratio $r_{\mathrm{AB}}=-5$, deviation
$t_{\mathrm{AB}}=0.1t_{\mathrm{AC}}$ significantly disturbs the
delocalization, as shown in Fig.7 (h). However, the change seems to be abrupt
since $t_{AB}=0.05t_{\mathrm{AB}}$ is not causing large difference as shown in
Fig.7 (g).

##  Appendix D More than two photons

Here we discuss the behavior of the switch if more than two photons enter the
system. Fig.8 demonstrates the effect of having more than two photons at the
initial state for the Stub unit cell and the two-rhombi diamond chain. For the
Stub unit cell, the population delocalizes more than in the single-photon
case. However, similar dynamics of all photons moving together, as found for
the 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 mode 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 mode of the
switch.

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.

##  Appendix E Classical dynamics

In the limit of many photons, the mean-field approximation becomes valid,
where one can replace $\hat{b}_{i}\to b_{i}=\langle\hat{b}_{i}\rangle$, that
is, the operator with a classical number. The Heisenberg equation of motion
for the operator $\hat{b}_{i}$ is

$-i\hbar\frac{\mathrm{d}}{\mathrm{d}t}\hat{b}_{i}=[\hat{H},\hat{b}_{i}]=\sum_{j}t_{ij}\hat{b}_{j}-U_{i}\hat{b}_{i}^{\dagger}\hat{b}_{i}\hat{b}_{i}$
(60)

where we obtain by the mean-field approximation

$i\hbar\frac{\mathrm{d}}{\mathrm{d}t}b_{i}=-\sum_{j}t_{ij}b_{j}+U_{i}|b_{i}|^{2}b_{i}\leavevmode\nobreak\
,$ (61)

which is known as the nonlinear Schrödinger equation. We solve this equation
for the sawtooth edge system, diamond chain and the Stub unit cell with and
without interaction $U_{i}$ in Fig.9. It turns out that, in contrast to the
quantum limit, the interaction does not delocalize the light at the diamond
chain, in accordance to Ref. [39], while the sawtooth and the Stub systems
delocalizes weakly. Thus, the presence or absence of interaction does not lead
to successful switching at the classical limit.

Figure 9: Closed classical dynamics. 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.

## References

  * Almeida  _et al._ [2004] V. R. Almeida, C. A. Barrios, R. R. Panepucci, and M. Lipson, All-optical control of light on a silicon chip, Nature 431, 1081 (2004).
  * Reed  _et al._ [2010] G. T. Reed, G. Mashanovich, F. Y. Gardes, and D. Thomson, Silicon optical modulators, Nature Photonics 4, 518 (2010).
  * Chai  _et al._ [2017] Z. Chai, X. Hu, F. Wang, X. Niu, J. Xie, and Q. Gong, Ultrafast all-optical switching, Advanced Optical Materials 5, 1600665 (2017).
  * Sasikala and Chitra [2018] V. Sasikala and K. Chitra, All optical switching and associated technologies: a review, Journal of Optics 47, 307 (2018).
  * Pscherer  _et al._ [2021] A. Pscherer, M. Meierhofer, D. Wang, H. Kelkar, D. Martín-Cano, T. Utikal, S. Götzinger, and V. Sandoghdar, Single-Molecule Vacuum Rabi Splitting: Four-Wave Mixing and Optical Switching at the Single-Photon Level, Physical Review Letters 127, 133603 (2021).
  * Zasedatelev  _et al._ [2021] A. V. Zasedatelev, A. V. Baranikov, D. Sannikov, D. Urbonas, F. Scafirimuto, V. Y. Shishkov, E. S. Andrianov, Y. E. Lozovik, U. Scherf, T. Stöferle, R. F. Mahrt, and P. G. Lagoudakis, Single-photon nonlinearity at room temperature, Nature 597, 493 (2021).
  * Shomroni  _et al._ [2014] I. Shomroni, S. Rosenblum, Y. Lovsky, O. Bechler, G. Guendelman, and B. Dayan, All-optical routing of single photons by a one-atom switch controlled by a single photon, Science 345, 903 (2014).
  * Tiecke  _et al._ [2014] T. Tiecke, J. D. Thompson, N. P. de Leon, L. Liu, V. Vuletić, and M. D. Lukin, Nanophotonic quantum phase switch with a single atom, Nature 508, 241 (2014).
  * Hacker  _et al._ [2016] B. Hacker, S. Welte, G. Rempe, and S. Ritter, A photon–photon quantum gate based on a single atom in an optical resonator, Nature 536, 193 (2016).
  * Volz  _et al._ [2012] T. Volz, A. Reinhard, M. Winger, A. Badolato, K. J. Hennessy, E. L. Hu, and A. Imamoğlu, Ultrafast all-optical switching by single photons, Nature Photonics 6, 605 (2012).
  * Giesz  _et al._ [2016] V. Giesz, N. Somaschi, G. Hornecker, T. Grange, B. Reznychenko, L. De Santis, J. Demory, C. Gomez, I. Sagnes, A. Lemaitre, _et al._ , Coherent manipulation of a solid-state artificial atom with few photons, Nature Communications 7, 11986 (2016).
  * Dietrich  _et al._ [2016] C. P. Dietrich, A. Fiore, M. G. Thompson, M. Kamp, and S. Höfling, GaAs integrated quantum photonics: Towards compact and multi-functional quantum photonic integrated circuits, Laser & Photonics Reviews 10, 870 (2016).
  * Sun  _et al._ [2018] S. Sun, H. Kim, Z. Luo, G. S. Solomon, and E. Waks, A single-photon switch and transistor enabled by a solid-state quantum memory, Science 361, 57 (2018).
  * Peyronel  _et al._ [2012] T. Peyronel, O. Firstenberg, Q.-Y. Liang, S. Hofferberth, A. V. Gorshkov, T. Pohl, M. D. Lukin, and V. Vuletić, Quantum nonlinear optics with single photons enabled by strongly interacting atoms, Nature 488, 57 (2012).
  * Gorniaczyk  _et al._ [2014] H. Gorniaczyk, C. Tresp, J. Schmidt, H. Fedder, and S. Hofferberth, Single-photon transistor mediated by interstate Rydberg interactions, Physical Review Letters 113, 053601 (2014).
  * Muñoz-Matutano  _et al._ [2020] G. Muñoz-Matutano, M. Johnsson, J. Martínez-Pastor, D. Rivas Góngora, L. Seravalli, G. Trevisi, P. Frigeri, T. Volz, and M. Gurioli, All optical switching of a single photon stream by excitonic depletion, Communications Physics 3, 29 (2020).
  * Liao  _et al._ [2009] J.-Q. Liao, J.-F. Huang, Y.-x. Liu, L.-M. Kuang, and C. P. Sun, Quantum switch for single-photon transport in a coupled superconducting transmission-line-resonator array, Physical Review A 80, 014301 (2009).
  * Bermel  _et al._ [2006] P. Bermel, A. Rodriguez, S. G. Johnson, J. D. Joannopoulos, and M. Soljačić, Single-photon all-optical switching using waveguide-cavity quantum electrodynamics, Physical Review A 74, 043818 (2006).
  * Leykam  _et al._ [2018] D. Leykam, A. Andreanov, and S. Flach, Artificial flat band systems: from lattice models to experiments, Advances in Physics: X 3, 1473052 (2018).
  * Tovmasyan  _et al._ [2018] M. Tovmasyan, S. Peotta, L. Liang, P. Törmä, and S. D. Huber, Preformed pairs in flat Bloch bands, Physical Review B 98, 134513 (2018).
  * Törmä  _et al._ [2018] P. Törmä, L. Liang, and S. Peotta, Quantum metric and effective mass of a two-body bound state in a flat band, Physical Review B 98, 220511 (2018).
  * Pyykkönen  _et al._ [2023] V. A. J. Pyykkönen, S. Peotta, and P. Törmä, Suppression of Nonequilibrium Quasiparticle Transport in Flat-Band Superconductors, Physical Review Letters 130, 216003 (2023).
  * Kopnin  _et al._ [2011] N. B. Kopnin, T. T. Heikkilä, and G. E. Volovik, High-temperature surface superconductivity in topological flat-band systems, Physical Review B 83, 220503 (2011).
  * Peotta and Törmä [2015] S. Peotta and P. Törmä, Superfluidity in topologically nontrivial flat bands, Nature Communications 6, 8944 (2015).
  * Julku  _et al._ [2016] A. Julku, S. Peotta, T. I. Vanhala, D.-H. Kim, and P. Törmä, Geometric Origin of Superfluidity in the Lieb-Lattice Flat Band, Physical Review Letters 117, 045303 (2016).
  * Liang  _et al._ [2017] L. Liang, T. I. Vanhala, S. Peotta, T. Siro, A. Harju, and P. Törmä, Band geometry, Berry curvature, and superfluid weight, Physical Review B 95, 024515 (2017).
  * Törmä  _et al._ [2022] P. Törmä, S. Peotta, and B. A. Bernevig, Superconductivity, superfluidity and quantum geometry in twisted multilayer systems, Nature Reviews Physics 4, 528 (2022).
  * Vidal  _et al._ [1998] J. Vidal, R. Mosseri, and B. Douçot, Aharonov-Bohm Cages in Two-Dimensional Structures, Physical Review Letters 81, 5888 (1998).
  * Vidal  _et al._ [2000] J. Vidal, B. Douçot, R. Mosseri, and P. Butaud, Interaction induced delocalization for two particles in a periodic potential, Physical Review Letters 85, 3906 (2000).
  * Abilio  _et al._ [1999] C. C. Abilio, P. Butaud, T. Fournier, B. Pannetier, J. Vidal, S. Tedesco, and B. Dalzotto, Magnetic Field Induced Localization in a Two-Dimensional Superconducting Wire Network, Physical Review Letters 83, 5102 (1999).
  * Martinez  _et al._ [2023] J. G. Martinez, C. S. Chiu, B. M. Smitham, and A. A. Houck, Interaction-induced escape from an Aharonov-Bohm cage, arXiv:2303.02170 10.48550/arXiv.2303.02170 (2023).
  * Chase-Mayoral  _et al._ [2023] C. Chase-Mayoral, L. English, Y. Kim, S. Lee, N. Lape, A. Andreanov, P. Kevrekidis, and S. Flach, Compact Localized States in Electric Circuit Flatband Lattices, arXiv:2307.15319 10.48550/arXiv.2307.15319 (2023).
  * Longhi [2014] S. Longhi, Aharonov-Bohm photonic cages in waveguide and coupled resonator lattices by synthetic magnetic fields, Optics Letters 39, 5892 (2014).
  * Mukherjee and Thomson [2015] S. Mukherjee and R. R. Thomson, Observation of localized flat-band modes in a quasi-one-dimensional photonic rhombic lattice, Optics Letters 40, 5443 (2015).
  * Mukherjee  _et al._ [2018] S. Mukherjee, M. Di Liberto, P. Öhberg, R. R. Thomson, and N. Goldman, Experimental observation of Aharonov-Bohm cages in photonic lattices, Physical Review Letters 121, 075502 (2018).
  * Călugăru  _et al._ [2022] D. Călugăru, A. Chew, L. Elcoro, Y. Xu, N. Regnault, Z.-D. Song, and B. A. Bernevig, General construction and topological classification of crystalline flat bands, Nature Physics 18, 185 (2022).
  * Fleischhauer  _et al._ [2005] M. Fleischhauer, A. Imamoglu, and J. P. Marangos, Electromagnetically induced transparency: Optics in coherent media, Review of Modern Physics 77, 633 (2005).
  * Pyykkönen  _et al._ [2021] V. A. J. Pyykkönen, S. Peotta, P. Fabritius, J. Mohan, T. Esslinger, and P. Törmä, Flat-band transport and Josephson effect through a finite-size sawtooth lattice, Physical Review B 103, 144519 (2021).
  * Di Liberto  _et al._ [2019] M. Di Liberto, S. Mukherjee, and N. Goldman, Nonlinear dynamics of Aharonov-Bohm cages, Physical Review A 100, 043829 (2019).
  * Gligorić  _et al._ [2019] G. Gligorić, P. P. Beličev, D. Leykam, and A. Maluckov, Nonlinear symmetry breaking of Aharonov-Bohm cages, Physical Review A 99, 013826 (2019).
  * Yanay  _et al._ [2020] Y. Yanay, J. Braumüller, S. Gustavsson, W. D. Oliver, and C. Tahan, Two-dimensional hard-core Bose–Hubbard model with superconducting qubits, npj Quantum Information 6, 58 (2020).
  * Amo and Bloch [2016] A. Amo and J. Bloch, Exciton-polaritons in lattices: A non-linear photonic simulator, Comptes Rendus Physique 17, 934 (2016).
  * Ozawa  _et al._ [2019] T. Ozawa, H. M. Price, A. Amo, N. Goldman, M. Hafezi, L. Lu, M. C. Rechtsman, D. Schuster, J. Simon, O. Zilberberg, and I. Carusotto, Topological photonics, Review of Modern Physics 91, 015006 (2019).
  * Rey [2015] A. M. Rey, Synthetic gauge fields for ultracold atoms, National Science Review 3, 166 (2015).
  * Cooper  _et al._ [2019] N. R. Cooper, J. Dalibard, and I. B. Spielman, Topological bands for ultracold atoms, Review of Modern Physics 91, 015005 (2019).
  * Galitski  _et al._ [2019] V. Galitski, G. Juzeliūnas, and I. B. Spielman, Artificial gauge fields with ultracold atoms, Physics Today 72, 38 (2019).
  * Roushan  _et al._ [2017] P. Roushan, C. Neill, A. Megrant, Y. Chen, R. Babbush, R. Barends, B. Campbell, Z. Chen, B. Chiaro, A. Dunsworth, _et al._ , Chiral ground-state currents of interacting photons in a synthetic magnetic field, Nature Physics 13, 146 (2017).
  * Eisaman  _et al._ [2011] M. D. Eisaman, J. Fan, A. Migdall, and S. V. Polyakov, Invited review article: Single-photon sources and detectors, Review of Scientific Instruments 82, 071101 (2011).
  * Meyer-Scott  _et al._ [2020] E. Meyer-Scott, C. Silberhorn, and A. Migdall, Single-photon sources: Approaching the ideal through multiplexing, Review of Scientific Instruments 91, 041101 (2020).
  * Tomadin and Fazio [2010] A. Tomadin and R. Fazio, Many-body phenomena in QED-cavity array, Journal of the Optical Society of America B 27, A130 (2010).
  * Kang  _et al._ [2023] J. Kang, R. Wei, Q. Zhang, and G. Dong, Topological Photonic States in Waveguide Arrays, Advanced Physics Research 2, 2200053 (2023).
  * Amo  _et al._ [2010] A. Amo, T. Liew, C. Adrados, R. Houdré, E. Giacobino, A. Kavokin, and A. Bramati, Exciton–polariton spin switches, Nature Photonics 4, 361 (2010).
  * Törmä and Sengstock [2014] P. Törmä and K. Sengstock,  _Quantum Gas Experiments: Exploring Many-Body States_ , Vol. 3 (World Scientific, 2014).
  * Gross and Bloch [2017] C. Gross and I. Bloch, Quantum simulations with ultracold atoms in optical lattices, Science 357, 995 (2017).
  * Schäfer  _et al._ [2020] F. Schäfer, T. Fukuhara, S. Sugawa, Y. Takasu, and Y. Takahashi, Tools for quantum simulation with ultracold atoms in optical lattices, Nature Reviews Physics 2, 411 (2020).
  * Li  _et al._ [2022] H. Li, Z. Dong, S. Longhi, Q. Liang, D. Xie, and B. Yan, Aharonov-Bohm Caging and Inverse Anderson Transition in Ultracold Atoms, Physical Review Letters 129, 220403 (2022).
  * Bakr  _et al._ [2009] W. S. Bakr, J. I. Gillen, A. Peng, S. Fölling, and M. Greiner, A quantum gas microscope for detecting single atoms in a Hubbard-regime optical lattice, Nature 462, 74 (2009).
  * Sherson  _et al._ [2010] J. F. Sherson, C. Weitenberg, M. Endres, M. Cheneau, I. Bloch, and S. Kuhr, Single-atom-resolved fluorescence imaging of an atomic Mott insulator, Nature 467, 68 (2010).
  * Jia  _et al._ [2023] L. Jia, J. Wu, Y. Zhang, Y. Qu, B. Jia, and D. J. Moss, Third-Order Optical Nonlinearities of 2D Materials at Telecommunications Wavelengths, Micromachines 14, 307 (2023).
  * Miller  _et al._ [1983] D. A. B. Miller, D. S. Chemla, D. J. Eilenberger, P. W. Smith, A. C. Gossard, and W. Wiegmann, Degenerate four-wave mixing in room-temperature GaAs/GaAlAs multiple quantum well structures, Applied Physics Letters 42, 925 (1983).
  * Zhang  _et al._ [2022] Q. Zhang, Q. Bai, E. Cai, L. Hao, M. Wang, S. Zhang, Q. Zhao, L. Teng, N. Sui, F. Du, and X. Wang, Nonlinear optical properties of graphdiyne/graphene van der Waals heterostructure for laser modulations, Results in Physics 38, 105654 (2022).
  * Carusotto and Ciuti [2013] I. Carusotto and C. Ciuti, Quantum fluids of light, Review of Modern Physics 85, 299 (2013).
  * Tomm  _et al._ [2021] N. Tomm, A. Javadi, N. O. Antoniadis, D. Najer, M. C. Löbl, A. R. Korsch, R. Schott, S. R. Valentin, A. D. Wieck, A. Ludwig, _et al._ , A bright and fast source of coherent single photons, Nature Nanotechnology 16, 399 (2021).
  * O’Faolain  _et al._ [2010] L. O’Faolain, D. M. Beggs, T. P. White, T. Kampfrath, K. Kuipers, and T. F. Krauss, Compact optical switches and modulators based on dispersion engineered photonic crystals, IEEE Photonics Journal 2, 404 (2010).
  * Sanders and Milburn [1992a] B. C. Sanders and G. J. Milburn, Quantum limits to all-optical phase shifts in a Kerr nonlinear medium, Physical Review A 45, 1919 (1992a).
  * Sanders and Milburn [1992b] B. C. Sanders and G. J. Milburn, Quantum limits to all-optical switching in the nonlinear Mach–Zehnder interferometer, Journal of the Optical Society of America B 9, 915 (1992b).
  * Bravyi  _et al._ [2011] S. Bravyi, D. P. DiVincenzo, and D. Loss, Schrieffer–Wolff transformation for quantum many-body systems, Annals of Physics 326, 2793 (2011).
  * Cohen-Tannoudji  _et al._ [1998] C. Cohen-Tannoudji, J. Dupont-Roc, and G. Grynberg,  _Atom-photon interactions: basic processes and applications_ (John Wiley & Sons, 1998).