Introduction

The possibility of establishing a quantum network of practical use is currently under active investigation. Some early versions of them, modest as they may be, have been designed and realized in real world in the recent years1,2,3,4,5,6, or in some instances they are under way. In fact, building a quantum network has been targeted as a fundamental goal in quantum information7,8 an even a more feasible goal to accomplish than the first scalable quantum computer. There are other more advanced proposals for quantum networks9,10 based on entanglement connections that need quantum repeaters11,12,13 in order to function properly and being stable14,15,16. Related to this, some physical quantum models exhibit very remarkable long-distance entanglement properties17,18,19,20. Another alternative to build different types of quantum networks makes use of quantum percolation protocols21,22,23,24.

Thus, it is interesting to study how different possibilities of quantum networks would behave regarding what we know about the world wide web. In particular, an essential ingredient in the classical network that we enjoy today is the ability to search web pages in the immense changing world that the web has come to be known. The key tool for performing those searches is the notion of the PageRank algorithm25,26,27,28,29,30,31,32,33.

We envision a similar tool to perform the task of ranking quantum webpages. A quantum webpage is a node of the quantum network realized by means of a quantum storage device, like a quantum memory. What is crucially important is that a fully fledged quantum computer is not required. Thus, the quantum webpages have limited capabilities: storing and reading in/out quantum states.

Since the notion of a quantum PageRank is by no means unique, it is convenient to introduce a class or category of possible quantum PageRanks. They must satisfy a set of properties that define an admissible class:

Quantum Computer PageRank Class:

  • Q1: The classical PageRank must be embedded into the quantum class in such a way that the directed graph structure is preserved at the quantum level.

  • Q2: The sum of all quantum PageRanks must add to 1 i.e. Σi Iq(Pi) = 1.

  • Q3: The Q-PageRank admits a quantized Markov Chain (MC) description.

  • Q4: The classical algorithm to compute the quantum computer PageRank belongs to the computational complexity class BQP.

However, as we have noticed that working with a real quantum computer seems not realistic in the near future and prospects for realizing quantum networks based on nodes made up of quantum storing devices, like quantum memories, are high as shown by experimental progress, we find also very convenient to introduce a more realistic class of quantum PageRanks as follows:

Quantum PageRank Class:

  • P1: The classical PageRank must be embedded into the quantum class in such a way that the directed graph structure is preserved at the quantum level.

  • P2: The sum of all quantum PageRanks must add to 1 i.e. Σi Iq(Pi) = 1.

  • P3: The Q-PageRank admits a quantized Markov Chain (MC) description.

  • P4: The classical algorithm to compute the quantum PageRank belongs to the computational complexity class P.

The crucial difference is the substitution of property Q4 that deals with the feasibility of calculations with a quantum computer in polynomial time by property P4 which is more demanding since it means that even a classical computer can simulate the process and find the importance of webpages in polynomial time.

Property P1 reflects the fact that originally we would have an internet that is a classical network represented by a directed graph and then shall apply some kind of quantization procedure in order to turn it into a quantum network. The latter must be compatible with the classical one, particularly preserving the directed structure which is crucial to measure a page's authority. This is non-trivial and some quantization methods may fail to produce a unitary quantum PageRank importance for the quantum case, as shown in Sect. Results: Quantum PageRanks.

With property P2 we guarantee that we have a globally well-defined notion of the importance of a web page at the quantum level. This allows us to have the probabilistic interpretation of the surfer's position (see Sect. Results: Quantum PageRanks).

Property P3 is the key to a wide class of natural quantization methods for the classical PageRank based in the equivalence of this one with a classical Markov chain process (see Sect. Results: Quantum PageRanks). Thus, it is natural that the equivalent property holds true in the quantum version of the PageRank and consequently, its description in terms of a quantized surfer's motion.

The reason for property P4 relies on the assumption that we envisage a near-future scenario when a certain class of quantum network will be operative but not yet a scalable quantum computer. Therefore, we demand that the computation of the quantum PageRank Iq be efficiently carried out on a classical computer.

In this paper we have constructed a valid quantum PageRank that fulfills all these requirements. We remark that there may be other solutions to the quantum version of the PageRank within the class defined above, but nevertheless we shall show that finding one instance of this quantum PageRank class is a non-trivial task.

