A recurrent Gaussian quantum network for online processing of quantum time series

Over the last decade, researchers have studied the interplay between quantum computing and classical machine learning algorithms. However, measurements often disturb or destroy quantum states, requiring multiple repetitions of data processing to estimate observable values. In particular, this prevents online (real-time, single-shot) processing of temporal data as measurements are commonly performed during intermediate stages. Recently, it was proposed to sidestep this issue by focusing on tasks with quantum output, eliminating the need for detectors. Inspired by reservoir computers, a model was proposed where only a subset of the internal parameters are trained while keeping the others fixed at random values. Here, we also process quantum time series, but we do so using a Recurrent Gaussian Quantum Network (RGQN) of which all internal interactions can be trained. As expected, this increased flexibility yields higher performance in benchmark tasks. Building on this, we show that the RGQN can tackle two quantum communication tasks, while also removing some hardware restrictions of the currently available methods. First, our approach is more resource efficient to enhance the transmission rate of quantum channels that experience certain memory effects. Second, it can counteract similar memory effects if they are unwanted, a task that could previously only be solved when redundantly encoded input signals could be provided. Finally, we run a small-scale version of the last task on Xanadu’s photonic processor Borealis.


A recurrent Gaussian quantum network for online processing of quantum time series
Robbe De Prins 1* , Guy Van der Sande 2 & Peter Bienstman 1 Over the last decade, researchers have studied the interplay between quantum computing and classical machine learning algorithms.However, measurements often disturb or destroy quantum states, requiring multiple repetitions of data processing to estimate observable values.In particular, this prevents online (real-time, single-shot) processing of temporal data as measurements are commonly performed during intermediate stages.Recently, it was proposed to sidestep this issue by focusing on tasks with quantum output, eliminating the need for detectors.Inspired by reservoir computers, a model was proposed where only a subset of the internal parameters are trained while keeping the others fixed at random values.Here, we also process quantum time series, but we do so using a Recurrent Gaussian Quantum Network (RGQN) of which all internal interactions can be trained.As expected, this increased flexibility yields higher performance in benchmark tasks.Building on this, we show that the RGQN can tackle two quantum communication tasks, while also removing some hardware restrictions of the currently available methods.First, our approach is more resource efficient to enhance the transmission rate of quantum channels that experience certain memory effects.Second, it can counteract similar memory effects if they are unwanted, a task that could previously only be solved when redundantly encoded input signals could be provided.Finally, we run a small-scale version of the last task on Xanadu's photonic processor Borealis.
In the pursuit of improved data processing, there is an increasing emphasis on combining machine learning (ML) techniques with quantum computing (QC).Building on the established belief that quantum systems can outperform classical ways of computing 1 , quantum machine learning (QML) 2 provides a methodology for identifying applications for quantum computers where the target algorithm is learned (i.e.trained) rather than designed.
In classical machine learning, algorithms such as recurrent neural networks (RNNs) 3,4 , transformers 5,6 , long short-term memory (LSTM) networks 7 , and reservoir computing (RC) 8 have led to state-of-the-art performances in natural language processing, computer vision, and audio processing.This makes them good sources of inspiration for new QML models.
However, the common use of projective measurements in quantum computing leads to the requirement of processing the same input data multiple times to estimate the expectation values of detected observables.It is known that this can lead to an exponential decrease in achievable computational complexity 9 , and this poses even more of a fundamental bottleneck for temporal models.As the detections are often carried out at intermediate processing stages, this leads to back-actions on the state of the quantum system.On the one hand, this gives rise to laborious operating procedures and large overheads 10 .On the other hand, it prevents one from performing online time series processing (i.e.constantly generating output signals in real-time, based on a continuous stream of input signals).This restricts the use of temporal models in fields like quantum communication, where online operation is of great importance.
Recently, an approach was introduced that proposes to sidestep this detection issue by performing online processing of quantum states and thereby removing the need for detectors 11 .The model was inspired by the concept of RC 8 , where random dynamical systems, also called reservoirs, are made to process temporal input data.RC research has demonstrated that training only a simple output layer to process the reservoir's output signals can achieve state-of-the-art performance in various computational tasks while significantly reducing training costs.Building on this idea, Ref. 11 tackled several computational tasks using a random network of harmonic oscillators and training only the interactions between that network and some input-carrying oscillators.

