Growing Random Graphs with Quantum Rules
Abstract
Random graphs are a central element of the study of complex dynamical networks such as the internet, the brain, or socioeconomic phenomena. New methods to generate random graphs can spawn new applications and give insights into more established techniques. We propose two variations of a model to grow random graphs and trees, based on continuous-time quantum walks on the graphs. After a random characteristic time, the position of the walker(s) is measured and new nodes are attached to the nodes where the walkers collapsed. Such dynamical systems are reminiscent of the class of spontaneous collapse theories in quantum mechanics. We investigate several rates of this spontaneous collapse for an individual quantum walker and for multiple non-interacting walkers. We conjecture (and report some numerical evidence) that the models are scale-free.
Keywords: continuous time quantum walk; growing network; spontaneous collapse.
1 Introduction
The intrinsic randomness of quantum physics can be exploited to generate “truly random” numbers. If a system is prepared in a superposition of basis states, a measurement outcome in that basis is intrinsically random. Such genuine randomness, which cannot be achieved with only classical means, has an important role in several fields such as cryptography [16] and simulations [14].
In this work we harness quantum randomness for generating random graphs. Our motivation is that a large variety of real systems, from natural to socioeconomic phenomena [18], protein-protein interactions [20], the brain [17], the internet [22], financial trading [19], and many other dynamical systems can be described by random graphs. Moreover, the random collapse of the wave function of the quantum walker that is built into our models is reminiscent of the spontaneous collapse theories in quantum mechanics [12].
Although there are various ways to construct such discrete structures [6, 11], for most of them it is difficult to certify randomness based solely on the observed random graph states [13]. On the other hand, the intrinsic randomness that emerges from measuring a quantum system in superposition of states can be used to give guarantees on the randomness of a graph. Quantum walks on graphs are well-known [2] and already lend themselves to many applications, including search algorithms [9], element distinctness [3] and isomorphism tests [7], discretization of differentiable surfaces [4, 5] and cryptography [21]. Quantum walks are a natural choice in our models, and can be seen as the quantum counterpart of classic random walks which have been defined on all kinds of grids, in continuous and discrete time [10].
Here we propose an original application of Quantum Walks on graphs to the problem of random graph generation. In our models, the quantum system is given by one or more quantum walkers that evolve continuously on the graph. Then, a measurement operation or a spontaneous collapse of the walker guides the evolution of the graph’s adjacency matrix over time.
We will present two models. The first can grow random trees and is based on a single quantum walk, while the second can grow general graphs and is based on two walkers.
The manuscript is organized as follows: we will first present our two models in sections II and III.
Then we will present a few numerical experiments where we grow random graphs and analyze various metrics and how they depend on the average collapse time.
To support the numerical explorations in this manuscript and to promote reproducibility, we have developed an open source python library [15].
2 Models
2.1 Single-walker model: random trees
Let us consider an undirected graph , where is the set of vertices, , and is the set of the edges connecting the nodes. Such graph can be described by a symmetric adjacency matrix of dimension , which has a 1 at position if the -th node and the -th node are directly connected by an edge, and 0 otherwise. In our case, we use the adjacency matrix as the Hamiltonian of a continuously evolving system: the quantum walker. The quantum walker is defined by its state on the nodes such that , where are the vertices of the graph. The continuous time quantum walk is driven by the unitary operator . The probability of a walker starting at vertex to be measured at vertex after a time is given by
(1) |
The process for growing graphs can be summarized as follows:
-
1.
set an initial graph state over the graph ;
-
2.
let the walker evolve under the Hamiltonian for a time where is sampled from the exponential distribution of average ;
-
3.
measure the position of the walker and obtain a node (this step is equivalent to sampling from the distribution );
-
4.
attach a new node to the node , updating the adjacency matrix accordingly;
-
5.
restart from 1. with .
Note that at each step the dimension of the Hilbert space associated to the graph increases by one. As this model does not allow to create closed loops, it leads to the growth of random trees, so with vanishing cluster coefficient.
As an exemple, consider the graph represented by
(2) |
with the walker on the node , i.e. with state . Let the walker evolve for a time . The probability distribution of the walker’s position is now . We measure the walker and we collapse its state, finding it for example on the node . Finally, as illustrated in Fig.1, we update the graph and the walker and we are set for a new iteration:
(3) |


As illustrated in Fig. 2, we observe that for short average time between collapses, the nodes aggregate in few large star graphs connected by single edges. This can be understood by noticing that for short evolution times, the walker may not have enough time to leave the central node where it keeps collapsing. However, as we show below, the dynamics in these sub-graphs is rich and indeed a walker is actually guaranteed to leave a localised star graph because the rate at which the amplitude leaves the central node increases with the size of the star.
For longer average times instead the walker has time to explore the graph and the star sub-graphs don’t have a way to develop. It is an open question whether structures analogous to star graphs develop on a larger scale, leading to scale-free trees.