The definition of Class of Quantum PageRank given here is very general and it can accommodate very diverse situations, ranging from quantum channels (including entangled states) between nodes in the network to simpler situations where network nodes are quantum levels of a multilevel quantum system where information is stored in the same way as in the Grover algorithm. In the particular instance of Quantum PageRank algorithm that we have found in subsection Results: A Quantization of Google PageRank, we are concerned with the latter case of a multilevel quantum systems where the quantum state is attached to a link of the network of nodes. This instance does not exhaust all possibilities represented in our generic Class of Quantum PageRanks by all means, but it is the first non-trivial instance in which sharp deviations from the classical PageRank algorithm can be found, as explained later on in our paper.

The explicit step-by-step description of our quantum PageRank algorithm is presented in Sect. Results: A Quantization of Google PageRank. A key distinctive feature of this quantum algorithm is that the importance of the quantum pages exhibit quantum fluctuations unlike its classical counterpart. These quantum fluctuations, as shown in the simulations in Sect. Results: Simulations for Quantum PageRanks, show up in the form of time dependent importances Iq(Pi, t), which causes in turn that sometimes one certain pair of pages satisfy Iq(Pi, t1) > Iq(Pj, t1) and some other times the relative importance is reversed Iq(Pi, t2) < Iq(Pj, t2), for time-steps such that t1 < t2. We may use an analogy to understand this situation: the classical PageRank gives us a snapshot or photo with a fixed hierarchy of web pages according to their calculated importance. On the contrary, the quantum PageRank is more like a movie since the quantum importance of the pages vary with time. In order to produce a fixed output made of a list with the quantum pages sorted according to their importance, a natural choice we make is to compute the temporal average of the quantum PageRanks and their standard mean deviation.

There are additional features that a certain quantum PageRank may have as a consequence of the definition of the class above. We provide hereby several useful definitions:

Strong Hierarchical Preserving PageRank: when the classical hierarchical structure of a PageRank is preserved upon quantization.

This notion is too strong when the PageRank varies with time as it is the case at the quantum level.

Weak Hierarchical Preserving PageRank: when the node with highest classical PageRank is preserved after quantization, but not so for the rest of pages.

Outperforming: when the highest classical PageRank of a page is overcome by the quantum PageRank of that page.

Outperforming may occur at one given instant or on average thereby leading to the natural extended concepts of instantaneously outperforming or average outperforming, respectively.

In section Discussion we provide a list of main results that we have obtained with our quantized version of the quantum PageRank algorithm. Remarkably, quantum fluctuations may change the classical hierarchy of web pages both instantaneously and in terms of mean values.

This paper is organized as follows: in Sect. Results we give an introduction to the classical notion of PageRank needed to present in subsect. Results: Quantum PageRanks the quantum version of it. In subsect. Results: A Quantization of Google PageRank we present our proposal for a quantum version of Google PageRank algorithm. In subsect. Results: Simulations for Quantum PageRanks we perform numerical simulations of the quantum algorithm to representative directed graphs representing either an intranet or a general web with no special symmetry. Sect. Discussion is devoted to conclusions.

Results

A. Classical PageRank

Brin and Page introduced Google in 199825,26,27, a time when the pace at which the web was growing began to outstrip the ability of current search engines to yield useable results. A major distinction between their algorithm, called PageRank (PR) and previous approaches is the fact that PR has an objective character, while other searchers were based up on the subjective criterium of the contents of the pages, because they were built as a collection of links that people in companies stored on a regular basis. In order words, PR is dynamical while the other approaches were static and subjective w.r.t. contents of the pages.

The way most search engines, including Google, work is to continually retrieve pages from the web, index the words in each document and store this information. Each time a user asks for a web search using a search phrase, such as “search engine”, the search engine determines outputs all pages on the web that contain the words in the searched phrase or are semantically related to it.

Then, a problem arises naturally: Google now claims to index 50 billion pages. Roughly 95% of the text in web pages is composed from a mere 10,000 words. This means that, for most searches, there will be a huge number of pages containing the words in the search phrase. What is needed is a mean of ranking the importance of the pages that fit the search criteria so that the pages can be sorted with the most important pages at the top of the list. Their success is largely due to PageRank's ability to rank the importance of pages in the WWW.

