Abstract
As digital content expands, the need to deliver recommendations quickly becomes increasingly important. In traditional recommendation methods the online recommendation time scales linearly with the number of items, making such approaches less effective as datasets grow. Quantum computing offers novel techniques for parallel computation and sampling, yet current hardware remains constrained by noise and limited scalability. Variational quantum algorithms (VQAs), which rely on shallow circuits, are better suited for noisy quantum machines. In this work, we explore a scheme for variational quantum recommendation system (VQRS), which combines classical matrix factorization (MF) and data re-uploading in the offline phase with quantum sampling in the online phase, aiming to accelerate inference. Using noiseless simulations on small-size standard datasets, we assess the method’s performance and analyze its computational resource requirements. Our findings indicate that the scheme is capable of learning accurate recommendations on small datasets, but faces scalability challenges and may require long offline training. Nonetheless, the results show that the proposed quantum circuit design supports the inference of user preferences, and that a relatively small number of online circuit executions suffices to yield moderately accurate predictions. This highlights a trade-off between inference time and accuracy, which may be of interest in applications where online speed is prioritized over precision.
Subject terms: Quantum information, Computer science
Introduction
Recommendation systems play a crucial role in providing personalized content to users across various platforms, such as entertainment apps, streaming services, and even medical decision support systems1,2. However, these systems face a major challenge: the need to search through the entire item space to identify the best recommendation. When handling large datasets, this process becomes computationally intensive and time-consuming, especially since recommendations are often generated in real-time. On platforms with frequent recommendation requests, this results in substantial computational overhead.
Quantum computing has the potential to accelerate certain computational tasks3 and has gained significant attention over the past decade with the development of actual quantum devices. However, challenges such as noise, measurement errors, and hardware limitations hinder its full potential, as error rates grow exponentially with circuit depth4. Variational quantum algorithms (VQAs) offer a potential workaround by using shallow, parameterized circuits that are optimized to minimize a given cost function, making them better suited for near-term quantum devices5. Such parameterized quantum circuits are explored as quantum machine learning models with varying levels of success6–8. This paper develops and investigates a parameterized quantum circuit-based approach for recommendation systems.
Quantum recommendation systems (QRS) were first explored by Kerenidis and Prakash in 20169, who proposed a breakthrough algorithm for efficiently sampling user-item interactions to predict likely item consumption. Their method achieved polylogarithmic time complexity in the number of users and items, offering a potential exponential speedup over classical methods. In 2019, Tang showed that a classical algorithm could match this complexity10, albeit with a large polynomial overhead10–12. Several other approaches to QRS have been explored in recent years13–15. These works primarily focus on improving recommendation quality or rely on fixed, often deep, quantum circuits.
Inspired by quantum sampling for efficient recommendation generation9, and combining it with the data re-uploading strategy from Ref.16–in which classical data is embedded into the quantum circuit by means of angle encoding across repeated encoding layers–this paper explores a parameterized quantum circuits-based QRS approach; its aim is to reduce online recommendation time, which in classical systems typically scales linearly with the number of items.
We use a classical algorithm to generate user embeddings, which are encoded into the quantum circuit via data re-uploading. Specifically, we use the well-established matrix factorization (MF) algorithm17, though other recommendation approaches that yield user latent vectors could also be used. This work examines whether the proposed circuit design can effectively learn user preferences, and if so, whether quantum sampling enables faster inference compared to classical methods.
To that end, we evaluate our method on small, standard datasets with up to 128 users and 128 items, assessing performance in a noiseless setting using the conventional HR@K recommendation metric. Since our primary goal is to determine whether meaningful learning can occur, all evaluations are conducted under idealized conditions-including the assumption of perfect sampling during training phase.
Our results show that the circuit design can indeed learn and generate accurate recommendations on small datasets, but its efficiency degrades as dataset size increases-even under idealized conditions-a limitation we analyze in detail. Moreover, we demonstrate that if accuracy requirements are relaxed, faster inference can be achieved by sampling the trained quantum circuit a relatively small number of times.
The rest of the paper is structured as follows: “Background: recommendation systems” provides the necessary background on classical recommendation systems, with a focus on the matrix factorization (MF) algorithm. Section “The variational quantum recommendation system (VQRS)” describes our proposed variational quantum recommendation system (VQRS) algorithm. Section “Experimental setup” details the experimental setup used in our evaluation. Next, “Results” presents numerical results, and “Computational resources estimation” provides a detailed time and space complexity analysis of the proposed VQRS, including comparisons with both the classical MF algorithm and classical simulations of VQRS. Finally, “Conclusions and outlook” concludes the paper and outlines directions for future research.
Background: recommendation systems
A recommendation system algorithm takes as input a representation of a user and outputs one or more items that the user is most likely to consume next. Various types of recommendation systems exist. In this work, we focus on the implicit collaborative filtering approach1, which predicts a user’s preferences by leveraging the preferences of other users, without relying on explicit information about users or items. A typical recommendation system operates in two phases: an offline learning phase and an online inference phase. During the offline phase, the system is trained to capture patterns in past user-item interactions. In the online phase, it uses these patterns to generate personalized recommendations in response to user queries.
Matrix Factorization in a nutshell
The matrix factorization (MF) recommendation algorithm is a widely used and effective technique in collaborative filtering, commonly used in applications like movie, product, and music recommendation systems17. It works by decomposing a large, sparse user-item interaction matrix into two lower-dimensional embedded matrices, whose product forms a dense matrix that approximates the missing values in the original interaction matrix. This enables the system to predict user preferences for items they have not yet interacted with.
Formally, given N users and M items, an interaction matrix R is a sparse
matrix, where each entry (n, m) represents an interaction between user n and item m. We consider a simple binary model, where each entry is either 0 or 1, indicating whether an interaction has occurred (e.g., a user has watched a movie or purchased a product), without capturing its strength. The total number of interactions is denoted by
.
In its offline phase, MF decomposes R into a user matrix P of size
and an item matrix Q, of size
. Here, D is a hyperparameter representing the size of a latent feature space, which is typically much smaller than N and M. Each row in P encodes a single user’s profile in the latent vector space, and each column in Q represents a single item, see Fig. 1. A common, efficient, approach for finding the latent matrices is the alternating least squares (ALS) method18, which alternates between treating one matrix as fixed while optimizing the other.
Figure 1.
Matrix factorization (MF) illustration: the input interaction matrix
(right) is a sparse binary matrix for
users and
items. The MF algorithm factorizes
into a user latent matrix
and an item latent matrix
, using a latent dimension of
. The factorization is performed such that multiplying
by
constructs the dense matrix
(left), which closely approximates
, with high values at entries
where
.
The user and item matrices are optimized so that their product
closely matches the original sparse binary interaction matrix R on past user-item interactions (1 entries). These matrices exhibit an important property: users with similar preferences tend to have similar representations in the user matrix P, and the same holds for items in the item matrix Q. This similarity is reflected in smaller angular distances between the corresponding vectors, and allows the system to infer preferences for unobserved interactions (0 entries).
In the online phase, when a user n interacts with the system, the multiplication
is performed, where
is the n-th row of the user matrix P, and
represents the n-th row of the predicted matrix
. Each entry in this vector corresponds to an item, and the item with the highest entry is selected as the recommended item for the user.
In terms of space and time complexity, the offline phase of MF, which is based on the ALS optimization process, requires
space and
time complexity for a single optimization iteration19. The time complexity of the online phase is
. Finally, there is also an update phase: when a new user-item interaction is made, the algorithm is not executed from scratch, but rather only the latent vectors of the respective user and item are updated.
A variational quantum recommendation system (VQRS)
Before describing the proposed scheme, let us first consider a scenario in which the system is allowed a space complexity of
for N users and M items. In this case, a straightforward MF-based recommendation system capable of producing responses in
time would involve precomputing and storing all recommendation scores sorted for every user. Such a system could be constructed offline with a time complexity of
. While this enables very fast inference, the offline time and memory requirements become intractable for large-scale databases. Although practical systems may mitigate this via top-k pruning, such strategies add complexity and limit adaptability. Moreover, updating this system after user-item interactions would require recomputing all recommendation scores for (at least) the affected user and item, making the approach impractical in dynamic real-world settings. Therefore, to avoid trivial design, we constrain the offline space complexity to scale linearly with the number of users and require an efficient update mechanism—similar to that used in standard MF—which enables the system to quickly adapt to new interactions.
The proposed variational quantum recommendation system (VQRS) is illustrated on the left side of Fig. 2. It consists of two phases: an offline phase and an online phase. The offline phase, depicted on the right side of Fig. 2, involves four main steps: (a) running the MF algorithm and extracting the user latent matrix P; (b) constructing a target probability vector for each user based on the interaction matrix
; (c) encoding each user’s latent vector as fixed angles
in a parameterized quantum circuit with data re-uploading; and (d) optimizing a set of tunable global circuit parameters
to best prepare the target quantum state for each user.
Figure 2.
The VQRS algorithm. Left: Overview of the full framework, including offline and online phases. Right: Illustration of the offline learning phase (steps A-D) for
users and
items, with latent dimension D=
=3, starting from the input interaction matrix R (top right). The VQRS quantum circuit consists of
layers, each containing two sets of Y-rotation gates: one with fixed, user-specific latent parameters
, and another with global, tunable parameters
, followed by entangling CNOT gates.
This approach relies on the intuition that similar users yield similar latent vectors through MF, which, when embedded into the quantum circuit, are expected to produce similar recommendation states. Learning is driven by optimizing the shared global parameters. We emphasize that while VQRS explicitly uses the MF latent user vectors, it does not encode or rely on the full user-item MF score matrix. Consequently, to generate recommendations, VQRS must learn solely from the interaction matrix R and the MF user embeddings, posing a nontrivial learning challenge.
After optimizing the global parameters, an additional set of tunable parameters is learned for each user to prevent recommending previously consumed items. This step, referred to as history removal (step e in Fig. 2), is schematically illustrated in Fig. 3. By the end of this step, the VQRS circuit is ready for the online inference phase.
Figure 3.

