Frequency-encoded photonic qubits for scalable quantum information processing

Among the objectives toward large-scale quantum computation is the quantum interconnect: a device which uses photons to interface qubits that otherwise could not interact. However, current approaches require photons indistinguishable in frequency---a major challenge for systems experiencing different local environments or of different physical compositions altogether. Here we develop an entirely new platform which actually exploits such frequency mismatch for processing quantum information. Labeled"spectral linear optical quantum computation"(spectral LOQC), our protocol offers favorable linear scaling of optical resources and enjoys an unprecedented degree of parallelism, as an arbitrary $N$-qubit quantum gate may be performed in parallel on multiple $N$-qubit sets in the same linear optical device. Not only does spectral LOQC offer new potential for optical interconnects; it also brings the ubiquitous technology of high-speed fiber optics to bear on photonic quantum information, making wavelength-configurable and robust optical quantum systems within reach.


I. INTRODUCTION
The basic building block of the long-sought quantum computer is the quantum bit, or qubit: a two-dimensional quantum system which can be controlled, read, and entangled with other qubits [1]. In light of the myriad qubit platforms currently in contention [2], it is likely that the ultimate quantum computer will combine several technologies as a hybrid system in which dissimilar and physically separated qubits are joined via universal quantum interconnects-a network dubbed the "quantum internet" [3,4]. In this vision, quantum information must be transmitted over appreciable distances, a task for which photons prove uniquely capable. Photonic qubits operate equally well at cryogenic and room temperatures, suffer from virtually no decoherence, and are readily manipulated with optical components. Add to these the fact that they travel at the speed of light, and photons provide unrivaled performance in interfacing separate quantum systems.
The ideal photonic interconnect should also be capable of full-fledged quantum information processing in the optical domain, facilitating complex operations between heterogeneous material qubits which-whether because of thermal, spectral, or spatial incompatibilitycannot interact directly. However, the advantages which make photons such sound quantum information carriers come at a cost: forcing two single photons to interact, as required for multiqubit operations, is notoriously difficult with standard optical nonlinearities. In 2001 Knill, Laflamme, and Milburn (KLM) [5] revolutionized photonic quantum computing by showing that such nonlinearities can actually be realized through detection, deriving a universal quantum computing architecture based on phase shifters, beam splitters, and pho- * lukensjm@ornl.gov † lougovskip@ornl.gov ton counters-so-called "linear optical quantum computation" (LOQC). Yet the spatial encoding of conventional LOQC proves entirely ill-suited for interconnecting heterogeneous qubits; not only is it unavailable in singlemode optical fiber, the most robust and efficient medium for long-distance optical transmission, but the use of a single frequency (or at least a single spectral mode) precludes direct coupling into and out of materials possessing distinct resonances.
In this paper, we propose and theoretically develop a photonic computing platform which addresses both problems. Instead of viewing frequency mismatch as an obstacle to optical interconnects, we deem it an opportunity and capitalize on it for encoding quantum information. Termed "spectral LOQC," our protocol consists of photonic qubits which occupy two discrete spectral modes and are operated on by Fourier-transform pulse shapers and electro-optic phase modulators, standard components in classical telecommunications with purely electrical control parameters. Since each qubit shares a common spatial mode, stability against environmental fluctuations is assured, and all photons can be transmitted over long distances in well-established fiberoptic networks. This signifies a major departure from spatial/polarization-mode LOQC, where stabilizing relative phase between separate spatial modes is crucial and requires a non-trivial amount of work. And unlike previous time-frequency computing proposals [6,7], which rely on ultrafast pulsed modes, our use of narrowband modes reduces speed requirements in both manipulation and detection, and can interface directly with disparate atomic levels. Our approach thereby offers new opportunities for both interfacing matter qubits and strengthening timefrequency quantum information in general.

