Introduction

Atomic ensembles are a very successful platform used to couple input light to atomic degrees of freedom, allowing the development of new quantum technologies. Historically, the weak optical nonlinearities associated with atomic ensembles have allowed most of the processes of interest, such as quantum memories for light1, to be describable within a limited realm of classical linear optics or Gaussian quantum states2. More recently, it has become possible to engineer strong interactions between photons in atomic ensembles and thereby realize highly non-Gaussian states. Under weak field inputs, for example, phenomena such as photon blockade3 or two-photon bound states4 in atomic Rydberg gases5,6,7 have been experimentally demonstrated. A number of other systems, such as photonic waveguides coupled to atoms8,9,10,11,12,13,14 or “artificial” atoms such as superconducting qubits and quantum dots15,16,17,18 also show potential to realize similar physics.

A major question of interest is what occurs in such systems at higher field inputs. In particular, it is expected that strong interactions might lead to interesting many-body phenomena involving photons, such as photon crystallization (illustrated schematically in Fig. 1a). To address this question theoretically seems challenging: the systems are out of equilibrium, being driven by an external laser source; are open, where spontaneous decay of atoms leads to losses; and have long range interactions between atoms mediated by the exchange of photons. Some progress has been made in limiting regimes, where for example effective theories can emerge under certain approximations11, 12, 19,20,21,22,23,24,25,26. While these effective theories provide useful insights, it would also be highly desirable to develop numerical methods with minimal approximations to verify these models and investigate regimes where the approximations break down, potentially revealing new physics as a result.

Fig. 1
figure 1

Photon propagation in atomic ensembles. a Propagation through atomic ensembles with strong inter-atomic interactions can lead the quantum properties of the light to be strongly modified, represented here as crystalline-like output of photons from the medium. b In a typical approach to treat such quantum light propagation numerically, space is broken up into M discrete units centered at positions z j , with corresponding local Fock basis states \(\left| {0_{z_j}} \right\rangle ,\left| {1_{z_j}} \right\rangle , \ldots\) for the photons. The equations of motion for the field may be solved on this space, where the growth of the Hilbert space with the number of Fock components on each site typically restricts calculations to a maximum of two or three photons in the entire system. c Here instead we model the quasi-1D propagation problem by a 1D waveguide coupled to N atoms. In this case the degrees of freedom associated with the light field are integrated out, to produce an effective model consisting of an interacting “spin” chain (with the spins being associated with atomic internal states). Output fields are then directly calculated from the spin dynamics using an input-output relation and the Hilbert space is reduced to the atomic one, which can be efficiently treated using matrix product states. As discussed in the Results section, the atoms are coupled to the waveguide modes with strength Γ1D and for the simple case of two-level atoms the excited state |e〉 may also decay into modes outside of the waveguide at rate Γ′

Currently numerical techniques are quite limited. For example, the standard approach is to describe the atom-light dynamics using Maxwell-Bloch equations27, 28, which are solved by discretizing the atomic and photonic fields3, i.e., by modeling the continuum in which fields propagate by a finite number M of boxes, as depicted in Fig. 1b. To describe a state with up to n photons in each box then requires a Hilbert space with dimension of at least (n + 1)M (plus any atomic degrees of freedom associated with each box). In practice, this has limited numerical simulations to two3, 4, 20, 29, 30 or three23 total excitations over the entire system, and excluding the full effects of dissipation (in particular, either quantum jumps in wave function evolution, or population recycling terms in density matrix evolution).

Here, we show instead that simulating the high-photon number limit is possible by mapping the propagation problem onto the dynamics of a one-dimensional (1D) open “spin” model, which can be solved using the powerful matrix product state (MPS) ansatz31, 32. The essence of the spin model is that in light propagation through an ensemble, the only independent degrees of freedom are the atomic internal states (“spins”), where the light fields mediate interactions between the atoms. A common theoretical approach is then to integrate out the fields, reducing the description to a problem of N interacting spins (N being the number of atoms)33,34,35,36,37,38,39. Furthermore, many light propagation experiments are quasi-one dimensional, where the input and output light are in a single transverse mode2. In this case, a simpler model capturing the same physics is a 1D spin chain coupled by the modes of a 1D photonic waveguide, as shown in Fig. 1c.

Our model further takes advantage of the fact that typically the number of spins in the chain does not appear independently, but rather macroscopic observables such as optical depth depend on the product of atom number and the atom-photon interaction probability. By tuning this probability to be large, a relatively small (~102) number of atoms is sufficient to model most atomic ensemble experiments. We can then use the MPS technique from condensed matter physics to numerically simulate the system, which is well adapted to treating chains of hundreds of spins. This technique depends on the fact that many of the quantum states we encounter in reality do not have large amounts of entanglement and are confined to a small portion of the in-principle exponential Hilbert space, allowing for a more efficient state representation. While the amount of entanglement present in atom-light interfaces is generally an unstudied problem, we give heuristic arguments below why we expect the MPS ansatz to work for such systems. As a benchmark of our model, we use it to simulate pulse propagation in the case of vacuum induced transparency40, 41, which is one of the few cases where many-photon propagation is qualitatively understood30, 42.

Results

1D spin model of light propagation

While there are some phenomena in atomic ensembles that are truly three-dimensional, such as radiation trapping43 and collective emission at high densities44,45,46, within the context of generating many-body states of light, the problems of interest largely involve quasi one-dimensional propagation19,20,21,22,23,24, 26. Indeed a typical experimental design is to input light in a single transverse mode and detect the light in the same mode after it traverses the ensemble. The standard approach to describe light propagation in such a system is to use Maxwell–Bloch equations27, 28 in their one-dimensional, paraxial form2,3,4, 20, 47,48,49. There, the electric field operator can be decomposed as the sum of a forward propagating mode that travels in the direction of the input, taken here to be the positive z direction, and a backward propagating one, E(z, t) = E +(z, t) + E (z, t). These have propagation equations,

$$\left( {\frac{1}{c}\frac{\partial }{{\partial t}} \pm \frac{\partial }{{\partial z}}} \right){\kern 1pt} E_ \pm \left( {z,t} \right) = i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} P_{{\mathrm{ge}}}\left( {z,t} \right),$$
(1)

determined by the atomic polarization density operator P ge(z). For concreteness, we assume that the probe field couples to a single dipole-allowed transition from atomic ground state |g〉 to excited state |e〉, however, it is straightforward to modify these equations to account for additional atomic levels and transitions, driving fields, and interactions.

The atomic polarization density, on the other hand, is driven by the field, and obeys an optical Bloch equation

$$\begin{array}{*{20}{l}} {\partial _tP_{{\mathrm{ge}}}\left( {z,t} \right)} \hfill & \hskip-8pt = \hfill &\hskip-7pt { - i\left( {\omega _{{\mathrm{eg}}} - i\Gamma^\prime {\mathrm{/}}2} \right){\kern 1pt} P_{{\mathrm{ge}}}\left( {z,t} \right)} \hfill \\ {} \hfill & {} \hfill & { + i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} \left[ {P_{{\mathrm{gg}}}\left( {z,t} \right) - P_{{\mathrm{ee}}}\left( {z,t} \right)} \right]{\kern 1pt} E\left( {z,t} \right) + F\left( t \right),} \hfill \end{array}$$
(2)

where ω eg is the atomic transition frequency, P ee,gg are the excited and ground state populations, and F describes the quantum noise associated with decay rate Γ′. Here we have introduced the coupling rate Γ1D of an individual atom to the one-dimensional input mode. In principle, this rate can vary with z depending on the details of this mode, but for notational simplicity we assume here that it is constant. In this standard formulation of the Maxwell-Bloch equations, it should be noted that the interaction of the atoms with the remaining continuum of three-dimensional modes is reduced to an independent emission rate Γ′, meant to approximately capture scattering of photons out of the transverse mode of interest. The question of when this approximation breaks down is quite complicated and rich20, 50, 51 and will not be discussed here; in any case, Eqs. (1, 2) are widely accepted as the standard model for quasi-1D light propagation through atomic ensembles.

