Data re-uploading with a single qudit

Quantum two-level systems, i.e., qubits, form the basis for most quantum machine learning approaches that have been proposed throughout the years. However, higher dimensional quantum systems constitute a promising alternative and are increasingly explored in theory and practice. Here, we explore the capabilities of multi-level quantum systems, so-called qudits, for their use in a quantum machine learning context. We formulate classification and regression problems with the data re-uploading approach and demonstrate that a quantum circuit operating on a single qudit is able to successfully learn highly non-linear decision boundaries of classification problems such as the MNIST digit recognition problem. We demonstrate that the performance strongly depends on the relation between the qudit states representing the labels and the structure of labels in the training data set. Such a bias can lead to substantial performance improvement over qubit-based circuits in cases where the labels, the qudit states, and the operators employed to encode the data are well-aligned. Furthermore, we elucidate the influence of the choice of the elementary operators and show that a squeezing operator is necessary to achieve good performances. We also show that there exists a trade-off for qudit systems between the number of circuit-generating operators in each processing layer and the total number of layers needed to achieve a given accuracy. Finally, we compare classification results from numerically exact simulations and their equivalent implementation on actual IBM quantum hardware. The findings of our work support the notion that qudit-based algorithms exhibit attractive traits and constitute a promising route to increasing the computational capabilities of quantum machine learning approaches.


Introduction
In recent years, the field of quantum machine learning has attracted much attention.There, quantum circuits are employed as central processing units for data-driven applications (Biamonte et al, 2017;Schuld and Petruccione, 2018;Dunjko and Briegel, 2018).While it is currently not clear whether or not quantum processing can provide a benefit on practical machine learning problems (Schuld and Killoran, 2022;Schuld, 2021), there has been some evidence that quantum machine learning models can outperform classical models in certain tasks (Liu et al, 2021;Sweke et al, 2021;Gyurik and Dunjko, 2022;Gyurik et al, 2022).While most studies, theoretical (Bharti et al, 2022;Montanaro, 2016) as well as experimental (Graham et al, 2022;Pino et al, 2021;Kjaergaard et al, 2020), focus on quantum systems consisting of two-level quantum systems, i.e., quantum bits (qubits), quantum computing hardware and algorithms can also be based on d-level systems, which are typically called qudits (Wang et al, 2020;Ringbauer et al, 2022).Such qudit systems were shown to have advantages in specific contexts (Cozzolino et al, 2019;Sheridan and Scarani, 2010) and have already been applied to several tasks (Bravyi et al, 2022;Deller et al, 2023;Weggemans et al, 2022).However, a full evaluation on application-relevant tasks is still lacking.
Currently, it is not clear whether there is a fundamental advantage or disadvantage of utilizing qudit systems over their qubit counterparts for quantum machine learning or other application domains such as quantum optimization.However, qudits provide a complementary route to increasing the Hilbert space size in pursuit of better computation performance.This is an alternative direction to qubit systems, where the route to larger Hilbert spaces is to increase the number of qubits.Among other challenges, increasing the number of qubits comes with increased difficulty of engineering high-fidelity interactions between separate qubits, which are technologically challenging and typically involve larger gate errors than single qubit operations, see for example, Kjaergaard et al (2020), Fedorov et al (2022) or Resch and Karpuzcu (2019).In that regard, expanding the local Hilbert space dimension by utilization of qudit systems seems promising, since certain interactions between spatially separated qubits could instead be implemented by local qudit operations, and thus might prove to be more efficient (Fischer et al, 2022;Ringbauer et al, 2022).We discuss several of such aspects of qudit system at various parts in this work.
We explore the usage of qudit systems in the context of the data re-uploading (Pérez-Salinas et al, 2020) quantum machine learning approach to build regression and multi-class classification models.In this scheme, a single qudit provides a natural way of encoding multiple classes by representing each class label as an orthogonal basis state.We focus on the prominent data reuploading architecture, since it was shown in the original work that a single qubit is already sufficient to implement a universal classifier.Due to the comparably small resource requirement data re-uploading circuits were also experimentally implemented on a trapped ion device (Dutta et al, 2022).Additionally, the encoding characteristics of these models is well understood, as it generates increasingly higher Fourier terms with more layers (Schuld et al, 2021).Thus, it is natural to first evaluate and confirm these same properties for a single qudit as well.Extending these circuits to multi-qubit/multi-qudit circuits would allow for more sophisticated setups including entanglement.However, in this work we refrain from doing this and instead focus on the most simple, nontrivial case to investigate the fundamental aspects of qubits and qudits related to basic operators and Hilbert spaces.
This paper is structured as follows: In Sec. 2, we introduce the mathematical description of qudits.Sec. 3 illustrates the implementation of the data re-uploading algorithm (Pérez-Salinas et al, 2020) with qudits and shows the circuit structure as well as the chosen loss functions used during training.Sec. 4 presents the training procedure which is done numerically and on IBMQ hardware.To be able to run our model on qubit based quantum hardware, we present a way to encode qudits with multiple qubits.In Sec. 5, we verify the expressivity of our model by testing it on a simple regression problem.We then go on and test our model on multi-class classification problems where we show an intrinsic bias between the qudit state representation and the data structure.Finally, we present numerical results of the model when being trained on the MNIST handwritten digits data set (LeCun and Cortes, 2005).We additionally investigate an equivalent qubit-based implementation on IBMQ hardware and the effect of entangling operations on the performance of the model.Inspired by cold atom systems (Kasper et al, 2022), we interpret a d-level qudit as a spin with total angular momentum ℓ = d−1 2 , such that the basis state |k⟩ corresponds to the spin eigenstate with angular momentum m = 2k−d+1 2 .A natural set of operations on qudits states, which is also easily implementable in experiments, is given by the angular momentum operators {L x , L y , L z }.These generate rotations around the corresponding axes and obey the canonical commutation relations of the special unitary group SU (2), [L i , L j ] = iϵ ijk L k .The action of the angular momentum operators on the qudit basis state are given by