Model
Our RGQN model is presented in Fig. 1a.It incorporates a generic m-mode circuit S that consists of beam split- ters, phase shifters, and optical squeezers.Such a circuit can be described by a symplectic matrix.Hence, we will further refer to it as a symplectic circuit.As shown in Fig. 1b, any symplectic circuit can be constructed as a linear interferometer, followed by a set of single-mode squeezers and a second linear interferometer.This is known as the Bloch-Messiah decomposition 20 .The two linear interferometers can be further decomposed into a set of beamsplitters and phase shifters using a rectangular decomposition 21 .
Figure 1.RGQN model.(a) Quantum states are repeatedly sent in the upper m io modes.These input modes are combined with m mem memory modes and sent through a symplectic circuit S .Afterwards, the state on the upper m io modes is collected as output, while the remaining m mem modes are looped back to the left side of S .(b) The symplectic circuit S can be constructed as a linear interferometer, a set of single-mode squeezers (orange boxes), and a second linear interferometer 20 .
The m io upper modes at the left (right) side of S are the input (output) modes of the RGQN.The remaining modes of S are connected from left to right using m mem = m − m io delay lines.The delay lines are equally long and we will further denote them as 'memory modes' .To perform a temporal task, we send a time series of quantum states (e.g., obtained from encoding classical information or from a previous quantum experiment) to the input modes of the RGQN.The temporal spacing between the states is chosen equal to the propagation time of S and the delay lines, such that we can describe the RGQN operation in discrete time.Because of the memory modes, output states depend on multiple past input states, which grants the RGQN some memory capacity.By training the circuit S (essentially training the parameters of its constituent gates), the RGQN can learn to process temporal data.
In further sections, we sometimes restrict S to be orthogonal symplectic.Such a circuit only comprises beam splitters and phase shifters, excluding optical squeezers.When applicable, we will denote the circuit as O.
Note that, in contrast to quantum RNN models like Ref. 22 , no detectors are present in our model.Although we will need to use detectors to train the hardware setup, they will be left out at inference time.As discussed before, this allows for online operation, which means our model focuses on tackling a conceptually different set of tasks than currently existing quantum temporal models.

Short-term quantum memory task
The goal of the short-term quantum memory (STQM) task is to recall states that were previously fed to the RGQN after a specific number of iterations, denoted by D .This task is visualized in Fig. 2a for the case where m io = 2 and the RGQN consists of an orthogonal circuit.Note that if we were to use a general symplectic network instead of an orthogonal one, optical squeezers could be added and optimized, such that the results would be at least equally good.However, we will show that we can reach improved performance without including optical squeezers in the RGQN, which is beneficial for an experimental setup.
We focus our attention on the case where D = 1 .The input states are chosen randomly from a set of squeezed thermal states (more details in Methods).Fig. 3a shows the average fidelity 23 between an input state at iteration k and an output state at iteration k + D , as a function of m mem and m io .We see that the RGQN perfectly solves the STQM task if m io ≤ m mem .This is easy to understand as O can be trained to perform several SWAP opera- tions (i.e. operations that interchange the states on two different modes).More specifically, the RGQN can learn to swap every input mode with a different memory mode, such that the input state is memorized for a single iteration before being swapped back to the corresponding output mode.For m io > m mem , such a SWAP-based circuit is not possible, leading to less than optimal behavior of the RGQN.
In Fig. 3b, the fidelity values obtained by the RC-inspired model of Ref. 11 are subtracted from our results.Across all values of m mem and m io , we observe that the RGQN scores equally well or better.Although Ref. 11 also achieves a fidelity of 1 for certain combinations of m io and m mem , the set of these combinations is smaller than for the RGQN.Moreover, it is important to note that the RC-inspired design limits the number of trainable parameters, making a SWAP-based solution impossible in general.As a result, prior to training, it is more challenging to guarantee optimal performance of the RC-inspired model, while this is not the case for the RGQN.

Entangler task
The objective of the entangler task is to entangle different states of a time series that were initially uncorrelated.The performance of this task is evaluated based on the average logarithmic negativity between output states at iterations k and k + S .Negativity 12 is an entanglement measure for which higher values indicate greater levels of entanglement between the states.Note that if we consider output states with spacing S = 1 , then we aim to entangle nearest-neighbor states.This last task is visualized in Fig. 2b for the case where m io = 1 .We choose vacuum states as input and hence the circuit S should not be orthogonal as we want to generate states with nonzero average photon numbers.www.nature.com/scientificreports/For m io = 1 , Fig. 4a displays the average logarithmic negativity obtained by the RGQN for various values of m mem and S. For a given spacing, the performance increases with m mem .This can be attributed to the fact that a higher value of m mem leads to a bigger circuit S , such that more entangling operations can be applied.It can also be seen that the performance roughly stays the same along the diagonal ( S = m mem ) and along lines parallel to the diagonal.This can be explained by the findings of Fig. 3, which indicate that increasing m mem can effectively address the increased linear memory requirements of the task that arise from increasing S. Finally, our comparison with the RC-inspired model proposed in Ref. 11 , as shown in Fig. 4b, indicates that the RGQN performs better, owing to its larger number of trainable parameters.For instance, when m mem = 5 and S = 1 the RGQN achieves a logarithmic negativity of 0.565 whereas the RC-inspired model reaches a value of 0.359.These values correspond to those of two-mode squeezed vacuum states with squeezing amplitudes 0.283 and 0.180, respectively.