Eqs. (1, 2) represent an open, interacting quantum field theory, for which a general solution is unknown. The complexity is reduced in ensembles that lack strong non-linearities, where for example one can linearize the atomic system, such that the resulting joint quantum state of matter and light is Gaussian2. However, in the highly non-linear ensembles that are interesting for many-body physics we are typically restricted to solving numerically the Maxwell-Bloch equations by discretizing the fields, which, as mentioned in the introduction, is not feasible for more than a few photonic excitations.

Here instead, we take advantage of the fact that the Maxwell-Bloch equations presented above can also formally arise from a simple toy model of atoms coupled to a 1D waveguide36, 52,53,54,55. In particular, one can consider a model of atoms coupled to a bi-directional waveguide of infinite bandwidth, and frequency-independent propagation speed c and coupling strength. In that case, the propagation equations of the forward and backward going modes are exactly those in Eq. (1), where \(P_{{\mathrm{ge}}}(z) = \mathop {\sum}\nolimits_{j = 1}^N {\kern 1pt} \sigma _{{\mathrm{ge}}}^j\delta \left( {z - z_j} \right)\) for N atoms with positions z j . These equations can then be formally integrated giving a solution for the field as the sum of the input field \({\cal E}_{{\mathrm{in}}}(z,t)\) and the field radiated by the atoms36,37,38,39,

$$E\left( {z,t} \right) = {\cal E}_{{\mathrm{in}}}\left( {z,t} \right) + i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} {\kern 1pt} \mathop {\sum}\limits_{j = 1}^N {\kern 1pt} e^{ik_0\left| {z - z_j} \right|}\sigma _{{\mathrm{ge}}}^j(t).$$
(3)