Qudits
where k ∈ [0, d − 1] and with There are various ways to define a universal gate set to realize arbitrary actions in the qudit Hilbert space, see e.g.Wang et al (2020) and Luo et al (2014).For a single qudit, as it is considered in this work, we choose the two angular momentum operators L x and L z and the squeezing or one-axis twisting operator L z 2 = L 2 z .For d > 2 this additional gate is needed to be able to generate any state by (possibly many) repeated finite rotations as detailed in Kasper et al (2022) and Giorda et al (2003).The reason for this is that the iterated commutators of these three operators generate all d 2 − 1 Hermitian basis operators, which are necessary to generate all unitary operations of the SU (d) group.
Equivalent to qubits, the gates for qudit circuits are then generated by exponentiation of the basic operators which implements the rotations with j ∈ {x, z, z 2 } and where θ ∈ R are free parameters.
In Fig. 1 we illustrate the qudit states (panel A) and the action of the elementary operators by showing the Husimi-Q quasi-probability distribution (Husimi, 1940) on a generalized Bloch sphere in panel B. The pure rotation does not deform the probability distributions, but applying the squeezing operation leads to a deformation of the state.
By choosing the operator set {L x , L z , L 2 z } we impose a ladder structure on the qudit target states.This primarily arises from the operator L x , which couples each state |k⟩ to its adjacent states |k + 1⟩ and |k − 1⟩, as it is illustrated in Eq. 1.
3 Data re-uploading with a single qudit We utilize a single d-level qudit and implement the quantum machine learning model as a data re-uploading quantum circuit (Pérez-Salinas et al, 2020;Jerbi et al, 2023).The quantum circuit in its general form is build up from L layers and encodes a quantum state, which depends on the input data x as where |0⟩ is the initial state.The characteristic of the data re-uploading architecture is that the unitary operation of each layer l encompasses data dependent unitaries, which are parametrized by the scaling parameters ω (l) and data independent operations with free parameters θ (l) .We tested several layer structures and found that they all produce similar results.In the following we report results for two architectures.The first one is inspired by classical Euler rotations, where the unitaries of each layer have the structure: The data encoding block S of each layer consists of alternating x and z rotations, where the number of rotations is determined by the dimensionality D of the input data and consequently α = x (α = z) in case D is odd (even).The alternating x and z rotations is chosen to ensure that these are non-commuting.This is necessary to distinguish between the individual dimensions of the data vector.If only x (or z) rotations were chosen to encode the data, the classifier would only be able to learn the sum of the input data.The data-independent block in each layer is composed of a sequence of three rotations followed by a squeezing gate R z 2 as the last operation, i.e.
The first three operations give rise to Euler angles, starting from |0⟩, and thus the freedom to create overlap with an arbitrary qudit state.The total number of adjustable parameters of a L-layer model is given by (4 + D)L.The action of this circuit structure is illustrated in Fig. 1 C.
The second architecture considered here is inspired by the simplified form presented by Pérez-Salinas et al (2020) and has the structure: Here the first term in the exponent is the sum over the three angular momentum operators, i.e. the generators of the SU (2), and the function c(j) = (j mod 3) selects one of them.The second term in the exponent is a generalization of the original simplified architecture by including the squeezing operator in each layer.The total number of adjustable parameters for an L-layer model of this structure is given by (2D + 1)L.
We like to point out that in this form both architectures implement the aforementioned ladder structure, since the data encoding is done with the angular momentum operators, that only couple each qudit basis state to its adjacent states.
In our work we approach supervised classification and regression tasks by using qudit-based quantum circuits.In a supervised learning setting, there exists a set of N training samples (x i , y i ) with i = 1, . . ., N , which consist of pairs of input samples x with corresponding output values y.The input samples are real-valued D-dimensional vectors x ∈ R D while the output values are either real numbers or a finite set of integers for regression and classification tasks, respectively.
For classification problems the output values y ∈ (0, 1, . . ., d − 1) indicate to which of the d classes the data sample x belongs.In the quantum formulation, each class label is represented by a basis state of the d-level qudit |y⟩ with y = 0, . . ., d − 1.The model prediction, i.e., the probability that a data sample x belongs to class y, can then conveniently be calculated from the overlap of the label state and the qudit wave function obtained from the quantum circuit with input x, Training the quantum circuit is achieved by minimizing a loss function over the given training data set D = {(x i , y i )} i=1,...,N .The overlap of Eq. ( 10) is the basis for formulating the mean squared error (MSE) loss function, with the average predicted label of the quantum model Another popular choice is the overlap loss as used in Pérez-Salinas et al ( 2020), The learning procedure amounts to adjusting the parameters of the quantum circuit (ω, θ) in order to minimize the loss function, which is done by running a classical optimization algorithm.
After the quantum circuit has been trained its accuracy is evaluated by analyzing its predictions of the output variables on a test data set, i.e. a set of data samples not used during the training procedure.For a classification task the predicted output labels is given by the basis state with the highest probability in the quantum state with the corresponding input data sample, i.e.
where (ω opt , θ opt ) are the optimized values of the circuit parameters.The accuracy of the trained model can then be evaluated by calculating the fraction of correctly predicted labels in the test data set, where D test denotes the test data set which contains N test data samples and δ a,b is the Kronecker delta.
The MSE loss of Eq. ( 11) is also suitable to learn regression tasks.In that case the output variables are finite-range continuous variables, y ∈ [0, d − 1].The resulting qudit state of the trained quantum circuit is then a superposition of basis states and the predicted output value for input x i is calculated as the expectation value of Eq. ( 12), For simulations running on actual quantum hardware, the probability distribution of Eq. ( 10) is estimated by performing a finite number of measurement shots and recording the measurement results as a histogram.This approximative distribution is then used to calculate the predicted output values of Eqs. ( 14) and ( 16).

