Unique Factorisation, Prime-Walks and Continued Fractions on Digraphs P-L Giscard ,a,1 , S J Thwaite b,2 , D Jaksch a,c a Clarendon Laboratory, Department of Physics, University of Oxford, Parks Road, Oxford OX1 3PU, United Kingdom b Faculty of Physics, Ludwig Maximilian University of Munich, Theresienstrasse 37, 80333 Munich, Germany. c Centre for Quantum Technologies, National University of Singapore, 3 Science Drive 2, Singapore 117543 Abstract We show that all the walks (also known as paths) on any (multi) directed graph obey an equivalent to the fundamental theorem of arithmetic: any walk factorizes uniquely into products of prime walks. A prime walk behaves precisely like a prime integer: if it is a factor of the product of two walks, then it is a factor of a least one of these two walks. We demonstrate that a walk is prime if and only if it is self-avoiding. Thanks to these results, we show that the series of all walks between any two vertices of any (possibly weighted) directed graph is given by a universal continued fraction of finite depth and breadth. We obtain an explicit formula giving this continued fraction. This formula has already found applications in machine learning, matrix computations and quantum mechanics. We provide illustrative examples of our results. Key words: Digraphs and Quivers; Walks; Unique Factorization; Prime Elements; Continued Fractions; Self-Avoiding Walks. 2000 MSC: 05C38, MSC 05C20, MSC 05C22, MSC 05C25 1. Introduction 1.1. Context Walks on graphs are pervasive mathematical objects that appear in a wide range of fields from mathematics and physics to engineering, biology and social sciences [24, 18, 8, 7, 36, 3, 9]. Walks are perhaps most extensively studied in the context of random walks on lattices [30], where they are used to model physical processes [11]. At the same time, it is dicult to find general ‘context-free’ results concerning walks: indeed, the properties of walks are almost always strongly dependent on the graph on which they take place. For this reason, many results concerning walks on graphs are intimately connected with the specific context in which they appear. Over the past 30 years, the solutions to a number of problems across many fields have been formulated in terms of sums of walks. Amongst the most important we must mention the early work by Brydges et al. in statistical physics [10] and the seminal work by Malioutov and coworkers [32] concerning Gaussian belief propagation in probabilistic graphical models. These previous works are unified by two underlying themes: firstly, that some quantities are most naturally expressed as sums of walks, and secondly, that these walk-sums can be reduced to more manageable expressions by resumming certain families of terms appearing in the sum. However, none of the existing studies address the question of how these resummations can be developed in a systematic fashion. Consequently, the results in the existing literature depend strongly on the context of their discovery, and are only applicable in a limited number of situations. The general feasibility of walk resummations for graphs of arbitrary structure thus remains an open problem. In this article we present a mathematically rigorous and general approach to the question of summing and Corresponding author Email address: p.giscard1@physics.ox.ac.uk (P-L Giscard) 1 Supported by a Scatcherd European Scholarship and EPSRC Grant EP/K038311/1. 2 Supported by Balliol College, a Clarendon Scholarship, and the Alexander von Humboldt Foundation. 3 Supported by EPSRC Grant EP/K038311/1 and by the ERC under the European Unions Seventh Framework Programme (FP7/2007- 2013)/ERC Grant Agreement no. 319286 Q-MAC. Preprint submitted to Elsevier May 23, 2015