In the above equation the propagation of the field from the atomic position z j to z leads to a phase factor determined by the wavevector k 0 = ω eg/c. On the other hand, the time delay in free-space propagation is neglected and the field sees the response of an atom at another point instantly. That is, any pulse delay that arises is due to the atomic dispersion itself. This is justified when the free-space propagation time over the length of the system L is much smaller than the time scale characterising the atomic evolution, e.g., when \(L{\mathrm{/}}c \ll 1{\mathrm{/}}\Gamma'\), a condition easily satisfied in atomic ensemble experiments36. In limiting cases, this approximation can be further validated by solving for dynamics exactly and seeing that the results are the same56.

Removing time retardation provides a drastic simplification of the problem as the equations of motion of the atoms and fields are now all local in time. Indeed, inserting Eq. (3) into the Heisenberg equation for the atomic coherences, one finds that the dynamics of the atoms depend only on the input field and on the state of the other atoms at the same time. Part of the system dynamics can then be derived from an atomic interaction Hamiltonian36, 54,

$$H_{{\mathrm{dd}}} = \frac{{\Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \mathop {\sum}\limits_{j,l = 1}^N {\kern 1pt} {\mathrm{sin}}\left( {k_0\left| {z_j - z_l} \right|} \right){\kern 1pt} \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^l$$
(4)

which describes the process of emission by an excited atom at z j into the waveguide, and the subsequent absorption of that photon by a ground-state atom at z l . These effective atom-atom interactions also lead to collective spontaneous emission, described in the master equation by the Lindblad operator

$$\begin{array}{*{20}{l}} {{\cal L}_{{\mathrm{dd}}}\left[ \rho \right]} \hfill & \hskip-8pt = \hfill &\hskip-7pt { \frac{{\Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \mathop {\sum}\limits_{j,l = 1}^N {\kern 1pt} {\mathrm{cos}}\left( {k_0\left| {z_j - z_l} \right|} \right)} \hfill \\ {} \hfill & {} \hfill & { \times \left( {2\sigma _{{\mathrm{ge}}}^j\rho \sigma _{{\mathrm{eg}}}^l - \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^l\rho - \rho \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^l} \right).} \hfill \end{array}$$
(5)

In addition, we can add a phenomenological independent decay rate Γ′ as in the Maxwell-Bloch equations, which corresponds to scattering out of the quasi-1D input mode. This is described by the locally acting Lindblad operator \({\cal L}_{{\mathrm{spont}}}[ \rho ] = \Gamma^\prime{\mathrm{/}}2{\kern 1pt} \mathop {\sum}\nolimits_{j = 1}^N {\kern 1pt} ( {2\sigma _{{\mathrm{ge}}}^j\rho \sigma _{{\mathrm{eg}}}^j - \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^j\rho - \rho \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^j} )\).

The coupling of the atoms to the input field is given by \(H_{{\mathrm{drive}}} = - \sqrt {\Gamma _{{\mathrm{1D}}}{\mathrm{/}}2}{\kern 1pt} \mathop {\sum}\nolimits_{j = 1}^N ( {{\cal E}_{{\mathrm{in}}}(t,z_j){\kern 1pt} \sigma _{{\mathrm{eg}}}^j + {\mathrm{H}}.{\mathrm{c}}.} )\). In the following we will consider the case most common in experiments of a coherent state input, where \({\cal E}_{{\mathrm{in}}}\) can be treated as a classical field57 and we neglect the associated quantum noise term, as this does not contribute to the normally ordered correlation functions of the output field that we will be interested in. The output field itself is the field measured past the position of the last atom, \(E_{{\mathrm{out}}}(t) = E\left( {z_N^ + ,t} \right)\) given by Eq. (3), which is completely determined by the solution of the driven spin system and the input.

In the model above, the coupling of the atoms to the waveguide and the positions of the atoms must be chosen carefully to reproduce phenomena associated with free-space ensembles. In particular, as we discuss below, our numerical calculations are facilitated by choosing ratios of \(\Gamma _{{\mathrm{1D}}}{\mathrm{/}}\Gamma^\prime \sim 1\). It is known that for a weak resonant input field, a single two-level atom can produce an appreciable reflectance of \(\Gamma _{{\mathrm{1D}}}^2{\mathrm{/}}\left( {\Gamma _{{\mathrm{1D}}} + \Gamma^\prime } \right)^2\) 52, 53. The reflectance can be further enhanced if multiple atoms are placed on a lattice with lattice constant defined by k 0 a = π, in which case the reflectance from individual atoms constructively interferes54, 58, 59. While it is possible to observe similar effects in atomic ensembles60, 61, this situation is atypical and will not be discussed further here. To reproduce the typical case in atomic ensembles where reflection is negligible, we choose a waveguide spacing of k 0 a = π/2, in which case reflection from different atoms in the lattice destructively interferes.

In this configuration, the 1D waveguide model reproduces one of the key features of an atomic ensemble, that of decay of the transmitted field with increasing optical depth. If we consider the transmittance \(T = \langle {E_{{\mathrm{out}}}^{\mathrm{\dagger }}E_{{\mathrm{out}}}} \rangle {\mathrm{/}}| {{\cal E}_{{\mathrm{in}}}} |^2\), then for a resonant weak coherent state input we find in the 1D waveguide model T = exp(−OD), where the optical depth is OD = 2NΓ1D/Γ′ for \(\Gamma _{1{\mathrm{D}}} \, \lesssim \, \Gamma^\prime\) 12. Since \({\mathrm{OD}} \, \lesssim \, 10^2\) in realistic atomic ensembles of ~106 weakly coupled atoms, by artificially choosing \(\Gamma _{{\mathrm{1D}}}\sim \Gamma^\prime\), the same optical depth is achieved with just tens or hundreds of atoms. At the same time, the essential properties of most quantum nonlinear optical phenomena are believed to depend only on optical depth47, 62, 63, or on a limited number of other parameters where atom number does not appear independently (such as the optical depth per blockaded region in a Rydberg gas6, 26, 29). By matching these parameters using a much smaller number of atoms, we can then model the physics of interest in 3D atomic ensembles. The possibility that artificial effects (such as saturation) arise from low atom number can be eliminated by numerically checking that observables converge with increasing N while, e.g., decreasing Γ1D in proportion to keep the key parameters fixed.

While our model can be used to reproduce the macroscopic observables of light propagation in a traditional atomic ensemble, we also note that it quantitatively captures the microscopic details of experiments where atoms or other quantum emitters couple to 1D channels. This includes atoms coupled to nano-fibers (\(\Gamma _{{\mathrm{1D}}}{\mathrm{/}}\Gamma^\prime \sim 0.05\))13 or photonic crystals (\(\Gamma _{{\mathrm{1D}}}{\mathrm{/}}\Gamma^\prime \sim 1\))14, or “artificial” atoms such as superconducting qubits or quantum dots coupled to waveguides (\(\Gamma _{{\mathrm{1D}}}{\mathrm{/}}\Gamma^\prime \gg 1\))15,16,17,18. In these cases, our model is valid when the spacing between the atoms is of the order of the wavelength of the light or larger, for smaller atomic distances additional effects can occur51, 64.

Simulations using matrix product states

Using the 1D spin model described above significantly reduces the size of the Hilbert space required to simulate the light propagation problem, but the dimension still grows exponentially with atom number. This growth can be avoided in the case where the input field is sufficiently weak that the Hilbert space can be truncated to a maximum number of total excitations likely to be found in the system12, 36. In the more general case, where many-photon effects are important, the full Hilbert space may be treated numerically for around 10–20 atoms depending on the size of the single-atom Hilbert space dimension d. Going beyond this requires some reduction of the Hilbert space and here we choose to use matrix product states, which have been successfully used in condensed matter to model a wide variety of 1D interacting spin systems31, 32.

The key idea behind MPS is to write the quantum state of the spin chain in a local representation where only a tractable number of basis states from the full Hilbert space is retained. In the case of time evolution, these basis states are updated dynamically in order to have optimum overlap with the true state wave function. In particular, the wave function of a many-body system \(\left| \psi \right\rangle = \mathop {\sum}\nolimits_{\sigma _1, \ldots ,\sigma _N} {\kern 1pt} \psi _{\sigma _1,\sigma _2, \ldots ,\sigma _N}{\kern 1pt} \left| {\sigma _1,\sigma _2, \ldots ,\sigma _N} \right\rangle\) can be represented by reshaping the N-dimensional tensor \(\psi _{\sigma _1,\sigma _2, \ldots ,\sigma _N}\) into a matrix product state of the form

$$\left| \psi \right\rangle _{{\mathrm{MPS}}} = \mathop {\sum}\limits_{\sigma _1, \ldots ,\sigma _N} {\kern 1pt} A^{\sigma _1}A^{\sigma _2} \ldots A^{\sigma _N}{\kern 1pt} \left| {\sigma _1,\sigma _2, \ldots ,\sigma _N} \right\rangle ,$$
(6)

where σ j represent the local d-dimensional Hilbert space of the atoms, e.g., \(\sigma _j \in \left\{ {\left| {\mathrm{e}} \right\rangle ,\left| {\mathrm{g}} \right\rangle } \right\}\) for two-level atoms. Each site j in the spin chain has a corresponding set of d matrices, \(A^{\sigma _j}\), and by taking the product of these matrices for some combination of σ j ’s we then recover the coefficient \(\psi _{\sigma _1,\sigma _2, \ldots ,\sigma _N}\). The matrices have dimensions D j−1 × D j for the jth site (D 0 = D N+1 = 1), which are referred to as the bond dimensions of each matrix. We also define D = max j {D j } as the maximum bond dimension of the state \(\left| \psi \right\rangle _{{\mathrm{MPS}}}\). This representation is completely general, and as such the bond dimensions grow exponentially in size for arbitrary quantum states. In certain circumstances, however, the bond dimension D needed to approximate a state well might grow more slowly with N due to limited entanglement entropy, which enables MPS to serve as an efficient representation.

For example, this forms the underlying reason for the efficiency of density-matrix renormalization group algorithms for computing ground states of 1D systems with short-range interactions65. A priori, for our system involving the dynamics of an open system with long-range interactions, we know of no previous work that makes definitive statements about the scaling of D. However, we can provide some intuitive arguments that MPS should work well (at least without additional interactions added to the system). First, we note that although the dipole-dipole interaction term in Eq. (4) appears peculiar, being infinite-range and non-uniform, it conserves excitation number. For a single excitation, it simply encodes a (well-behaved) linear optical dispersion relation that propagates a pulse from one end of the atomic system to the other12, and thus does not add entanglement to the system. While the spin nature in principle makes the atoms nonlinear, thus far in atomic ensemble experiments the strength of nonlinearity arising purely from atomic saturation remains very small at the level of single photons, and thus one can hypothesize that only a small portion of the Hilbert space is explored.

Once extra interactions are added, at the moment the scaling of D must be investigated on a case-by-case basis. However, generically one expects that the system has a memory time corresponding roughly to the propagation time of a pulse through the length of the system. Thus, if the system is driven continuously, it should generally reach a steady state over this time and there will not be an indefinite growth of entanglement. In the case of pulsed input, the number of photons in the pulse limits entanglement and it is possible to establish upper bounds on the bond dimension required as we discuss in the Supplementary Note 1. For arbitrary n-photon wave functions the bound may still scale exponentially in the number of photons N n/2, however in the case of vacuum induced transparency that we investigate as a benchmark the scaling is instead approximately quadratic in the number of photons.

In our MPS treatment of the spin model we adopt a quantum jump approach to model the time dynamics of the master equation66, which has been successfully applied to many-body dissipative systems67, 68. As we describe in more detail in the Methods, this method decomposes the master equation evolution into an ensemble of quantum trajectories, which are formed by deterministically evolving pure states under an effective Hamiltonian H eff and stochastically applying quantum jumps to the system. As an aside, however, we note that MPS-based techniques for evolution of density matrices have also been developed69,70,71,72. Whether and when such techniques out-perform quantum jump methods for our problem is likely a subtle question, which will be explored in more detail in future work.

To numerically simulate the spin model there are then four essential manipulations of the MPS as illustrated in Fig. 2 and described in greater detail in the Methods. The first is (a) deterministic evolution of the MPS over a small discrete time step δt. Here an approximation of the time evolution operator \(e^{ - iH_{{\mathrm{eff}}}\delta t} \approx 1 - iH_{{\mathrm{eff}}}\delta t\) is applied to the MPS representation of the state. This is achieved by expressing the operator as a matrix product operator (MPO), a generalization of MPS to operators. After this deterministic evolution the MPS then undergoes (b) stochastic quantum jumps that account for dissipation, realised again by applying MPOs to the MPS, where this time the MPOs correspond to the quantum jump operators O l . In each case, after applying an MPO (with corresponding bond dimension D W defined in the same way as for an MPS) to an MPS, the MPS bond dimension increases. The state must then be (c) compressed to constrain the growth of its representation in time. At any time step we may then (d) calculate observables, such as the output field, given the MPS representation of a state and the MPO corresponding to the observable. The steps are then repeated to obtain the full time evolution.

Fig. 2
figure 2

Schematic of MPS operations. a Deterministic time evolution of MPS. The initial state |ψ(t)〉 in MPS form is presented pictorially as a tensor network, where the circles represent the set of local matrices \(A^{\sigma _j}\) on each site j. The lines or bonds joining the circles represent the contraction of these local tensors to give the state |ψ(t)〉, where the bonds have dimension D j . The open ended lines correspond to the local d-dimensional Hilbert space of the atoms σ j . The deterministic evolution is then found by contracting these open connectors with those of the MPO representing \(e^{ - iH_{{\mathrm{eff}}}\delta t} \approx 1 - iH_{{\mathrm{eff}}}\delta t\), shown as a tensor network of red squares. b Quantum jumps. After each deterministic evolution a random number generator is used to decide whether quantum jumps should be applied to the wave function. This is achieved by applying the MPO corresponding to a quantum jump O l , shown as a tensor network of green squares. c After the application of the time evolution or jump MPOs the resulting MPS has larger bond dimension, e.g., \(D_1^\prime = D_{\mathrm{W}} \times D_1\), and is compressed, typically back to the original bond dimension, although this can be increased if the compression produces a large error. d Measurement of observables. At any time we may measure an observable by sandwiching the corresponding MPO, here for example \(E_{{\mathrm{out}}}^{\mathrm{\dagger }}E_{{\mathrm{out}}}\), between the MPSs representing |ψ〉 and 〈ψ|, so that the corresponding tensor contraction yields \(\left\langle {\psi \left| {E_{{\mathrm{out}}}^{\mathrm{\dagger }}E_{{\mathrm{out}}}} \right|\psi } \right\rangle\)

Vacuum induced transparency

The model introduced above gives a powerful and flexible algorithm for simulating the interaction of light with atomic ensembles in the multi-photon limit. To demonstrate the utility of this approach we now investigate the phenomenon of vacuum induced transparency (VIT)40. This example also serves to benchmark our method, as exact solutions for non-trivial multiphoton behavior are not available, while in the case of VIT at least the qualitative nature of the system dynamics is understood.

VIT is closely related to the effect of electromagnetically induced transparency (EIT)1, which occurs in three-level atomic media. In a two-level medium incoming probe light that couples resonantly to an atomic transition |g〉-|e〉 is absorbed and scattered by the atoms into other directions, leading for example to the strong attenuation in the linear transmittance for high optical depth, T = exp(−OD). In EIT, an additional metastable level |s〉 (Fig. 3a) is also coupled to the excited state by a classical control field with Rabi frequency Ω, allowing probe photons to couple with spin-wave excitations from state |g〉 to |s〉, forming so-called “dark-state polaritons”. The coupling to the spin wave leads to a strongly reduced group velocity relative to free space (v g = Ω2 a/(2Γ1D) for a waveguide with spin chain lattice constant a 12), while the absence of population in |e〉 enables a pulse to propagate with minimal attenuation.

Fig. 3
figure 3

Vacuum induced transparency. a Three-level atoms, where the transition |s〉-|e〉 is coupled to a control or cavity field with frequency ω c, allow for transparent propagation of probe photons (ω p) in EIT or VIT. b In VIT, an atomic ensemble is trapped inside an optical cavity where the atoms couple both to the probe field E in and to a cavity mode, which is initially in its vacuum state. Photons in the cavity have an associated decay rate κ from transmission through the mirrors. c Idealized time-dependent transmission of a coherent pulse with average number of photons equal to one through a VIT medium. Here, the intensity (photons per unit time) is normalized by the single-atom decay rate Γ′ into free space, while the time t is also normalized by Γ′. In the case where all loss mechanisms are ignored, as well as the effect of pulse distortion on entry and exit from the atomic ensemble, the individual Fock number state components |n〉 of the input pulse (blue) propagate through the medium with group velocity v n n. This leads to separation of the one- (red), two- (yellow) and three-photon (violet) components of the output field, and a total output intensity shown by the green dashed line. We have taken v 1 = 4aΓ′ and the medium has a length L = 100a

In VIT the control field is replaced by strong coupling of the atoms to a resonant cavity mode as shown in Fig. 3b 40, 73, which is described by the Hamiltonian \(H_{{\mathrm{cav}}} = g{\kern 1pt} \mathop {\sum}\nolimits_{j=1}^N {\kern 1pt} ( {\sigma _{{\mathrm{es}}}^jb + {\mathrm{H}}.{\mathrm{c}}.} ){\mathrm{/}}2\) in the case of uniform coupling g to a cavity mode with annihilation operator b. Here even when the cavity is empty the atomic medium can become transparent as vacuum Rabi oscillations transfer population from state |e〉 to |s41. The propagation of light in the system then takes on the nature of the non-linear coupling of the atoms to the cavity. Specifically, the formation of a spin wave from n probe photons is accompanied by the excitation of the same number of cavity photons, which produce an effective control field strength of \(\sqrt n g\). Since in EIT the group velocity of the light is determined by the control field, where v g Ω2, the group velocity in VIT becomes number dependent \(v_n\sim ng^2a{\mathrm{/}}\left( {2\Gamma _{{\mathrm{1D}}}} \right)\) 30, 42. Fock states |n〉 input into the system are then expected to propagate at v n .

On the other hand, a coherent state |α〉 that has average number of photons |α|2 is a superposition of Fock states, where n photons are present with probability \(e^{ - \left| \alpha \right|^2}{\kern 1pt} \left| \alpha \right|^{2n}{\mathrm{/}}n!\). Input into the VIT medium, these components are then expected to spatially separate due to their different propagation velocities, given sufficient optical depth. The output intensity can then be calculated naively by simply delaying the input Fock components by a time τ n  = L/v n , where L is the length of the atomic medium. The output intensity in time resulting from such a toy model is shown in Fig. 3c, for a coherent state input pulse with average number 〈n pulse〉 = 1. We have taken the system length to be L = 100a and the single photon velocity v 1 = 4aΓ′, which results for example from taking g = 4Γ′ and Γ1D = 2Γ′ in which case the system’s optical depth is 400. We note that the experimental conditions needed to observe photon number separation in VIT are difficult to achieve41, and thus our parameters are chosen to observe the desired effect, rather than correspond to a given experiment.

A plot similar to Fig. 3c was given in a previous theoretical treatment of VIT42, as at that time it was unknown how to calculate observables in the presence of losses and spatio-temporal effects, such as occurring from pulse entry and exit from the atomic medium. More recently, VIT has also been studied numerically in the weak-field limit using the space discretization technique schematically illustrated in Fig. 1b 30. In the weak field limit, only the single photon manifold contributes to the output intensity and the higher number components are only visible in higher order correlation functions like g (2). This also means that quantum jumps have a negligible effect on the system dynamics, and they were neglected in the calculations. In more general circumstances, using MPS simulations, we will show that the effects of quantum jumps and pulse distortion can have a significant effect on the output field.

For concreteness, we take input pulses with central frequency ω p and Gaussian envelope \({\cal E}_{{\mathrm{in}}}(t) = \alpha \left( {\pi \sigma _t^2{\mathrm{/}}2} \right)^{ - 1/4}{\kern 1pt} {\mathrm{exp}}\left( {\left. { - \left( {t - t_0} \right)^2{\mathrm{/}}\sigma _t^2} \right)} \right)\), which have an average photon number of \(\left\langle {n_{{\mathrm{pulse}}}} \right\rangle = \left| \alpha \right|^2\sim 1\). The average photon number chosen is not due to any intrinsic limitation coming from the MPS method itself, but rather because in VIT the spatial separation is largest for the Fock components with low photon number (Fig. 3c) and with |α|2 = 1 the single photon and two photon components of the coherent state give an equal contribution to intensity emphasizing this effect. In this case, number states with three or more photons make up 8% of the input state and constitute 26% of the input intensity due to their high photon number.

To treat VIT, we include in the spin model formalism the atomic part H 0 of the total effective Hamiltonian (Eq. (8) in Methods section),

$$\begin{array}{*{20}{l}} {H_0} \hfill & \hskip-8pt = \hfill &\hskip-7pt { - \mathop {\sum}\limits_{j=1}^N {\kern 1pt} \left( {\Delta + i\frac{{\Gamma^\prime }}{2}} \right){\kern 1pt} \sigma _{{\mathrm{ee}}}^j - \left( {\delta _{\mathrm{c}} + i\frac{\kappa }{2}} \right){\kern 1pt} b^{\mathrm{\dagger }}b} \hfill \\ {} \hfill & {} \hfill & { + \frac{g}{2}{\kern 1pt} \mathop {\sum}\limits_{j=1}^N {\kern 1pt} \left( {\sigma _{{\mathrm{es}}}^jb + {\mathrm{H}}{\mathrm{.c}}} \right).} \hfill \end{array}$$
(7)

Here Δ = ω p − ω eg is the detuning of the probe light from the |e〉-|g〉 transition frequency, δ c = ω p − ω c − ω sg is the VIT two-photon detuning and κ is the decay rate of the cavity mode. In what follows we assume both the probe and cavity are resonant with their respective transitions, so that Δ = δ c = 0. Dissipation via the various loss channels is then included through quantum jump operators, where the collective emission into the waveguide is described by O ± as detailed in the Methods. The jump operator corresponding to cavity decay is \(O_{\mathrm{c}} = \sqrt \kappa b\) and we assume that the atomic excited state can decay via free-space spontaneous emission into either state |g〉 or |s〉 (taking these decay rates to be equal for simplicity), leading to 2N jump operators \(O_{j,{\mathrm{ge}}} = \sqrt {\Gamma^\prime {\mathrm{/}}2} \sigma _{{\mathrm{ge}}}^j\) and \(O_{j,{\mathrm{se}}} = \sqrt {\Gamma^\prime {\mathrm{/}}2} \sigma _{{\mathrm{se}}}^j\). The cavity mode is represented in our MPS treatment by an additional site in our spin chain, which can support up to n c bosonic excitations. In the simulations we present here we have taken n c = 10 and observe no difference in observables if n c is increased.

In Fig. 4a, b, we show the time-dependent output pulse intensity \(I_{{\mathrm{out}}}(t) = \langle {E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}(t)} \rangle\) calculated from an MPS simulation of 100 atoms and an input pulse with |α|2 = 1. We also show the zero-delay second-order correlation function \(I_{{\mathrm{out}}}^{(2)}(t,t) = \langle {E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}(t)E_{{\mathrm{out}}}(t)} \rangle\). In the output intensity two main peaks are observed, where the first peak in time (\(t\Gamma^\prime \sim 23\)) is due to photon number components with two or more photons, while the last peak (\(t\Gamma^\prime \sim 36\)) is associated with the slow propagation and exit of the single-photon component. That the most delayed part contains only single photons can be confirmed by looking at the second order correlation function which is only non-zero in the first part of the pulse. In Fig. 4b, we see good agreement between the features of the numerical pulse shape and the expected group velocity for each part of the pulse (compare with Fig. 3c), where the vertical black dashed lines represent the expected times for the peaks of the Fock state components, that is, with delays τ n .

Fig. 4
figure 4

VIT output field. a Pulse propagation in a VIT medium with optical depth OD = 400, simulated using N = 100 atoms coupled to a 1D-waveguide, and averaged over 20000 quantum trajectories. Input of a coherent pulse with |α|2 = 1 (blue) results in an output intensity I out(t) (red) with two main peaks. Also plotted is the second-order correlation function \(I_{{\mathrm{out}}}^{(2)}(t,t)\) (yellow). b Zoom of the plot above, with dashed lines showing the expected positions of pulses delayed by τ n , for n = 1, …, 5. Simulation parameters are Γ1D  = 2Γ′, Δ = δ c = 0, g = 4Γ′, κ = 0.03Γ′, σ t  = 3/Γ′ and t 0 = 10/Γ′. We chose D = 50 and δt = 0.01/Γ′ where convergence was observed for all observables of interest (see Methods)

Compared with the ideal picture in Fig. 3c, where a clean separation is seen between one and two photons, one can see that the full simulation produces a much larger intensity between the one- and two-photon peaks. We now show how the trajectories from the MPS simulations can be further filtered and analyzed, to gain insight about the underlying physics. In particular, we find that quantum jumps play a key role in blurring the separation between the different number components in the output, even for the very good system parameters that we have chosen (OD = 400, \(g{\mathrm{/}}\kappa \sim 130\)). An intuitive picture of how the blurring occurs can be gained by considering two photons that enter the medium, and initially propagate at a velocity v 2 = 2v 1. During evolution, this state may decay via spontaneous emission into free space and leave behind a single photon propagating in the medium, at which point the group velocity is slowed to v 1. This change in group velocity can happen at any point in the system and leads to single photons that arrive at the output earlier than expected if just a single-photon Fock state was input into the system, destroying the perfect separation of the single photon output from the two photon component.

We can quantify this behavior by analyzing the quantum jumps that happen in our simulations, where due to the choice of physical jump operators discussed in the Methods, the total number of jumps in a given trajectory corresponds to the number of photons emitted from the system. Furthermore, the type of jumps (and thus the emission channel) can be explicitly tracked, between free-space loss, cavity loss, or detection in the waveguide output. In Fig. 5a, we show a histogram of the average number of jumps into the output waveguide channel versus time for the 20000 trajectories used to produce Fig. 4. This provides an alternative way (compare to Fig. 4) to calculate the intensity, as would be done in an experiment where detector counts are averaged over many identical realizations.

Fig. 5
figure 5

VIT quantum jumps statistics. a Stacked bar graph of quantum jumps into the output channel over the 20000 quantum trajectories used in Fig. 4. The height of each bar, I J, is the average number of jumps occurring in the time bin defined by the bar’s width, in this case 1/Γ′. The bars are then divided into three categories by classifying each jump according to how many jumps into the output channel occur for a particular trajectory (1, 2, or 3 or more). Jumps from trajectories where there are a higher number of photons emitted into the output channel are seen to occur earlier. For comparison the dashed black line shows the output intensity from Fig. 4. b Stacked bar graph for quantum jumps from trajectories where only a single photon is detected in the output of the waveguide. These jumps are then divided into jumps that are not accompanied by any other jump into other channels, and those that are. We see that the tail of photons detected earlier are due to trajectories where 2 or more photons entered the medium but all but one were lost into other channels. c Post-selection of trajectories to find evolution for Fock state input. By selecting only trajectories where there were a total of 1 (blue), 2 (red), or 3 (yellow) jumps into any channel we can reconstruct the intensity output for the corresponding input Fock state

Moreover, we can classify the jumps according to whether they come from trajectories where 1, 2 or 3+ photons are emitted into the waveguide (as indicated by the different bar colors in Fig. 5a). As we see in the plot, the higher the number detected in the waveguide, the earlier in time the jumps happen, in agreement with the simple theoretical model and with the calculations of I out(t) and \(I_{{\mathrm{out}}}^{(2)}(t,t)\), discussed above. We can also select only the trajectories where a single photon is detected at the waveguide output, and further separate those trajectories into two distinct cases: (i) when that is the only jump event (indicating a single photon was input and successfully propagated through the system), and (ii) where a multi-photon state was input, and all but one photon decayed into other channels. The histogram according to this classification in time is shown in Fig. 5b, where we see that the tail of faster arriving single photons, seen to the left of the main peak, results from the decay of number states with two of more photons, and the resulting mixing of propagation velocities.

Alternatively, we can use the jump statistics from a coherent state input to identify the intensity resulting from a Fock state input. Since the VIT system does not support any long lived excitations (compared with the simulated time scale), the total number of photon jumps (into any channel) out of the system for any one trajectory is equal to the number of the photons that entered the system for that trajectory. By post-selection on the total number of jumps we can then find the intensity that results from a Fock state input as shown in Fig. 5c. Here we see the same effect of jumps as noted above but observed in a different way. In particular, while we categorized the trajectories in Fig. 5a, b by the number of photons that survive and are output, in Fig. 5c we classify them by the number that are input. For Fock state inputs of two or more photons, the output intensities show tails of longer than expected delay times, again as a result of photon loss and the mixing of propagation speeds.

These altered delay times are not only due to quantum jumps however, they can also result from distortion of the multi-photon wavepacket as it enters the medium30. This distortion happens as the input pulse crosses the boundary of the atomic ensemble, as we illustrate for a two-photon wave function in Fig. 6a. For example, if the two photon wave function has a Gaussian pulse shape, the two photons can arrive at the boundary of the atomic ensemble at different times. The first photon that enters then travels at v 1 until the time that the second photon enters and the group velocity becomes 2v 1. A similar process occurs when the photons exit the medium. In this case the further the photons are separated in the original pulse, the larger the delay of the photons. This process distorts the two-photon input Gaussian into a heart shaped output and higher photon number manifolds into higher dimensional hearts. In Fig. 6b we show how this behavior can be observed in the two time correlation measurement of the output photons for an input coherent pulse at low input photon number. For higher photon number input the heart shape is distorted as higher photon number manifolds with larger group velocity smear out the distribution.

Fig. 6
figure 6

VIT pulse distortion. a Distortion process as a two-photon wave-function ψ(z 1, z 2) enters the atomic medium. The initial Gaussian distribution of the photon positions z 1 and z 2 is shown as a circle. The two-dimensional space of the photon pair is divided into regions where only one photon is inside the medium and has group velocity v 1, indicated by the dashed lines, and when both photons are inside the medium having velocity v 2 = 2v 1, the square box. Photon pairs with greater separation spend more time in the regions where only one photon is inside the medium, delaying them compared to pairs with z 1 = z 2, leading to a characteristic heart shaped pattern. b Two-time correlation function \(I_{{\mathrm{out}}}^{(2)}\left( {t_1,t_2} \right)\) for the output field of the VIT system, after excitation with a coherent Gaussian input pulse for various average input photon number: |α|2 = 0.01, 0.25, 1.0, and 2.0. At weak input field the correlation function is purely due to the two photon component and shows a clean heart shape. As the number of input photons increases, higher photon number components contribute, which travel faster through the medium distorting the pattern and pulling it forward in time. The system parameters were for an optical depth of OD = 60, with N = 30, Γ1D  = Γ′, Δ = δ c = 0, g = 4, Γ′, κ = 0.03Γ′, σ t  = 4/Γ′ and t 0 = 6/Γ′. We used bond dimension D = 30 and time step δt = 0.01/Γ′ where convergence was observed for all observables of interest (see Methods)

Discussion

In summary, we have described a novel technique to numerically simulate quasi-1D quantum light propagation through atomic ensembles, which is based on the powerful toolbox of matrix product states. This technique is versatile and adaptable to many cases of theoretical and experimental interest (e.g., with regard to level structure, types of interactions, additional degrees of freedom, etc.). Similar to the important role that DMRG and MPS played in one-dimensional condensed matter systems, we envision that results gained from our numerical technique could be used to push forward the development of effective theories of strongly interacting systems of light11, 12, 19, 22,23,24,25, and conversely that such analytical work could be used to improve numerical algorithms. Beyond that, it would be also interesting to investigate further why MPS apparently works well in the context of our open, long-range interacting system, and under what conditions MPS might fail. This could yield a better understanding of the growth of entanglement, which naively seems like a potentially useful resource, but which has not been explored for such systems to our knowledge.

The ability to formally map atom-light interactions to quantum spin models is intriguing in general, and it would be valuable to explore whether other techniques for solving spin systems give further insights into atom-light interactions. Finally, it should be noted that this mapping essentially relies on the fact that the atomic response dominates the dispersion of near-resonant light fields, as compared to the dispersion of empty space. It would thus be interesting to investigate whether a similar effective theory could be derived for other strongly dispersive systems, such as exciton-polariton condensates74,75,76, to shed new light on interacting photon dynamics in those settings.

Methods

Quantum jump formalism

To find the time dynamics for the spin model we must evolve the master equation in time. Numerically this can be done directly by evolving the full density matrix ρ in time using standard techniques such as the Runge-Kutta algorithm. Alternatively, we can instead use the “quantum jump” approach to unravel the master equation into trajectories of evolving pure states66, 68. Here we briefly review the quantum jump formalism, which we implement with MPS as discussed below.

We write the master equation for our 1D spin model in the form \(\dot \rho = - i ( {H_{{\mathrm{eff}}}\rho - \rho H_{{\mathrm{eff}}}^{\mathrm{\dagger }}} ) + \mathop {\sum}\nolimits_l {\kern 1pt} O_l\rho O_l^{\mathrm{\dagger }}\), where O l are the “jump” operators associated with the dissipation resulting from emission into the waveguide and into free space, and H eff is a non-Hermitian effective Hamiltonian. This division of the master equation into jump terms and an effective Hamiltonian H eff is not unique and we attempt to do so here in a way that the jump operators have a physical significance. In particular, the emission of a photon into the forward going mode of the waveguide may interfere with the input light that is also traveling in the positive z direction (Eq. (3)), an interference that would be present in real detection of photons output from the waveguide. This interference can be taken into account in our jump operator, and as such we take the forward going jump operator to be \(O_ + = {\cal E}_{{\mathrm{in}}}(t) + i\sqrt {\Gamma _{{\mathrm{1D}}}{\mathrm{/}}2} {\kern 1pt} \mathop {\sum}\nolimits_j {\kern 1pt} e^{ - ik_0z_j}\sigma _{{\mathrm{ge}}}^j\) (in contrast with \(O_ + = \sqrt {\Gamma _{{\mathrm{1D}}}{\mathrm{/}}2} {\kern 1pt} \mathop {\sum}\nolimits_j {\kern 1pt} e^{ - ik_0z_j}\sigma _{{\mathrm{ge}}}^j\) as in ref. 36). The backward going jump operator is simpler given the lack of input field in that mode, \(O_ - = i\sqrt {\Gamma _{{\mathrm{1D}}}{\mathrm{/}}2} {\kern 1pt} \mathop {\sum}\nolimits_j {\kern 1pt} e^{ik_0z_j}\sigma _{{\mathrm{ge}}}^j\). In addition, we have N local jump operators \(O_j = \sqrt {\Gamma ^\prime } \sigma _{{\mathrm{ge}}}^j\) corresponding to the free space decay, giving a set of possible jumps O l  {O +, O , O 1, …, O N }.

With the jumps formulated in this way the effective Hamiltonian becomes

$$\begin{array}{*{20}{l}} {H_{{\mathrm{eff}}}} \hfill & \hskip-8pt = \hfill &\hskip-7pt {H_0 - i\frac{{\Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \mathop {\sum}\limits_{j,l = 1}^N {\kern 1pt} {\mathrm{exp}}\left( {ik_0\left| {z_j - z_l} \right|} \right){\kern 1pt} \sigma _{{\mathrm{eg}}}^j\sigma _{{\mathrm{ge}}}^l} \hfill \\ {} \hfill & {} \hfill & { - \sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} {\kern 1pt} {\cal E}_{{\mathrm{in}}}(t){\kern 1pt} \mathop {\sum}\limits_{j=1}^N {\kern 1pt} e^{ ik_0z_j}{\kern 1pt} \sigma _{{\mathrm{eg}}}^j - \frac{i}{2}\left| {{\cal E}_{{\mathrm{in}}}(t)} \right|^2.} \hfill \end{array}$$
(8)

In general H 0 can describe any additional atomic evolution; in the specific case of two level atoms coupled to a probe of frequency ω p we can write, in the frame rotating with in the input frequency, \(H_0 = -\mathop {\sum}\nolimits_{j=1}^N {\kern 1pt} \left( { \Delta + i\Gamma^\prime {\mathrm{/}}2} \right)\sigma _{{\mathrm{ee}}}^j\), where Δ = ω p − ω eg.

The quantum jump approach uses the above decomposition of the master equation to restate the evolution of the density operator as a sum of pure state evolutions called trajectories66, where the wave function evolution is divided into (a) deterministic evolution under H eff and (b) stochastic quantum jumps made by applying jump operators O l . Starting from a pure state |ψ(t)〉 at time t, the deterministic evolution over a time step δt gives \(\left| {\psi (t + \delta t)} \right\rangle = e^{ - iH_{{\mathrm{eff}}}\delta t}{\kern 1pt} \left| {\psi (t)} \right\rangle\). However, during this evolution the norm of the state decreases to \(\delta p = 1 - \langle {\psi (t) | {e^{iH_{{\mathrm{eff}}}^{\mathrm{\dagger }}\delta t}e^{ - iH_{{\mathrm{eff}}}\delta t}} |\psi (t)} \rangle\), as the effect of the jump operators is neglected. The effect of these operators is instead accounted for stochastically, where after each deterministic evolution we generate a random number r between 0 and 1. If r > δp the system remains in state |ψ(t + δt)〉. Otherwise, the state makes a random quantum jump to \(\left| {\psi (t + \delta t)} \right\rangle = O_l\left| {\psi (t)} \right\rangle\) with probability \(\delta p_l = \delta t{\kern 1pt} \langle {\psi (t) | {O_l^{\mathrm{\dagger }}O_l} |\psi (t)} \rangle\). The state is then normalized and the process repeats for the next time step and each sequence of evolutions gives a quantum trajectory. Any observable can be obtained by averaging its value over many trajectories. Furthermore, as we choose our quantum jumps to relate to physical processes, the distribution of the jumps can be thought of as corresponding to actual photon detection in an experiment.

Time evolution with MPS

As discussed in the Results section and depicted in Fig. 2, to evolve the MPS of the spin model in time and measure the expectation value of different observables we perform the following four steps.

  1. (a)

    Deterministic time evolution. To evolve the state |ψ(t)〉 in time we need to apply the operator \(e^{ - iH_{{\mathrm{eff}}}\delta t}\) to the MPS representation. This is achieved by applying a matrix product operator (MPO) to the state, where just as a state can be decomposed into an MPS, any operator W can be expressed in a local representation as

    $$\begin{array}{*{20}{l}} W \hfill & \hskip-8pt = \hfill &\hskip-7pt {\mathop {\sum}\limits_{\sigma _1^\prime , \ldots ,\sigma _N^\prime ,\sigma _1, \ldots ,\sigma _N} {\kern 1pt} W^{\sigma _1^\prime ,\sigma _1}W^{\sigma _2^\prime ,\sigma _2} \ldots W^{\sigma _N^\prime ,\sigma _N}} \hfill \\ {} \hfill & {} \hfill & { \times \left| {\sigma _1^\prime ,\sigma _2^\prime , \ldots ,\sigma _N^\prime } \right\rangle \left\langle {\sigma _1,\sigma _2, \ldots ,\sigma _N} \right|.} \hfill \end{array}$$
    (9)

    Here \(W^{\sigma _j^\prime ,\sigma _j}\) are a set of matrices at site j, where the matrices now have two physical indices \(\sigma _j^\prime ,\sigma _j\) due to W being an operator. An MPO may be “applied” to an MPS via a tensor contraction over the physical indices σ j of the MPS and MPO, as shown in Fig. 2a. This generates a new MPS with higher bond dimension, as the bond dimension of the MPO, D W, multiplies the bond dimension of the original MPS, and for the calculation to be tractable D W must be small. Such a compact form is not known for the operator \(e^{ - iH_{{\mathrm{eff}}}\delta t}\); however, the first order approximation \(e^{ - iH_{{\mathrm{eff}}}\delta t} \approx 1 - iH_{{\mathrm{eff}}}\delta t\) has a compact MPO form if H eff does.

    This is the case for the 1D spin model where the MPO representation of the effective Hamiltonian has D W = 4. We can write \(H_{{\mathrm{eff}}} = W_1 \ldots W_N\), where \(W_j = \mathop {\sum}\nolimits_{\sigma _j^\prime ,\sigma _j} {\kern 1pt} W^{\sigma _j^\prime ,\sigma _j}{\kern 1pt} \left| {\sigma _j^\prime } \right\rangle \left\langle {\sigma _j} \right|\) are matrices of operators given by

    $$W_j = \left( {\begin{array}{*{20}{c}} {{\cal I}^j} & { - \frac{{i\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{eg}}}^j} & { - \frac{{i\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{ge}}}^j} & {H_{{\mathrm{loc}}}^j} \\ 0 & {\lambda {\kern 1pt} {\cal I}^j} & 0 & {\sigma _{{\mathrm{ge}}}^j} \\ 0 & 0 & {\lambda {\cal I}^j} & {\sigma _{{\mathrm{eg}}}^j} \\ 0 & 0 & 0 & {{\cal I}^j} \end{array}} \right),$$
    (10)

    for 1 < j < N, and end vectors

    $$W_1 = \left( {\begin{array}{*{20}{c}} {{\cal I}^1} & { - \frac{{i\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{eg}}}^1} & { - \frac{{i\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{ge}}}^1} & {H_{{\mathrm{loc}}}^1} \end{array}} \right)$$
    (11)

    and

    $$W_N = \left( {\begin{array}{*{20}{c}} {H_{{\mathrm{loc}}}^N} & {\sigma _{{\mathrm{ge}}}^N} & {\sigma _{{\mathrm{eg}}}^N} & {{\cal I}^N} \end{array}} \right)^T.$$
    (12)

    Here \(\lambda = e^{ik_0a}\), \({\cal I}^j\) is the identity operator for site j and the \(H_{{\mathrm{loc}}}^j\) contain all the local terms in H eff. The MPO of the linear expansion of the time evolution operator 1 − iH eff δt can be obtained from this MPO without increasing the bond dimension. It is enough to replace W 1 with

    $$W_1^{{\mathrm{t}}{\mathrm{.e}}{\mathrm{.}}} = \left( {\begin{array}{*{20}{c}} { - i\delta t{\cal I}^1} & { - \frac{{\delta t\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{eg}}}^1} & { - \frac{{\delta t\lambda \Gamma _{{\mathrm{1D}}}}}{2}{\kern 1pt} \sigma _{{\mathrm{ge}}}^1} & {{\cal I}^1 - i\delta tH_{{\mathrm{loc}}}^1} \end{array}} \right),$$
    (13)

    to obtain the desired MPO. Using a small time step δt we can then advance the wave function in time by applying this MPO.

  2. (b)

    Quantum jumps. After evolving a time δt, the state is either kept and renormalized, or a jump is applied. To apply the quantum jump formalism we then just require an MPO form of the jump operators that can be applied to the MPS at each time step, see Fig. 2b. The jump operators of the 1D spin model can be written in compact MPO form, where loss into the waveguide requires an MPO of bond dimension D W = 2. The jump operator corresponding to the emission of a photon in the +z output channel can be written as O + = Z 1 Z 2 .. Z N with

    $$Z_j = \left( {\begin{array}{*{20}{c}} {{\cal I}^j} & { i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} e^{ - ik_0z_j}\sigma _{{\mathrm{ge}}}^j} \\ 0 & {{\cal I}^j} \end{array}} \right),$$
    (14)

    for 1 < j < N, and end vectors

    $$Z_1 = \left( {\begin{array}{*{20}{c}} {{\cal I}^1} & {{\cal E}(t){\cal I}^1 + i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} e^{ - ik_0z_1}\sigma _{{\mathrm{ge}}}^1} \end{array}} \right)$$
    (15)

    and

    $$Z_N = \left( {\begin{array}{*{20}{c}} { i\sqrt {\frac{{\Gamma _{{\mathrm{1D}}}}}{2}} e^{ - ik_0z_N}\sigma _{{\mathrm{ge}}}^N} & {{\cal I}^N} \end{array}} \right)^T.$$
    (16)

    The MPO of O is analogous, but without the external field term in Z 1 and with k 0 replaced by −k 0. For the jumps associated with spontaneous emission into free space an MPO representation is not required as these jumps just require an operator to be applied locally to a single site.

  3. (c)

    State compression. After applying the time evolution operator or jump operators the size of the MPS increases as the bond dimension of the operator multiplies the bond dimension of the original state. Over time this would lead to exponential growth in the MPS size if not constrained. This increase in bond dimension can correspond to the true build up of entanglement, but may also correspond to the new state being expressed inefficiently in the MPS form. In the second case, a more efficient representation can be found and the bond dimension compressed to a smaller value, as in Fig. 2c. This can be done using singular value decompositions to find low rank approximations of the matrices \(A^{\sigma _j}\) in the MPS representation, or by variationally exploring the space of MPS states with a fixed bond dimension that are closest to the original state31, 32. The validity of such a compression can be evaluated by checking how strongly the parts of the state discarded in the compression contribute to the description. From this an error can be calculated and the bond dimension in the compression adjusted so the error remains small (see below).

  4. (d)

    Calculating observables. At any point in time observables such as the spin populations or output field may be calculated for a particular quantum trajectory by applying the appropriate operator associated with that observable in MPO form to the state. For example, to find the output intensity, \(\langle {\psi (t) | {E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}(t)} |\psi (t)} \rangle\), one can express the individual elements as matrix product states or operators. The intensity for that trajectory can then be evaluated through a tensor contraction, as shown in Fig. 2d. This intensity is then averaged over all the quantum trajectories to find the expectation value \(I_{{\mathrm{out}}}(t) = \langle {E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}(t)} \rangle\). Multi-time correlation functions such as \(I_{{\mathrm{out}}}^{(2)}(t,t + \tau ) = \langle {E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t)E_{{\mathrm{out}}}^{\mathrm{\dagger }}(t + \tau )E_{{\mathrm{out}}}(t + \tau )E_{{\mathrm{out}}}(t)} \rangle\) can also be found. This is done by propagating the state in time until time t and then applying the operator E out to the state. The state is evolved a further time τ and the operator applied again. The norm of the resulting states are then averaged over many such evolutions to find the two-time correlation.