Experimental setup
We perform the training of the quantum circuit utilizing exact numerical simulations of the qudit states and quantum gates.The parameter values of ω and θ are initialized randomly in the range [−π, π].As classical optimization algorithms for minimizing the loss function we employ the ADAM optimizer (Kingma and Ba, 2014) paired with the exact gradients calculated by the automatic differentiation package JAX (Bradbury et al, 2018).Additionally, we also used L-BFGS-B and Powell optimization approaches from the scipy library (Virtanen et al, 2020), where we do not utilize automatic differentiation.Apart from differences in the run time for the training, the results obtained with all approaches were always comparable.If not stated otherwise, all models are trained on randomly selected data sets with size N = 750.The performance is evaluated on a separate randomly selected test data set, which contains N 3 = 250 data samples.In order to obtain reliable statistics of the results, we run 60 different simulations for each setting, each time randomly varying the data set and the model initialization.To visualize the decision boundaries of the trained classifiers, we utilize the visualization library orqviz (Rudolph et al, 2021).
In addition to the numerically exact simulation, in 5.6 we re-train and evaluate the qudit quantum circuit on the IBM ibmq lima hardware using the qiskit (Treinish et al, 2023) framework.This allows us to estimate the impact of gate errors and noise of actual NISQ hardware on the learning performance.As the IBM hardware naturally operates on qubits, we employ a mapping of the d-level qudit Hilbert space to d − 1 qubits, which is inspired by cold atom systems (Kasper et al, 2022;Santra et al, 2022) which is implemented as two-qubit zz-rotation gates on the hardware (Treinish et al, 2023).From this form it is clear that the squeezing operator has the capability to generate correlation and entanglement between the individual qubits (Santra et al, 2022).On the qubit device, we start from the optimized parameters found by the training with the exact simulation and re-train the model on the actual hardware.There, we perform 512 measurement shots for each qiskit circuit evaluation.
For comparison we also report the accumulated results on classification tasks of a standard The performance of these approaches were always comparable and we report the cumulative results of running each algorithm 50 times on randomized data stets.