History removal phase. Illustration of the VQRS circuit followed by a history removal layer, which sets the probabilities of previously interacted items to zero and renormalizes the probabilities over the remaining (non-interacted) items.
In the online phase, the system generates recommendations for a given user. The latent vector representing the user is loaded into the VQRS circuit, which is then executed multiple times (shots). The item sampled most frequently is recommended.
Finally, in the update phase, when a user consumes an item, only that user’s embedding and tunable parameters are updated.
The following sections describe each of the offline and online steps in detail.
VQRS: offline phase
The offline phase is composed of the following steps, as illustrated in Fig. 2.
A. Run the MF algorithm and extract the users’ latent matrix
The first step is running the MF algorithm on the input user-item interaction matrix
to construct the latent matrix
, where the latent space dimension is set to
, with
being the number of items. This choice ensures that the number of qubits is
.
B. Construct the target probability vector per user
This step defines the target probability vectors, one per user, which guide training. For a given user
, the target vector
assigns equal probability to the indices of previously consumed items, and zero to all others, ensuring the vector sums to 1. For efficiency, only the nonzero entries corresponding to consumed items are explicitly represented in practice.
C. Angle encoding: embedding the user’s latent vector as fixed angles in the VQRS circuit
The VQRS circuit design follows the principle of data re-uploading, where classical data is embedded into the rotational angles of quantum gates across repeated encoding layers16. As shown on the right side of Fig. 2, the circuit consists of
qubits; upon measurement, it outputs a bit string whose binary representation corresponds to an item index between 0 and
. The most frequently sampled bit string indicates the recommended item.
The first layer prepares the uniform
state using Hadamard gates. Each subsequent layer consists of: (a) a
-rotation gate per qubit, each encoding a single entry of the
-th user’s latent vector
as a fixed angle-used directly, without further manipulation, i.e.,
; (b) a second
-rotation gate per qubit with global tunable parameters,
, optimized iteratively; and (c) a fixed pattern of entangling CNOT gates. We adopt the CNOT pattern from PennyLane’s StronglyEntanglingLayers circuit template20. The use of
-rotations is motivated by the observation that quantum states with real-valued amplitudes suffice for our purpose.
D. Optimizing global parameters
The key step in the offline phase is to optimize the circuit’s global parameters,
, so that each user’s output probability distribution aligns with their target vector. In each iteration, the algorithm cycles through all users, loading their fixed latent parameters
into the circuit and updates
to minimize the discrepancy between the resulting distributions and the targets, as defined by the following cost function:
![]() |
1 |
where
is the number of users, M is the number of items,
is the sampling probability of item
for user
based on the VQRS circuit with user parameters
and global parameters
, and
is the target probability for user
and item
. The rationale behind this optimization scheme is that the global parameters, being shared across all users, would allow users with similar preferences to influence one another-thereby enabling learning in a collaborative-filtering manner.
It is worth noting that the cost function in Eq. 1 is likely to demand a prohibitive number of circuit repetitions to fully recover each user’s probability histogram, whose dimension equals the number of items M. Although unrealistic in practice, this study assumes perfect sampling in the offline training phase to assess the method’s optimal performance in the online phase and determine whether such a design enables meaningful learning. Analyzing the impact of partial sampling in the offline phase, and exploring strategies to reduce its runtime, are left for future work.
The cost function in Eq. 1 will result, by design, with quantum circuits that often produce bit strings corresponding to items the user has already consumed. Because the algorithm samples from the full quantum state over items, it cannot directly score a specific item-potentially leading to repeated recommendations of previously consumed items. A similar issue, though less severe, also arises in classical recommendation systems, see e.g.21. Next, we explore one way, albeit inefficient, to address this issue within the VQRS scheme.
E. History removal via amplitude damping
To reduce the probability of recommending previously consumed items, one can add an additional layer of tunable
-rotation angles at the end of the original VQRS circuit, as shown in Fig. 3. This layer is user-specific. During the training phase, the goal is to adjust the history removal tunable parameters so that the VQRS circuit’s output distribution matches the original, except that the probabilities assigned to previously interacted items are set to zero, and the remaining probabilities are rescaled proportionally to maintain their relative ratios and ensure the total sums to 1:
![]() |
2 |
where
is the set of interacted items,
is the original probability vector for user
, and
is the updated probability vector.
The independence of history removal parameters across users enables both rapid convergence and full parallelization. Each user requires only a single history removal layer, composed of single-qubit rotation gates, which typically converges within a few training iterations. However, similar to the main training phase, the number of shots required is expected to be prohibitive. Moreover, here the probabilities of all items are explicitly processed for each user, leading to a time-consuming computation that scales linearly with NM. In this study, history removal is not modeled as an explicit component of the algorithm, instead it is implemented implicitly by directly excluding previously consumed items during the online phase.
VQRS: online phase
The online phase is illustrated in Fig. 4. Upon completion of the offline phase, the recommendation system is ready to generate online recommendations using the optimized global circuit parameters
, as illustrated in Fig. 4. In this phase,
remain fixed across users. Given a user index n, the system loads the user’s MF latent vectors as rotation angles
, along with the optimized history removal parameters
, into the quantum circuit. Each measurement (shot) yields a bit string of length
, representing a single item index. The item most frequently measured is recommended.
Figure 4.
Online phase. For a given user, the corresponding latent vector
is retrieved from the user latent matrix P, along with the optimized history removal parameters
. These, together with the optimized global parameters
, are loaded into the quantum circuit. The recommended item index is determined by majority voting over multiple circuit executions (shots).
The runtime of the online phase is mostly dictated by the number of shots. This introduces a trade-off between time and performance, which is observed in our experiments, as described in “Results”.
Experimental setup
Next, we present numerical experiments conducted to evaluate the performance of the proposed VQRS algorithm. All experiments were performed using noiseless classical simulations with the PennyLane framework20, assuming perfect history removal by ignoring previously interacted items in the online phase, which allowed us to explore the algorithm’s potential in an idealized setting and to accelerate result collection.
We used two datasets. The first is the MovieLens 100k dataset, a widely used benchmark in collaborative filtering research22. It contains 100,000 ratings from 943 users on 1,682 movies. The second is the Jester dataset, which contains ratings from 24,938 users over 100 items. From each dataset, we extracted smaller interaction matrices for evaluation. Specifically, we used three subsets from Movielens: (I)
users and
items, implemented with a VQRS circuit using
qubits; (II)
users and
items, using
qubits; and (III)
users and
items, using
qubits; From the Jester dataset, we extracted two subsets: (I)
users and
items, implemented with a VQRS circuit using
qubits; (II)
users and
items, using
qubits. Throughout the experiments, we used 10 layers of tunable parameters
. This number was selected based on empirical testing, though further investigation into the optimal number of layers could potentially improve the algorithm’s performance and efficiency. We used 50–150 iterations until convergence was observed, after which additional iterations were not expected to improve the results.
Leave-one-out evaluation method
To evaluate recommendation performance, we use the common leave-one-out method23. Specifically, for each user, we removed one consumed item - referred to as the true item—to test whether the algorithm successfully recommends it.
The HR@K metric
To evaluate accuracy, we use the Hit Rate at K (HR@K)-a standard metric in recommendation systems23, which measures how often the true item appears among the top K recommendations-computed as the averaged hit count:
![]() |
3 |
where
is the total number of users,
is the true item for user
,
is the set of top K recommended items for user
and
is the indicator function, which returns 1 if the true item is within the top K recommendations, and 0 otherwise.
The HR@K metric is cumulative by definition: HR@1
HR@2
HR@3, and so on. We also note that HR@K remains unchanged when the total number of recommendations is less than K. For instance, if at most 5 items are recommended, the true item cannot appear in the 6th position, making HR@6 equal to HR@5. This effect becomes relevant when the VQRS circuit is sampled only a few times, which is why we focus on small values of K (up to 5) when reporting HR@K.
Benchmarks
To assess the algorithm’s performance, we conduct a comparative analysis against three baseline models: (a) Matrix Factorization (MF), implemented in Surpise package24 trained for 100 steps and using the same latent dimension D as VQRS; a perfect history removal is assumed by excluding past interacted items in the MF online phase, for a fair comparison; (b) the popular model (POP), which recommends the most popular item the user has not yet interacted with; and (c) the random model (RAND), which presents each user with a uniformly sampled item from their set of unexplored items.
While the popular and random baselines serve as trivial sanity checks, matrix factorization (MF) is our primary benchmark. Beyond being a strong and widely used collaborative filtering method, MF provides the user embeddings that serve as input to our hybrid scheme. Comparing to MF is thus both natural and necessary to assess the potential added value of the quantum component. Other latent-vector-based methods could also be used, in which case they should serve as the corresponding baseline.
We further stress that the goal of our benchmarks is not to compare performance under the exact same time scaling-VQRS inherently incurs higher offline cost due to its reliance on MF-but to assess whether it can, in principle, learn effective recommendations from the interaction matrix R and MF user embeddings alone, while enabling faster inference under the memory constraint described in “The variational quantum recommendation system (VQRS)”.
Results
As mentioned, we evaluated two datasets. To ensure clarity, the results for each dataset are presented separately. First, an in-depth analysis is provided for the Movielens dataset, followed by an analysis of the Jester dataset, which adopts the same structure.
Movielens dataset results
The learning process
Figure 5 depicts the offline learning process (without history removal) of the VQRS algorithm on the three Movielens partial datasets: (I)
users and
items, using
qubits (Fig. 5a); (II)
users and
items, using
qubits (Fig. 5b); and (III)
users and
items, using
qubits (Fig. 5c); the figures present two kinds of plots: (a) the cost function per iteration in black dashed curve, which decreases monotonically; and (b) the average sampling probabilities for three item types: previously interacted items (solid blue), the true item (solid green), and non-interacted items (solid red). These averages are calculated per iteration across all users, according to Eqs. (3)-(5):
![]() |
4 |
![]() |
5 |
![]() |
6 |
where N is the number of users, M is the number of items, p(n, m) is the probability to sample the m’th item for the n’th user,
is the total number of user-item interactions,
is the probability to sample the true item
for user n, and
depicts the number of (n, m) user-item pairs with no previous interaction (number of 0 entries in the R matrix).
Figure 5.
VQRS learning process on the Movielens dataset: results are shown for circuits with 5, 6, and 7 qubits. In each subplot, the black dashed curve shows the decreasing cost function, indicating effective training. The solid blue and green curves represent the average probabilities of recommending previously consumed items and the true test item, respectively-both increasing over iterations, as desired. Accordingly, the solid red curve, representing the average probability of recommending non-target (non-interacted) items, decreases. These trends indicate that the circuit successfully learns to concentrate probability mass on relevant items.
A correlation between the cost function (dashed black) and the average probability of sampling an interacted item (solid blue) is observed in Fig. 5: as the cost decreases, the average probability increases. This serves as a sanity check, confirming that the optimization scheme behaves as intended.
More importantly, a similar correlation is observed with the average probability of recommending the true item (solid green), indicating that information is indeed being shared among users in a collaborative filtering manner, as designed. Overall, all three figures exhibit similar trends, demonstrating meaningful learning.
Performance quality
Next, we evaluate the algorithm’s performance in terms of recommendation quality. Figure 6 presents the HR@K metric for
across our three partial datasets, implemented using 5 to 7 qubits. Using the leave-one-out evaluation method, VQRS runs for each user to check whether the true test item appears among the top K recommendations. The results of VQRS (blue) are compared with those of the three benchmark models described above: (a) MF (purple); (b) popular recommendation (POP, orange); and (c) random recommendation (RAND, gray).
Figure 6.
HR@K results from Movielens dataset: obtained for K = 1–5 using MF (purple), VQRS (blue), popular model (POP, orange), and the random model (RAND, gray). Higher values indicate better performance. Overall, VQRS matches MF onsmaller datasets using 5- and 6-qubit circuits, while a performance drop is observed in the larger dataset, implemented with 7-qubit circuit.
The RAND benchmark is averaged over 30 trials and serves as a sanity check. The near-linear HR@K plots reflect the expected uniform distribution of recommendations, with a slope of approximately
. The POP model recommends the most popular unseen items and performs surprisingly well, in some cases nearly matching MF. This is likely due to the small dataset size, where limited item diversity favors popularity-based recommendations. As expected, MF consistently outperforms both the POP and RAND baselines.
Figure 6 shows that the VQRS scheme performs comparably to MF in the 5- and 6-qubit settings (Fig. 6a,b), indicating that it can learn meaningful recommendations. However, its accuracy declines in the 7-qubit case, mimicing that of the POP baseline (Fig. 6c). The drop in HR@K indicates reduced learning effectiveness on larger datasets, as non-relevant items are assigned overly high probabilities-sometimes exceeding that of the true item and lowering its rank in the user’s histogram, despite the overall desired learning trend. This highlights VQRS’s key limitation: scalability. As the dataset size increases, performance degrades. Even under ideal, noiseless state-vector simulations-equivalent to infinite shots in both offline and online phases-VQRS fails to match MF for a dataset with 128 users and 128 items (7 qubits). Nevertheless, though not optimal, VQRS still produces meaningful recommendations also on the 128x128 dataset, suggesting that its particular parametrized design-based on embedded user MF latent vectors- is capable of capturing implicit user–item patterns.
Effect of shot count on performance in the online phase
Finally, Fig. 7 examines how well VQRS achieves its main goal: reducing online time complexity while preserving recommendation quality. To that end, we first note that as detailed in “Computational resources estimation”, the online complexity of VQRS with q qubits and L circuit layers scales linearly with the circuit execution time, given by
, multiplied by
, the number of shots required during the online phase. While the number of qubits q scales logarithmically with the number of items, and the number of layers L is expected to grow at most polynomially with the number of qubits-and thus polylogarithmically with the number of items-the shot count
may scale less favorably and therefore warrants more careful analysis. We thus next evaluate the algorithm’s performance as a function of the number of shots in the online phase. As mentioned, we assume perfect history removal implementation by explicitly ignoring shots that result with previously interacted items.
Figure 7.