Google PageRank

The key idea of Google's PageRank algorithm is that the importance of a page is given by how many pages link to it. If we define I(Pi) as the importance of a page Pi and Bi as the set of pages linking to it, then we might think to put in equations the key idea put forward above as follows:

where outdeg(Pj) is the outdegree (i.e. the number of outgoing links) of the page Pj. Let us define a matrix, called the hyperlink matrix, in which the entry in the ith row and jth column is:

We will also form a vector I whose components are the PageRanks I(Pi). The condition above defining the PageRank can be expressed in matrix form as:

Thus, we have recast the problem of finding the PageRanks as the problem of finding the eigenvalues of a matrix28. We are in for a special challenge since the matrix H is a square matrix with one column for each web page indexed by Google. This means that H has about n = 50 billion columns and rows. However H is a sparse matrix, i.e. most of the entries in H are zero; in fact, studies show that web pages have an average of about 10 links, meaning that, on average, all but 10 entries in every column are zero.

We will choose a method known as the power method for finding the stationary vector I of the matrix H. How does the power method work? We begin by choosing a vector I0 as a candidate for I and then producing a sequence of vectors Ik by:

However, as it is formulated the PageRank algorithm will not output a meaningful vector. We will need to patch the procedure in various ways.

Patching the Algorithm

It can be seen that if there are dangling nodes (as e.g. in Fig. 1), pages that are not linked to by any one, then the power method will output the null vector. If we consider the following example shown in Figure 1, whose hyperlink matrix is:

Figure 1
figure 1

A simple web of 2 nodes.

and start from I0 = (1, 0)t one ends up with I = (0, 0)t.

The first patch in the tinkering of the PageRank algorithm will be replacing the column corresponding to a dangling node with a column of all 1/n with n the number of nodes. This means that virtually every dangling node is linking to every single node in the web, including itself. This prevents the power method from giving the null vector. This way, the disconnected graph becomes effectively connected at the price of giving a very low weight to the artificial bonds (added links).

The graph, with the addition of the extra links would look like (see Fig. 2):

Figure 2
figure 2

The web of 2 nodes with the patch that ensures stochasticity of the matrix E.

with a modified hyperlink matrix, E:

The matrix E that we obtain is, in general, (column) stochastic, i.e. its columns all sum up to one. From the theory of stochastic matrices one knows that 1 is always an eigenvalue. Furthermore, the convergence of Ik = EIk−1 to I depends on the second eigenvalue of E, λ2. If it is smaller than 1, then the power method will converge. In addition, it is more rapid if |λ2| is as close to 0 as possible.

Let us consider the graph in fig. 3, with E matrix:

Figure 3
figure 3

A graph whose matrix E's second eigenvalue, λ2, is zero (see text in section Resuts).

One can see that the second eigenvalue of E, |λ2| is equal to one in this case and actually all the eigenvalues are on the circle of radius 1 in the complex plane. If we compute I with the power method starting from, say, I0 = (1, 0, 0, 0)t it will fail to converge.

We will need to patch the algorithm again to ensure that |λ2| < 1. In order to guarantee it, we will require E to be primitive, i.e. that there is an integer m such that Em contains all positive entries. The meaning of this assumption is that the graph is such that any page is connected by a path of at least m links to any other.

Anticipating the interpretation of a diffusion phenomenon associated to searching the web, we can interpret the requirement of E to be primitive as the requirement of finding the walker with nonzero probability on any site after a minimum time m. Let us now consider the graph in fig. 4. One can divide the graph in two subgraphs and . There are no links pointing from the subgraph , made of the nodes 3 and 4 to the first subgraph , made of nodes 1 and 2. If we write down the matrix E:

Figure 4
figure 4

A graph that is not strongly connected, or equivalently, whose matrix E's is reducible (see text in section Results).

we can see that there is a block that is zero, precisely the one that carries the information of the edges linking the nodes of to the nodes of .