Expressivity in one dimension
First, we examine the expressivity of the data reuploading circuit with a single qudit on a continuous one-dimensional regression problem analogous to Schuld et al (2021).We train a model with one qutrit, i.e. a d = 3 qudit, to learn the simple function As the model output we use the expectation value of Eq. ( 12) but shift it to match the data range, i.e. f predicted i = ⟨ ȳi ⟩ − 1.For training the quantum circuit we employ the MSE loss function of Eq. ( 11) and use a training set of 100 linearly distributed samples.
We show the results of a L = 1 layer model in the left panel of Fig. 2. It is evident that this model is not able to learn the function properly.This confirms the previous insight for qubit circuits (Schuld et al, 2021), that data re-uploading models learn truncated Fourier series, and that a circuit containing only one angle parametrized by the input can only encode one Fourier component.In the right panel we show the results of a model with L = 2 layers.As expected, this model is now able to learn the function with two Fourier coefficients exactly.The derivation is analogous to the qubit case (Schuld et al, 2021), but is not shown in this work.Apart from the results obtained by numerically exact simulations, we also include results from the evaluation on the IBM ibmq lima hardware (green dots in the plot).These predicted values are generally noisy which result from the inherent errors in the quantum circuit, as well as the shot noise from the finite number of samples used to estimate the probability distribution of Eq. (10).

Two-dimensional classification tasks
Inspired by the original benchmark of the data reuploading algorithm (Pérez-Salinas et al, 2020), we investigate the performance of the qudit circuit with the structure of Eqs. ( 6)-( 8) on various two-dimensional multi-class classification problems.The data samples are located on a twodimensional square , where each sample is associated with one out of d classes.In the first problem setting, the classes are arranged in parallel horizontal stripes.Fig. 3 shows the results for seven classes, where we used a d = 7 qudit to represent the classes in the quantum circuit.
In the upper row of the figure, we show results from the case where we align the qudit states with the labels in such a way, that the z-components of the spin are in order with the class label.In that case, adjacent classes are represented by qudit states with adjacent z-spin values.Under these circumstances, the model has a strong inductive bias towards the data set caused by the chosen ladder structure.This is illustrated in the leftmost figure where we draw the qudit states on the generalized Bloch sphere.The lowest qudit state |0⟩ is associated with the class of the lowest (blue) stripe, the second lowest qudit |1⟩ with the second lowest stripe, and so on.The corresponding results show that the data re-uploading circuit can predict this data set almost perfectly with three or more layers, L ≥ 3 (blue graph in top right plot).Remarkably, the performance of the data reuploading circuit is even better than the classical machine learning models shown on the far right of the right panel.However, the learned classes and decision boundaries, as shown in the middle panels of the Figure, can still differ from the ground truth.This is due to the small size of the training data set, which necessarily leads to small random variations of the learned decision boundaries, depending on the precise location of the training data close to the decision boundaries.
The importance of the squeezing operation R z 2 in the W operator of Eq. ( 8) is highlighted by observing the massively degraded performance of the same circuits without this gate (green graph in the top right panel of Fig. 3).Without squeezing, the median accuracy saturates at around 0.7 while with squeezing the median accuracy reaches 0.95 and higher.This performance difference is attributed to the fact, that the squeezing operator is necessary to allow for the representation of arbitrary unitary operations in the qudit Hilbert space.
The second row of Fig. 3 shows the performance when the class labels are randomly assigned to the qudit states.This removes the inductive bias of the model and makes the problem much harder to learn for the qudit quantum circuit, since the ladder structure used for the data encoding does not align to the data set.Consequently, the accuracy drops significantly and many more layers are necessary to recover the performance level of the scenario with aligned labels.
The plots of the accuracies also show the accumulated results of the three classical machine learning classifiers RF, SVC and knn for comparison.The performance of the quantum circuits including squeezing with randomized assignment of qudit states to labels is comparable to the classical approaches.For aligned labels the quantum circuit even slightly outperform the classical approaches.
We also considered several other twodimensional multi-class classification problems and trained data re-uploading models on several horizontal stripe data sets with varying number of stripes (i.e.classes), as well as data sets where the stripes are not horizontal but rotated by an angle.We also investigated the models on data sets where the class regions are given by concentric rings with approximately the same width and where the center of the rings is somewhere in the plane.The results (not shown) on those models were always qualitatively similar to the ones presented here.Squeezing is always necessary to achieve good performance and when the label order is aligned with the qudit states, the performance is consistently higher.The overall performance was slightly reduced for the tilted stripes and the concentric rings and the variance in the results was also slightly larger as compared to the horizontal stripes cases presented here.