VQRS HR@5 scores relative to the MF baseline on the MovieLens dataset, as a function of the number of shots: Results are shown for 5-, 6-, and 7-qubit circuits, using 32x32, 64x64, and 128x128 user-item matrices, respectively. The gray bar represents the ratio of HR@5 performance between the random and MF models.
Fig. 7 displays three groups of bars, corresponding to datasets with 5, 6, and 7 qubits. Each group contains five bars: the first four represent the ratio between VQRS’s HR@5 and MF’s HR@5 when using, respectively, an “infinite” number of shots (purple), M shots (blue),
shots (green), and
shots (orange). While these shot counts are labeled as functions of M, we emphasize that these are not intended to suggest asymptotic scaling behavior, but rather serve as illustrative values chosen to motivate our analysis. The fifth bar (gray) shows the ratio between the RAND’s HR@K and MF’s HR@5.
As before, Fig. 7 shows that VQRS performance consistently degrades as problem size increases, even under infinite-shot conditions (purple). The additional aspect highlighted by Fig. 7 is a clear within-dataset trend: performance declines as the number of shots decreases. This behavior is expected and aligns with Fig. 5, which shows that although the true item’s probability increases during training, it often remains relatively small. Meanwhile, non-relevant items receive small but nonzero probabilities, which accumulate and reduce the probability mass available for the true item due to normalization. As a result, the likelihood of sampling irrelevant recommendations increases, leading to degraded performance as shot count decreases.
Nevertheless, even in the most shot-efficient form we tested (orange), VQRS consistently outperforms the RAND baseline (gray)-sometimes by more than a factor of two-indicating its ability to generate moderately accurate recommendations very fast. This suggests that despite its limitations, VQRS with perfect history removal may offer meaningful predictive power under tight time constraints, motivating both future research and the consideration of applications where fast, approximate recommendations are desirable.
The importance of entangling layers
Entangling layers are vital in VQAs, enabling circuits to model complex qubit correlations and enhancing expressiveness. Without them, circuits composed solely of single-qubit gates are classically simulable and offer no quantum advantage. To assess their importance in VQRS, we removed the entangling layers and observed a sharp performance drop. As shown in Fig. 8, the model with entangling layers (blue) significantly outperforms the version without them (red) on a 32-user, 32-item dataset (5 qubits, 10 iterations). The latter even performs below the RAND benchmark (gray), demonstrating the essential role of entangling layers in effective learning.
Figure 8.