If we calculate I with the power method starting from I0 = (1, 0, 0, 0)t we find: I = (0, 0, 3/5, 2/5)t. Yet, one is not satisfied from giving an interpretation to the vector I because the nodes from the first subgraph have zero importance albeit being linked by other nodes. This is caused by the reducibility of E that causes a drain of importance from to . In order to have a meaningful vector I, one that has all nonzero entries, one should demand that the matrix be irreducible. A necessary and sufficient condition for it is that the graph is strongly connected, i.e. that given two pages there is always a path connecting one to the other (see29) chap. 8.

The Patched Algorithm

In order to implement all these patches, let us imagine a walk on the graph. With probability α the walker, which is equivalent to the surfer mentioned earlier, will follow the web with stochastic matrix E and with probability 1−α, it will jump to any page at random. The matrix of this process would be:

where 1 is a matrix with entries all set to 1 and N is the number of nodes. This matrix is known as the Google Matrix. Now, the matrix G is irreducible because the matrix 1 is irreducible. Furthermore, it is also primitive since it has all positive entries. We have thus obtained a matrix that is both primitive and irreducible. This means it has a unique stationary vector that may be calculated with the power method. Furthermore, the result does not depend on the initial value I0 because the underlying graph is strongly connected, which is equivalent to the irreducibility of G, see29.

The parameter α is free and needs to be tuned. It is known30 that the second eigenvalue of G, λ2, is such that λ2 ≤ α, so one would choose α as close to zero as possible but in this way the structure of the web, described by E would not be taken into account at all. Brin and page chose α = 0.85 to optimize the calculation.

Formulation as a Random Walk

It is very appealing and useful to rethink the problem of assigning the importance of a page as the task of calculating the fraction of time a walker diffusing on the graph according to the stochastic process given by the Google matrix G. In fact we, can reformulate the Google PageRank as the algorithm that computes the fraction of the time the walker spends on each node by defining the fraction on the jth page Tj as:

Equivalently, one can say that the operational meaning of the PageRank algorithm is to give the probability to find the walker on the node Pi. Let us make it clearer by defining a set of random variables: X(0), X(1), …, X(n), …, one for every time step. For each step, the random variable can take on values in the set of nodes {Pi} of the web. We can recast Google PageRank in the language of a Markov Chain. Thus, from eq. (6) written as:

and from the law of total probability:

one can interpret the stochastic matrix G as the conditional probability linking one time step to the other, i.e.:

We will make use in the following of the latter interpretation of Google PageRank to devise methods to quantize it.

Quantum PageRanks

Quantum walks in their discrete time formulation were known already to Feynman34 and since then, they were rediscovered many times35 and in contexts as different as quantum cellular automata36,37 and the halting problem of the quantum Turing machine38,39. For simplicity, let us discuss possible ways for quantizing a quantum walk taking place on the line. Later, we shall generalize it to an arbitrary graph. From now on, we shall make the notation lighter denoting each node (or page) Pi simply by i as shown in the following figure (see Fig. 5):

Figure 5
figure 5

A simple classical random walk on a line.

The naive way of quantizing this random walk would be to go from the index set to a Hilbert space of states as shown in figure 6:

Figure 6
figure 6

The naive way to quantize a random walk on a line.

Following the key idea outlined above, one could define the quantum importance of a page as:

where |ψ〉 is the state of the system after it has diffused on the graph. However, this quantization procedure is not viable. This is because the direct quantization of the time step evolution operator as

is not unitary. Indeed, while 〈0|2〉 = 0 one has that 〈0|UU|2〉 ≠ 0 in the general case of .

This difficulty can be overcome enlarging the Hilbert space. There are various ways to do it:

  • adding a coin space to each site on the quantum network. A coin space encodes the possibility to go left or right i.e. .

  • defining the Hilbert space as the space of (oriented) edges and treating the vertices as scattering centers. The resulting walk is called a Scattering Quantum Walk.

  • using Szegedy's40 procedure to quantize Markov chains.

We will discuss the latter way for it will give us a valid quantization of Google's PageRank that satisfies the properties 1–4 introduced in Sect. Introduction.

Szegedy's Quantization of Markov Chains