Classifying MNIST data
As the next application example, we train the model of Eqs. ( 6)-( 8) on subsets of a scikit-learn (Pedregosa et al, 2018) version of the MNIST handwritten digits data set (LeCun and Cortes, 2005).This version includes downsampled images with 8x8 pixels instead of the 28x28 pixels of the original MNIST data set.Since it is very computationally demanding to encode 8 × 8 = 64 dimensional data samples into the quantum circuit, we reduce the input dimension further using the principal component analysis (PCA) (Jolliffe and Cadima, 2016).
In Fig. 4(a)-(c) we visualize the classification boundaries of a L = 5 layer circuit for two, three and five classes, where the input dimension is reduced to D = 2 using a PCA.The plots show that the data re-uploading classifier is able to learn highly non-linear decision boundaries.It can also be seen that the classifier tends to produce disconnected classification regions due to the oscillatory nature of parametrized quantum circuits.The statistics of the accuracy for various classes is shown in Fig. 4 (d) as a function of the quantum circuit layers.It can be observed that the accuracy, as expected, increases with more layers, and that increasing the number of classes in the problem reduces the accuracy.For more classes, the reduction to two dimensions using PCA leads to more spacial overlap between classes, which makes the problems inherently noisy and limits the overall achievable accuracy.The overlapping classes can be directly observed in panel (c).Additionally, panel (d) shows the result from 50 runs of a random forest (RF) classifier.The accuracy of the quantum-based classifier approaches the values of the RF model with increasing number of layers.However, the variance in the result is significantly larger for the data re-uploading circuit.One reason for this is found in the increasingly more complex classical optimization problem when increasing the number of parameters in the quantum circuit.