II. PROTOCOL COMPONENTS
Due to their large Hilbert spaces and compatibility with classical telecommunicatons, the time and frequency arXiv:1612.03131v1 [quant-ph] 9 Dec 2016 characteristics of single photons have garnered increasing interest as resources in quantum information processing: chronocyclic protocols for quantum cryptography have exploded in recent years, with advances in both theory [8][9][10] and experiment [11][12][13]. However, it is one thing to transmit and measure spectro-temporal modes, as required in quantum key distribution; it is an entirely different matter to mix and manipulate these modes at the single-photon level, mandatory for quantum computation. Clever protocols appear possible, though: quantum pulse gates have been proposed for chronocyclic operations [7], and a complete time-mode-based LOQC proposal makes use of polarization rotation and delay to mix optical time bins located in a single spatial mode [6]. Yet because of the ultrafast nature of the modes involved in either example, sophisticated nonlinear optical control is required, either by specification [7], or by necessity [6] due to the difficulty in realizing sufficiently long polarizationinduced delays.
To remove such restrictions, here we consider monochromatic frequency bins, such as those in classical dense wavelength-division multiplexing. Spectral modes offer additional benefits absent in temporal modes, such as straightforward high-resolution measurement, reduced constraints on detector jitter, and the prospect for temporally simultaneous processing of multiple modes. For example, time-to-frequency conversion has been used to extract temporal information too fast for direct detection [14,15], highlighting a practical advantage of working in frequency space instead of time. But while spectral quantum modes have been considered in the context of continuous-variable cluster-state quantum computing [16][17][18]-an alternative approach to the standard circuit model-no true spectral LOQC protocol has been formalized.
The Hilbert space in which we work consists of the countably infinite set of modes with frequency ω n , with n any integer. Spatial and polarization degrees of freedom are assumed constant over all frequencies and are neglected. The fixed spacing between modes is ∆ω = ω n+1 −ω n , so that a single dual-rail qubit spanning modes p and q assumes the form where |α| 2 + |β| 2 = 1. Here the subscript L denotes the logical state, whereas |N p = (N !) −1/2 â † p N |0 p corresponds to the physical Fock state with N quanta occupying mode p. As in the original KLM proposal, the modes p and q need not be adjacent on the grid, but can be chosen for convenience in realizing a particular operation. Figure 1(a) provides a visualization of this spectral encoding; in this case, a single photon at frequency ω 0 represents |0 L , whereas a photon at ω 1 signifies |1 L . The computational operations we implement are best represented by their action on the positive-frequency electricfield operator [19,20], expressed before a given operation asÊ (+) and after asÊ (+) where we have neglected unimportant scaling factors, and used the symbolâ n (b n ) to denote mode n's annihilation operator before (after) the optical transformation. Motivated by feasibility, we build our computational operations on components common in telecommunication networks. In general, all computing operations can be decomposed into phase shifts and cross-modal couplings. For the former, a Fourier-transform pulse shaper can be used [21,22], a simplified schematic of which is presented in Fig. 1(b). This device separates frequency modes of the input with, e.g., a diffraction grating, prism, or arrayed waveguide grating. Then the phase of each mode is manipulated by adjusting the voltage on separate pixels of a spatial light modulator (or any other phasecontrol element). Recombining the spectrum then leaves an arbitrary output field. From the perspective of optical quantum computing, the ideal pulse shaper applies an arbitrary phase to each spectral mode in questionessentially it can implement any diagonal unitary matrix in the frequency mode space. Explicitly, a pulse shaper transforms the electric field in Eq. (2) aŝ so that on a mode-by mode basis, Pulse shaping has been applied to single and entangled photons [23][24][25][26][27][28], including works directly in the telecom band [29][30][31][32][33].
For the second operation, mode mixing, we make use of the electro-optic phase modulator (EOM) [34]. Based on the electro-optic effect, a voltage applied across an EOM modifies the refractive index of the material and hence the phase accrued by an optical field traveling through it. If this voltage itself oscillates at a particular frequency (typically in the range DC-100 GHz), it generates equispaced sidebands, an effect exploited to realize tunable optical frequency combs [35,36]. Figure 1(c) provides a schematic of such a device. By controlling the voltage pattern ϕ(t) applied to the device, assumed periodic with frequency equal to the mode spacing, it is possible to modify the coupling between frequency slots. Mathematically speaking, if the phase modulation operation is expressed as the Fourier series e iϕ(t) = k c k e −ik∆ωt , FIG. 1. Building blocks for spectral LOQC. (a) Dual-rail qubit encoding. A single photon corresponds to |0 L or |1 L depending on which one of two modes it occupies. (b) Fouriertransform pulse shaper. This applies arbitrary phases to each spectral mode, physically by separating and recombining frequency components (left) and conceptually as a multimode element operating on all rails individually (right). (c) Electrooptic phase modulator. This device (left) applies an arbitrary temporal phase periodic at the inverse mode spacing . In rail form, the modulator acts as mode mixer which can move photons across frequency states (right). The labels A0 and A1 mark the zero and one modes for a representative qubit.
then the electric field transforms aŝ from which the modal transformation is found to bê which is unitary on the countably infinite set of spectral modes ( k c * m−k c n−k = δ mn ). A functional block representation of the EOM follows in Fig. 1(c) (right), where each rail denotes a separate frequency mode. In this example, the single-qubit amplitudes in modes A 0 and A 1 interfere analogously to a spatial interferometer. As with the pulse shaper, experiments over the last decade [37][38][39][40][41][42][43][44] have confirmed that nonclassical single-photon states do respond to electro-optic modulation as expected from this theory.
However, because the coupling is effected on all modes globally, rather than in pairs, the nature of this mixing is markedly different than that of the beamsplitters used to argue scalability in spatial LOQC [45]. Nevertheless, a sequence of alternating pulse shapers and EOMs is sufficient to reproduce any matrix transformation. As demonstrated by a recent constructive proof [46], any N × N complex matrix can be factored exactly as the product of no more than 2N − 1 circulant and diagonal matrices-or equivalently of 2N − 1 diagonal matrices spaced by DFT matrices. As described in the following section, such a decomposition is precisely that provided by EOMs and pulse shapers when discretized for numerical simulation, thereby implying that the number of components needed to implement an arbitrary unitary transformation on N spectral modes scales like O(N ). In contrast, the scaling of optical components for spatial-or polarization-encoded LOQC is quadratic [O(N 2 )]. Such an improvement in our protocol can be understood intuitively through complexity arguments [47]. In general, a mode transformation between N input and N output modes requires O(N 2 ) free parameters. And whereas the transformations of spatial beamsplitters and phase shifters are fixed by only one or two numbers, those provided by pulse shapers and EOMs offer O(N ) independent real parameters. Thus one can view the linear scaling as a consequence of the fact that the building blocks of spectral LOQC operate on all modes simultaneously, rather than fixed subsets.
Finally, it is important to note that spectral mode mixing could alternately be accomplished through interactions mediated by a classical field in a nonlinear medium, as in a recent experiment exploiting Bragg scattering to transform a single spectral qubit like ours [48]. However, EOMs are simpler and more scalable, for they require only a single electrical control, produce no noise photons from powerful optical fields, and are linear in the sense that their characteristics are independent of the number of optical photons passing through them [49]. Similar considerations apply also to acousto-optic modulators, which are mathematically equivalent to two-mode beam splitters [50]; but because of their noncollinear interaction geometry, such modulators do not support single-spatial-mode operation. Accordingly, of these options, only EOMs satisfy both linearity and spatial purity, and so we classify our computing protocol built on pulse shapers and EOMs as truly a form of LOQC.