We have seen that the Google matrix G can be seen as the time step evolution operator of a Markov chain, or equivalently, of a discrete-time classical random walk: the two terms will be used interchangeably from now on. Szegedy put forward a general scheme to quantize a Markov chain. Let G be a N × N stochastic matrix representing a Markov chain on an N-vertex graph. In order to introduce a discrete-time quantum walk on the same graph we use as the Hilbert space the span of all vectors representing the N × N (directed) edges of the graphs i.e. . The order of the spaces in the tensor product is important here because we are dealing with a directed graph. We stress this fact in the notation using subindices 1 and 2. Let us define the vectors:

that is a superposition of the vectors representing the edges outgoing from the jth vertex. The weights are given by the (square root of the) stochastic matrix G.

One can easily verify that due to the stochasticity of G the vectors |ψj〉 for j = 1, 2, …, N are normalized. The operator

is then a projector onto the subspace generated by the vectors |ψj〉 for j = 1, 2, …, N. With this, the step of the quantum walk is then given by

where S is the swap operator i.e.

Before continuing let us point out that the time step operator is unitary:

from the unitarity of S and the fact that Π is a projector and squares to itself. Analogously:

The time step is thus the effect of a coin flip followed by a swap operator. Let us look more closely at the coin flip operation:

The vectors |ψj〉 contain the information of the directed links that connect the jth node to all its neighbors to which it is connected through the stochastic matrix G. The sum on all nodes of the operators is nothing but a reflection around the subspace spanned by the vectors |ψj〉 and has the effect of enhancing the amplitudes of the mentioned directed edges at the expenses of the others. Furthermore, the swap operator preserves the unitarity of the step.

Solving the Eigenvalue Problem for the Walk Operator

The quantization procedure based on the unitary operator (14) allows us to get remarkable insight on the properties of the walk by a systematic analysis of the spectral properties of U. The spectrum of the quantized walk is related to the spectrum of the original stochastic matrix that in turn we have seen has a key role on the properties of the related classical random walk.

Let us define the following N × N matrix D that will play an important role in relating the spectra of the classical and quantum walks by specifying its entries as follows:

where there is no sum over repeated indexes. Let us also define the following operator A from the space of vertices, , to the space of edges, :

It has the following properties, which are straightforward to prove:

The matrix D is symmetric by construction. The eigenvalue problem D|λ〉 = λ|λ〉 can in principle be solved yielding N eigenvalues λ with the associated eigenvectors |λ〉:

Let us now consider the the following vectors out of them: on the space of the quantized Markov chain i.e. . In order to obtain the spectrum of U, we will first isolate an invariant subspace for U and look for eigenvalues and eigenvectors in this space. We will then concentrate on the orthogonal complement of it. We will argue that the interesting part of the Hilbert space for the dynamics is the aforementioned invariant subspace. In order to identify the invariant subspace of the walk operator let us see the effect of U on :

where we used the property 1 and 2. Let us see also its effect on :

using properties 2 and 3 and the fact that the vectors |λ〉 are eigenvectors of D. From (22) and (23) we can deduce that the subspace

is invariant under the walk operator U. It is thus sensible to solve the eigenvalue problem:

for the walk operator restricted to the invariant subspace (24). Following what we have said, let us make an educated ansatz for the eigenstates of U:

We have that:

thereby the condition for |µ〉 to be eigenstate of U is

which yields .

We note also that the span of the vectors coincides with the span of the vectors |ψj〉. Indeed we have .

To complete our analysis let us point out that on the orthogonal complement to the span of the vectors |ψj〉, the action of the walk operator is just −S, which has eigenvalues ±1. This is because Π yield the null vector when applied to vectors of this subspace. We conclude that the spectrum of U is the set

where λ are the eigenvalues of D. In the following we will need the quantum walk where two steps at a time are performed, with operator U2. We can advance that the interesting subspace, where we have dynamics, is the span of the vectors |ψj〉 and Sj〉 where the walk operator acts nontrivially.

Furthermore, considering the two-step evolution operator, one can see that:

Therefore under the two-steps operator U2 the Hilbert space splits naturally into the subspaces where dynamics takes place and its orthogonal complement as can be seen from (30) U2 acts trivially in such a way that, obviously, . The dimension of is at most 2N and, remembering that the dimension of is N2 we can conclude that the spectrum of U2 corresponding to is composed by, at most, the 2N values

and the rest of the spectrum, corresponding to where U2 acts trivially, is composed of at least N2 − 2N 1's.