Qudit vs Qubit
The quantum circuits we employed up to this point used a single d-level qudit to solve classification problems with d classes, where each basis state encodes one class label.While it may appear less natural, multi-class classification problems can also be learned with a data re-uploading circuit operating with a single qubit (Pérez-Salinas et al, 2020).In those approaches, the different classes are represented by single-qubit quantum states which are chosen to be maximally orthogonal.Unless a two-class classification problems is considered, where the labels states are |0⟩ and |1⟩, these states cannot be fully orthogonal to each other.For a d = 6 class example, we choose the eigenstates of the three spin operators, i.e.
as the maximally orthogonal label states.Note that in this situation, the overlap of Eq. ( 10) as a function of the labels is no longer a proper probability distribution since y P (y) > 1.The natural question which arises is whether there is any difference when using qubit or qudit data re-uploading circuits for multi-class classification problems.Therefore, we study and compare  9).Left: tilted D = 2 dimensional stripes data set with a rotation angle of 27 • .Qudit accuracies are shown for aligned and randomized label and state assignment, as well as with aligned labels and qudit states, but with a randomized Lx in the encoding.Right: six randomly selected digits of the MNIST data set which are reduced to D = 2 input dimensions using a PCA the performance of a single qubit as well as a single qudit on several problems.For the single qubit approach, we utilize the simplified data reuploading structure of Eqs. ( 9).Here, the squeezing operator can be removed from the circuit since it is proportional to the identity, L z 2 = 1 4 , and therefore only applies a global phase.
Fig. 5 shows the results where the qubit and qudit models were trained on two different classification problems with d = 6 classes and D = 2 input dimensions.The left panel of Fig. 5 shows the classification accuracy as a function of the circuit layers for the tilted stripes data set, where the horizontal stripes from Fig. 3 are rotated by an angle of 27 • .It can be seen that the accuracy of the qubit and qudit circuits are comparable for the case where the class labels were randomly assigned to the qudit basis states.However, for labels aligned with the qudit states, the performance is consistently higher for the qudit circuits.This result is similar to the one obtained for the horizontal stripe data set reported in Fig. 3 and can be explained by the ladder structure employed in the qudit circuits.This gives rise to the inductive bias and leads to an performance improvement in case the structure of the data encoding operators are aligned with the data.This view is supported by a slight variation of the setup: we consider aligned labels and basis states but replace the L x operator in the encoding scheme with a randomized version, Lx = k (L P(k+1),P(k) +L P(k−1),P(k) ).Here, P denotes a random permutation of the label set k = 0, . . ., d − 1 and L k,k ′ generates a transition from state k ′ to state k.These operators do not implement a ladder structure, since the Lx generate transitions between random states.We indeed observe in Fig. 5 that the median performance then decreases to the similar level as for the situation with a ladder structure, but randomized labels.
The right panel shows the results of the qubit and qudit data re-uploading circuits for the MNIST handwritten digits data set limited to six randomly selected digits (i.e.classes) and where each image is reduced to two input dimensions using a PCA.Here, qubit and qudit approaches are comparable in their performance, while the qubit architectures seem to slightly outperform the qudit ones, especially for smaller circuit depths.In this problem, the decision boundaries between the different classes are highly non-linear as discussed before.Therefore, there is no apparent favorable alignment between qudit basis states and class labels, and consequently also no inductive bias which could lead to an improved qudit performance.
In our simulations, the loss function and the classification accuracy are calculated numerically exact with full access to the quantum state.When running on real quantum hardware, this cannot be done and one needs to prepare and sample, i.e. measure, the quantum state multiple times in order to estimate the probabilities/overlaps of Eq. ( 10).For the qudit system, where each class label is associated with an orthogonal basis state in the measurement basis, the statistics of the measurement outcomes directly translate to estimating the probabilities.For qubit systems with non-orthogonal label states (i.e., for d > 2), different measurement protocols such as quantum state tomography or quantum state discrimination (Barnett and Croke, 2009) need to be employed.For fixed number for measurement shots, these lead to a slightly increased error probability for discriminating between nonorthogonal states.Additionally, the difference in overlap between a true label state and an undesired label state is less pronounced when different label states have a finite overlap.For qudits, this difference is always one since P qudit (y|y ′ ) = δ y,y ′ for label states y, y ′ (here, basis states).In the qubit representation, the difference is ≤ 1 since P qubit (y|y ′ ) = δ y,y ′ + y ′′ ̸ =y ′ c y ′′ δ y,y ′′ with c y ≥ 0.
For example, in the case of d = 6 classes considered here, P qubit (0|y ′ ) = |⟨0|y ′ ⟩| 2 = 1 2 for y ′ ∈ {2, 3, 4, 5}.This can lead to a reduced training signal in the loss functions using the overlap of Eq. ( 10), since even contributions from incorrect label states have non-zero overlap and therefore reduce the loss.Obtaining the overlaps using a finite number of measurement samples necessarily adds noise to the estimates, which in turn makes the problem of discriminating between correctly and wrongly predicted labels more difficult.As a consequence, the shot noise is expected to have a more pronounced negative effect on the training as well as prediction performance for multi-class problems when overlapping label states are used.