A walker that begins its evolution on the central node of a star graph keeps oscillating between the central node and an uniform superposition on the edges, which can be seen by analyzing the eigenvalues of the adjacency matrix of a star graph. The frequency of oscillation for nodes is proportional to , and the probability to collapse on the central node after a time is given by .
Starting from a trivial graph with a single node, the probability to be in the same node at the center of the star for consecutive collapse events for a short average collapse time is
(4) |
It’s easy to see that decreases monotonically with for any value of . So the probability to escape the center after exactly events is
(6) |
To first approximation, a star graph will cease growing as soon as the walker collapses to an outer node. So we can compute the average star size by
(7) |
And the expected number of stars for steps is approximately . Understandably, the longer we wait, the easier it is for the walker to escape smaller stars.
One way to study the structure properties of the graph is to study its spectrum. To find how the spectrum evolves we compute the characteristic polynomial of the adjacency matrix. For example, a single star-graph is represented by the adjacency matrix
(8) |
The characteristic polynomial is then . Hence, the eigenvalues are with multiplicity and . This in turn implies that there are two eigenstates that evolve with frequency in opposite directions and several other “frozen” walker states on the outer edge of the star.
For stars, let be the number of nodes on the star, then:
We finally get the spectrum by finding the roots of these polynomials and we get the same evolution as we can see in Fig.3.


2.2 Multiple walkers model: random graphs
In order to build structures with a non-zero cluster coefficient, we can use two or more walkers. In this model we have two independent walkers that collapse at the same time. We attach a new node to both the nodes where the walkers collapsed. This allows closed loops to form, thus with non-vanishing cluster as we can see in Fig.4. If the walkers happen to collapse to the same node, the new node will have a single edge.






3 Qualitative analysis
We first look at the degree distribution. For each degree we compute the fraction of nodes on the graph that has connections. By studying the degree distribution, we can get an indication of whether our models generate scale-free networks i.e. whose degree distribution follows a power-law . We compute the average degree distribution for the first model, with 1000 and 100 nodes. We find that the degree distribution seems to converge, for large , to a power law, as shown in Fig. 5.



Next we turn to the diameter of the graphs. To compute the diameter of a graph we compute the maximum value of the shortest path between every pair of edges. As we can see in Fig. 6, the diameter dependence on time depend on the number of walkers and is maximal for .

We observe an interesting phenomenon when we compute the fraction of nodes that live on the edge of the graphs. We define this as the “leaf fraction”, i.e. the fraction of nodes with only one neighbor. As can be seen in Fig. 7, the leaf fraction decreases with until it becomes stable from around . This effect seems to be independent of the size of the graphs, and we conjecture that is a universal property of this model.

Finally, we compute the average clustering coefficient. The local clustering coefficient of a node is a measure of how much its neighbors are linked to each other. It is a coefficient introduced by Watts and Strogatz in [23] to find whether a graph exhibits the small-world property.
To define the clustering coefficient, we need to define what is the neighborhood of a node in a graph. The neighborhood of a node is defined as the set of all its neighbors. Let be a graph of nodes with and the set of couples if there’s a link between the nodes and . Then we define the local clustering coefficient of the node which has neighbors as for an undirected graph. Finally, we obtain the graph’s average clustering coefficient : . We can notice that the clustering coefficient decreases rapidly for large and seems to be independent on the number of walkers, with the only exception of the single-walker model.