The analysis presented above will allow us to save computational resources when calculating the Quantum PageRank because of the presence of the invariant subspace . A different type of problem is concerned with using a quantum computer to perform a quantum computation that might improve the efficiency of the classical PageRank algorithm. An adiabatic quantum computation can be set to to compute the classical PageRank vector. In this case the classical PageRank vector is encoded in a quantum state and an adiabatic quantum computation is described in order to reach this state41.

A Quantization of Google PageRank

In this section we define a valid Quantum PageRank and take advantage of the analysis presented above to provide an efficient algorithm for its calculation as requested in Sect. Introduction. A natural way to define a quantization of the importance of a node or page in the quantum network associated to a directed graph is to exploit the connection with the Markov chain process in which the fictitious walker is now subjected to quantum superpositions of paths throughout the quantum web. In this way, the instantaneous importance of a quantum web page, denoted as Iq(Pi, m), is given by the probability of finding the walker in that page Pi at the node i of the network after m time steps. As we have said before, the Hilbert space of this quantum walk is the set of directed links of the graph, where the numbering of the vector spaces is meaningful due to the directedness of the underlying graph and the second space in the tensor product contains the information of where the directed link points to. It seems natural then to project onto a vector of this second space |i2 obtaining the quantum state |Iq(Pi, m)〉 that contains the superposition of the nodes that were linked to it. To quantify the importance one can then extract a positive number calculating the norm of |Iq(Pi, m)〉 and with this we obtain an instantaneous list of page ranks including quantum fluctuations of the network. Thus we expect its instantaneous value to oscillate in time as a result of the underlying coherent dynamics.