Circuit structure and basic operators
For qubit circuits, the spin-1 2 Pauli matrices allow to represent arbitrary single-qubit unitary operations inside each layer.For d-level qudits, one instead needs to include all d 2 − 1 generators of the special unitary group in d dimensions SU (d), to achieve the same arbitrary control.However, as indicated above and shown in Kasper et al (2022) and Giorda et al (2003), the three operators L x , L z and L z 2 are sufficient to represent any unitary operation by repeated finite rotations with multiple layers.This leads to the question whether there is a benefit when more than this reduced set of three operators are used in the data re-uploading circuit.We test this hypothesis by adding the following two types of operators, The motivation behind this choice is that these operators directly couple the initial state |0⟩ to all other states |j⟩ and thus may allow for a more efficient learning.We then use the simplified structure of Eq. ( 9) and replace the squeezing operator by the sum over all operators in Eq. ( 20).The results of the three types of circuit structures on the six-class reduced MNIST data set are shown in Fig. 6.The left panel shows the accuracies as a function of the number of circuit layers.First, one can observe that there is no significant difference between the simplified structure of Eq. ( 9) and circuit structure of Eqs. ( 6)-( 7).On the other hand, the performance of the circuits with the extended set of operators is significantly better.At first glance this seems to support the hypothesis that adding more operators to the set generators does in fact enhance the trainability of qudit quantum circuits.However, adding more operators also introduces more free parameters to the quantum circuit for a given number of layers, which allows for more flexibility in the trainable circuit.When comparing the accuracies as a function of number of free parameters, as shown in the right panel of Fig. 6, one can observe that the performance is statistically the same for all circuit structures and number of operators.Therefore, we conclude that it is not the number of operators which is determining the trainability, but rather the number of trainable parameters.
This reveals a tradeoff between the complexity of each layer, i.e. the number of operators and free parameters in each layer, and the total number of layers which are necessary to achieve a certain accuracy.Including more operators in each layer allows to achieve good performance with fewer number of layers.On quantum hardware, where gate errors play an important role, the freedom to choose the elemental operations provides additional flexibility.And because different hardware may natively support different gate sets, this allows to choose configurations which result in running variational quantum circuits with less errors.For qubits, this is not possible since the three Pauli matrices form a basis and no additional operators can be constructed.6)-( 8) with and without the squeezing operation between numerically exact results and the case where the re-training and evaluation is done on actual ibmq lima hardware.For the qubit implementation of the qudit circuits we use the Dicke-state encoding described in Sec. 4. The left panel of Fig. 7 shows the accuracy as a function of the quantum circuit layers for the first five digits, i.e. qudit dimension d = 5, and with input dimension D = 5.The numerically exact simulations show the same trend as previously described for two input dimensions and approach the values of the traditional RF classifier with an increasing circuit depth.However, when re-trained and evaluated on actual hardware the performance is only comparable for the first two layers, after that it saturates and then decreases strongly.This is due to the noise and infidelities in the actual hardware realization of the entangling gates used to implement the squeezing operations.Removing the squeezing operations from the circuit reveals this explicitly, since the accuracies of both approaches are then comparable as shown in the right panel of Fig. 7.This is an explicit example of a situation where is more efficient to increase the local Hilbert space and work with qudits, instead of increasing the number of qubits.

Discussion
In this work, we demonstrated that multi-level qudit systems are well-suited to be applied to multi-class classification problems, as each qudit basis state can naturally encode one class of the data.We implemented data re-uploading quantum circuits, where we used the angular momentum and the squeezing operators to build a universal gate set.We illustrated the capabilities of the qudit-based approach on regression and classification benchmarks.Owing to the ability to learn highly non-linear classification boundaries, the models were able to successfully learn on various data sets and achieve performances comparable to standard classical machine learning models.Interestingly, the achievable performance was strongly dependent on the qudit states representing the class labels and their relation to the structure of the labels in the data set.This intrinsic bias due to the label alignment can boost the performance of qudit circuits substantially, when the data set is structured accordingly, which might be beneficial for certain types of application problems.
We also studied the influence of the choice of the elementary operations and the layer structure in qudit quantum circuits.There, we found, that the structure, i.e. the particular sequence and types of rotations, does not appear to have significant influence on the performance, as long as the number of degrees of freedom was accounted for.This reveals a trade-off between the number of elementary operators in the gate set and the number of layers to achieve the same performance.In some situations it might be advantageous to utilize the minimum set of operators and to employ more layers, while in others, more operators and less layers might be the better choice.This is especially interesting on quantum hardware where different gates typically have different error rates, and the freedom to choose between several configurations may allow to minimize the influence of errors on the resulting performance.
However, our data encoding layers always employed only L z and L x operators and thus implemented a ladder structure.This is linked to the observed intrinsic bias, and selecting different operators for the data encoding might mitigate this bias.However, we did not investigate such extensions and leave them for future work.
It should be noted that we did not employ any of the more sophisticated techniques to improve the performance of single-qudit data re-uploading circuits, for example, employing different classical optimizers (Deller et al, 2023;Lavrijsen et al, 2020), fine-tuning hyperparameter settings (Moussa et al, 2022), and finding better parameter initializations (Sack and Serbyn, 2021;Grant et al, 2019;Egger et al, 2021).All techniques have been shown to be very beneficial in related contexts and can be used in the future to improve the current approach.
A necessary next step is to investigate the performance of multi-qudit circuits, since here we only investigated single-qudit circuits.Interesting research questions include how the intrinsic bias of a single qudit is influences a multi-qudit circuit and its learning performance, and what the role of the set of elementary operators is in these cases.Crucially, the effect of multi-qudit entangling gates needs to be elucidated.
In summary, our results and discussion support the conclusion that qudit systems offer a promising alternative quantum computing architecture.There are several differences to qubit-based systems which could potentially be leveraged to eventually provide practical benefits for quantum algorithms and quantum machine learning tasks in particular.
NLW, FJ and SS conduced the numerical simulations, NLW, MSR and SS analyzed the results data.All authors jointly wrote and reviewed the manuscript.