III. DERIVING UNVERISAL GATE SET
In the spirit of spatial KLM computing, we assume in our protocol ancillary single photons and perfect photonnumber-resolving detectors; such additional resources are required to nondestructively mark completion of a twoqubit gate. We also allow for vacuum modes which can be populated during the gate operation, later showing that the number of such modes can be restricted in a practical gate. Pulse shapers and EOMs are modeled as matrices acting on our spectral mode space, truncated to M modes; if M is sufficiently large, this well approximates the transformation on the interior computational modes. Specifically, each pulse shaper acts as a diagonal matrix D consisting of complex-exponential elements, and each EOM acts as a unitary diagonal matrixD in time, transformed to frequency by the DFT matrix F whose elements are defined via F nk = M −1/2 e 2πink/M . Thus the spectral transformation realized by an EOM is given by FDF † , where the M phases inD represent samples in a single temporal period-an approximation which holds when the number of samples is sufficient to model the phase smoothly.
We apply pulse shapers and modulators in an alternating sequence, and focus on how they transform an input state in the computational subspace of the Hilbert space H n N for n photons in N modes of interest. A series of R pulse shapers and R EOMs produces the following M × M unitary mode transformation acting on the N computational and M − N ancilla modes' annihilation operators: With this mode transformation in hand, our procedure for analyzing gate performance follows that of [51]; see Appendix A for details. From the mode operator we derive the equivalent state transformation W , represented in the Fock basis and projected onto the detection of any ancillas. Then we compare it to the target state transformation T via the fidelity F, defined according to the Hilbert-Schmidt inner product: This is equal to unity when W is proportional to T . The success probability P is then defined as which is independent of the input state as F → 1. So, after specifying the mode positions of all qubits, ancillas, and detectors, and choosing the number of elements for a given operation, we run a numerical optimization routine searching for the 2RM phases that maximize the success probability P while preserving fidelity F = 1.
Our primary order of business is to derive a universal gate set [1]. For our purposes, the family comprising the single-qubit phase and Hadamard (H) operations and the two-qubit controlled-Z (cz) gate proves most convenient. In the single-qubit case, spectral LOQC delivers the phase gate directly: a single line-by-line pulse shaper can effect arbitrary phase shifts between spectral modes, ideally with no loss. Yet the Hadamard operation is more difficult. In the logical qubit space (|0 L , |1 L ) it is defined: The nature of electro-optic phase modulation [Eq. (7)] makes a lossless mixer such as H impossible with a single EOM; however, we do find it attainable with two. Figure  2(a) shows the block form of our Hadamard gate acting on adjacent spectral rails, utilizing two pulse shapers and two EOMs. The dots above and below the latter three devices indicate potential coupling to modes beyond those in the figure. The numerical solution we obtain (plotted in Appendix B) possesses F = 1 and P = 1, so the gate is entirely deterministic; the qubit exits in the same modes it entered with no need for heralding detectors. The second two rows in Table I summarize performance of these single-qubit gates, listing the physical resources (number of pulse shapers, number of EOMs, and number of ancilla photons) as well as the key performance metrics (fidelity, probability of success, and approximate number of spectral modes required).
To complete the universality proof, we construct a two-qubit cz gate, alternatively called controlled-phase (cphase) or controlled-sign (cs). Not only are the properties of the cz gate well studied in LOQC, providing a benchmark for clear comparison, but the cz gate is also symmetric in both photons-an aid in our design procedure. In the logical basis of spectral qubits A and B, , the matrix representing this operation is The most efficient nondestructive cz gate in KLM computing known to date, making use of two ancillary photons, was introduced by Knill in 2002: it succeeds with probability P = 2/27 ≈ 0.0741 [52]. Although better implementations are not excluded theoretically, extensive numerical searches indicate that this is indeed the optimal gate with nonentangled ancillas [51]. Since the specific form of our linear optical operation [Eq. (8)] is subsumed within the general search space considered  in [51], we anticipate being able to do no better than P = 7.41%. The goal, then, is to come as close as possible to this limit with minimal resources.
A schematic of our proposed cz gate is provided in Fig. 2(b). The logical |0 L and |1 L modes for each photon are separated by two auxiliary spectral modes, one of which is loaded with an ancilla photon (triangle). The photons then propagate through a series of R pulse-shaper/modulator pairs, followed by detection in the ancilla modes; the specific coincidence pattern in Fig. 2(b) (zero photons in the top detector, one photon in the middle, one photon on the bottom) signifies successful gate operation. Because of its probabilistic nature, we do need to look for photons in the adjacent vacuum modes, but only to ensure that no photons have escaped the computational space. Thus we can employ a single spectral "bucket" detector [top detector of Fig. 2(b)] which checks whether any photon leaks into the initially unoccupied modes. The practical number of modes to which this detector must respond is determined by how strongly coupled they are to the six input modes loaded with photons. To express it another way, the detection pattern in Fig. 2(b) guarantees that two photons exit in the four computational modes, and the spectro-temporal modulation patterns then must ensure that when this happens, the two have undergone a cz operation.
Starting with R = 2, we constrain the fidelity to F ≥ 0.9999 (comfortably within the fault-tolerant limit for LOQC under any definition [53]) and numerically determine the phases required to maximize the success probability P. The results for our optimization as R is increased are presented in the last three rows of Table   I. At R = 4, the success probability is within 1% of the KLM limit, indicating optimal performance. And even at R = 3, the success probability surpasses the slightly less optimal gate from the original KLM proposal, which had P = 1/16 = 0.0625 [5]. (Appendix B plots the specific EOM and pulse shaper phases for each solution.) With parameters for a two-qubit spectral cz gate now established, the universal gate set is complete. While our spectral version does require additional vacuum modes (quantified in the next section), the success probabilities and ancilla photon requirements match the best known in general linear optics; this represents the main finding of our paper.

