one of the main theoretical challenges in quantum computation theory is quantum algorithm design .some attempts to uncover underlying principles common to all known efficient quantum algorithms have already been explored though not definite and satisfactory answer has been found yet . on the one hand, it has been seen that majorization theory seems to play an important role in the efficiency of quantum algorithms .all known efficient quantum algorithms verify a step by step majorization of the probability distribution associated to the quantum register in the measurement basis .therefore , efficient quantum algorithms drive the system towards the final solution by carefully reordering probability amplitudes in such a way that a majorization arrow is always present . on the other hand ,the most relevant ingredient is likely the role entanglement plays in quantum computational speedup . regarding this topic several results have recently been found which suggest that entanglement is at the heart of the power of quantum computers .an important result has been obtained by vidal , who proved that large entanglement of the quantum register is a necessary condition for exponential speed - up in quantum computation . to be concrete , a quantum register such that the maximum schmidt number of any bipartition is bounded at most by a polynomial in the size of the systemcan be simulated efficiently by classical means .the figure of merit proposed in is the maximum schmidt number of any bi - partitioning of the quantum state or , in other words , the maximum rank of the reduced density matrices for any possible splitting .it can be proved that , where the von neumann entropy refers to the reduced density matrix of any of the two partitions . if at every step of the computation in a quantum algorithm , then it can be efficiently classically simulated . exponential speed - up over classical computationis only possible if at some step along the computation , or , being and positive constants . in order to exponentially accelerate the performance of classical computers any quantum algorithmmust necessarily create an exponentially large amount of at some point .another topic of intense research concerns the behavior of entanglement in systems undergoing a quantum phase transition .quantum correlations in critical systems have been analyzed in many situations and using a wide range of entanglement measurements .in particular , it has been noted that some of these measurements have important connections to well - known results arising from conformal field theory . more generally , when a splitting of a -dimensional spin system is made , the von neumann entropy for the reduced density matrix of one of the subsystems at the critical point should display a universal leading scaling behavior determined by the _ area _ of the region partitioning the whole system .this result depends on the connectivity of the hamiltonian and applies as is to theories with a gaussian continuum limit .for example , when separating the system in the interior and the exterior of a sphere of radius and assuming an ultraviolet cutoff , the entropy of the interior is    where corresponds to a known heat - kernel coefficient . in terms of the number of spins present in the system , this leading universal scaling behavior can be written as    ( which reduces to a logarithmic law for ) .this explicit dependence of entanglement with dimensionality throws new light into some well established results from quantum computation .a similar situation is present in quantum adiabatic algorithms , initially introduced by farhi et . , where the hamiltonian of the system depends on a control parameter which in turn has a given time dependence .the hamiltonians related to adiabatic quantum computation for solving some np - complete problems ( such as 3-sat or exact cover ) can be directly mapped to interactive non - local spin systems , and therefore we can extend the study of entanglement to include this kind of hamiltonians .this point of view has the additional interest of being directly connected to the possibility of efficient classical simulations of the quantum algorithm , by means of the protocol proposed in ref . .in this paper we analyze the scaling of the entropy of entanglement in several quantum algorithms .more concretely , we focus on shor s quantum factoring algorithm and on a quantum algorithm by adiabatic evolution solving the np - complete problem exact cover , finding for both of them evidence of a quantum exponential speedup with linear scaling of quantum correlations , which difficults the possibility of an efficient classical simulation .we furthermore study the adiabatic implementation of grover s quantum search algorithm , in which entanglement is a bounded quantity even at the critical point , regardless of the size of the system .we have structured the paper as follows : in sec .2 we analytically address the study of quantum entanglement present in shor s factoring algorithm .we consider the problem of universal scaling of entanglement at the critical point of an adiabatic quantum algorithm solving the np - complete problem exact cover in sec .3 , where we present numerical results for systems up to 20 qubits . in sec .4 we focus on the adiabatic implementation of grover s quantum searching algorithm , and derive analytical expressions for the study of entanglement in the system . finally , in sec .5 we collect the conclusions of our work .it is believed that the reason why shor s quantum algorithm for factorization beats so clearly its classical rivals is rooted in the clever use it makes of quantum entanglement .several attempts have been made in order to understand the behavior of the quantum correlations present along the computation . in our case, we will concentrate in the study of the scaling behavior for the entanglement entropy of the system .we shall first remember both shor s original and phase - estimation proposals of the factoring algorithm and afterwards we shall move to the analytical analysis of their quantum correlations .the interested reader is addressed to for precise details . given an odd integer to factorize , we pick up a random number  ] , called the _ order _ of the modular exponentiation , such that . let us assume that the we have chosen is such that is even and , which happens with very high probability ( bigger than or equal to ) .this is the case of interest because then the greatest common divisor of and is a non - trivial factor of .therefore , the factoring problem has been reduced to the order - finding problem of the modular exponentiation function , and it is at this point where quantum mechanics comes at work .the procedure can be casted in two different ways :   we make use of two quantum registers : a source register of qubits ( such that  ] the order of the modular exponentiation . if were a multiple of there would not be any approximation and the last equation would be exact .this is not necessarily the case , but the corrections to this expression go like , thus being exponentially small in the size of the system .it follows from expression ( [ rho ] ) that the rank of the reduced density matrix of the target register at this point of the computation is    because  ] .if at time the ground state is given by the state , the adiabatic theorem states that if we prepare the system in its ground state at ( which is assumed to be easy to prepare ) and let it evolve under this hamiltonian , then    provided that    where is the hamiltonian matrix element between the ground and first excited state , , and the maximization is taken over the whole time interval $ ] . because the problem hamiltonian codifies the solution to the problem in its ground state , we get the desired solution with high probability after a time .a closer look to the adiabatic theorem tells us that dramatically depends on the scaling of the inverse of with the size of the system . more concretely ,if the gap is only polynomially small in the number of qubits ( that is to say , it scales as , the computational time is , whereas if the gap is exponentially small ( ) the algorithm makes use of an exponentially big time to reach the solution .the explicit functional dependence of the parameter on time can be very diverse .the point of view we adopt in the present paper is such that this time dependence is not taken into account , as we study the properties of the system as a function of , which will be understood as the hamiltonian parameter .we will in particular analyze the entanglement properties of the ground state of , as adiabatic quantum computation assumes that the quantum state remains always close to the instantaneous ground state of the hamiltonian all along the computation .note that we are dealing with a system which is suitable to undergo a quantum phase transition at some critical value of the hamiltonian parameter , and therefore we expect to achieve the biggest quantum correlations at this point .the question is how this big quantum correlations scale with the size of the system when dealing with interesting problems .this is the starting point for the next two sections .the np - complete problem exact cover is a particular case of the 3-sat problem , and is defined as follows : given the boolean variables , , where is regarded as the bit index , we define a _ clause _ of exact cover involving the three qubits , and ( say , clause " ) by the equation .there are only three assignments of the set of variables that satisfy this equation , namely , , and . the clause can be more specifically expressed in terms of a boolean function in conjunctive normal form ( cnf ) as so as long as the clause is properly satisfied .an _ instance _ of exact cover is a collection of clauses which involves different groups of three qubits .the problem is to find a string of bits which satisfies all the clauses .this problem can be mapped into finding the ground state of a hamiltonian in the following way : given a clause define the hamiltonian associated to this clause as    where we have defined , ) .the quantum states of the computational basis that are eigenstates of with zero eigenvalue ( ground states ) are the ones that correspond to the bit string which satisfies , whereas the rest of the computational states are penalized with an energy equal to one .now , we construct the problem hamiltonian as the sum of all the hamiltonians corresponding to all the clauses in our particular instance , that is to say ,    so the ground state of this hamiltonian corresponds to the quantum state whose bit string satisfies _ all _ the clauses . we have reduced the original problem stated in terms of boolean logic to the hard task of finding the ground state of a two and three body interactive spin hamiltonian with local magnetic fields .observe that the couplings depend on the particular instance we are dealing with , and that the spin system has not an a priori well defined dimensionality neither a well defined lattice topology , in contrast with some usual simple spin models .we now define our s - dependent hamiltonian as a linear interpolation between an initial hamiltonian and :    where we take the initial hamiltonian to be basically a magnetic field in the direction , more concretely ,    where is the number of clauses in which qubit appears , and , with ,so the ground state of is an equal superposition of all the possible computational states .observe that is , apart from a constant factor , a sum of terms involving local magnetic fields in the and direction , together with two and three - body interaction coupling terms in the component .this system is suitable to undergo a quantum phase transition ( in the limit of infinite ) as is shifted from to .the study of this phenomena is the aim of the following section .we have randomly generated instances for exact cover with only one possible satisfying assignment and have constructed the corresponding problem hamiltonians .instances are produced by adding clauses at random until there is exactly one satisfying assignment , starting over if we end up with no satisfying assignments . according to ,these are believed to be the most difficult instances for the adiabatic algorithm .our analysis proceeds as follows :  * _ appearance of a quantum phase transition _ *  we have generated 300 exact cover instances ( 300 random hamiltonians with a non - degenerated ground state ) and have calculated the ground state for 10 , 12 and 14 qubits for different values of the parameter in steps of . we then consider a particular bipartition of the system into two blocks of qubits , namely , the first qubits versus the rest , and have calculated the entanglement entropy between the two blocks . for each ofthe randomly generated hamiltonians we observe a peak in the entanglement entropy around a critical value of the parameter .we have averaged the obtained curves over the 300 instances and have obtained the plot from fig .[ mix-300 ] .the point at which the entropy of entanglement reaches its maximum value is identified as the one corresponding to the critical point of a quantum phase transition in the system ( in the limit of infinite size ) .this interpretation is reinforced by the observation of the typical energy eigenvalues of the system . for a typical instance of 10 qubitswe observe that the energy gap between the ground state and the first excited state reaches a minimum precisely for a value of the parameter ( see fig .[ gap-10 ] ) .we observe from fig .[ mix-300 ] that the peak in the entropy is highly asymmetric with respect to the parameter .a detailed study of the way this peak seems to diverge near the critical region seems to indicate that the growth of entanglement is slower at the beginning of the evolution and fits remarkably well a curve of the type , whereas the falling down of the peak is better parameterized by a power law a certain critical exponent .these laws governing the critical region fit better and better the data as the number of qubits is increased .  * _ analysis of different bi - partitions of the system _ *  explicit numerical analysis for qubits tells us that all possible bi - partitions for each one of the instances produce entropies at the critical point of the same order of magnitude -as expected from the non - locality of the interactions- .this is represented in fig .[ part1 ] , where we plot the minimum and maximum entanglement obtained from all the possible partitions of the system for each one of the generated instances ( points are sorted such that the minimum entropy monotonically increases ) .similar conclusions derive from the data plotted in fig .[ part2 ] , where we have considered again the same quantities but looking at partitions of the ground state for different instances of qubits . according to these resultswe restrict ourselves in what follows to the analysis of a particular bipartition of the system , namely the first qubits versus the rest .it is worth emphasizing that the existence of a single partition with exponentially large entanglement makes the algorithm not amenable to classical simulation .the above result is stronger and shows that essentially all partitions are highly entangled .the system is definitely hard to simulate by classical means .  * _ scaling laws for the minimum energy gap and the entanglement entropy _ *  to characterize the finite - size behavior of the quantum phase transition ,we have generated 300 random instances of exact cover with only one satisfying assignment from 6 to 20 qubits , and studied the maximum von neumann entropy for a bipartition of the system as well as the minimum gap , both in the worst case and in the mean case over all the randomly generated instances .we must point out that the scaling laws found in this section are limited to the small systems we can handle with in our computers . increasing the number of qubits may lead to corrections in the numerical results , which should be of particular importance for a more precise time - complexity analysis of the adiabatic algorithm .[ gap ] represents the behavior of the gap in the worst and mean cases . from fig .[ gap2 ] it is noticed that the gap seems to obey a scaling law of the style , being the number of qubits , which would assure a polynomial - time quantum computation . this law is in agreement with the results in , and are in concordance with the idea that the energy gap typically vanishes as the inverse of the volume in condensed matter systems ( here the volume is the number of qubits ) .error bars in the two plots give per cent of confidence level in the numerically calculated mean .we have considered as well the scaling behavior of the entanglement entropy for an equally sized bipartition of the system also in the worst and in the mean case .the obtained data from our simulations are plotted in fig .[ ent ] -where error bars give per cent of confidence level in the mean- and seem to be in agreement with a strongly linear scaling of entanglement as a function of the size of the number of qubits .more concretely , a numerical linear fit for the mean entanglement entropy gives us the law .observe that the entropy of entanglement does not get saturated in its maximum allowed value ( which would be for qubits ) , so we can say that only a twenty percent of all the possible potential available entanglement appears in the quantum algorithm .linearity in the scaling law would imply that this quantum computation by adiabatic evolution , after a suitable discretization of the continuous time dependence , could not be classically simulated by the protocol of ref .given that the scaling of the gap seems to indicate that the quantum computation runs in a polynomial time in the size of the system , our conclusion is that apparently we are in front of an exponentially fast quantum computation that seems extremely difficult ( if not impossible ) to be efficiently simulated by classical means .this could be an inherent quantum mechanical exponential speedup that can be understood in terms of the linear scaling of the entropy of entanglement .note also the parallelism with the behavior of the entanglement found in shor s algorithm in sec .2 . as a remark, our numerical analysis shows that the quantum algorithm is difficult to be simulated classically in an efficient way , which does not necessarily imply that the quantum computer runs exponentially faster than the classical one , as our time - complexity analysis is limited to 20 qubits .the linear behavior for the entropy with respect to the size of the system could in principle be expected according to the following qualitative reasoning . naively , the entropy was expected to scale as the area of the boundary of the splitting , according to some considerations taken from conformal field theory ( see ) .this area - law is in some sense natural : because the entropy value is the same for both density matrices arising from the two subsystems , it can only be a function of their shared properties , and these are geometrically encoded in the area of the common boundary . for a system of qubits , this implies a scaling law for the entropy like ( which reduces to a logarithm for ) . our system does not have a well defined dimensionality , but owing to the fact that there are many random two and three body interactions, the effective ( fractal ) dimensionality of the system should be very large .therefore , we expect a linear ( or almost linear ) scaling , which is what we have numerically obtained . the data seems to indicate that such an effective dimensionality is around , thus diverging as goes to infinity .it is possible to compare our apparently linear scaling of the mean entropy of entanglement with the known results obtained by averaging this quantity over the entire manifold of -qubit pure states , with respect to the natural fubini - study measure . according to the results conjectured by page and later proved in ,the average entropy for an equally - sized bipartition of a random -qubit pure state in the large limit can be approximated by ( in our notation ) , therefore displaying as well a linear scaling law ( but different from ours ) .in fact , this is an indicator that most of the -qubit pure states are highly entangled , and that adiabatic quantum computation naturally brings the system close to these highly entangled regions of the pure state manifold ( more information about the average entanglement of an -qubit system can be found in ) .  * _ the entanglement - gap plane _ *  the plots in fig .[ entgap1 ] and fig .[ entgap2 ] show the behavior of the peak in the entanglement versus the gap , both again in the average and the worst case for all the generated instances .clearly , as the gap becomes smaller the production of entanglement in the algorithm increases .a compression of the energy levels correlates with high quantum correlations in the system .  *_ convergence of the critical points _ *  the critical point seems to be bounded by the values of associated to the minimum gap and to the maximum entropy .actually , the critical point corresponding to the minimum size of the energy gap is systematically slightly bigger than the critical point corresponding to the peak in the entropy . by increasing the size of the system these two pointsconverge towards the same value , which would correspond to the true critical point of a system of infinite size .this effect is neatly observed in fig .[ move ] , which displays the values of associated to the mean critical points both for the gap and for the entropy as a function of .* _ universality _ *  all the above results suggest that the system comes close to a quantum phase transition .the characterization we have presented based on the study of averages over instances reconstructs its universal behavior .results do not depend on particular microscopic details of the hamiltonian , such as the interactions shared by the spins or the strength of local magnetic fields .any adiabatic algorithm solving a -sat problem and built in the same way we have done for exact cover should display on average exactly the same properties we have found _ regardless of the value of _ , which follows from universality ( the case , though not being np - complete , should display also this property as its hamiltonian would consist as well of local interactions in a big - dimensional lattice ; is a particular case , as its hamiltonian is non - interacting ) .linear scaling of entanglement should therefore be a universal law for these kind of quantum algorithms .the specific coefficients of the scaling law for the entropy should be a function only of the connectivity of the system , that is on the type of clauses defining the instances .we have explicitly checked this assertion by numerical simulations for clauses of exact cover but involving qubits ( ) , which is a particular case of -sat . in fig .[ univ1 ] we plot the behavior of the entropy of entanglement for a -qubit system for these type of clauses and compare it to the same quantity calculated previously for the clauses involving qubits ( the usual exact cover hamiltonian ) .we observe again the appearance of a peak in the entropy , which means that the system is evolving close to a quantum phase transition .figures [ univ3 ] and [ univ2 ] respectively show the scaling of the energy gap in the mean and worst case and the scaling of the peak in the entropy in the mean and worst case as well , up to qubits .error bars give again per cent of confidence level for the means .the behavior is similar to the one already found for the instances of exact cover involving qubits ( figures [ gap2 ] and [ ent ] ) , which supports the idea of the universality of the results .the minimum energy gap seems to scale in this case as ( being the number of qubits ) , which would guarantee again a polynomial - time quantum adiabatic evolution .let us now consider the adiabatic implementation of grover s quantum searching algorithm in terms of a hamiltonian evolution and study its properties as a function of the number of qubits and the parameter .for this problem , it is possible to compute all the results analytically , so we shall get a closed expression for the scaling of entanglement . as a side remark , it is worth noting that the treatment made in is not valid for oracular problems as it is assumed that all quantum gates are known in advanced . independently of this issue, we shall see that the system remains little entangled between calls to the oracle .grover s searching algorithm can be implemented in adiabatic quantum computation by means of the -dependent hamiltonian    where is the marked state .the computation takes the quantum state from an equal superposition of all computational states directly to the state , as long as the evolution remains adiabatic .the time the algorithm takes to succeed depends on how we choose the parameterization of in terms of time .our aim is to compute the amount of entanglement present in the register and need not deal with the explicit dependence of the parameter on time and its consequences ( see for further information about this topic ) .it is straightforward to check that the hamiltonian ( [ grahm ] ) has its minimum gap between the ground and first excited states at , which goes to zero exponentially fast as the number of qubits in the system is increased .therefore , this hamiltonian apparently seems to undergo a quantum phase transition in the limit of infinite size at .quantum correlations approach their maximum for this value of ( for more on grover s problem as a quantum phase transition , see ) .it can be seen ( see for example ) that the ground state energy of the hamiltonian given in equation ( [ grahm ] ) corresponds to the expression    being is the hamiltonian parameter .the corresponding normalized ground state eigenvector is given by    where we have defined the quantities    in all the forthcoming analysis we will assume that the marked state corresponds to , which will not alter our results .the corresponding density matrix for the ground state of the whole system of qubits is then given by    where we have defined as the the unnormalized sum of all the computational quantum states ( including the marked one ) , .taking the partial trace over half of the qubits , regardless of what qubits we choose , we find the reduced density matrix    where we understand that is the remaining marked state for the subsystem of qubits and is the remaining unnormalized equally superposition of all the possible computational states for the subsystem . defining the quantities    ( note that ), the density operator for the reduced system of qubits can be expressed in matrix notation as    where its dimensions are .we clearly see that the density matrix has rank equal to . therefore , because ( where is the von neumann entropy of the density matrix ) we conclude that , which corresponds to our entanglement measure between the two blocks of qubits , is always .this holds true even for non symmetric bi - partitions of the complete system . regardless of the number of qubits ,entanglement in grover s adiabatic algorithm is always a _ bounded _quantity for any , in contrast with the results obtained in the previous sections for shor s factoring algorithm and for the exact cover problem .grover s adiabatic quantum algorithm essentially makes use of very little entanglement , but even this bounded quantity of quantum correlations is enough to give a square root speedup .we have explicitly calculated the von neumann entropy for .because the rank of the reduced density matrix is two , there are only two non - vanishing eigenvalues that contribute in the calculation which are    we analyze the limit for and separately :  _ ( i ) _  in the limit of very high we can approximate the ground state energy given in equation ( [ ground ] ) by    therefore , the quantity    diverges at , which implies that this limit can not be correct for that value of the parameter .the closer we are to , the bigger is . in this limitwe find that    where all these quantities tend to zero as .it is important to note that the convergence of the limit depends on the value of or , in other words , how close to we are .the closer we are to , the slower is the convergence , and therefore any quantity depending on these parameters ( such as the entropy ) will converge slower to its assimptotical value . for the eigenvalues of the reduced density matrixwe then find that when    and , and therefore the assimptotical entropy is    the convergence of this quantity is slower as we move towards .  _( ii ) _  we begin our analysis by evaluating the quantities at and then taking the limit of big size of the system .we have that . from hereit is easy to get the approximations    and therefore    so and . according with ( [ eigensdos ] )we can evaluate the finite size corrections to this behavior and find the scaling of the entropy with the size of the system for very large .the final result for the entropy at the critical point reads    note that the entropy remains bounded and tends to for as an square root in the exponential of the size of the system , which is the typical factor in grover s quantum algorithm .we have represented the evolution of the entanglement entropy as a function of for different sizes of the system in fig .[ pic ] and have plotted in fig .[ scale ] the maximum value of the entropy along the computation as a function of the size of the system according to the expression given in equation ( [ scaling ] ) .we can now compare the two plots with fig .[ mix-300 ] and fig .[ ent ] in the previous section .the behavior for the entropy in grover s adiabatic algorithm is dramatically different to the one observed in the np - complete problem .entanglement gets saturated in grover s adiabatic algorithm _ even at the critical point _ , which is reminiscent of short ranged quantum correlations in quantum spin chains .let us note that , in the limit of infinite size , the quantum state in grover s algorithm is separable with respect to any bipartition of the system ( and therefore not entangled , as it is a pure state ) for any except for .all the entanglement along the algorithm is concentrated at this point , but this entanglement is still a bounded quantity and actually equal to .consequently , a small amount of entanglement appears essentially only at one point when the size of the system is big , whereas the rest of the algorithm needs to handle just separable states .we point out that these results apply as well to the traditional discrete - time implementation of grover s searching algorithm , as the states between iterations are the same as in the adiabatic version for discrete values .in this paper we have studied the scaling of the entanglement entropy in several quantum algorithms . in particular , we have analytically proven that shor s factoring algorithm makes use of an exponentially large amount of entanglement between the target register and the source register after the modular exponentiation operation , which in turn implies the impossibility of an efficient classical simulation by means of the protocol of ref .furthermore , we have provided numerical evidence for a universal linear scaling of the entropy with the size of the system together with a polynomially small gap in a quantum algorithm by adiabatic evolution devised to solve the np - complete problem exact cover , therefore obtaining a polynomial - time quantum algorithm which would involve exponential resources if simulated classically , in analogy to shor s algorithm .universality of this result follows from the fact that the quantum adiabatic algorithm evolves close to a quantum phase transition and the properties at the critical region do not depend on particular details of the microscopic hamiltonian ( instance ) such as interactions among the spins or local magnetic fields .we have also proven that the von neumann entropy remains a bounded quantity in grover s adiabatic algorithm regardless of the size of the system even at the critical point .more concretely , the maximum entropy approaches to one as an square root in the size of the system , which is the typical grover s scaling factor .our results show that studying the scaling of the entropy is a useful way of analyzing entanglement production in quantum computers .results from other fields of physics can be directly applied to bring further insight into the analysis of quantum correlations .different entanglement scaling laws follow from different situations according to the amount of correlations involved , as can be seen in table [ scalinglaws ] .a quantum algorithm can be understood as the simulation of a system evolving close to a quantum phase transition .the amount of entanglement involved depends on the effective dimensionality of the system , which in turn governs the possibilities of certain efficient classical simulation protocols .these scaling laws provide a new way of understanding some aspects from one - way quantum computation .it is known that the so - called cluster state of the one - way quantum computer can be generated by using ising - like interactions on a planar two - dimensional lattice .this fact can be related to the linear ( in the size of a box ) behavior of entropy for spin systems in two dimensions .one - dimensional models seem not to be able to efficiently create the highly - entangled cluster state .again , this fact can be traced to the logarithmic scaling law of the entropy in spin chains which is insufficient to handle the large amount of entanglement to carry out _e.g. _ shor s algorithm .note also that dimensional systems bring unnecessarily large entanglement .quantum phase transitions stand as the more demanding systems in terms of entanglement .they are very hard to simulate classically .it is then reasonable to try to bring np - complete problems to a quantum phase transition setup , which quantum mechanics handles naturally .* acknowledgements : * we are grateful to a. acn , j. bergli , h. j. briegel , a. childs , m. a. martn - delgado , e. farhi , l. masanes , k. pilch , e. rico and g. vidal for discussions about the content of this paper .we acknowledge financial support from the projects mcyt fpa2001 - 3598 , gc2001sgr-00065 , ist-1999 - 11053 , pb98 - 0685 and bfm2000 - 1320-c02 - 01 .part of this work was done at the benasque center for science .

Abstract: we study the universality of scaling of entanglement in shor s factoring algorithm and in adiabatic quantum algorithms across a quantum phase transition for both the np - complete exact cover problem as well as the grover s problem . the analytic result for shor s algorithm shows a linear scaling of the entropy in terms of the number of qubits , therefore difficulting the possibility of an efficient classical simulation protocol . a similar result is obtained numerically for the quantum adiabatic evolution exact cover algorithm , which also shows universality of the quantum phase transition the system evolves nearby . on the other hand , entanglement in grover s adiabatic algorithm remains a bounded quantity even at the critical point . a classification of scaling of entanglement appears as a natural grading of the computational complexity of simulating quantum phase transitions .


the interest of physicists in pedestrian dynamics dates back at least to the year 1995 , when a many - particle model was proposed to describe observed self - organization phenomena such as the directional segregation ( `` lane formation '' ) in pedestrian counterstreams and oscillations of the passing direction at bottlenecks .it took five more years until clogging effects and intermittent flows in situations of crowd panic were discovered . since the year 2000 , there is an avalanche of publications on pedestrians .this includes papers on other force models and cellular automata models of pedestrian dynamics , addressing counterflows , the self - organized dynamics at intersecting flows , capacity drops by interaction effects , and the instability of pedestrian flows .recent studies focus on the empirical or experimental study of pedestrian flows by means of video analysis .one of the most relevant and at the same time most challenging problems are panic stampedes , which are a serious concern during mass events . despite huge numbers of security forces and crowd control measures ,hundreds of lives are lost in crowd disasters each year . in this paper, we present a high - performance video analysis of unique recordings of the muslim pilgrimage in mina / makkah , saudi arabia .it suggests that high - density flows can turn `` turbulent '' and cause people to fall ( see sec .[ trans ] ) .the occuring eruptions of pressure release bear analogies with earthquakes and are de facto uncontrollable .we will , however , identify variables that are helpful for an advance warning of critical crowd conditions . in our summary and outlook, we will indicate how our insights facilitated the organization of a safe hajj in 1427h , i.e. during the stoning rituals between december 30 , 2006 , and january 1 , 2007 .while panic has recently been studied in animal experiments with mice and ants , there is still an evident lack of data on critical conditions in human crowds . in homogeneous corridors and at very large openings , unidirectional pedestrian flows are mostly assumed to move smoothly according to the `` fluid - dynamic '' flow - density relationship , where represents the flow , is the pedestrian density , and the average velocity is believed to go to zero at some maximum density as in traffic jams ( see fig .this formula is often used as basis for the dimensioning and design of pedestrian facilities , for safety and evacuation studies .our video analysis of the muslim pilgrimage in mina / makkah shows , however , that this description needs corrections at extreme densities . in particular, it does not allow one to understand the `` turbulent '' dynamics causing serious trampling accidents in dense crowds trying to move forward .we have evaluated unique video recordings of a 27.7m.5 m large area in front of the 44 m wide entrance of the previous jamarat bridge , where upto 3 million muslims perform the stoning ritual within 24 hours .on the 12th day of hajj , about 2/3 of the pilgrims executed lapidation even within 7 hours . with a new computer algorithm developed by us ,we have extracted the positions and speeds of pedestrians as a function of time .this algorithm is based on the successive application of several digital transformation , contrast enhancement , motion prediction and pattern recognition techniques .it has been calibrated with data obtained by manual evaluation and tested in field experiments under well - known conditions , with an accuracy of about 95% . for the time period from 11:45am to 12:30 on january 12 , 2006 , the resulting dataset contains more than 30 million position - velocity pairs in the evaluated _ central _ area of size 20m m .we have restricted ourselves to the evaluation of this area in order to avoid any boundary effects of the measurement algorithm .the resolution of 25 pixels per meter and 8 frames per second allows one to determine even small average speeds by calculating the mean value of a large sample of individual speed measurements .the data extracted from the videos allowed us to determine not only densities in larger areas , but also local densities , speeds , and flows . the local density at place and time was measured as  are the positions of the pedestrians in the surrounding of and \label{dens2}\ ] ] is a gaussian distance - dependent weight function . is a measurement parameter .the greater , the greater the effective measurement radius , which is greater than .it can be calculated that the weight of neighboring pedestrians located within the area of radius is 63% . in another paper , we have shown that the average of the local density values obtained with formulas ( [ dens1 ] ) and ( [ dens2 ] ) agrees well with the actual average density . moreover ,the variance of the local density measurements around the given , average density , goes down with larger values of .in fact , for , all local density measurements result in the same value , which corresponds exactly to the overall number of pedestrians , divided by the area they are distributed in .the latter corresponds to the classical method of determining the average ( `` global '' ) density .however , it can also be determined by averaging over local density measurements , i.e. where the approximate equality becomes exact for .this is , because of \ , d^2r  \nonumber \\ & = &  \frac{1}{\pi r^2 }  \int\limits_0^{2\pi } \!\int\limits_0^\infty \ !\mbox{e}^{-r^2/r^2 } r\ , d\varphi \ , dr = 1 \ , , \end{aligned}\ ] ] = 1 \ , , \ ] ] and .the local speeds have been defined via the weighted average while flows have been determined according to the fluid - dynamic formula in the fundamental diagram , one displays the absolute value of the flow as a function of the density . for further aspects regardingthe above definitions see ref . .  as the criticality in the crowd depends on the local conditions , we are interested in local measurements with a small value of , while many other measurements in the literature present averages over larger areas . in the central recorded area studied by us, local densities reached values greater than 10 persons per square meter , if m was chosen ( fig .the local densities vary considerably ( see fig .1c ) . as a rule of thumb ,the maximum local densities are twice as high as the average densities . when a local density of 6 persons per square meter is exceeded , the local flow decreases by a factor of 3 or more , so that the outflow drops significantly below the inflow ( see figs .1b and 2b ) .this causes a higher and higher compression in the crowd , until the local densities become critical in the end .while this seems to explain crushing accidents quite well , it is startling that the crowd accident on january 12 , 2006 occured in a flat and practically open area without significant counterflows .   as a function of the local density .our own data points are for m and shown as red stars .other symbols correspond to data by fruin ( black ) , mori and tsukaguchi ( green ) , polus _ et al . _ ( purple ) , and seyfried _ et al . _ ( blue ) , obtained with other measurement methods .the solid fit curve is from weidmann . scaling the density with a factor 0.7 ( and the mori data by a factor 0.6 ) ,our data become compatible with weidmann s curve ( see inset ) , i.e. the different average projected body areas of people in different countries are very important to consider .note , however , that the average local speed does not become zero at extreme densities .* b , * average of the local flows as a function of the local density .we have used the same symbols as in fig .note the second flow peak , i.e. the local maximum at 9 persons / m .* c , * distribution of _ local _ densities for a given _ average _ density ( red : 1.6 persons / m , blue : 3.0 persons / m , black : 5.0 persons / m ) .the gamma distribution fits the histograms with 50 bins well ( solid lines ) .* d , * distribution of local speeds for the same average densities as in fig .1c ( same colors for same densities ) .the distributions deviate from the expected normal distributions , as many pilgrims are parts of large groups including people of high age .solid lines are smoothed fit curves serving as guides for the eye .note that , at low densities , a small percentage of pilgrims returns against the main flow direction . ]our video analysis revealed that , even at extreme densities , the _ average _ local speeds and flows stayed finite , i.e. there was no level of crowdedness under which people completely stopped moving ( fig .this is in marked contrast to vehicle traffic , where drivers keep some minimum safety distance and stop to avoid collisions .it also causes an unexpected , second flow maximum at 9 persons / m , which implies the possibility of alternating forward and backward moving shockwaves with serious consequences for the resulting crowd dynamics .such shock waves cause safety hazards and have actually been observed .however , a quantitative characterization of their properties and a satisfactory understanding of the underlying mechanisms are lacking .current models fail , as it is hardly conceivable that a 44 m wide opening would cause intermittent outflows through arching effects .moreover , the notion of shockwaves is confusing , as it is mostly used for discontinuities in the density that are caused by random initial velocity or density variations , while we observe emergent , self - generated waves ( fig .of pilgrim motion ( where the bracket indicates an average over the index variable , i.e. over time ) .arrows represent pedestrian speeds , averaged over the period from 11:45am to 12:30am on january 12 , 2006 . to avoid boundary effects ,the evaluation focussed on the 20m m central area of our video recordings .the -coordinate denotes the distance to the on - ramp of the jamarat bridge and points into the direction of its entrance .one can clearly see the merging of pedestrians coming from different directions , which caused a bottleneck effect .the contour plot below the arrows represents the `` pressure '' , which we have defined as the average pedestrian density times the velocity variance ^ 2\rangle_t ] is the velocity variance .( for the spatial dependence see fig .2c , for the spatio - temporal evolution , see the video animation in the supplement . ) the transition to `` turbulent '' crowd dynamics ( see the crowd video in the supplement ) starts at 12:19 , i.e. when the `` pressure '' exceeds the value 0.02/s .the crowd accident began when the `` pressure '' reached its peak .* d , * probability density functions of the velocity increment in the laminar and the turbulent regime , determined over many locations for ( see fig . 1 ) and ( red curves ) , ( green curves ) , ( blue curves ) , and ( black curves ) .for clarity of presentation , the curves are shifted in vertical direction .note the non - parabolic , peaked curve for small values of , which distinguishes turbulent from laminar flows .* e , * distribution of displacements ( i.e. location changes between subsequent stops , defined by m/s ) .the double - logarithmic representation reveals a power law reminiscent of a gutenberg - richter law for earthquake amplitudes . here, the slope is 2.01.15 .* f , * double - logarithmic representation of the structure function of `` turbulent '' crowd motion , measuring the dependence of the relative speed on the distance . as in fluids ,the slope at small distances is 2 , but the slope of 0.18.02 at large separations ( in the so - called `` inertial regime '' ) differs from turbulent fluids due to the increased propulsion forces during `` crowd panics '' . ]`` crowd turbulence '' has further specific features . due to the physical contacts among people in extremely dense crowds , we expect commonalities with granular media beyond the level of _ analogy _ established in previous work .in fact , dense driven granular media may form density waves , while moving forward , and can display turbulent - like states . moreover , under quasi - static conditions , force chains are building up , causing strong variations in the strengths and directions of local forces . as in earthquakes this can lead to events of sudden , uncontrollable stress release with power - law distributed displacements .such a power - law has also been discovered by our video - based crowd analysis ( see fig .in contrast to purely density - based assessments , we suggest to quantity the criticality of the situation in the crowd by the `` pressure '' i.e. the local pedestrian density times the local velocity variance .closeup video recordings show that , under `` turbulent '' conditions , the densities and resulting mechanical pressures are so unbearable that people try to escape the crowd and start pushing to gain space .this state , which is sometimes called `` crowd panic '' , is characterized by additional energy input in compressed areas , in contrast to normal fluids or granular media .this causes particularly violent displacements in extremely dense crowds , which are practically impossible to control even by large numbers of security forces and reflected by a different scaling behaviour of the so - called structure function compared to fluids ( fig .current simulation models of crowd panics fail to reproduce this `` turbulent '' dynamics , as they neglect that the propulsion force of people _ increases _ in areas of extreme densities .in summary , even in extremely dense crowds with local densities upto 10 persons per square meter , the motion of the crowd is not entirely stopped .this produces over - critical densities .the largest danger , however , originates from the dramatically different crowd dynamics at high densities .we have found two sudden transitions leading from laminar to stop - and - go flows and from there to `` turbulent '' crowd motion , which can trigger the trampling of people , in contrast to previously discovered self - organisation phenomena in pedestrian crowds .stop - and - go waves start , when the density is high and the flow drops below a critical value ( fig .2a , b ) , while `` turbulent '' dynamics sets in with overcritical `` pressures '' in the crowd , see fig .the critical values depend on the choice of in the evaluation of the local densities , speeds , and variances , see eq .( [ dens2 ] ) .it is still an unresolved challenge to simulate _ both _ transitions , from laminar to stop - and - go _ and _ `` turbulent '' flows by a many - particle model just by increasing the inflow to a bottleneck area .   due to the generality of these mechanisms, we expect that our findings are transferable to other mass gatherings .in fact , qualitatively similar conclusions can be drawn from video recordings at the same location during the hajj in the year 2005 . in that year , the pressure did not reach so high values and no accident occurred , but in 1997 and 1998 there were crowd disasters north of the ramp of the jamarat bridge as well .similar observations were reported by fruin from other places : `` at occupancies of about 7 persons per square meter the crowd becomes almost a fluid mass .shock waves can be propagated through the mass , sufficient to ... propel them distances of 3 meters or more . ...people may be literally lifted out of their shoes , and have clothing torn off .intense crowd pressures , exacerbated by anxiety , make it difficult to breathe , which may finally cause compressive asphyxia . the heat and the thermal insulation of surrounding bodies cause some to be weakened and faint .access to those who fall is impossible .removal of those in distress can only be accomplished by lifting them up and passing them overhead to the exterior of the crowd . ''this drastic picture visualizes the conditions in extremely dense crowds quite well , but fruin and others have not provided a scientific analysis and interpretation .turbulent waves are experienced in dozens of crowd - intensive events each year all over the world .therefore , it is necessary to understand why , where and when potentially critical situations occur .viewing real - time video recordings is not very suited to identify critical crowd conditions : while the average density rarely exceeds values of 6 persons per square meter , the local densities can vary considerably due to dynamical patterns in the crowd ( see fig .moreover , evaluating the local densities is not enough to identify the critical times and locations precisely , which also applies to an analysis of the velocity field .the decisive quantity is rather the variance of speeds , multiplied by the density , i.e. what we call the `` pressure '' .it allows one to identify critical locations ( fig .2c ) and times ( fig .there are even advance warning signs of critical crowd conditions : the crowd accident on january 12 , 2006 started about 10 minutes after `` turbulent '' crowd motion set in , i.e. after the `` pressure '' exceeded a value of 0.02/s ( fig .3c ) . moreover , it occured more than 30 minutes after the average flow dropped below a critical threshold ( fig .2b ) , which can be identified by watching out for stop - and - go waves in accelerated surveillance videos ( fig .such advance warning signs of critical crowd conditions can be evaluated on - line by an automated video analysis system . in many cases ,this can help one to gain time for corrective measures such as flow control , pressure relief strategies , or the separation of crowds into blocks to stop the propagation of shockwaves .such anticipative crowd control could certainly increase the level of safety during future mass events .   based on our insights in the reasons for the accidents during the hajj in 1426h ,we have recommended many improvements . in the following ,we mention only the most important changes in the organization of the hajj in 1427h :  * the stoning capacity of the jamarahs and , thereby , the flow capacity of the different levels of the jamarat bridge was improved by an elongated , elliptical shape , as suggested by dr .keith still .* on the plaza around the jamarat bridge , no opportunity for accumulation of the crowd was given .* an automated counting of pilgrims using the signals of the surveillance cameras was implemented to have all the time a reliable overview over the densities and capacity utilizations in critical places of the system . *complementary , a new plaza design allowed the general security to easily balance the flows between the ground floor of the current construction stage of the new jamarat bridge and the northern and southern ramps of the first floor , in order to avoid overloading and a breakdown of the flow .* the two - way operation of the street system and the jamarat plaza was replaced by a one - way operation in order to avoid obstructions and problems by counterflows . *a systematically optimized scheduling and routing program was applied in order to reach a homogeneous distribution of registered pilgrims in space and time .* squatters were removed from the streets in order to avoid bottleneck situations .these and some further changes ( which will be described in detail in some other publications ) ultimately reached comfortable and continuous flows conditions and a safe hajj in 1427h , although the situation was expected to be particularly critical due to a lack of experience with the implemented changes and due to the significantly increased number of pilgrims in 1427h . as the new jamarat bridge will be expanded in 2007 by additional floors , it will have a greater capacity in 1428h and imply the need for changes in the organizational concepts to avoid bottlenecks in other places .this will pose new challenges for crowd researchers , experts , and authorities in the future .the authors are grateful to the german research foundation for funding ( dfg project he 2789/7 - 1 ) , to the ministry of municipal and rural affairs for providing data and organisational support , and to its minister , h.r.h . , for facilitating this scientific collaboration .they also thank salim al - bosta and the stesa staff for spending many hours positioning the cameras , converting the video recordings , and the great cooperation and support . finally , d.h .appreciates the insightful discussions with various colleagues and the phantastic collaboration with dirk serwill , knut haase , erfan qasimi and many others , who have contributed to the progress of this project .he congratulates the saudi authorities to their great efforts and the successful implementation .s. a. h. algadhi and h. s. mahmassani , in _ proceedings of the 11th international symposium on transportation and traffic theory _ , edited by m. koshi ( elsevier , new york , 1990 ) , pp .59 . k. still , _ crowd dynamics _ ( phd thesis , university of warwick , 2000 ) . c. saloma , g. j. perez , g. tapang , m. lim , and c. palmes - saloma , _ proc .u.s.a . _ * 100*(21 ) , 11947 ( 2003 ) .              m. r. virkler and s. elayadath , in _ proceedings of the second international symposium on highway capacity _ , edited by r. akelik ( transportation research board , washington , 1994 ) , vol .2 , pp . 671 .j. j. fruin , in _ engineering for crowd safety _ , edited by r. a. smith and j. f. dickie ( elsevier , amsterdam , 1993 ) , pp .. s. t. pheasant , ( taylor and francis , london , 1998 ) .this `` gas - kinetic '' definition of the pressure is to be distinguished from the mechanical pressure experienced in a crowd .however , a monotonously increasing functional relationship between both kinds of pressure is likely , at least when averaging over force fluctuations .

Abstract: many observations in the dynamics of pedestrian crowds , including various self - organization phenomena , have been successfully described by simple many - particle models . for ethical reasons , however , there is a serious lack of experimental data regarding crowd panic . therefore , we have analyzed video recordings of the crowd disaster in mina / makkah during the hajj in 1426h on january 12 , 2006 . they reveal two subsequent , sudden transitions from laminar to stop - and - go and `` turbulent '' flows , which question many previous simulation models . while the transition from laminar to stop - and - go flows supports a recent model of bottleneck flows [ d. helbing et al . , phys . rev . lett . 97 , 168001 ( 2006 ) ] , the subsequent transition to turbulent flow is not yet well understood . it is responsible for sudden eruptions of pressure release comparable to earthquakes , which cause sudden displacements and the falling and trampling of people . the insights of this study into the reasons for critical crowd conditions are important for the organization of safer mass events . in particularly , they allow one to understand where and when crowd accidents tend to occur . they have also led to organizational changes , which have ensured a safe hajj in 1427h .