d
level quantum systems, typically called qudits, are a generalization of qubits to d > 2 and can serve as a basis for quantum information processing.The Hilbert space is spanned by d orthonormal basis vectors, denoted by |0⟩, |1⟩, ...|d − 1⟩ and arbitrary qudit states can be represented by the supersposition |ψ⟩ = d−1 k=0 c k |k⟩ with the normalization condition d−1 k=0 |c k | 2 = 1.
Fig. 1 a: Schematic representation of d = 7 qudit states on a generalized Bloch sphere.b: Schematic illustration of the action of the three operators Rx (left), Rz (middle) and R z 2 (right) on a qudits state.c: Illustration of the data re-uploading circuit structure . The qudit basis state |k⟩ is represented by the qubit Dicke-state |D d−1 k ⟩, i.e. |k⟩ → |D d−1 k ⟩ (Gasieniec et al, 2019).The k th Dicke state |D d−1 k ⟩ of d − 1 qubits is given by the equal superposition of all states which have k qubits in the state |1⟩ and d − 1 − k in state |0⟩, i.e.
where hw(x) indicates the Hamming weight of string x, i.e. the number of 1's in x.The angular momentum operators for the d−1 qubit states are defined as the sum over the single-qubit operators, L tot a = d−1 j=0 L j a with a = {x, y, z}, and they act as described by Eqs.(1) on the Dicke states.In particular, the Dicke state |D d−1 k ⟩ and the qudit state |k⟩ have the same z-component of the angular momentum, i.e.L tot z |D d−In this representation the squeezing operation consists of all pairwise qubit interactions,

Fig. 2
Fig. 2 Results of trained data re-uploading models with structure of Eqs.(6)-(8) using a d = 3 qutrit with one (left) and two (right) layers for the regression task of learning the function in Eq. (19) (blue line).The purple dots indicate the results of the numerically exact model simulation obtained and the green dots the results from re-training and evaluation on the IBM ibmq lima hardware

Fig. 3
Fig. 3 Results of the seven-class horizontal stripe classification problem with circuit structure of Eqs.(6)-(8).In the upper row the qudit states are aligned with the class labels, while in the lower row the class labels are randomly assigned to the qudit states as illustrated in the pictures on the left.The first stripe pattern shows the ground truth and the training data samples.The middle and right stripe patterns show the classification regions obtained after training with three and six layers, respectively.The rightmost plots show the statistics of classification accuracy, obtained from 50 independent training runs, as a function of layers in the quantum circuit with (blue) and without (green) the squeezing operation in the W blocks. Colored boxes indicate 25% and 75% percentiles and horizontal whiskers the minimal and maximal values.In the right panels, cML indicates the results of the classical machine learning approaches

Fig. 5
Fig. 5 Comparison of d = 6 multi-class classification performance of qubit and qudit data re-uploading circuits with the simplified structure of Eq. (9).Left: tilted D = 2 dimensional stripes data set with a rotation angle of 27 • .Qudit accuracies are shown for aligned and randomized label and state assignment, as well as with aligned labels and qudit states, but with a randomized Lx in the encoding.Right: six randomly selected digits of the MNIST data set which are reduced to D = 2 input dimensions using a PCA

Fig. 6
Fig. 6 Comparison of results of qudit data re-uploading circuits of different structures on the d = 6 class MNIST data set with input dimension D = 2.The left panels shows the results as function of the number of layers, while the right panel shows it as function of the degrees of freedom, i.e. the number of tunable parameters in the circuit (notice: the x-axis is not to scale in the right plot)

Fig. 7
Fig. 7 Results for the classification of the first five digits of the MNIST data set with input dimension D = 5 with (left) and without (right) squeezing as a function of the layers in the quantum circuit operating with a d = 5 qudit.The numerical exact simulations are shown in blue, whereas the results from ibmq lima simulations are in green.The performance of a random forest (RF) model is displayed to the right in each plot