Quantum communication tasks
Whereas the last section confirmed that the performance of the benchmark task can be increased by using the RGQN instead of the RC-inspired strategy, in this section we show that the higher flexibility of our model makes it well-suited to tackle quantum communication tasks.For two such tasks, the RGQN will remove some hardware restrictions of the currently available methods.www.nature.com/scientificreports/

Superadditivity
First, we show that the RGQN can enhance the transmission rate of a quantum channel that exhibits memory effects.When a state is transmitted through such a 'memory channel' , it interacts with the channel's environment.
As subsequent input states also interact with the environment, correlations arise between different channel uses.Contrary to memoryless channels, it is known that the transmission rate of memory channels can be enlarged by providing them with input states that are entangled over subsequent channel uses 24 , a phenomenon that is known as 'superadditivity' .Here, we aim to create such entangled input states using our RGQN.Note the similarity with the definition of the entangler task.Now however, the goal is not to create maximal entanglement between the different states, but rather a specific type of entanglement that depends on the memory effects of the channel and that will increase the transmission rate.
The setup for the 'superadditivity task' is shown in Fig. 5.A RGQN with m io = 1 transforms vacuum states into an entangled quantum time series.Information is encoded by displacing each individual state of the series over a continuous distance in phase space.These distances are provided by a classical complex-valued information stream.Their probabilities follow a Gaussian distribution with zero mean and covariance matrix γ mod .
The resulting time series is sent through a memory channel.A number of K consecutive uses of the channel are modeled as a single parallel K-mode channel.The memory effects we consider here are modeled by correlated noise emerging from a Gauss-Markov process 16 .The environment has the following classical noise covariance matrix γ env : Here, φ ∈ [0, 1) denotes the strength of the nearest-neighbor correlations and N ∈ R is the variance of the noise.In Eq. (1), M(φ) correlates the q quadratures, while M(−φ) anti-correlates the p quadratures.
The transmission rate of the channel is calculated from the von Neumann entropy of the states that pass through the channel (i.e. from the Holevo information).Here we adopt the approach and the parameter values outlined in Ref. 16 .
Note that the average photon number that is transmitted per channel use ( n ) has a contribution from both the RGQN (i.e. from its squeezers) and from the displacer.Given a value for n , the transmission rate is maxi- mized by training both the circuit S and γ mod under the energy constraint imposed by n .Nonzero squeezing values are obtained, leading to an information carrier.This highlights the counter-intuitive quantum nature of the superadditivity phenomenon: by spending a part of the available energy on the carrier generation rather than on classical modulation, one can reach higher transmission rates, something that has no classical analog.
We now define a quality measure for the superadditivity task.The gain G is the ratio of the achieved transmission rate to the optimal transmission rate for separable input states.For 30 channel uses, Fig. 6 shows G as a function of the average photon number n per use of the channel and for different values of the correlation parameter φ .We take the signal-to-noise ratio SNR = n/N = 3 , where N is defined in Eq. ( 2).We observe that superadditivity is achieved, as the gain is higher than 1 and can reach as high as 1.10.These results agree with the optimal gain values that were derived in prior numerical studies of this memory channel (cfr.Fig. 7 of Ref. 25 ).
While a scheme already exists to generate carriers sequentially 17 (i.e., generating carriers without creating all channel entries simultaneously), our model provides a simpler and more versatile alternative.Unlike the existing scheme, our model eliminates the need for Bell measurements, while achieving the same near-optimal gains.Additionally, it is known that reconfigurable circuits can learn to compensate for fabrication imperfections as these imperfections are taken into account during training 18,19 . (1) Figure 5. Setup for the superadditivity task.A RGQN (with m io = 1 ) transforms vacuum states into a quantum information carrier that is entangled across different time bins.A displacer (D) modulates this carrier to encode classical input information.The resulting signal is sent to a bosonic memory channel 16 .A number of K consecutive uses of the channel are modeled as a single parallel K-mode channel.The channel's environment introduces noise that leads to correlations between the successive channel uses.As a result of the entangled carrier, the transmission rate of the channel can be enhanced.www.nature.com/scientificreports/