VIT matrix product operators

The MPO of the VIT Hamiltonian can be obtained by extending the bare spin model case above. The cavity degree of freedom is associated with an additional site in the spin chain at position N + 1, in which case the VIT MPO of H eff is obtained by adding two columns and rows to the bare representation:

$$W_j^{{\mathrm{VIT}}} = \left( {\begin{array}{*{20}{c}} \ldots & \ldots & \ldots & {\frac{g}{2}\sigma _{{\mathrm{es}}}^j} & {\frac{g}{2}\sigma _{{\mathrm{se}}}^j} & \ldots \\ \ldots & \ldots & \ldots & 0 & 0 & \ldots \\ \ldots & \ldots & \ldots & 0 & 0 & \ldots \\ 0 & 0 & 0 & {{\cal I}^j} & 0 & 0 \\ 0 & 0 & 0 & 0 & {{\cal I}^j} & 0 \\ \ldots & \ldots & \ldots & 0 & 0 & \ldots \end{array}} \right),$$
(17)

for 1 < j ≤ N, where the dots stand for the elements given in Eq. (10) and

$$W_{N + 1}^{{\mathrm{VIT}}} = \left( {\begin{array}{*{20}{c}} {H_{{\mathrm{loc}},{\mathrm{cav}}}} & 0 & 0 & b & {b^{\mathrm{\dagger }}} & {{\cal I}_{{\mathrm{cav}}}} \end{array}} \right)^T.$$
(18)

