Efficient qudit based scheme for photonic quantum computing

Linear optics is a promising alternative for the realization of quantum computation protocols due to the recent advancements in integrated photonic technology. In this context, usually qubit based quantum circuits are considered, however, photonic systems naturally allow also for d -ary, i


Introduction
In recent years, many advancements have been made in the area of integrated photonic quantum technologies.Integrated quantum photonic processors (IQP) with on-chip linear optics [1,2], single photon sources [3][4][5] and photon number resolving detectors (PNRD) [6][7][8] have been demonstrated.These integrated components and waveguides are usually printed onto silica, which makes it possible to miniaturize the chips and increase the number of onchip components.Since photons couple very weakly to their environment, IQPs typically do not require millikelvin temperatures to operate as opposed to other quantum information processing architectures like superconducting devices [9].However, there are still many hurdles to overcome in order to achieve fully scalable and fault-tolerant quantum computation.Until then even IQPs will remain intermediate scaled and thus the amount of available quantum resources will be limited.
A common technique for reducing computational resources is to encode quantum information efficiently.Typically quantum information is encoded into two level systems, qubits which became standard due to their simplicity and analogy to classical computation.However, there are other ways to deal with quantum information.An alternative is to use qudits, d > 2 level quantum systems, which are the basis for high-dimensional quantum computation [10].Qudits have been considered in many areas of quantum computation, for example in topological quantum computation the braiding of d parafermions [11] provide a natural way to implement qudits [12].There also have been attempts to realize superconducting qudits [13,14], but because of the flexibility in how photon states can be interpreted, qudits are most prominent in photonics [15][16][17][18][19][20].The use of qudits increases the number of dimensions per computation unit.This property of qudits in theory can provide some benefits over qubit systems by reducing circuit complexity of quantum algorithms or by increasing the channel capacity and noise tolerance of communication protocols [21,22].
There has been considerable experimental progress on the way towards photonic quantum supremacy via boson sampling (see, for example, Refs.[23][24][25]), however, the realization of universal photonic quantum computation still seems far from reality.This is because linear optics alone cannot be used to produce certain multi-photon states which are required in some form by all universal photonic schemes.The most well-known universal photonic scheme is the KLM scheme [26] which solves the problem of creating entanglement between photonic qubits by applying postselection based on ancilla measurements.This makes it possible to prepare entangled two qubit states non-deterministically using only linear optics and PNRDs.This measurement based method combined with the quantum teleportation of qubits was shown to be able to create near-deterministic two qubit gates.However, the complete implementation of the KLM scheme proved to be out of reach with current technology, and only some of the its techniques has been demonstrated experimentally.
Another approach for realizing universal quantum computation is to use measurement based quantum computation (MBQC).In MBQC the quantum algorithms are performed by making single qubit measurements on a large entangled state, usually a cluster state [27,28].For photonics MBQC provides a resource efficient and deterministic way to implement universal quantum computation.Since using qudits instead of qubits are often beneficial in quantum computation, as discussed above, it is natural to ask whether photonic MBQC can also be improved by utilizing high-dimensional computational units.In this work, we show that qudit cluster states can indeed be more resource efficient than qubit cluster states.
For the above mentioned reasons there has been a considerable effort to realize qudit entanglement experimentally [15,[29][30][31][32][33] and demonstrate the benefits of high-dimensional quantum information processing.Observing the experimental setups used in these experiments shows that there is a clear trade off between the experimental complexity and the high-dimensionality of the experiment.However, these experiments also show that the increased complexity can be overcome using clever engineering and it is possible to demonstrate advantages of high-dimensional quantum information processing experimentally.
The present paper is structured as follows: In Sec. 2 we go over a high-dimensional generalization of the KLM encoding and explain how to use passive linear optics to create singleand many-qudit gates.We generalize the post selection based approach of the KLM scheme to implement non-deterministic many-qudit gates.Then we use an optimization method to find locally optimal interferometer configurations for some two-qudit gates.In Sec. 3 we introduce the theory of high-dimensional clusters states, and then in Sec. 4 we show how to use high-dimensional cluster states to solve the k-coloring problem.

Multi-rail qudit encoding
In this section, we describe a simple method for encoding d-level quantum system, i.e., qudits, into optical modes and show how to implement non-deterministic many-qudit gates using linear optics and PNRDs.Before describing the qudit encoding, we present a few basic qudit gates and discuss some useful identities between them.Then, after the specific description of the multi-rail encoding, we also present an optimization method for increasing the success rate of non-deterministic photonic many-qudit gates.

Qudit gates
There are several different conventions in use for the generalization of the well known Pauli X and Z gates for qudit systems.We will use the following definitions where ⊕ means addition modulo d and ω = exp (i2π/d).One can immediately see that X and Z are unitary and X d = Z d = 1.However, it is important to note that they are not Hermitian for d > 2. Since the qudit gates X and Z defined above have the same eigenvalues, they satisfy a similarity relation, where the corresponding basis change operator defines the qudit Hadamard gate The Hadamard gate is often used to prepare the qudit state which plays a key role in many quantum algorithms.
The controlled X and Z gates are defined as From Eq. ( 2) it follows that Equation ( 5) means that C X |n〉 ⊗ |m〉 = |n〉 ⊗ |n ⊕ m〉, thus one can write where n, m ∈ {0, 1, 2, . . .d − 1}, therefore and by a very similar derivation we obtain Equations ( 8) and ( 9) will prove to be useful later when one needs to decompose unitaries of the form exp (iαZ ⊗ Z).
Another useful qudit gate is the one-level controlled-Z gate CZ, which is defined by its action on the basis states |k〉 ⊗ |l〉 as where δ k,l denotes the Kronecker delta.In other words, the gate CZ is another generalization of the two-qubit controlled sign flip operation, it applies a phase factor exp(i2πl/d) on the target (second) qudit if the control (first) qudit is in the state |d − 1〉.

Optical multi-rail qudit protocol
A straightforward way to encode a qudit in an optical system is to use d different optical modes, labeled by the numbers 0, 1, . . ., d − 1, and map the logical qudit levels to the occupation of different modes via a one-hot encoding map This encoding of qudit levels is a multi-rail encoding and has the advantage that any single-qudit U(d) transformation can be efficiently implemented using the Clements decomposition [34], for illustration see Fig. 1.
Another competing encoding for discrete-variable photonic quantum computation are frequency comb qudits.In concept they are very similar to multi-rail qudits, but instead of spatial modes the qudit levels are represented by different frequencies.One of the advantages of this frequency encoding is that the quantum information can be transported in a single fiber-optical cable over long distances [35].However, creating interference between modes with different frequencies requires either χ 2 , χ 3 nonlinearities or electro-optic modulation (EOM).Such nonlinearities have not yet been proven to be scalable to high-dimensional Hilbert spaces, and although EOMs can be cascaded in a scalable manner to reproduce any operation possible with linear-optics on spatially encoded qudits, the realization of EOMs with arbitrary modulation patterns pose significant practical challenges compared to the challenges of realizing linear-optical networks [36].For this reason, spatially encoded multi-rail qudit registers are currently experimentally more viable than frequency comb qudit registers, as large programmable linear-optical networks have been built and efficient single-photon generation capabilities have been developed [37].When encoding many-qudit systems using the multi-rail encoding, one thus needs d optical modes for each qudit, and all the one-qudit operations can be performed by linear optical gates.To implement two-qudit gates, one can generalize the KLM construction, where a nonlinear sign flip operation is used to obtain non-deterministic two-qubit gates.Moreover, in general not only the sign flip but any phase shift can be implemented this way.The nonlinear phase shift acts on a linear combination of the vacuum, one-and two-photon states of an optical mode, say the i-th mode, in the following way It can be implemented in a probabilistic way with linear optics and PNRDs utilizing two ancilla modes.
The ancilla modes are prepared in the state |1〉 2 ⊗|0〉 3 , so that the initial state of the system looks like After this preparation of the ancillas, a specific interferometer configuration U is applied on the three modes and then finally the ancillas are measured.If the result of the measurement is |1〉 2 ⊗ |0〉 3 then the operation was successful otherwise it failed.There are infinitely many choices for U such that one obtains on the first mode the state α 0 |0〉 1 + α 1 |1〉 1 + e iϕ α 2 |2〉 1 when measuring |1〉 2 ⊗ |0〉 3 on the ancilla modes, however, the optimal solution in terms of the probability of success is unique up to some phase factors of the rows and columns of the matrix.The set of solutions for U is the following where ϕ is the desired phase shift and is the probability of success.The optimal solution can be found by simply finding the maximum of P as a function of |U 12 |.Since all single-qudit gates are already established, it is enough to implement the two-qudit transformation C Z defined in Eq. ( 10) to create a universal gate set [10].The qudit gate CZ can be constructed using beamsplitters and nonlinear phase shift operations, this is shown by Fig. 2. As can be seen the C Z gate is made up by 2(d−1) number of non-linear phase shifts and the same number of beamsplitters.The nonlinear phase shifts have a success rate less than 1/4 which is the global maximum of Eq. ( 13), thus the probability of the C Z gate is bound by P ≤ 1/16 d−1 (the asymptotic scaling is much worse than that, see Fig. 4).This construction proves that a universal qudit protocol is possible in the same way as in the teleportation-based KLM scheme.However, the proposed CZ gate has a very low success rate, which implies that it is an unfeasible option for actual applications (especially when d is high).This means that one needs an alternative method, which we will present in the next subsection.

Locally optimal many-qudit gates
We now present, as an alternative to the scheme of Sec.2.2, an optimized method for obtaining photonic many-qudit gates, e.g., CZ or CZ operations, with a considerably improved success rate.Similarly to the scheme presented in the previous subsection, the desired gate is executed by implementing a non-trivial unitary transformation and doing postselection on the measurement results, as shown by Fig. 3.The parameters of the unitary are optimized to enhance the success rate.Such a scheme was already employed for generic two-qubits gates successfully [38].Now we apply the method for generic many-qudit gates.
Figure 3: Configuration of the interferometer for a general nonlinear operation.The many-qudit state is encoded in the modes at the top and the ancilla modes are placed below them.The ancilla modes are measured using PNRDs and the measurement result is used to determine whether the operation was successful or not.In the event of success, the computational output is encoded in the many-qudit state |ψ out 〉 c .
In the multi-rail encoding the many-qudit basis states ||i are mapped to photon number states |n 1 , n 2 , . . ., n M 〉 ≡ |n〉 with fixed photon number N c matching the number of qudits and a fixed number of optical modes M = N c d.The general problem we aim to solve is how to implement a many-qudit gate T using linear optics and PNRDs.Given some computational input state |ψ in 〉 c = n α n |n〉 encoded into the M computational optical modes, the many-qudit gate T transforms it into where n and m indices are referring to the photon number states |n〉 = |n 1 , n 2 , . . ., n M 〉 and |m〉 = |m 1 , m 2 , . . ., m M 〉 with i n i = i m i = N c .Unfortunately for a general transformation T there exists no linear interferometer which could execute such a transformation, i.e., most of the time some nonlinear effects are required.Here we will provide nonlinearities via photon number measurements and postselection.A linear optical interferometer can be described by a unitary U which transforms the creation operators via a ′ i † = j u i j a † j and the photon number states via Since for most transformations T there exist no U such that U |ψ in 〉 c = |ψ out 〉 c , the next best thing we can achieve is where |ñ〉 = |n〉 |1〉 ⊗N a |0〉 ⊗N v .The Fock space matrix elements Ũmn can be expressed in terms of u i j using permanents [39].Equation ( 17) is a nonlinear polynomial equation for u i j and it can be solved for u i j using numerical optimization methods while maximizing the success rate P. Since u is unitary it also has to satisfy uu † = .To solve this problem via optimization we can define the cost function where and λ and σ are positive real constants.The fidelity F reaches its maximum if and only if Eq. ( 17) is satisfied for some probability P, this is guaranteed by the Cauchy-Schwarz inequality.
The unitary constraint C reaches its maximum if and only if U is a unitary matrix.
The optimization problem defined by the cost function L was solved using a trust-region method [40] which, beside direct line search methods [41], is one of the most established family of algorithms for solving non-linear unconstrained optimization problems.We chose this technique because it has been shown that trust region methods in certain cases can have better convergence properties than direct line search methods [40], and the implementations of the trust-region methods provided by the Scipy Python package [42] proved adequate.
We employed the method of continuation to solve the optimization problem: First the problem was solved using λ = 0. Once a solution with F = 1 and C = 0 was found, λ was gradually increased to the largest possible value for which the solution still converged to F = 1 and C = 0.This process proved practical for two reasons.The first reason was that the local optimum to which the algorithm converged to from a random staring point did not necessarily lie on the F = 1 and C = 0 surface.By performing the optimization process with λ set to zero, we checked that the algorithm can actually reach the F = 1 and C = 0 surface.This initial checking run saved time as the optimization process could be restarted from a new initial point when it was clear that the solution will not reach the F = 1 and C = 0 surface.The second reason was that if the optimization run succeeded with λ = 0, i.e., the solution reached the F = 1 and C = 0 surface, the solution could be used as a starting point for the complete optimization problem when λ > 0.
At the beginning N a and N v were chosen such that the system of equations in Eq. ( 17) would be under-defined.After finding a solution N a and N v would be decreased until no solution with F = 1 and C = 0 could be found.This process was carried out for the qutrit C Z and C Z gates (see Table 1).There is a significant improvement in the success rate when the gates are optimized.However, the scaling properties of the optimized solutions are not known.Our numerical results suggests that the optimized gates' probabilities could scale much better with the dimension d then the naive gates' probabilities (see Fig. 4).Unfortunately, our results only extend up to d = 4, because for larger d values the optimization algorithm failed to converge in a reasonable amount of time.Thus, using our results it is not possible to make any conclusive statements about the scaling of the optimized gates' probabilities and it remains an open problem to find optimal solutions for larger qudit dimensions d.These optimized gates could be used to non-deterministically prepare entangled photon states which are necessary for many measurement based architectures like optical cluster state computing [43].
Table 1: Optimized two-qutrit gates.P naive is the probability we get when the gates are decomposed into many nonlinear phase shifts.P is the best probability found after doing the optimization process for many different randomly selected initial conditions (these are not guaranteed to be global optima).To further discuss the impact of these results it is useful to make an estimate of what is practically achievable in the near term using already existing single-photon generation and detection devices.Highly indistinguishable single photons can be generated on-demand using quantum dots [45][46][47]; state-of-the-art sources can generate as much as 100 million single photons per second [37] potentially allowing for MHz attempt rates when implementing nondeterministic entangling gates such as the ones listed in Table 1.When it comes to the detection of single photons, superconducting nanowire single-photon detectors (SNSPDs) are the leading technology in the near-infrared region [48][49][50][51].The advantages of SNSPDs are that they have exceptionally low dark count rates, high system detection efficiency (SDE) and low reset times on the order of nanoseconds.These properties make SNSPDs ideal for quantum information processing applications.
The increased success probabilities of the optimized non-deterministic gates presented in this section provide a speedup over their naive variants.The speed of the non-deterministic gate synthesis is directly proportional to the success probability of the gate and the rate of attempts which is dictated by the reset time of the detectors and the emission rate of singlephoton sources.In previous boson sampling experiments single-photon pulse trains generated by quantum dots were demultiplexed and injected into several spatial modes at rates close to 1 MHz [52,53].An experimental setup similar to what is presented in Refs.[52,53] could be used to implement non-deterministic gates with an attempt rate in the MHz range.At such a rate even the naive variants of the gates listed in Table 1 would be technically feasible under ideal circumstances.For example, the naive non-deterministic qutrit (d = 3) CZ gate would take roughly 4 • 10 5 attempts on average to succeed, i.e., 0.4 seconds if 10 6 attempts are made every second.On the other hand, the optimized qutrit CZ gate would take only 2 milliseconds on average to succeed under the same circumstances.
While the naive gates are feasible by themselves, in practice there can be strict timing constraints on the gate times in quantum information processing schemes which require quantum memories.In many cases the storage time of quantum memories poses as a limit on the gates times, e.g., in the KLM scheme or in cluster state preparation schemes like Ref. [54].For these and similar applications the gate times should be much shorter than the storage time of the quantum memories.Current quantum memories operating on the single-photon level typically have storage times between a few milliseconds to a second at most [55, ].Thus, in the near term it is unlikely that non-deterministic gates with average gate times longer than a few milliseconds would be practical for universal quantum computing schemes.Also, the efficiency of quantum memories usually decreases exponentially with the storage time (see Refs. [55, ]), further emphasizing the need for speed optimized gates.The optimized gates in Table 1 show an improvement over the success probabilities of the naive gates and hence reduces the average gate times by orders of magnitude.For the reasons above, these improvements can have a significant impact on the feasibility of experimental realization of high-dimensional universal quantum computing schemes.

High-dimensional cluster states
The most common computational model is the quantum circuit model which resembles the logic gate based description of classical computation.Measurement based quantum computation is an alternative to the circuit model, where instead of applying unitary gates one performs adaptive single qubit or qudit measurements on a large entangled state, called the cluster state.At first this may seem completely different from the circuit model but their equivalence have been proved [28].MBQC is in particular a promising paradigm for the realization of universal optical quantum computation, because if cluster states can be prepared efficiently there is no longer need for further non-deterministic gates to perform the computation.In other words, MBQC shifts the problem of implementing nonlinearities to the problem of state preparation.Several methods have been developed to generate cluster states efficiently, thus MBQC is one of the most viable options for realizing universal quantum computation using photonics [54,57,58].
Cluster states have the form where C Z is the controlled qudit Z gate and C is a graph whose edges represent the C Z gates between qudits.The idea is to perform single-qudit measurements sequentially on the qudits found in the cluster, where the basis of each measurement depends on the results of the previous measurements.When a qudit is measured it is effectively removed from the cluster reducing its size.After the measurements, the remains of the cluster state will encode the computational state up to some known single-qudit Pauli errors which can be easily corrected for at the end of the computation.
To connect the cluster state picture with the quantum circuit model, we can use the teleportation identity where |ψ〉 is a general qudit state, m is the result of the measurement performed on the top qudit, and P(θ ) is a phase gate with θ ∈ d which acts like P(θ ) |n〉 = exp(iθ n ) |n〉 [59].This circuit represents a single measurement step in the cluster state picture.It applies the singlequdit unitary H P(θ ) and propagates the state to the qudit that connects to it.Any unitary can be decomposed into a product that only contains gates of the form H P(θ ), thus chaining together many of these circuits one can perform any single-qudit unitary [59,60].These chains directly correspond to measurements on a linear cluster state.An important detail is that after each measurement we introduce Pauli errors of the form X a Z b where a, b depend on the results of the previous measurements.In order to account for the accumulated Pauli errors we have to change the measurement angles to θ ′ such that In general, we can translate any quantum circuit to a cluster state with measurement instructions using the teleportation identity defined above.This way each qudit in the quantum circuit model will correspond to a linear subcluster made up of several physical qudits and the C Z gates between qudits in the quantum circuit will become connections across the corresponding linear clusters.Although this construction is enough to translate any quantum circuit, it makes the translation easier if we allow the use of C Z † connections between physical qudits in the cluster.This is justified by another teleportation identity slightly different from ( 21) These cluster states can be illustrated by depicting the linear clusters as rows with the C Z or C Z † gates between them shown as vertical lines.An example of this is shown by Fig. 5.

The k-coloring problem
Graph coloring is one of the most studied topics of graph theory because of its applications in solving scheduling problems and compiler theory [61,62].Coloring refers to the assignment of labels (colors) from a label set to the vertices of a graph G.This assignment defines a map C : V → L, where V is the set containing the vertices of G and L is the label set.Arbitrarily ordering the vertices of G allows us to represent a coloring as string of labels: If we call the i-th vertex v i ∈ V and its assigned color C(v i ) = l i ∈ L, then the string l = l 1 l 2 l 3 . . .l |V | completely characterizes the coloring C. The k-coloring problem of a graph is to decide whether the vertices of the graph can be colored using k colors, such that no adjacent vertices have the same color.The smallest k for which the k-coloring is possible for a given graph is called the chromatic number of the graph.The k-coloring problem of an arbitrary graph is known to be NP-complete [63][64][65].There has been rigorous proof showing the speed up of certain quantum algorithms compared to the best known classical, [66], and even certain heuristic variational quantum algorithms for a similar problem have been hinted to outperform classical methods [67].

Qubit algorithm
The k-coloring problem can be reformulated as a combinatorial optimization problem where the goal is to minimize the number of edges connecting vertices with identical colors by searching through the possible |V | length strings of the label set L = {0, 1, 2, . . ., k − 1}.On qubitbased architectures, binary optimization problems can be solved using the quantum approximate optimization algorithm (QAOA) [68].Encoding the strings of L as bit-strings means that we can use the QAOA to solve the k-coloring problem as well; such a QAOA type of approach for the k-coloring (and the related k-SAT problem) has been studied in Refs.[69][70][71][72][73].The encoding of colorings into bit-strings is most easily done via one-hot encoding, this means that the strings of L are encoded into N = |V | • k bits, where each set of k consecutive bits encodes the color of a vertex.The color of the i-th vertex l i is indicated by the i-th set of k bits of the form 00 . . .010 . . .00, where the l i -th bit is flipped and the rest of the k bits is zero.We will denote the j-th bit of the i-th set of k bits by x i, j .

Minimizing the cost function
is equivalent to finding a solution to the k-coloring problem, where x is a bit-string of length N , A nm are the matrix elements of the adjacency matrix of G and C and D are arbitrary positive real constants.The first term in Eq. ( 23) weighted by C is a penalty term, since not every bit-string of length N corresponds to a coloring.For every n ∈ {1, 2, . . ., |V |} exactly one of the k bits x n, j , where j ∈ {0, 1, . . ., k − 1}, has to equal one in order for x to encode a coloring.The remaining term simply counts the number of edges that connect vertices with the same color.
To construct the QAOA cost Hamiltonian we can use the recipe where |x〉 is the computational state |x n,i 〉 .
Substituting Eq. ( 23) into Eq.( 24), the cost Hamiltonian becomes where Z n,i is the Pauli Z matrix acting on the (k • (n − 1) + i)-th qubit labeled by the tuple (n, i).
Obtaining the ground state of H C is the same as finding a bit-string that minimizes the cost function f [70].
In Eq. ( 27) E denotes the set containing the edges of the graph.The Hamiltonians H 0 and H 1 commute since they only contain Pauli Z matrices, thus The unitary e iαH 1 can be decomposed into the product of |V | k 2 + k|E| number of controlled rotations (29) where P n, j (α) = e iαZ n, j is the phase gate acting on the qubit labeled by the pair of indices (n, j) and C X n,i;n, j is a controlled NOT gate between the control qubit (n, i) and the target qubit (n, j).Eq. ( 29) can be derived using the identity e iαZ⊗Z = C X (1 ⊗ P(α)) C X .
The physical realization of the unitary e iαH 1 requires by far the most amount of physical resources compared to the other parts of the algorithm, since only this part needs entangling gates.Therefore, focusing only on the implementation details of e iαH 1 can give us a good lower bound on the resources necessary to carry out the QAOA.

Graph coloring using qudits
When using qudits with dimension d = k, there is a one-to-one correspondence between the computational basis and the possible graph colorings with k colors via the mapping where l i ∈ {0, 1, 2, . . ., k − 1}.This means that the coloring problem can be formulated as an unconstrained d-ary optimization problem which can be solved by the QAOA generalized to qudits [74][75][76].Because the optimization problem is unconstrained, the decomposition of the QAOA layers will turn out to be simpler due to lack of penalty terms.The QAOA for qudits is very similar to the qubit version only the form of the mixing and cost Hamiltonian is different.The mixing Hamiltonian is still a simple sum of single-qudit terms, e.g., the r-nearby-values single-qudit mixer as in Ref. [75], and the cost Hamiltonian is where Z n is the qudit Pauli Z gate acting on the n-th qudit and A nm are the matrix elements of the adjacency matrix of the graph G.The ground states of the Hamiltonian H C correspond to optimal k-colorings of G. Similarly to the qubit case, we can decompose the unitary U C (α) = e iαH C into |E| number of controlled qudit rotations where P m (α) is a single-qudit phase gate which acts on the m-th qudit the following way

Cluster states for the qubit and qudit implementations
Having established all the necessary techniques to implement the QAOA solution of the kcoloring problem both using qubits and qudits, we can now compare the physical resources used by the two methods.A single layer of the qudit QAOA algorithm without the mixing part can be executed on the qudit cluster state C d constructed from many copies of R d , where R d is a cluster with the topology depicted by Fig. 5 made up by d-dimensional qudits.When the number of colors is k, one has to use d=k-dimensional qudits for the algorithm.The construction of C d is shown by Fig. 6.The construction of C 2 , the qubit equivalent of C d , works differently.In the qubit case, one has to add k copies of R 2 for each edge of G and also k(k −1)/2 copies for each node of G.These construction rules follow from the decompositions in Eqs. ( 29) and (32).
The number of qudits in C d is approximately where |E| is the number of edges in G, which is equal to the number of copies of R d used to build C d , and |R d | is the number of qudits in R d .The approximation can be made exact by carefully considering the precise sequence of node additions and removals in the cluster growing process, however, for large enough graphs Eq. ( 34) provides a highly accurate estimate.
Similarly, the number of qubits in C 2 is In general, the ratio |C 2 |/|C d | is strictly larger than k, and in the large dense graph limit, when |E| ≫ |V |, this ratio approaches k.This is illustrated by Fig. 7 for Erdős-Rényi random graphs.If one uses the multi-rail encoding described in Sec. 2, the photon numbers of the cluster states is equal to their size.The number of optical modes required to encode the cluster state C d is d|C d | including the qubit case d = 2. Thus, the number of photons decreases by a k-fold and the number of optical modes halves, when using multi-rail qudits instead of KLM qubits to encode the k-coloring problem.

Conclusion and Outlook
In this work, we investigated a KLM-like qudit encoding for universal photonic quantum computation.First, the optimization of non-deterministic many-qudit gates was discussed, then the solution of the k-coloring problem as an application of high-dimensional cluster states was examined.
The physical implementation of the single-qudit gates by the described protocol should pose no problem in experiments, since they require only the use of passive linear optics.However, the low probabilities of the entangling many-qudit gates make this scheme applied with postselection challenging from the universal quantum information processing point of view.Nevertheless, the approach may still be used to non-deterministically prepare highly entangled photon states, which are required by many other universal photonic schemes, most notably photonic cluster state computation.We present a numerical optimization method to improve the success rate of a general many-qudit gate.The method is capable of finding locally optimal solutions with perfect fidelity, improving the success rates typically by orders of magnitude compared to the naive implementations when the gates are decomposed into nonlinear phase shift operations.We only considered qudit gates where photon number of the input states is fixed, but in principle it could also be used when this restriction is lifted.For example, it can be applied to numerically find an optimal solution for the nonlinear phase shift.Furthermore, it can be employed for more general hybrid qudit gates [77], when the dimensions of the qudits are not the same.
To amend the problems of the non-deterministic postselection based approach, we used cluster states encoded in the multi-rail encoding to give an implementation for the highdimensional QAOA.We demonstrated our method on the k-coloring problem which can be solved by either using qubits or qudits with d=k.We show that the high-dimensional cluster states proposed in this work to solve the k-coloring problem are made up of fewer photons and require less optical modes to encode than the KLM qubit cluster states needed to perform the same task.The reduced number of photons can help with quantum storage since usually the fidelity of quantum memories drop quickly with number of photons due to photon loss [78].The real difficulty of cluster state computation is in the generation of the cluster states, and all results involving cluster states rely on the assumption that they can be generated efficiently.In a recent work it has been shown that in theory one can produce these type of high-dimensional cluster states deterministically using quantum emitters [79].The methods shown in Ref. [79] combined with the result of this work give a convincing argument for the usefulness of multirail encoded high-dimensional cluster states.

Figure 1 :
Figure 1: Interferometer configuration for the implementation of a single qudit gate when d = 5.This configuration can implement any single qudit gate and minimizes the optical depth.Each crossing represents a general beamsplitter between neighboring optical modes.In general the configuration requires d(d − 1)/2 number of beamsplitters.On the left the input state ||2〉〉 encoded by single photon enters the interferometer and the output state U ||2〉〉 appears on the right.

Figure 2 :
Figure 2: Realization of the CZ gate entangling two qudits defined by the multi-rail encoding.The red and blue segments indicate symmetric beamsplitters with angles θ = ±π/4 and φ = 0 (red is plus and blue is minus), and the white boxes denote nonlinear phase shifts with angles ϕ k = 2πk/d.

Figure 4 :
Figure 4: Comparison of the success probabilities of the naive and optimized C Z nondeterministic gates for different d values.The naive probabilities scale exponentially with d, where the base of the exponential is 0.037.The optimized probabilities were only calculated up to d = 4.

Figure 5 :
Figure 5: Qudit cluster state with the measurement instructions to implement the two qudit unitary U = C X P(θ )C X † .The black and red edges denote the C Z and C Z † connections between the physical qudits.The initial state with its Pauli errors is encoded in the green qudits.The measurement order is indicated by the numbers.After the execution of all the measurements, the final state is encoded in the red qubits.The arrows show how the qudit states are teleported from one qudit to the next, and the unitary of each arrow indicates what transformation should the teleportation perform.

Figure 6 :
Figure 6: Qudit cluster state for a single layer of the qudit QAOA.Each edge of G corresponds to a controlled qudit rotation in the decomposition of exp(iαH C ) described by Eq. (32).Thus one can chain many copies of R d to form the complete qudit cluster.The two input nodes of R d are merged with two output nodes of the unfinished cluster state based on the topology of G.Each row of physical qudits represents a logical qudit labeled by the numbers.Each logical qudit encodes the color of a node in G.

Figure 7 :
Figure 7: (a) Number of physical qubits and qudits versus the number of edges in G, the graph to be colored.|C 2 | is the number of physical qubits in the qubit cluster state implementation of exp(iαH 1 ), where H 1 is defined by Eq. (27).|C d | is the number of physical qudits in the cluster state implementation of exp(iαH C ), where H C is defined in Eq. (31).(b) Ratio of the qubit and qudit cluster sizes when |V | = 500 and k = 3, where |V | is the number of vertices in G and k is the number of colors used for the coloring.
(16)s with other ancilla values,(16)where we introduced N a number of ancilla modes each occupied by a single photon and N v number of vacuum ancilla modes.If we were to prepare the state U |ψ in 〉 c |1〉 ⊗N a |0〉 ⊗N v , we would find the ancillas in the state |1〉 ⊗N a |0〉⊗N v with probability P.This means that by preparing U |ψ in 〉 c |1〉 ⊗N a |0〉 ⊗N v and measuring the ancilla modes T is implemented with probability P. The relation between U and T is minimizes the expectation value 〈ψ (α, β)| H C |ψ (α, β)〉, where is the mixing Hamiltonian, where p denotes the number of QAOA layers.Preparation of |ψ (α, β)〉 requires the implementation of two parameterized unitary U M (α) = e iαH M and U C (β) = e iβ H C .U M can be realized using single qubit rotations and only U C requires entangling gates.U C can be further separated into the product of two unitaries, where one of the unitary requires only single qubit phase gates and the other unitary requires only controlled rotations.This can be achieved by separating the cost Hamiltonian into a non-interacting and an interacting part, H C = H 0 + H 1 , where