Quantum channel equalization
In this section, we use the RGQN as a model for a quantum memory channel.This time, we assume its memory effects to be unwanted (unlike the previous section) and compensate for them by sending the channel's output through a second RGQN instance.
Figure 7 shows the setup for the quantum channel equalization (QCE) task in more detail.An 'encoder' RGQN acts as a model for a memory channel.Because such channels normally do not increase the average photon number of transmitted states, we restrict the encoder's symplectic circuit to be orthogonal and denote it as O enc .This circuit is initialized randomly and will not be trained later.A second 'decoder' RGQN is trained to invert the transformation caused by the encoder.Similar to the STQM task, we will show that an orthogonal symplectic circuit O dec is enough to lead to the desired performance, without requiring optical squeezers, which is beneficial for experimental realizations.We will further denote the number of memory modes of the encoder and decoder as m mem,enc and m mem,dec respectively.Finally, we introduce a delay of D iterations between the input and output time series, similar to the definition of the STQM task (see Fig. 2a).
Assume for a moment that the input time series of the encoder only consists of a single state, i.e. we are looking at an impulse response of the system.We send this state to the encoder at iteration 0, and expect the decoder to reconstruct it at iteration D .However, a part of the input state may be initially stored in the encoder's memory modes.By choosing D > 0 , multiple states are sent from the encoder to the decoder, thereby depleting the encoder's memory modes.When we increase D , more information about the original input state reaches the decoder by the time it needs to start the reconstruction process.A similar reasoning applies when the input time series consists of multiple states.This approach effectively addresses the challenge posed by the no-cloning principle, which prevents the decoder from accessing information stored in the encoder's memory or in the correlations between the encoder's memory and output.
For the RC-inspired model of Ref. 11 , only the case where D = 0 was considered.The no-cloning problem was addressed by redundantly encoding the input signals of the encoder.I.e., multiple copies of the same state were generated based on classical input information and subsequently fed to the model through different modes ('spatial multiplexing') or at subsequent iterations ('temporal multiplexing').Here, we show that taking D > 0 allows us to solve the QCE task without such redundancy, ultimately using each input state only once.This not  only simplifies the operation procedure but also enables us to perform the QCE task without prior knowledge of the input states, which is often missing in real-world scenarios such as quantum key distribution.As these input states cannot be cloned, our approach significantly increases the practical use of the QCE task.It is important to note that such an approach where D > 0 was also attempted for the RC-inspired model 26 , but this was unsuc- cessful, which can be attributed to its limited number of trainable interactions.
Additionally, we will show that the QCE performance of the RGQN is influenced by two key factors: the memory capacity of the decoder (as determined by the value of m mem,dec ), and the response of the encoder to a single input state (observed at the encoder's output modes).
More formally, we measure the impulse response of the encoder by sending in a single squeezed vacuum state (with an average photon number of nimpulse ) and subsequently tracking the average photon number h enc in its output modes over time.We denote the impulse response at iteration k by h k enc .We now define: I enc is a re-normalized cumulative sum that represents the fraction of nimpulse that leaves the encoder before the decoder has to reconstruct the original input state.
We now consider 20 randomly initialized encoders with m mem,enc = 2 .The input states are randomly sampled from a set of squeezed thermal states (more details in Methods).Figure 8a shows the average fidelity 23 between an input state of the encoder at iteration k and an output state of the decoder at iteration k + D as a function of I enc and for different values of D − m mem,dec .We see that if D ≤ m mem,dec (blueish dots), the decoder potentially has enough memory, and the quality of constructing the input states increases as the decoder receives more information from the encoder (i.e. as I enc increases).If D > m mem,dec (reddish dots), we ask the decoder to wait for a longer time before starting to reconstruct the input.This explains why the dots are clustered on the right side of the diagram because more information about input will be received and I enc will be higher.On the other hand, if the delay is too long, it will exceed the memory of the decoder, and the input will start to be forgotten.This explains that the darkest dots with the longest delay have the worst performance.
Note that D is a hyperparameter that can be chosen freely.Also note that the optimal choice for the value of D is not necessarily D = m mem,dec (light grey dots) and the actual optimum depends on the exact configuration of the encoder.Figure 8b shows a subset of the results in Fig. 8a, where the optimal value of D is chosen for every encoder initialization and every value of m mem,dec .We conclude that the task can be tackled without redundantly encoded input signals.As discussed earlier, such redundancy was required in Ref. 11 , but often cannot be provided in real-world scenarios.We further observe that the performance increases with both m mem,dec and I enc .For m mem,dec = 3 , all 20 encoders are equalized better than is done in Ref. 11 .

Experimental demonstration of quantum channel equalization
As the RGQN does not contain any non-Gaussian components, it can be constructed using optical components that are readily available in the laboratory [13][14][15] .In this section, we perform the QCE task on the recently introduced quantum processor Borealis 15 .Because of hardware restrictions, we only consider the case where m mem,enc = m mem,dec = 1 .The setup for this task is visualized in Fig. 9.The input time series consists of squeezed vacuum states (whereas squeezed thermal states were previously used to simulate the QCE task).Both the encoder and decoder are decomposed using beam splitters and phase shifters.Here we use the following definitions for those respective components: (3) where a † i ( a i ) is the creation (annihilation) operator on mode i.Note that the transmission amplitude of the beamsplitter is cos(θ).
Whereas Fig. 8 presented the results of training the decoder, here we will visualize a larger part of the cost function landscape (including sub-optimal decoder configurations).By doing so, we are agnostic to the exact training procedure, such as the parameter-shift rule 27,28 .Note that while evaluating a certain point of the cost function landscape, i.e. while processing a single time series, the parameters of the beam splitters and phase shifters are kept fixed.Hence, in Fig. 9, the measurement results are not influenced by the phase shifters outside of the loops (i.e.outside of the memory modes).These components can be disregarded.Consequently, we can parameterize the encoder (decoder) using only a beam splitter angle θ enc ( θ dec ) and a phase shift angle φ enc ( φ dec ).
We use a photon-number-resolving (PNR) detector to detect output states.This provides us with the average photon numbers of the output states, but with their phases.Unlike in Fig. 8, we cannot use fidelity as a quality measure.Therefore, we will assess the performance of the RGQN using the following cost function: where nk out and nk target are the average photon numbers of the actual output state and the target output state at iteration k respectively.K is the total number of states in the input time series.As the average photon number of a squeezed vacuum state increases monotonously with the squeezing parameter r 29 , i.e. n = sinh 2 (r) > 0 , the cost function quantifies how much the squeezing levels of the output states deviate from the target values.As is explained in more detail in Methods, the experimentally obtained PNR results are re-scaled prior to evaluating Eq. ( 6) in order to compensate for hardware imperfections.
The small-scale version of the QCE task (depicted in Fig. 9) is run on the photonic processor Borealis 15 (depicted in Fig. 10).It consists of a single optical squeezer that generates squeezed vacuum These states are sent to a sequence of three dynamically programmable loop-based interferometers of which the delay lines have different lengths, corresponding with propagation times of T, 6T, and 36T ( T = 36µs ).For our experiment, we only use the two leftmost loop-based interferometers.More formally, we choose θ = 0 for the rightmost BS and φ = 0 for the rightmost PS.
As is explained in more detail in Methods, we can virtually make the lengths of Borealis' delay lines equal.We do so by lowering the frequency at which we send input states and by putting the θ = 0 for the leftmost beam splitter in between input times.
We first consider the case where φ enc = φ dec = 0 , such that all phase shifters can be disregarded.Figure 11 compares the experimental and numerical performance of the QCE task for D = 1 .We observe that the task is solved perfectly when either the encoder or the decoder delays states by D = 1 and the other RGQN transmits ( 5) Setup for the QCE task where both the encoder and decoder have a single memory mode.The matrices O enc and O dec are decomposed using beam splitters (BS) and phase shifters (PS).A squeezer (S) is used to generate input states, while the output states are measured using a photon-number-resolving (PNR) detector.
As the PSs outside of the loops do not influence the PNR results, they can be disregarded.
Figure 10.Borealis setup 15 .A squeezer (S) periodically produces single-mode squeezed states, resulting in a train of 216 states that are separated in time by T = 36µs .These states are sent through programmable phase shifters (PS) and beam splitters (BS).Each BS is connected to a delay line.From left to right in the figure, the lengths of these delay lines are T, 6T, and 36T.The output states are measured by a photon-number-resolving (PNR) detector.
states without delay.The performance is worst when both the encoder and decoder delay states with an equal number of iterations (either D = 0 or D = 1 ).Indeed, the cost of Eq. ( 6) is then evaluated between randomly squeezed vacuum states.For beam splitter angles between 0 and π/2 , we find that the cost follows a hyperbolic surface.We observe good agreement between simulation and experiment.We now consider the case where φ enc and φ dec are not restricted to 0. Note that the Borealis setup (Fig. 10) does not have phase shifters inside the loops.However, as is explained in more detail in Methods, we can virtually  6).The optimal performance occurs when the input states are delayed by D = 1 in the encoder and fully transmitted in the decoder ( θ enc = π/2 , θ dec = 0 ), or when they are fully transmitted in the encoder and delayed by D = 1 in the decoder ( θ enc = 0 , θ dec = π/2).c) Experiment where phase shifters are tunable within [0, π) .The columns correspond with different encoders.Each plot shows the QCE cost (as defined in Eq. ( 6)) as a function of the decoder parameters θ dec and φ dec .
apply the phase shifts φ enc and φ dec inside Borealis' loops by dynamically adjusting the phase shifters positioned before those loops over time.Unfortunately, this procedure is hampered by hardware restrictions.The range of Borealis' phase shifters is restricted to [−π/2, π/2] .This is problematic, since in order to apply a single virtual phase shift value within a specific loop, the phase shifters preceding that loop need to be tuned dynamically across the complete [−π , π] range.As a result, about half of the parameter values of the phase shifters cannot be applied correctly.When such a value falls outside of the allowed range, an additional phase shift of π is added artificially to ensure proper hardware operation.
Figure 12 shows the QCE ( D = 1 ) performance for three different encoders (corresponding to the three columns).We compare classical simulation results (rows 1 and 2) with experimental results (row 3).Whereas the restricted range of Borealis' phase shifters is taken into account in rows 2 and 3, it is not in row 1.While Fig. 11 (for φ enc = φ dec = 0 ) showed that the decoder can easily be optimized by considering only θ dec = 0 and θ dec = π/2 , this optimization is less trivial when φ enc = 0 and φ dec = 0 .We observe that the general trends of the cost function landscapes agree between rows 2 and 3, although row 3 is affected by experimental imperfections.