The necessity of entangling operations. Comparison of HR@5 scores for the VQRS algorithm with (blue curve) and without (red curve) entangling layers, after 10 learning iterations on the MovieLens dataset with 32 users and 32 items (5 qubits). Both are compared to the RAND benchmark (gray curve). The entangled VQRS circuit demonstrates effective learning, whereas the non-entangled variant shows no evidence of learning.
Jester dataset results
Figure 9 presents plots analogous to those shown in the Movielens analysis. Figures 9a and 9b depict the learning process for 128
64 and 128
100 (users
items) setups using 6- and 7- qubit circuits, respectively. As in the Movielens case, the plots illustrate a decrease in the cost function (dashed black curves), alongside an increase in the average probabilities assigned to previously interacted items (solid blue) and the true item (solid green), as well as a decrease in the average probabilities assigned to non-interacted items (solid red), throughout the iterative process. This again indicates that the learning process progresses towards achieving the collaborative filtering objective-namely, enabling the system to infer recommendations for a given user based on patterns learned from similar users. Moreover, in the case of the Jester dataset, we observe that throughout learning, the average probability assigned to the true item (green) increases even beyond that assigned to the previously interacted items (blue), which is remarkable.
Figure 9.
VQRS learning process and HR@K results on the Jester dataset for circuits with 6 and 7 qubits. Top: Figures 9a and 9b illustrate the learning process: similar to the Movielens dataset, the cost function decreases over iterations, while the probabilities of recommending the true item and previously interacted items increase, as shown by the green and blue curves, respectively. Bottom: Figures 9c and 9d show the HR@K results, where VQRS on the smaller dataset, with 6 qubits, achieves performance comparable to MF, while accuracy declines for the larger dataset with the 7-qubit circuit.
Regarding performance, and consistent with the Movielens results, Figure 9c shows relatively good performance of VQRS compared to the MF algorithm for a 6-qubit circuit. Figure 9d, which corresponds to a 7-qubit circuit, again demonstrates that increasing the size of the problem degrades VQRS performance, even in the infinite sampling scenario, while still achieving a much higher HR@5 score than the random benchmark.
Computational resources estimation
In what follows, we provide a detailed time and space complexity analysis of the VQRS algorithm, along with the corresponding complexities of its classical simulation. We estimate the scaling of the required computational resources in terms of the number of users (N), items (M) and also the embedding dimension used in the MF algorithm (D), as summarized in Table 1.
Table 1.
Comparison of time and space complexities for the standard MF method, the proposed VQRS scheme, and its classical simulation.
| Matrix factorization | VQRS | VQRS classical simulation | |||
|---|---|---|---|---|---|
| Classical | Quantum | ||||
| Space | ![]() |
![]() |
![]() |
![]() |
|
| Time | Preprocessing | – | “MF” | – | “MF” |
| Offline (learning) | ![]() |
![]() |
![]() |
![]() |
|
| Online | ![]() |
– | ![]() |
![]() |
|
Here, N denotes the number of users, M the number of items, and D the embedding dimension (with
in VQRS).
is the total number of user-item interactions, L is the number of layers in the quantum circuit, and P is the number of tunable parameters.
and
denote the number of circuit executions (shots) in the offline and online phases, respectively; to achieve perfect sampling, both scale exponentially with the number of qubits. Offline complexities are given per iteration in the learning phase and do not account for history removal.
VQRS resource analysis
In VQRS, both the number of qubits and the embedding dimension are set by design to
and
, respectively. Consequently, an
-layer VQRS circuit contains
tunable parameters and a total of
gates. As stated before, we assume that the number of layers L is small and scales at most polynomially with the number of qubits, resulting in both P and G scaling polylogarithmically with M.
VQRS space analysis
Classical memory is required for three components: (i) the embedded user vectors generated by the matrix factorization (MF) algorithm, which require
memory; (ii) the tunable global parameters of the quantum circuit, which require
memory; and (iii) the history removal parameters, which are user-specific and require
memory; leading to a total of
memory. Note that the embedded item vectors are neither stored nor utilized.
The quantum memory requirement-i.e., the number of qubits-is, as previously noted,
by design.
VQRS time analysis
The VQRS algorithm consists of three distinct phases: a preprocessing phase in which the MF algorithm is executed classically, a training (offline) phase, and a recommendation (online) phase. In this section, we analyze the computational time of each phase separately, accounting for both classical and quantum resources.
Preprocessing phase:
The initial preprocessing step of VQRS consists of executing the offline phase of the MF algorithm, whose time and memory complexities are detailed in “Matrix Factorization in a nutshell” and summarized in Table 1.
Offline (learning) phase:
The runtime of the offline phase depends on the time required to evaluate the cost function, multiplied by the number of cost function evaluations. Since in the worst-case scenario, each tunable parameter requires a separate evaluation per iteration, we get that the total time per iteration is given by (see also25 for a similar analysis of a different algorithm):
![]() |
7 |
where Tc and Tq denote the classical and quantum times required for a single cost function evaluation, see Eq. 1, and P is the number of tunable parameters.
The classical time component,
, scales as:
![]() |
8 |
where N is the number of users and
is the average number of items each user has interacted with. Since
is typically very small relative to the total number of items M, we approximate it here by
.
The quantum time component, Tq, required to evaluate the cost function is:
![]() |
9 |
where N is the number of users; G, the total number of gates, serves as an upper bound on the circuit duration, and
is the number of shots required to achieve sufficient statistical accuracy in the offline phase.
As stated above, in order to maintain tractability in the offline phase, the number of shots
must scale significantly slower than the number of items M, which also defines the dimension of the quantum state. This is, however, nontrivial, as recovering a quantum state’s probability histogram generally requires a number of shots that scales exponentially with the number of qubits. If the users’ target probability distribution vectors,
, are sufficiently sparse—that is the number of interactions per user is significantly smaller than M—then more favorable shot-count scaling may be achievable; This, however, remains to be verified and is left for future research. Note further that this offline time analysis accounts only for the learning phase, without considering history removal.
Online (recommendation) phase:
Given a user, the online phase involves executing the trained quantum circuit multiple times and recommending the item that is sampled most frequently. Consequently, the time complexity is determined by the circuit duration multiplied by number of shots, and is given by:
![]() |
10 |
where
is the number of shots used in the online phase. The inference time is thus mostly dictated by the choice of
.
VQRS classical simulation: resource analysis
We analyze the computational resources required to simulate the VQRS algorithm on classical computers based on the so-called “Schrödinger algorithm”26,27, which is commonly used for quantum circuit simulation. For a quantum circuit with
qubits and
gates, this algorithm requires
memory and
time.
Building on this, the time complexity for evaluating the cost function in the offline learning phase, per user in a classical simulation of the VQRS circuit is
, which leads to an overall simulation time of
per iteration, per tunable parameter. This also includes the additional classical cost function evaluation time of
. The online phase involves simulating a single-user circuit, which has the same time complexity of
. In both the training and online phases, the space complexity is
.
Conclusions and outlook
The proposed quantum circuit-featuring global tunable parameters and fixed user-specific MF latent vectors embedded via angle encoding-can successfully learn meaningful user preferences based on those of others, under idealized conditions on small datasets. This highlights the potential of integrating classical recommendation systems, such as MF, with quantum models for recommendation tasks. Moreover, our numerical analysis underscores the importance of entanglement: without it, the circuit fails to capture meaningful patterns. Finally, while inference time in classical MF and VQRS simulations scales linearly with the number of items, the quantum variant’s cost is primarily governed by the number of circuit executions (shots), which can be adjusted as a hyperparameter to balance runtime and accuracy. Our results suggest that even a small number of shots can yield reasonable predictions-significantly better than random-suggesting potential benefits in settings where inference speed is prioritized over precision, or where recommendation quality may improve dynamically with additional shots.
Nevertheless, a key scalability challenge arises that limits the scheme’s practicality: as the dataset size increases, performance degrades-even before accounting for hardware noise or statistical shot noise in the offline phase, the latter resulting from the prohibitive cost of perfect sampling. This indicates that the learning scheme requires further improvement.
Outlook Future directions to improve the learning phase include applying negative sampling (see28 and references therein) and incorporating the item embedding matrix Q, which is currently unused, to better exploit item-level structure and enhance performance.
Beyond the scalability challenge, several additional aspects should be further investigated: (a) analyzing the scaling of
, including its dependence on the number of user interactions, and devising strategies to ensure it grows significantly slower than the number of items; (b) formally analyzing the online shot complexity; (c) better addressing the issue of history removal (d) comparing with neural collaborative filtering (NCF) methods23-a comparison with VQRS may yield insights for improving both approaches; (e) examining the impact of barren plateaus29,30, as understanding their effect on VQRS training dynamics is crucial for evaluating scalability and robustness; and (f) optimizing hyperparameter selection, including the number of layers and training iterations, and analyzing how these choices scale with system size.
Author contributions
AM conceived the main conceptual idea and supervised the project. SD developed, implemented, and numerically evaluated the proposed algorithm, conducted the computational analysis, and wrote the first draft of the manuscript.
Data availability
All data and code used in this study are available at https://github.com/sdabi/VQRS.
Declarations
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Bobadilla, J., Ortega, F., Hernando, A. & Gutiérrez, A. Recommender systems survey. Knowl.-Based Syst.46, 109. 10.1016/j.knosys.2013.03.012 (2013). [Google Scholar]
- 2.Karimi, M., Jannach, D. & Jugovac, M. News recommender systems-survey and roads ahead. Inf. Process. Manag.54, 1203. 10.1016/j.ipm.2018.04.008 (2018). [Google Scholar]
- 3.Nielsen, M.A., & Chuang, I.L. Quantum Computation and Quantum Information: 10th Anniversary Edition (Cambridge University Press, 2010).
- 4.Preskill, J. Quantum computing in the nisq era and beyond. Quantum2, 79. 10.22331/q-2018-08-06-79 (2018). [Google Scholar]
- 5.Cerezo, M. et al. Variational quantum algorithms. Nat. Rev. Phys.3, 625. 10.1038/s42254-021-00348-9 (2021). [Google Scholar]
- 6.Benedetti, M., Lloyd, E., Sack, S. & Fiorentini, M. Parameterized quantum circuits as machine learning models. Quant. Sci. Technol.4, 043001. 10.1088/2058-9565/ab4eb5 (2019). [Google Scholar]
- 7.Gujju, Y., Matsuo, A. & Raymond, R. Quantum machine learning on near-term quantum devices: Current state of supervised and unsupervised techniques for real-world applications. Phys. Rev. Appl.21, 067001. 10.1103/PhysRevApplied.21.067001 (2024). [Google Scholar]
- 8.Bowles, J., Ahmed, S., & Schuld, M. Better than classical? the subtle art of benchmarking quantum machine learning models. 10.48550/arXiv.2403.07059. arXiv preprint arXiv:2403.07059 (2024)
- 9.Kerenidis, I., & Prakash, A. Quantum recommendation systems, 10.48550/arXiv.1603.08675 arXiv preprint arXiv:1603.08675 ( 2016)
- 10.Tang, E. A quantum-inspired classical algorithm for recommendation systems, in Proceedings of the 51st annual ACM SIGACT symposium on theory of computing (2019) pp. 217–228 10.1145/3313276.3316310.
- 11.Chia, N.-H. et al. Sampling-based sublinear low-rank matrix arithmetic framework for dequantizing quantum machine learning. J. ACM69, 1. 10.1145/3549524 (2022). [Google Scholar]
- 12.Arrazola, J.M., Delgado, A., Bardhan, B.R., & Lloyd, S. Quantum-inspired algorithms in practice, 10.48550/arXiv.1905.10415 arXiv preprint arXiv:1905.10415 (2019).
- 13.Pilato, G. & Vella, F. A survey on quantum computing for recommendation systems. Information14, 20. 10.3390/info14010020 (2022). [Google Scholar]
- 14.Malik, V. & Goyal, S. Quantum ai powered dynamic user profiling for next-generation personalized recommender system. Quant. Mach. Intell.7, 44. 10.1007/s42484-025-00270-8 (2025). [Google Scholar]
- 15.Shi, J., Shang, F., Zhou, S., Zhang, X. & Ping, G. Applications of quantum machine learning in large-scale e-commerce recommendation systems: enhancing efficiency and accuracy. J. Ind. Eng. Appl. Sci.2, 90. 10.5281/zenodo.13117899 (2024). [Google Scholar]
- 16.Pérez-Salinas, A., Cervera-Lierta, A., Gil-Fuster, E. & Latorre, J. I. Data re-uploading for a universal quantum classifier. Quantum4, 226. 10.22331/q-2020-02-06-226 (2020). [Google Scholar]
- 17.Koren, Y., Bell, R. & Volinsky, C. Matrix factorization techniques for recommender systems. Computer42, 30. 10.1109/MC.2009.263 (2009). [Google Scholar]
- 18.Bell, R.M., & Koren, Y. Scalable collaborative filtering with jointly derived neighborhood interpolation weights, in Seventh IEEE international conference on data mining (ICDM 2007) (IEEE, 2007) pp. 43–52 10.1109/ICDM.2007.90.
- 19.Hu, Y., Koren, Y., & Volinsky, C. Collaborative filtering for implicit feedback datasets. In 2008 Eighth IEEE International Conference on Data Mining (2008) pp. 263–272. 10.1109/ICDM.2008.22.
- 20.Bergholm, V., Izaac, J., Schuld, M., Gogolin, C., Ahmed, S., Ajith, V., Alam, M.S., Alonso-Linaje, G., AkashNarayanan, B., Asadi, A. et al., Pennylane: Automatic differentiation of hybrid quantum-classical computations, 10.48550/arXiv.1811.04968 arXiv preprint arXiv:1811.04968 (2018).
- 21.Makmal, A., Ephrath, J., Berezin, H., Allerhand, L., Nice, N., & Koenigstein, N., Pick & merge: an efficient item filtering scheme for windows store recommendations, in Proceedings of the 13th ACM Conference on Recommender Systems, RecSys ’19 ( Association for Computing Machinery, New York, NY, USA, 2019) p. 472–476. 10.1145/3298689.3347005.
- 22.Harper, F. M. & Konstan, J. A. The movielens datasets: History and context. ACM Trans. Interact. Intell. Syst. (tiis)5, 1. 10.1145/2827872 (2015). [Google Scholar]
- 23.He, X., Liao, L., Zhang, H., Nie, L., Hu, X., & Chua, T.-S., Neural collaborative filtering, in Proceedings of the 26th international conference on world wide web (2017) pp. 173–182 10.1145/3038912.3052569.
- 24.Hug, N. Surprise: A python library for recommender systems. J. Open Source Softw.5, 2174. 10.21105/joss.02174 (2020). [Google Scholar]
- 25.Tene-Cohen, Y., Kelman, T., Lev, O., & Makmal, A. A variational qubit-efficient maxcut heuristic algorithm, arXiv preprint arXiv:2308.10383. 10.48550/arXiv.2308.10383 (2023).
- 26.Aaronson, S., & Chen, L. Complexity-theoretic foundations of quantum supremacy qxperiments. arXiv:1612.05903 [quant-ph] (2016).
- 27.Pednault, E., Gunnels, J.A., Nannicini, G., Horesh, L., Magerlein, T., Solomonik, E., & Wisnieff, R. Breaking the 49-qubit barrier in the simulation of quantum circuits (2017). arXiv:1710.05867v1 [quant-ph].
- 28.Chen, C. et al. Revisiting negative sampling non-sampling vs. in implicit recommendation. ACM Trans. Inf. Syst.41, 1 (2023). [Google Scholar]
- 29.McClean, J. R., Boixo, S., Smelyanskiy, V. N., Babbush, R. & Neven, H. Barren plateaus in quantum neural network training landscapes. Nat. Commun.9, 4812. 10.1038/s41467-018-07090-4 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Larocca, M. et al. Barren plateaus in variational quantum computing. Nat. Rev. Phys. 1. 10.1038/s42254-025-00813-9 (2025).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
All data and code used in this study are available at https://github.com/sdabi/VQRS.



