4 Discussion
We have presented two new models for growing random graphs, that are driven by the continuous evolution of quantum walkers and by spontaneous collapses of their wave function. We have numerical evidence that the random graphs that result from these models display a power-law degree of distribution, which indicates a scale-free structure.
We also have found two interesting phenomena in the average graph diameter and in the fraction of nodes that live on the edge. An average collapse time of seems to play a special role, while for it seems to lead the measures to relax to an asymptotic value. In particular, the leaf fraction is a quantity that seems to give us information about the bulk of a graph from its surface, which is reminiscent of the holographic principle. We suspect that around there could occur a first order phase transition, as Fig. 6 seems to suggest.
We note that as the wave function of the quantum walker can interfere with itself, the continuous-time quantum walk does not tend to a limiting distribution (which instead is characteristic of classical random walks). This might result in fundamental differences between classical and quantum models that are not possible to reconcile. Moreover, we note that as the off-diagonal elements of the adjacency matrix are never negative, the Hamiltonian that it represents is “stoquastic” [8] and therefore the evolution of the walker should not be exponentially hard to compute. Because of this, it could be that even if these growth models were not reproducible by classical random walk models, they could be reside in an efficient class of computational complexity.
Among the directions of future work one could introduce an additional degree of freedom in terms of a quantum coin, similarly to what is done in discrete-time quantum walks. Another possible perspective is to explore the possibility to perform quantum search algorithms over growing random graphs, for example by combining multiple walkers where e.g. two of them are in charge of growing the graph and a third performs the search while preserving its unitarity. Our hope is that this will produce “optimized” random graphs for the objective that the walker is searching for.
References
- [1]
- [2] Dorit Aharonov, Andris Ambainis, Julia Kempe & Umesh Vazirani (2001): Quantum walks on graphs. In: Proceedings of the thirty-third annual ACM symposium on Theory of computing, pp. 50–59. Available at https://doi.org/10.1145/380752.380758.
- [3] Andris Ambainis (2007): Quantum walk algorithm for element distinctness. SIAM Journal on Computing 37(1), pp. 210–239. Available at https://doi.org/10.1137/S0097539705447311.
- [4] Quentin Aristote, Nathanaël Eon & Giuseppe Di Molfetta (2020): Dynamical Triangulation Induced by Quantum Walk. Symmetry 12(1), p. 128. Available at https://doi.org/10.3390/sym12010128.
- [5] Pablo Arrighi, Giuseppe Di Molfetta, Iván Márquez-Martín & Armando Pérez (2019): From curved spacetime to spacetime-dependent local unitaries over the honeycomb and triangular Quantum Walks. Scientific reports 9(1), pp. 1–10. Available at https://doi.org/10.1038/s41598-019-47535-4.
- [6] A.-L. Barabási & R. Albert (1999): Emergence of scaling in random networks. Science 286, pp. 509–512, 10.1126/science.286.5439.509.
- [7] Scott D Berry & Jingbo B Wang (2011): Two-particle quantum walks: Entanglement and graph isomorphism testing. Physical Review A 83(4), p. 042317. Available at https://doi.org/10.1103/PhysRevA.83.042317.
- [8] Sergey Bravyi & Barbara Terhal (2010): Complexity of stoquastic frustration-free Hamiltonians. Siam journal on computing 39(4), pp. 1462–1485. Available at https://doi.org/10.1137/08072689X.
- [9] Andrew M Childs & Jeffrey Goldstone (2004): Spatial search by quantum walk. Physical Review A 70(2), p. 022314. Available at https://doi.org/10.1103/PhysRevA.70.022314.
- [10] Giuseppe Di Molfetta & Pablo Arrighi (2020): A quantum walk with both a continuous-time limit and a continuous-spacetime limit. Quantum Information Processing 19(2), p. 47. Available at https://doi.org/10.1007/s11128-019-2549-2.
- [11] Paul Erdős & Alfréd Rényi (1960): On the evolution of random graphs. Publ. Math. Inst. Hung. Acad. Sci 5(1), pp. 17–60.
- [12] Gian Carlo Ghirardi, Alberto Rimini & Tullio Weber (1986): Unified dynamics for microscopic and macroscopic systems. Physical review D 34(2), p. 470. Available at https://doi.org/10.1103/PhysRevD.34.470.
- [13] Andrei N Kolmogorov (1998): On tables of random numbers. Theoretical Computer Science 207(2), pp. 387–395, 10.1016/S0304-3975(98)00075-9. Available at https://www.jstor.org/stable/25049284.
- [14] Nicholas Metropolis & Stanislaw Ulam (1949): The monte carlo method. Journal of the American statistical association 44(247), pp. 335–341, 10.1080/01621459.1949.10483310.
- [15] Filippo M. Miatto (2020): quantumgraphs. https://github.com/ziofil/QuantumGraphs.
- [16] Claude E Shannon (1949): Communication theory of secrecy systems. Bell system technical journal 28(4), pp. 656–715. Available at https://doi.org/10.1002/j.1538-7305.1949.tb00928.x.
- [17] Cornelis J Stam & Jaap C Reijneveld (2007): Graph theoretical analysis of complex networks in the brain. Nonlinear biomedical physics 1(1), p. 3. Available at https://doi.org/10.1186/1753-4631-1-3.
- [18] Steven H Strogatz (2001): Exploring complex networks. nature 410(6825), pp. 268–276. Available at https://doi.org/10.1038/35065725.
- [19] Michele Tumminello, Fabrizio Lillo, Jyrki Piilo & Rosario N Mantegna (2012): Identification of clusters of investors from their real trading activity in a financial market. New Journal of Physics 14(1), p. 013041. Available at https://doi.org/10.1088/1367-2630/14/1/013041.
- [20] Alexei Vázquez, Alessandro Flammini, Amos Maritan & Alessandro Vespignani (2003): Modeling of protein interaction networks. Complexus 1(1), pp. 38–44. Available at https://doi.org/10.1159/000067642.
- [21] Chrysoula Vlachou, J Rodrigues, Paulo Mateus, N Paunković & André Souto (2015): Quantum walk public-key cryptographic system. International Journal of Quantum Information 13(07), p. 1550050. Available at https://doi.org/10.1142/S0219749915500501.
- [22] Xiao Fan Wang & Guanrong Chen (2003): Complex networks: small-world, scale-free and beyond. IEEE circuits and systems magazine 3(1), pp. 6–20. Available at https://doi.org/10.1109/MCAS.2003.1228503.
- [23] Duncan J. Watts & Steven H. Strogatz (1998): Collective dynamics of ‘small-world’ networks. Nature 393, p. 440–442. Available at https://doi.org/10.1038/30918.