Conclusions
We have introduced a new model to process time series of quantum states.Similar to an existing RC-inspired model, no detectors are present in our model, which allows the processing to be performed online.This leads to conceptually different tasks than the ones considered by temporal models with detectors.We first probed two key functionalities of our model: the linear memory capacity and the capability to entangle distinct states within a time series.As expected, these functionalities benefit from an RNN structure where all internal interactions can be trained (rather than fixing a subset of those interactions to random values).More interestingly, the RGQN showed the ability to tackle two quantum communication tasks, a domain where optics naturally is the leading hardware platform.First, we demonstrated that the RGQN can enhance the transmission rate of a quantum memory channel with Gauss-Markov noise by providing it with entangled input states.The enhancement showed to be near-optimal as compared to previous studies, while our generation scheme of the input states is simpler (e.g., it does not require Bell measurements).Moreover, our scheme is more versatile as it is known reconfigurable circuits can adapt to fabrication imperfections 18,19.Second, we showed that the RGQN can mitigate undesired memory effects in quantum channels.This task could previously only be solved when redundantly encoded input signals could be provided, which often is not the case in real-world scenarios.A small-scale experiment of this last task was performed on the photonic quantum processor Borealis 15 .

Methods
The classical simulations of our RGQN were carried out using the open-source photonic optimization library MrMustard 30 .This allows us to perform gradient-based optimizations of symplectic circuits and orthogonal symplectic circuits.