Convergence and accumulated error

Evolving the MPS representation of a state through time increases the bond dimension of the MPS. In particular, the action of the time evolution MPO, with maximum bond dimension D W, on an MPS, with maximum bond dimension D, increases the bond dimension to D′ = D W × D. In our simulations we typically keep the maximum bond dimension D of the MPS fixed throughout the evolution and to do so it is necessary to compress the MPS from dimension D′ to D after each step. This allows for efficient computation, however, for the results of the simulation to match reality, this compression must be done in a controlled manner to avoid discarding important information from the state.

One straightforward way to check the validity of the simulations is then to do the same simulation for various maximum bond dimensions D and see that values of the observables of interest converge as D increases. In Fig. 7a, b we plot the output intensity and zero-delay second-order correlation function for different bond dimensions for the trajectory without jumps (similar results hold for the other trajectories) for VIT with parameters as given in Fig. 4. We see that the intensity has an excellent convergence already for D = 20, while the zero-delay second-order correlation function requires higher bond dimension D~50 for convergence. From this we conclude that to accurately model the higher number components of the pulse requires larger bond dimension, as the higher number components of the pulse have higher weight in the second order correlation function. Correspondingly, in our simulations we fix the bond dimension to D = 50.

Fig. 7
figure 7

Convergence of VIT observables. a Intensity and b zero-delay second-order correlation function for the quantum trajectory without jumps at different values of the maximum bond dimension D. c Log-scale accumulated compression error \(\epsilon _{{\mathrm{tot}}}\) as function of the MPS maximum bond dimension D (blue dots). The red line is a polynomial fit, \(\epsilon _{{\mathrm{tot}}} \propto D^{ - 2.9}\), for all the points except D = 10