The method for computing the instantaneous PageRank of the page Pi is to start from an initial vector |ψ(0)〉 and to let it evolve according to the two-step evolution operator U2 (in order to swap the directions of the edges an even number of times, thus preserving the graph's directedness). Then, we need to project onto and finally to take the norm of the resulting quantum state:

In order to implement the full procedure, one starts from the stochastic matrix G representing the classical Google search that we want to quantize, forms the matrix D and obtains its spectrum σ(D) = {λ}. One then forms the states , in terms of which the eigenvectors of the walk operator, |µ〉, in the subspace where the dynamics takes place are written.

Using the spectral decomposition of U one can then arrive at a closed analytical expression for our quantum instantaneous PageRank:

where , µ = exp(±i arccos λ) and |ψ(0)〉 is taken to lie on the dynamical subspace. Note that due to the fact that |i2 are a basis of , in other words , from (32) one can see:

meaning that in the quantum version of Google PageRank we have that the normalization condition (34) is preserved at all times allowing to interpret the quantity Iq(Pi,m) as the instantaneous relative importance of the page Pi, thereby reproducing a basic sum rule that also holds in the classical domain.

In order to integrate out the fluctuations arising from the coherent evolution we also introduce the average importance of the page i sitting on the ith node 〈Iq(Pi)〉 as:

We also use its variance or standard mean deviation:

as a measure of its fluctuations.

In order to obtain the Quantum PageRank values of the nodes of a digraph we apply the algorithm that comes out of the analysis presented above. Namely the steps one has to perform are:

Quantum PageRank Protocol

  • Step 1/: Write the Google matrix for the digraph .

  • Step 2/: Write down the matrix D (see eq. (19)) and calculate its eigenvalues and eigenvectors.

  • Step 3/: Find the eigenvectors and eigenvalues of the two-step quantum diffusion operator U2 in the dynamical subspace Hdyn (see section Results: Quantum PageRanks for the details).

  • Step 4/: Extract the Quantum PageRank value in time (33), its mean (35) and standard deviation (36) starting from the initial condition .

Results: Simulations for Quantum PageRanks

After developing a quantum version of the Google PageRank in the previous subsection, it is necessary to apply it to specific networks and by means of simulations, see how it behaves as compared with the classical algorithm of PageRank.

We have put to test our new quantum version of the PageRank algorithm in the case of a binary directed tree with 3 levels (see fig. 7) and a small albeit general, with no special property, directed graph (see fig. 8). We will describe the results in Case Study 1: A Tree Graph and Case Study 2: A General Graph respectively.

Figure 7
figure 7

The three level tree considered in the text to benchmark the Quantum PageRank (see text in section Results: Simulations for Quantum PageRanks).

Each node represents a web page in an intranet with the root node being its home page.

Figure 8
figure 8

The general graph with 7 nodes considered in the text for benchmarking the Quantum PageRank (see text in section Results: Simulations for Quantum PageRanks).

Each node represents a web page in this directed quantum network.

Case Study 1: A Tree Graph

In this subsection we will display the results obtained in the case of a tree graph (see fig. 7). This type of directed graph has a clear meaning in terms of a web network: it represents an intranet with the root node being the home page of a certain website and its leaves representing internal web pages. This case of study has been extensively studied classically31. The quantum algorithm presented above is implemented numerically.

The quantum PageRank of the root page clearly oscillates in time and attains values that are higher than the classical counterpart, as shown in Fig. 9. According to the properties studied in Sect. Introduction, our quantum PageRank is instantaneously outperforming.

Figure 9
figure 9

The evolution of the instantaneous Quantum PageRank Iq with time for the root page (home page) in the case of a directed binary tree in Fig. 7.

It is rather remarkable that a quantum version of the PageRank may have an enhancement of the importance in the home page with respect to its classical counterpart. This is achieved merely by quantum means, without changing the connectivity of the original directed graph as has been proposed classically31.

As for the quantum fluctuations present in the importance of the root page, it is important to emphasize that they remain bounded during the evolution as can be checked from Fig. 9. In addition, the classical value is always inside the range of the quantum fluctuations. This feature is found to be true for all pages in the directed binary tree network configuration (see Fig. 10). A distinctive feature of the Quantum PageRank is that the hierarchy is not preserved at every time. Figure 10 clearly display the crossings of the instantaneous Quantum PageRanks (see also table 1).

Table 1 Comparison Classical and Averaged Q-PageRank in the case of the tree graph shown in Fig. 7. Given the symmetry of the tree only the values for each level are displayed
Figure 10
figure 10

The evolution with time of the instantaneous Quantum PageRank algorithm Iq defined in Sect. Results: A Quantization of Google PageRank for web pages (nodes) in the case of a directed binary tree graph in Fig. 7.

Only one page per level of the tree is displayed because pages that are in the same level have equal Quantum PageRank.

In order to extract a fixed value for the relative importances of the pages, we compute the mean value of the instantaneous quantum PageRank in time from eq. (35) and its variance from eq. (36).

One can notice that the hierarchy of the pages is preserved on average and that the errors i.e. the variances are negligible compared to the means. We can thus infer the pages' hierarchy as predicted by the classical algorithm from the Quantum PageRanks' averages as can be clearly seen in figure 11 for this particular case of directed binary tree graph.

Figure 11
figure 11

Comparison of the hierarchies that result from the Classical and the Quantum PageRank in the case of the directed graph tree shown in Fig. 7.

Error bars in the quantum case are computed with the standard mean deviation (35), (36).

Furthermore we can calculate a coarse grained evolution in time of the instantaneous Quantum PageRank. We divide its total evolution time of M steps in L equal segments made of an integer number M/L steps. We calculate the mean in every segment:

The result of integrating out the oscillations in a coarse grained time step is shown in figure 12. An interesting feature of this case is that the quantum PageRank oscillations shows a modulation with a clearly visible envelope for each node. It strongly enforces the idea that the proposed algorithm has a solid grounding on the classical PageRank algorithm and it is a valid quantization of it.

Figure 12
figure 12

The evolution in a coarse grained time (see text in section Results: Simulations for Quantum PageRanks) of the Quantum PageRanks in the case of the directed graph tree shown in Fig. 7.

Again only one page per level is being displayed because pages that are in the same level have equal Quantum PageRank.

Case Study 2: A General Graph

We have performed a calculation of the quantum PageRank also in the case of a general directed graph with no particular symmetry (see fig. 8).

The value of the instantaneous quantum PageRanks are found to display oscillations that are bounded and include the value found by the classical PageRank. The QPR of the node with the highest classical PageRank attains, at given times, values of the QPR that are higher than the classical counterpart (see fig. 13). As seen in the case of the binary tree treated above the Quantum PageRank is found to be instantaneously outperforming according to the definition given in section Introduction.

Figure 13
figure 13

The evolution in time of the Quantum PageRank Iq of pages 7, 5 (that classically have the highest and nearly degenerate PageRank) and of page 4 (that classically has the lowest PageRank) in the case of general graph shown in Fig. 8.

The classical hierarchy is not preserved by the QPR at any given time (as is clearly shown by Fig. 13, see caption and table 2). We can notice crossings in the importance given by the instantaneous Quantum PageRank even between the pages that classically have highest and lowest PageRank. Furthermore, the nodes that have a very close classical PageRank are shown to have a very similar behaviour in time of their instantaneous Quantum PageRank.

Table 2 Comparison Classical and Averaged Q-PageRank in the case of the general graph shown in fig. 8

Remarkably enough, we find that the Quantum PageRanks' averages do not give us the same hierarchy as in the classical case (see Fig. 14). Nevertheless, it is possible to clearly distinguish, within the error bar given by the variance, which pages have highest and lowest classical PageRank.

Figure 14
figure 14

Comparison of the hierarchies that result from the Classical and the Quantum PageRank in the case of the general graph shown in Fig. 8.

Error bars in the quantum case are computed with the standard mean deviation (35), (36).

The analysis with a coarse graining in time of the instantaneous Quantum PageRank (see Fig. 15) reinforces the conclusion that the classical PageRanks are still distillable in the case of pages with highest and lowest classical importances.

Figure 15
figure 15

The evolution in a coarse grained time (see text in section Results: Simulations for Quantum PageRanks) of the Quantum PageRanks in the case of the general graph shown in Fig. 8.

Discussion

In this paper we have proposed a notion of a class of protocols that qualify to be considered a quantum version of the classical PageRank algorithm employed by the Google search engine (see Sect. Introduction). In addition, we have constructed a step-by-step protocol explicitly in Sect. Results: A Quantization of Google PageRank based on the quantization of Markov chains for directed graphs. This is a non-trivial problem since dealing with quantum versions of digraphs may produce unitarity problems (see Sect. Results: Quantum PageRanks). We have tested our quantum PageRank algorithm with two web networks in order to gain insight into the specific behaviour of this protocol. One network is a binary tree graph representing an intranet with the root being the home page of it. The other is a general directed graph with no specific structure.

From our numerical simulations we have found that our quantum PageRank has very interesting properties. For the directed binary tree:

  1. i

    The quantum PageRank for the root page is instantaneously outperforming with respect to the classical value. This is a manifestation of the quantum fluctuations inherent to the quantum version of the algorithm and allows us to have an enhancement of the importance of the root page without changing the topology of the original network.

  2. ii

    The instantaneous values of the quantum PageRanks for the nodes violate the hierarchy of the classical values.

  3. iii

    The mean values of the quantum PageRanks including its standard deviation preserve the hierarchy of the classical values.

For the general directed graph:

  1. i

    The quantum PageRank for the web page with the highest classical PageRank is some times higher than the classical values obtained with the standard algorithm. This means that the quantum version of the PageRank is instantaneously outperforming with respect to the classical value.

  2. ii

    The instantaneous values of the quantum PageRanks for the nodes violate the hierarchy of the classical values.

  3. iii

    Remarkably enough, there are pages with mean values, including its standard deviation, of their quantum PageRank that violate the hierarchy of the classical values.

These properties are a clear manifestation that our proposal for a quantum version of the PageRank algorithm exhibits nontrivial features with respect to the Classical PageRank.

As the main purpose of our work is to devise a quantum PageRank algorithm by overcoming certain difficulties explained in the paper, thus far we have dealt only with small networks representing different types of web. It would be very interesting to perform computations with the quantum PageRank applied to very large networks with the properties exhibited by the complex structure of the real web42,43,44,45,46,47,48.

An interesting issue is whether the classically first ranked page remains with the highest importance also at the quantum level. While we have shown that generically this is not the case for instantaneous values of the quantum PageRank (33) in Fig. 10 and Fig. 13, they remain first-ranked with the time-average values of the quantum PageRank (35). It remains open to see what happens for larger networks having very similar first-ranked nodes when the effect of quantum fluctuations are taken into account. This will depend on the topology of the lattice as well.