STQM
As is explained in Ref. 11 , a special purpose cost function f can be used to solve the STQM task.f can be defined as a function of the submatrices of the orthogonal symplectic matrix that is associated with the circuit O .With slight abuse of notation, we write the orthogonal symplectic matrix that is associated with the circuit O as: In contrast to Eq. (1), the quadratures are ordered here as follows: (q 1 , p 1 , q 2 , p 2 , q 3 , p 3 , ...) , where q i and p i are the quadratures of mode i.
When the delay is nonzero ( D > 0 ), Ref. 11 shows that the goal of the STQM task can be redefined as the fol- lowing system of equations: Hence, we choose the following cost function: where � • � is the Frobenius norm.Note that the last sum in Eq. ( 9) was not used in Ref. 11 , as these terms appeared to worsen the results.However, we have found that their inclusion is beneficial in our work.A numerical parameter sweep showed that the factors 0.5, 5, and 0.5 for the terms in Eq. ( 9), together with a value of T = 10 yield good results.
The learning rate is initialized at a value of 0.01 and decreased throughout the training procedure until the cost function converges.For each value of (m io , m mem ) in Fig. 3, the training is repeated for an ensemble of 100 initial conditions of the RGQN.After training, a test score is calculated as the average fidelity over a test set of ( 7)