Another way to ensure the simulations accurately model the physical reality is to monitor the error incurred in each compression step. The compression can be done variationally minimizing the distance between the larger MPS \(\left| {\psi (t)} \right\rangle _{D\prime }\) and its compressed version \(\left| {\psi (t)} \right\rangle _D\), or by a sequence of singular value decompositions of the bond connections between each site32. In the latter case, the large bond dimension D′ yields D′ singular values λ t,j,l at bond site j and time t, with 1 ≤ l ≤ D′. If we order the singular values to monotonically decrease with increasing l, we may then reduce the bond dimension by keeping only the singular values with l ≤ D. One measure of this compression error is the norm of the difference of the original state and the compressed state \(\epsilon _t = \left\| \left|\psi (t)\right\rangle_D - \left| \psi (t) \right\rangle_{D\prime } \right\|\), which can be expressed in terms of the discarded singular values, where \(\epsilon _t = 1 - \mathop {\prod}\nolimits_{j = 1}^{N - 1} {\kern 1pt} \left( {1 - \epsilon _{t,j}} \right)\) with \(\epsilon _{t,j} = \mathop {\sum}\nolimits_{l >D} {\kern 1pt} \lambda _{t,j,l}^2\). The error accumulated during the whole time evolution is \(\epsilon _{{\mathrm{tot}}} = 1 - \mathop {\prod}\nolimits_t {\kern 1pt} \left( {1 - \epsilon _t} \right)\). Since all the terms are small one can approximate the products with sums and obtain

$$\epsilon _{{\mathrm{tot}}} \approx \mathop {\sum}\limits_{t = 0}^{T_f} {\kern 1pt} \mathop {\sum}\limits_{j = 1}^{N - 1} {\kern 1pt} \mathop {\sum}\limits_{l >D} {\kern 1pt} \lambda _{t,j,l}^2,$$
(19)

giving a figure of merit for the overall quality of the time evolution. In Fig. 7c, we plot the accumulated error for different bond dimensions. We find that starting from D = 20 the accumulated error decays as a power law \(\epsilon _{{\mathrm{tot}}}\sim D^{ - \alpha }\), with α ≈ 2.9.

Data and code availability

The data presented in the figures of this manuscript are available from the corresponding author upon request. The code used for the MPS simulation of the spin model is available at https://github.com/jdnz/MatrixProductStates.jl.