IV. PRACTICAL CONSIDERATIONS
One of the potential advantages of spectral LOQC is its amenability to massive parallelization; that is, a gate can be applied to spectrally distinct qubits simultaneously, all within the same spatial mode and propagating through the same components. However, the fact that both single-and two-qubit operations couple to adjacent modes implies that guard bands between qubits may be required, limiting how densely such qubits can be packed. In order to address this issue explicitly, here we quantify the bandwidth needed to maintain high-performance operation. The procedure is to introduce bandpass filtering in each of our pulse shapers, incrementally increasing the bandwidth until F and P reach their asymptotically optimum values. We do not allow any photon to stray from the specified band at any point in the circuit. Thus, the smallest bandwidth at which the performance reaches its optimal value gives a conservative estimate for the required gate band. The passbands required for success probabilities > 90% of their asymptotic values are listed in the last column of Table I. Since the phase gate preserves photon number in each mode, nothing beyond the logical basis is required. Such is not the case for the Hadamard gate, whose full results are summarized in Fig. 3(a). As the gate passband is increased in multiples of two modes, the fidelity reaches 99% for a passband of six (two vacuum modes on either size of the qubit), while the success probability attains 90% of its asymptotic value for an eight-mode band. Thus, the optical passband need only be chosen about eight times the logical mode spacing in order to reach good performance. Our simulations on the cz gate follow the same approach, but now we look at all three possible configurations from Table I (R = 2, 3, 4). The results displayed in Fig. 3(b) reveal a fascinating dependence on the number of elements. Not only does a larger value of R attain a greater asymptotic success probability (R = 4 just reaches the linear limit marked by a black line in the bottom plot), but it also does so more efficiently in terms of the effective number of modes. The case R = 4 needs only 18 optical modes to attain 90% of its asymptotic success probability, compared to 24 and 48 for R = 3 and R = 2, respectively. This scaling proves especially interesting because one might initially conjecture that more EOMs would actually utilize larger bandwidths, for each successive element couples the input to more modes. Instead, the observed performance hints at the positive correlation between success probability and keeping photons "close" to the computational modes; with more parameters available in the optimization, larger values of R can realize better performance all around. We therefore suspect that this tradeoff might prove more general in chronocyclic manipulations: fewer devices require more ancilla modes to maintain comparable performance.
Looking toward the ultimate implementation of this new protocol, we now outline performance requirements and current practical capabilities. Figure 4 sketches a possible realization of spectral LOQC, where we assume computational photons as input from some other source, as would be the case in a photonic interconnect. The required ancillas are generated by spontaneous fourwave mixing in a resonator [54,55], followed frequencyresolved detection ("Ancilla Preparation"). By choosing the spectral bins appropriately, ancillas in the desired frequency modes can be heralded. The photons are then combined via spectral multiplexers into the circuit itself ("Linear Network"), which consists of pulse shapers with voltage-controlled phases and EOMs driven by a highspeed arbitrary waveform generator. Upon exiting the computational circuit, the auxiliary modes are separated and detected ("Ancilla Detection"); if the desired coincidence pattern is attained, the operation succeeds and the output consists of transformed spectral qubits.  Table I are tested: R = 2 (green), R = 3 (red), and R = 4 (blue). The black line in the bottom plot marks the value 0.0741-the best linear optical cz gate known to date.
In order to analyze how such a circuit could perform, we focus on the elements unique to spectral LOQC (the "Linear Network" in Fig. 4), since photon preparation and detection are common to all versions of KLM quantum computing. The challenges these devices pose fall into three basic categories. (i) Spectral resolution: each pulse shaper must be able to separate frequency modes and apply arbitrary phases with minimal crosstalk. (ii) Microwave bandwidth: the electronic waveform generators-and the EOMs driven by themmust be able to reproduce the required phase modulation patterns. (iii) Loss: although phase modulation is theoretically unitary, realistic components can apply significant attenuation, particularly in waveguide coupling or diffractive elements. Perhaps predictably, these three pragmatic concerns often are at odds with each other. Widely spaced frequency modes would ease spectral resolution requirements, but tighten demands on modulation bandwidth; and pulse shapers with extremely high resolution often inflict large optical losses.
First let us consider possibilities with available discrete components.
For example, commercial fiberpigtailed pulse shapers offer 10-GHz resolution and support roughly 500 separate channels across the optical telecommunication band around 1550 nm [56]. If we thus take 10 GHz as the mode spacing, we require an arbitrary microwave signal generator with ∼50-GHz bandwidth (Nyquist sampling rate of ∼100 GSa/s) for the H and R = 4 cz solutions in Table I [ uct comes very close, offering 92 GSa/s [58]. Finally, lithium niobate phase modulators with speeds exceeding 100 GHz are readily available [59], indicating that the spectro-temporal phase control required for our computing protocol is realizable with current technology. Such a finding is extremely important, for it justifies the reasonableness of spectral LOQC with purely electrical controls. Moreover, with 500 distinct channels, the effective bandwidth of our R = 4 cz gate (18 modes) implies that one could pack approximately 28 cz gates in parallel without increasing the number of devices.
Unfortunately, the linear insertion loss of these discrete optical devices is relatively high, on the order of a few dB per element. But since a primary source of loss in fiber-pigtailed components is in coupling from and into the optical fiber mode, better performance could be possible with on-chip elements whose spatial modes are precisely matched. As an added benefit, the compactness would promote practicality by making the entire platform much more scalable. Research in both on-chip pulse shaping and electro-optic modulation has exploded in recent years, motivated primarily by classical optical communication. For example, microring filter banks [60][61][62] and arrayed waveguide gratings (AWGs) [63][64][65][66] have enabled on-chip line-by-line pulse shaping of optical fields. AWGs in particular seem well-suited for our application; with as many as 512 channels demonstrated in one example [67] and mode spacings down to 5 GHz in another [68], the bandwidth and spectral resolution are competitive with high-performance bulk dispersers. While the total loss of pulse shapers based on AWGs has been high (>10 dB is common [63,65,66]), clever AWG designs in other contexts have been able to reach insertion losses as low as ∼0.5 dB [69], so there is promise for driving down losses in such spectral shapers.
Integration of high-speed EOMs with AWGs has witnessed monumental progress as well, specifically in commercial wavelength-multiplexed transceivers [70,71]. Coupled with the independent research in chip-scale resonator-based photon sources [54,55,[72][73][74] and superconducting detectors [75,76], a fully integrated platform for spectral LOQC seems feasible in the future. The design requirements for on-chip chronocylic shaping do differ for quantum systems compared to classical ones; for example, whereas classical telecommunication designs can mobilize amplifiers to counteract loss, a quantum network cannot, making throughput a relatively higher priority than in the classical systems realized up to this point. For this reason, our quantum protocol suggests slightly different emphases in design, providing optimism for improved performance when devices are tailored to this application.

V. CONCLUSIONS AND FUTURE DIRECTIONS
In this article, we have proposed and numerically derived a universal linear-optical quantum computing platform based on dual-rail frequency encoding. Our approach requires no optical nonlinearities, is compatible with classical wavelength-division-multiplexed networks, and utilizes no spatial interferometers. The necessary spectral and temporal manipulations appear possible with current technology. Moreover, one can exploit the programmability of each pulse shaper and EOM to transform a given physical arrangement into any one of several quantum circuits by modifying the electrical controls, offering interesting practical avenues toward reconfigurable quantum networks.
From a more conceptual angle, our design space of phase manipulation in Fourier dual bases offers new directions for quantum optical circuit synthesis. Rather than building quantum computations by combining oneand two-qubit gates, one can view the full quantum circuit as a sequence of chronocyclic phases. Accordingly, we anticipate significant resource reduction since each design is optimized for its specific computation, analogous to previous findings in LOQC for the case of photonic cluster-state production [77][78][79]. Furthermore, although here we have specialized to time-frequency spaces, these design tools apply equally well to diffractive systems with lenses and masks, which are likewise based on successive Fourier transformations and phase manipulationsindicating pathways to take these ideas full-circle back to the spatial domain.
Yet the greatest impact of this computing protocol likely rests in the specific application of the quantum interconnect. Spectral qubits interface directly with frequency-disparate systems, can be transmitted long distances in optical fiber, and are controllable with telecommunication technology. In many ways, their advantages bear analogy to those of classical optical frequency combs [80]: just as an optical clock connects ultraprecise microwave frequencies (via the comb spacing) to optical wavelengths (via the absolute frequency), spectral LOQC can serve as the bridge between the microwave regime of material qubits and optical photons which are so adept at information transmission. And so it is our hope that quantum information processing with frequency-encoded photons will fill in yet one more piece of the puzzle that is practical quantum computing. As mentioned in the main text, the total M -mode transformation for a series of R pulse shapers and R electro-optic phase modulators (EOMs) assumes the form where the D k (D k ) are diagonal unitary matrices signifying spectral (temporal) phase modulation, and F is the DFT matrix with elements F nk = M −1/2 e 2πink/M . The input and output mode operators in the subspace of interest are connected by this matrix V according tô where K specifies the index of the smallest frequency in the N -mode subspace.
After [51], we first convert from the mode transformation [Eq. (A1)] to the Hilbert space H n N spanned by the photonic qubits. Let d in and d out signify the dimensionalities of the input and output computational photonic spaces. Then delineate the corresponding basis states by {|m in : m = 1, 2, ..., d in } for the input and {|l out : l = 1, 2, ..., d out } for the output; m and l are simply labels, not photon numbers. For a single-qubit, d in = d out = 2, and we can formally write as basis states and where r m and p l map each basis label to the particular mode occupied by the photon, which we are free to choose for convenience. By the preceding three equations, the actual 2 × 2 state transformation matrix W then has elements That is, for a single photon, the state transformation is related directly to the mode transformation. For a two-qubit gate, however, the conversion from mode to state is more complicated; with two computational photons and additional ancillas, multiple pathways connect a given pair of input and output basis states. In the following we assume for specificity two ancillary photons, initially placed-and later detected-in modes u and v (u = v); then the input photonic states are and the dimensionality satisfies d in = 4 (the Hilbert space of two qubits). The output states are similar, but now we allow for the possibility that the computational photons land in the same mode. Accordingly, the dimensionality is now d out = 10 (two photons in four modes), and the basis states become with the square root factor ensuring proper normalization when p l = q l . And so, combining Eqs. (A2), (A6), and (A7), we arrive at a 10 × 4 state transformation matrix given by where the sum extends over all 24 permutations of the four input photon modes-this accounts for every possible physical path taking four photons in modes (r m , s m , u, v) to four in (p l , q l , u, v). Note that the restriction to particular subspaces in Eqs. (A5) and (A8) implies a projection onto the vacuum in all other modes. For a probabilistic gate, one must therefore look for photons in these extra modes to ensure no qubit is lost; for a deterministic gate, no such steps are required.
Finally, by mapping the indices l and m to their corresponding logical basis states, we establish the target transformation matrix T for the particular operation considered, comparing it to W via the fidelity F, which we define according to the Hilbert-Schmidt inner product The success probability P then follows as a quantity which is meaningful (state-independent) whenever F = 1. And so, in the optimization procedure, we first define the specific mode mappings associating single-photon states with logical values [Eqs. (A3), (A4) or (A6), (A7)], then use these to determine the desired state transformation T for the targeted operation. Thereafter we run an optimization algorithm over the 2RM phases in Eq. (A1) and propagated through to the matrix W , such that F = 1 and P is maximized.

Appendix B: Full Solutions
We enlist the Optimization Toolbox in MATLAB for our numerical routines. Our thorough-though certainly nonexhaustive-searches yield the results summarized in Table 1 of the main text. For completeness, here we record the specific phases for each pulse shaper and EOM in the optimal Hadamard and cz gates. All simulations truncate the space at M = 128 modes, sufficiently precise without producing intractably long computation times. Figure 5 shows the results for the Hadamard gate. The specific temporal phases applied by each EOM are in Fig.  5(a), including the associated power spectra. These are not the mode coupling coefficients c n in Eqs. (6) and (7) of the article, but rather the Fourier transform of the temporal phase pattern ϕ(t) itself, which indicates the electronic bandwidth required by an arbitrary waveform generator. The pulse shaper phases follow in Fig. 5(b). Their relatively discontinuous form poses no problems for devices which resolve each mode individually.
For the cz gate, we start with the same number of devices as in the Hadamard solution, adding pulseshaper/EOM pairs until we reach the theoretical efficiency limit. Practically, this amounts to simulating the cases R = 2, 3, 4 in Eq. (A1). The specific EOM and pulse shaper phases for the R = 2 case are presented in Fig. 6; those for R = 3, in Fig. 7; and those for R = 4, in Fig. 8. Note in particular how the EOM modulation bandwidths for these solutions decrease as the total number of devices increases: while the 10-dB bandwidth of the modulation patterns in Fig. 6(a) extend out to the 14th harmonic, the widest in Fig. 7(a) reaches just the 10th harmonic, and those of Fig. 8(a) stop at the 5th harmonic. This behavior corroborates the scaling described in the article, whereby solutions with more components are found to require fewer optical modes.