Quantum channel equalization
In contrast to the STQM task, here we use the negative of the fidelity (between the desired output and the actual output) as a cost function, both during training and testing.The fidelity is calculated according to Ref. 23 .The input states are single-mode squeezed thermal states where nth , r sq , and φ sq are chosen uniformly within the following ranges: nth ∈ [0, 10) , r sq ∈ [0, 1) and φ sq ∈ [0, 2π).O enc and O dec are initialized randomly.Every epoch, 30 squeezed thermal states are sent through the RGQNs.In order to account for the transient process at the start of each epoch, the fidelity is only averaged over the last 20 output states.
The training is performed using 2000 updates of O dec and with a learning rate of 0.05.In Fig. 8, the training is repeated for an ensemble of 20 initial conditions of S for every value of (D, m mem,dec ) and for each encoder initialization.After training, a test score is calculated by simulating a transient process during 10 iterations and averaging the fidelity over 100 subsequent iterations.The lowest test score in each ensemble is kept.

Experimental demonstration of quantum channel equalization
This section describes the technical details of both the simulations and the experiments that were presented in the context of the QCE experiment.We first describe how the RGQN can be mapped onto the Borealis setup.Afterwards, we describe the input state generation, the post-processing of the PNR results, and some other relevant parameters for the simulations and experiments.

Mapping the RGQN model on Borealis
We map our model on the Borealis setup of Fig. 10.We choose φ = 0 and θ = 0 for the rightmost phase shifter and beam splitter respectively, such that these components and their corresponding delay line can be disregarded.After applying these changes, it is clear that the Borealis setup differs from the setup in Fig. 9 in two ways.First, the remaining delay lines of the Borealis setup have different lengths, which is not the case in Fig. 9. Second, Borealis does not have phase modulators in the delay lines.We can circumvent both of these problems as follows.
First, we can virtually increase the length of the leftmost delay line (i.e. the encoder delay line) from T to 6T by performing two changes: (1) we lower the frequency at which we input states from 1 T to 1 6T and (2) we store the encoder memory state as long as we do not input a new state.More formally, we do the following.Before generating a new input state, we put the values of the beam splitter angles to θ enc (for the encoder) and θ dec (for the decoder).Once a state enters the encoder, it interacts with the memory state, leading to an output state and a new memory state for the encoder.The output state of the encoder is sent to the decoder.We now put θ enc = 0 for a period of 6T, such that no new inputs can enter the loop.Hence, the new memory state is stored in the delay line of the encoder.During this period, no states are generated and no interactions occur between the encoder's memory mode and input/output mode.Afterward, a new state is generated and the process is repeated.
Second, we can apply virtual phase shifts in the delay lines of Fig. 10 by using the phase shifters in front of the loops.To do this, we utilize an existing functionality of Borealis' control software.This functionality (implemented in StrawberryFields 33 as compilers.tdm.Borealis.update_params) is normally used to compensate for unwanted phase shifts in the delay lines.Given such a static unwanted phase shift, the compensation is performed by adjusting the phase shifters in front of the loops over time, such that they apply different phase shifts at different iterations.The actual unwanted phase shifts that are present in the hardware can be measured before running an experiment.We now choose to operate the setup as if there were phase offset sets φ 1,unwanted − φ enc and φ 2,unwanted − φ dec in the first two delay lines respectively.Hence, we apply net virtual phase shifts in the loop with values φ enc and φ dec .
Unfortunately, this procedure is undercut by a hardware restriction of Borealis.The range of these phase shifters is limited to [−π/2, π/2] , which means that about half of the desired phase shifts cannot be implemented correctly.When a phase shift falls outside of the allowed range, an additional phase shift of π is added artificially to ensure proper hardware operation.Listing 1 shows the Python code for this process.
Listing 1. Code to apply virtual phase shifts inside Borealis' loops.This is an adapted version of the function compilers.tdm.Borealis.update_params of StrawberryFields 33 .

Generating input states, post-processing PNR results, and simulation parameters
Both for the computer simulations and for the experiments presented in the section on experimental QCE, the input states are generated by a single-mode optical squeezer that operates on a vacuum state.In every iteration, the squeezing magnitude is chosen randomly as either 0 or 1, effectively encoding bit strings into the quantum time series.It is worth noting that public online access to Borealis does not allow for multiple squeezing magnitudes within one experiment.Our experiments were therefore performed on-site.
The output of Borealis consists of the average photon numbers gathered over 216 iterations.Due to the mapping described in the previous section, only 36 of these average photon numbers can be used.To account for the transient process, the results of the first 10 of these 36 output states are disregarded.The PNR results of the remaining 26 output states are used to estimate the decoder's QCE performance.
For the simulations, 10 runs (each using a different series of input states) are performed per set of gate parameter values of the RGQNs.The cost is therefore averaged over 260 output states.For the experiments shown in Figs.11 and 12, the number of runs per data point is 7 and 2 respectively.
In hardware experiments, non-idealities occur that are not considered in the classical simulations.We compensate for two such non-idealities by re-scaling the experimentally obtained average photon numbers.On the one hand, there are optical losses.On the other hand, the optical squeezer suffers from hardware imperfections that lead to effective squeezing magnitudes that decrease over time when the pump power is kept constant.The re-scaling is performed as follows.At each iteration, we calculate the average of the number of detected photons over all experiments.We fit a polynomial of degree 2 to these averages.Given an experimental result, i.e. a series of average photon numbers, we then divide each value by the value of the polynomial at that iteration.The resulting series is rescaled such that the average of the entire series matches the average value of the entire series of input states.

Figure 2 .
Figure 2. Setups for the benchmark tasks.(a) STQM task with m io = 2.The RGQN consists of an orthogonal symplectic network O. Pulses of different colors represent a time series of quantum states.A state that is sent into the RGQN at iteration k should appear at the output at iteration k + D. (b) Entangler task for m io = 1 and spacing S = 1.Circles of different colors represent an input time series of vacuum states.Pulses of different colors are entangled output states.

Figure 3 .
Figure 3. STQM performance for D = 1 and for different values of m io and m mem .(a) Shows the average fidelity between a desired output state and a state resulting from the RGQN.In (b), the corresponding results achieved in Ref. 11 are subtracted from our results.

Figure 4 .
Figure 4. Entangler task performance for m io = 1 and for different values of S and m mem .(a) Shows the logarithmic negativity resulting from the RGQN.In (b), the corresponding results achieved in Ref. 11 are subtracted from our results.

Figure 6 .
Figure 6.Performance of the superadditivity task for 30 channel uses.The gain in transmission rate is plotted as a function of the average photon number per use of the channel ( n ) and for different values of the noise correlation parameter ( φ ).Additional parameters are chosen as follows: m io = m mem = 1 , N = n/3.

Figure 7 .
Figure 7. Setup for the QCE task when m io = 1 and for a delay D .Pulses of different colors represent a time series of quantum states.The encoder and decoder respectively consist of orthogonal symplectic networks O enc and O dec .O enc is initialized randomly and kept fixed.O dec is trained such that an input state that is sent into the encoder at iteration k appears at the output of the decoder at iteration k + D.

Figure 8 .
Figure 8. QCE performance for 20 randomly initialized encoders that consist of 2 memory modes.The results are shown as a function of I enc , i.e. the fraction of the photon number of a certain input state that reaches the decoder within D iterations.In (a), we consider D ∈ {0, 1, ..., m mem,dec + m mem,enc + 1} and m mem,dec ∈ {1, 2, ..., 5} .In (b), the optimal value of D is chosen (given an encoder and m mem,dec ).

Figure 11 .
Figure 11.QCE performance of Borealis when D = 1 and φ enc = φ dec = 0 .(a) Shows the results from numerical simulations, while (b) Shows experimental results.The cost function is defined in Eq. (6).The optimal performance occurs when the input states are delayed by D = 1 in the encoder and fully transmitted in the decoder ( θ enc = π/2 , θ dec = 0 ), or when they are fully transmitted in the encoder and delayed by D = 1 in the decoder ( θ enc = 0 , θ dec = π/2).

Figure 12 .
Figure 12.QCE performance of Borealis when D = 1 .(a) Simulation where phase shifters are tunable without range restriction.(b) Simulation where phase shifters are tunable within [0, π) .(c)Experiment where phase shifters are tunable within [0, π) .The columns correspond with different encoders.Each plot shows the QCE cost (as defined in Eq. (6)) as a function of the decoder parameters θ dec and φ dec .
Figure 12.QCE performance of Borealis when D = 1 .(a) Simulation where phase shifters are tunable without range restriction.(b) Simulation where phase shifters are tunable within [0, π) .(c)Experiment where phase shifters are tunable within [0, π) .The columns correspond with different encoders.Each plot shows the QCE cost (as defined in Eq. (6)) as a function of the decoder parameters θ dec and φ dec .