Feynman diagrams, ribbon graphs, and topological recursion of Eynard-Orantin

We consider two seemingly unrelated problems, the calculation of the WKB expansion of the harmonic oscillator wave functions and the counting the number of Feynman diagrams in QED or in many-body physics and show that their solutions are both encoded in a single enumerative problem, the calculation of the number of certain types of ribbon graphs. In turn, the numbers of such ribbon graphs as a function of the number of their vertices and edges can be determined recursively through the application of the topological recursion of Eynard-Orantin to the algebraic curve encoded in the Schr\"odinger equation of the harmonic oscillator. We show how the numbers of these ribbon graphs can be written down in closed form for any given number of vertices and edges. We use these numbers to obtain a formula for the number of N-rooted ribbon graphs with e edges, which is the same as the number of Feynman diagrams for 2N-point function with e+1-N loops.


Introduction
In this paper we consider two seemingly completely unrelated physical problems : calculating the WKB approximation of the harmonic oscillator wave functions and counting the number of Feynman diagrams in many-body physics, which correspond to the diagrams one would obtain from QED if Furry's theorem were not applicable. As we will show, the answers to both problems can actually be obtained from a single formalism, the topological recursion of Eynard and Orantin, applied to an algebraic curve of genus zero encoded in a natural way in the Schrödinger equation for the harmonic oscillator. This leads to the somewhat surprising result that calculating the WKB expansion of the harmonic oscillator wave functions is related to solving the enumerative problem of counting the number of Feynman diagrams in QED or in many-body physics. This also gives a link between a topological problem and the WKB expansion of the harmonic oscillator. Inspired by the loop equations of matrix models, the topological recursion of Eynard and Orantinthat we will now simply refer to as topological recursion -offers an algorithm to generate an infinite hierarchy of multi-differentials starting from a spectral curve and, at least in the case of genus zero curves, no other input. The nomenclature of spectral curves originates from the first applications where the curves were associated to the spectra of matrix models but the formalism has by now been applied to much more general situations, where curves may have no connection to any matrix model. What has generated much interest in this formalism is that, with judicious choices of spectral curves, these multi-differentials solve a large number of enumerative problems, in the sense that the coefficients of well-chosen series expansions of these multi-differentials count various quantities of topological or combinatorial interest. For example, topological recursion has been used to reproduce the Witten-Kontsevich intersection numbers of moduli spaces of curves, the Weil-Petersson volumes of moduli spaces of hyperbolic surfaces, the stationary Gromov-Witten invariants of P 1 , simple Hurwitz numbers and their generalizations, Gromov-Witten invariants of toric Calabi-Yau threefolds and much more (see for example [14] for an overview of some applications). In addition to the construction of generating functions for enumerative problems, the multi-differentials may be used to construct a so-called wave function defined as the exponential of a sum of integrals of the multi-differentials. One then defines quantum curves as differential operators annihilating this wave function. For a large class of genus zero curves, the quantum curves such defined are obtained from the corresponding spectral curves by making the simple substitutions x → x, y → d/dx (note that y does not correspond to the canonical momentum of quantum mechanics) and by making a specific choice of ordering when ordering ambiguities are present, see [6]. In those instances, the construction of the wave function using the differentials of topological recursion can be shown to coincide with the usual WKB expansion. When the dependence on y is at most quadratic, the application of the quantum curve on the wave function to give zero takes the form of the Schrödinger equation. The situation is more delicate for higher genera, see for example [5] and references therein. In the present paper, we focus on one of the simplest genus zero spectral curves y 2 = x 2 − c 2 , for which the quantum curve is simply 2 d 2 /dx 2 − x 2 + c 2 and topological recursion reproduces the WKB expansion of the quantum harmonic oscillator [6,11]. However, we notice, following [13] and [21], that in addition to giving the WKB expansion of the wave function, the same differentials can be used to compute certain numbers C g,n (µ 1 , . . . , µ n ) which are objects of study in combinatorics, see [23,24,25,26,27]. They represent the numbers of maps (graphs drawn on a compact orientable surface in a way that each face is a topological disc) on a genus g surface having n ordered vertices of respective degrees µ i and such that at each vertex one of the half-edges incident to this vertex is marked. It has been known for some time that using these numbers, one can count the number of rooted maps (that is maps with a distinguished half-edge) of genus g with e edges [25]. It has been recently realized, see [18] and [22], that the rooted maps are in one-to-one correspondence with the Feynman diagrams of the two-point function of a charged scalar field interacting with a neutral scalar field through a cubic term φ † Aφ. These diagrams also correspond to the electron propagator in QED if Furry's theorem is not applied or in many-body physics, including tadpoles. In the rest of the paper we will follow the example of [10] and refer to our diagrams as QED diagrams and call the two types of particles electrons and photons, but one must keep in mind that our diagrams will include electron loops connected to arbitrary numbers of photons. We will also give formulas for the number of QED diagrams with Furry's theorem enforced in Section 7. The connection between ribbon graphs and Feynman diagrams has been studied and exploited since the seminal work of 't Hooft [16] allowing to see ribbon graphs as Feynman diagrams through the matrix model approach. However, the correspondence between Feynman diagrams and ribbon graphs thus obtained is very different from ours. In [19] and [20] an approach similar to ours was used for the vacuum diagrams of the QED theory we consider here. In [18] it is shown that in order to extend this correspondence between the QED Feynman diagrams of the electron propagator and rooted maps to Feynman diagrams containing an arbitrary number of external electrons, one is naturally led to introducing the notion of N -rooted maps, that is maps with N distinguished half edges. In this paper, we show that it is also possible to use the C g,n (µ 1 , . . . , µ n ) to compute the number of N -rooted maps with a given number of edges. The application of topological recursion to the harmonic oscillator spectral curve therefore provides a curious bridge between three apparently unrelated problems: one mathematical, the enumeration of a certain type of maps, and the other two physical, the computation of the WKB expansion of the wave function and of the number of Feynman diagrams in QED. The paper is organized as follows. In Section 2 we review the topological recursion of Eynard and Orantin as applied to the harmonic oscillator curve and we show how to compute differentials W g,n (µ 1 , . . . , µ n ) used to obtain the coefficients C g,n (µ 1 , . . . , µ n ). In Section 3, we show how the differentials obtained in the previous section are used to obtain the WKB approximation of the harmonic oscillator wave functions. In Section 4, we introduce ribbon graphs and maps and describe how their enumeration is encoded in a set of coefficients C g,n (µ 1 , . . . , µ n ). In Section 5, we show how closed form formulas for the coefficients C g,n (µ 1 , . . . , µ n ) can be obtained from the differentials W g,n (µ 1 , . . . , µ n ) generated by topological recursion. In Section 6 we present the formula giving the number of N -rooted maps in terms of the C g,n (µ 1 , . . . , µ n ) and explain how they can be used to count QED diagrams. Section 7 shows the expression for the first non trivial WKB correction to the harmonic oscillator in terms of certain coefficients C g,n (µ 1 , . . . , µ n ). In the appendix we provide additional explicit expressions for some C g,n .
Acknowledgements. K.G. wishes to thank Dmitry Korotkin, Marco Bertola as well as the staff and members at Concordia University for the support extended during his stay. P.L. gratefully acknowledges the support from the Fonds de recherche du Québec -Nature et technologies (FRQNT) via a grant from the Programme de recherches pour les chercheurs de collège and to the STAR research cluster of Bishop's University. V.S. is grateful for the support from the Natural Sciences and Engineering Research Council of Canada through a Discovery grant as well as from the University of Sherbrooke. P.L. and V.S. thank the Max Planck Institute for Mathematics in Bonn, where this work was initiated, for hospitality and a perfect working environment.

Topological recursion for the harmonic oscillator curve
The Eynard-Orantin topological recursion is a procedure which constructs an infinite hierarchy of multi-differentials defined on a given algebraic curve. Let us assume that the curve C defined by a polynomial P (x, y) = 0 is of genus zero and the ramified covering x : C → CP 1 has only simple ramification points. The original definition for any curve with simple ramification is given in [15] and [6] gives the recursion formula adapted to an arbitrary ramification. Under our assumptions, the Eynard-Orantin topological recursion takes the following form : where • q, p i ∈ C are points on the genus zero curve C; • A i are simple ramification points of the covering x : C → CP 1 ; • q * denotes the image of the local Galois involution of a point q ∈ C lying in a neighbourhood of a simple ramification point A i (that is the points q and q * belong to the two sheets meeting at A i and project to the same value of x on CP 1 , the base of the covering); • the second sum excludes the value (0, 1) for (g 1 , k) and (g 2 , k); • the initial "unstable" differentials W 0,1 and W 0,2 are given by (being points on a genus zero curve p, p 1 , p 2 ∈ C can be thought of as complex numbers): W 0,1 (p) = y(p)dx(p) , W 0,2 (p 1 , p 2 ) = dp 1 dp 2 (p 1 − p 2 ) 2 ; (2) • the recursion kernel K is defined by This is a recursion with respect to the number 2g − 2 + n > 0. The obtained multi-differentials W g,n are invariant under arbitrary permutation of their arguments p 1 , . . . , p n , have poles at the ramification points A i with respect to each of the arguments and no other singularities, see [15].
Let us consider a family of harmonic oscillator curves parameterized by c ∈ C, that is a family of algebraic curves given by the equation Away from the point (x, y) = (∞, ∞) on the curve (4), one can choose the following local parameter: Then we have where = ±1 is an arbitrary choice of sign reflecting the arbitrariness in the choice of the sign of the square root defining the parameter z. The simple ramification points of the curve are at z = 0, ∞ and the Galois involution * acts by z * = −z which corresponds to (x, y) * = (x, −y).
With this data definitions (1)-(3) give (the superscript H reflects the fact that the quantities are calculated using the harmonic oscillator family of curves (4)): and Now, computing differentials W g,n for the harmonic oscillator curve reduces to plugging these data into recursion formula (1) and computing residues of some rational expressions. Here are a few examples taken from [11]. The first generation, with 2g − 2 + n = 1: The second generation, with 2g − 2 + n = 2:

WKB wave function
We will briefly review how the WKB expansion for the harmonic oscillator can be obtained from the W H g,n , see [13], [11] for more details.
Let us write the one-dimensional time independent Schrödinger equation in the form and so that Schrödinger's equation becomes This differential operator is called the quantum curve and corresponds to the algebraic (spectral) curve of the equation y 2 − f (x) + c 2 = 0 . For a large class of curves, see [6], the WKB wave functions can be calculated from the W g,n of the corresponding spectral curve. Here we outline this calculation for the example of the harmonic oscillator curves (4), that is specializing to the case V (x) = M ω 2 x 2 /2 and setting M ω = 1. We first introduce the functions F H g,n with 2g − 2 + n > 0 defined by integrating W H g,n as follows F H g,n (z 1 , . . . , z n ) = For example, one finds where in the last equation z = (x − c)/(x + c). Thus we obtain in the region x > c , Using these expressions in Eq. (11) reproduces the WKB expansion of the harmonic oscillator wave functions if we set = −1.

Ribbon graphs and maps
Initiated by the work of Tutte [23,24], enumeration of maps, that is graphs embedded in a compact orientable surface in a way that each face is a topological disc, received much attention in the last century, see [25,26,27,17,3,4,1]. More recently this topic was extended to counting maps on non-orientable surfaces, see [2,8,9] and references therein. Central to this paper is a notion of a connected ribbon graph, which is equivalent to that of a map. Intuitively, a ribbon graph is a graph whose vertices are replaced by small discs and edges are replaced by ribbons. This can be done in a canonical way once the cyclic order of edges is fixed at every vertex. In [25], a closed form expression was given for the number of ribbon graphs with e edges and with one half edge marked that can be drawn on a genus g surface (as will be defined more precisely below).
In [18] this result was rederived using quantum field theory and generalized to an arbitrary number of marked half edges. Before explaining this connection in more details, let us define more precisely the quantities we will be using.
Definition 1. A ribbon graph, or simply graph, is a data Γ = (H, α, σ) consisting of a set of halfedges H = {1, . . . , 2e} with a positive integer e and two permutations α, σ ∈ S 2e on the set of half-edges such that • α is a fixed point free involution, • the subgroup of S 2e generated by α and σ acts transitively on H.
The involution α is a set of transpositions each of which pairs two half-edges that form an edge. Cycles of the permutation σ correspond to vertices of the ribbon graph Γ; each cycle gives the ordering of half-edges at the corresponding vertex. Cycles of the permutation σ −1 • α correspond to faces of Γ. The condition of transitivity of the group σ, α on the set of half-edges ensures the connectedness of the graph Γ.  A ribbon graph defines a connected compact orientable surface. This surface is reconstructed by gluing discs to the faces of the ribbon graph. Let us denote by n the number of vertices of a ribbon graph Γ = (H, α, σ), that is the number of cycles in the permutation σ. Denote by f the number of faces, that is the number of cycles in the permutation σ −1 • α. Then the genus of the surface corresponding to Γ is defined through the Euler characteristic of the graph: The genus of the surface is called the genus of the ribbon graph.
Definition 2. An isomorphism between two ribbon graphs Γ = (H, α, σ) and That is two graphs are isomorphic if the data of one of them can be obtained from another by relabeling ψ : H → H of the half-edges. Two isomorphic ribbon graphs are identified.
In other words, an automorphism of a ribbon graph is a relabeling of its half-edges that does not change the permutations α and σ.
Example 2. The graph in Figure 1 has the following automorphism ψ = (1423), meaning that in the new labeling the half-edge 1 is labeled by 4, the half-edge 4 is labeled by 2, the half-edge 2 is labeled by 3. The group of automorphisms of this graph is Z 4 .

Definition 4.
A marked graph is a ribbon graph whose vertices are labeled with consecutive integers starting at 1. We call an unmarked graph a ribbon graph whose vertices are not labeled.
Definition 5. A marked isomorphism between two marked ribbon graphs is an isomorphism of the corresponding unmarked graphs which acts trivially on the set of vertices, that is on the set of cycles of σ.
Let us denote by Γ v a marked graph whose underlying unmarked graph is Γ. For a given marked graph Γ v , the group of automorphisms of Γ which fix every vertex is the group of marked automorphisms of That is there are two marked automorphisms -the identity and the exchanging of the two edges: ψ = (13) (24) . However, if we do not impose that the automorphism fixes the vertices, there is an additional automorphism exchanging the two vertices: ψ = (12)(34) and we have Lemma 1. Let Γ v be a marked graph with more than two vertices. Then |Aut v (Γ v )| = 1.
Given that the group Aut v (Γ v ) does not depend on a particular marking of the underlying graph Γ, we also write Aut v (Γ) for the automorphisms of Γ that fix the set of vertices pointwise.

The numbers C g,n
Let us denote by G g,n (µ 1 , . . . , µ n ) the set of distinct marked graphs of genus g with n vertices for which the vertex labeled i has µ i half-edges incident to it. We say that the vertex has degree µ i . Since we only consider connected graphs, it is assumed that the degrees µ i are positive integers for n > 1. If n = 1 the set G 0,1 (0) consists of one graph which is a single point. As a less trivial example, consider G 0,3 (1, 4, 1) which consists of the graphs with three ordered vertices drawn on a sphere with degrees one, four, and one. There are three such graphs, as shown in Figure  2. Figure 2: Graphs forming the set G 0,3 (1, 4, 1) .
Remark 1. In [13,21] the numbers C g,n were called generalized Catalan numbers because in the case of one vertex, C 0,1 (2m) is the mth Catalan number. In [25], the term dicings was used for the decorated graphs from the set G g,n (µ 1 , . . . , µ n ).
The precise relation between the coefficients C g,n and the enumeration of Feynman diagrams will be explained in Section 6.3.
5 The numbers C g,n and the topological recursion The following recursion formula for C g,n was derived in [25] and then rediscovered in [13,21] in the context of the topological recursion: where we use the notation from [13,21], namely |I| denotes the number of elements in the set I, the symbol stands for disjoint union, µ I = (µ i ) i∈I , and the hat symbol marks the omitted argument. In [13,21], this recursion formula was shown to be related by a Laplace transform to the topological recursion of Eynard-Orantin. Here we describe this relationship. Consider the following infinite hierarchy of differentials defined, for (g, n) such that 2g − 2 + n > 0, in terms of the C g,n by where w = (w 1 , . . . , w n ), µ = (µ 1 , . . . , µ n ), the scalar product is defined by w, µ = µ i w i , and the variables t i are related to w i by It was shown in [13,21] that differentials W C g,n (23) with (g, n) such that 2g − 2 + n > 0 except W C 1,1 satisfy the Eynard-Orantin topological recursion on the curve defined by the equatioñ For this curve, one considers two parametersỹ and t away from the point at infinity (x,ỹ) = (∞, ∞) related to each other byỹ which from Eq. (19) givesx The Galois involution in terms of these parameters becomesỹ * = 1/ỹ and t * = −t and the simple ramification points are located atỹ = ±1 or t = 0, ∞. However, to obtain differentials (17) by recursion on the curve (19) the definition of one of the initial differentials W 0,2 is modified in [13,21] as follows: With this W 0,2 and with the standard W C 0,1 =ỹdx = 8t(t+1)dt/(t 2 −1) 3 , the recursion kernel according to the above definition is It turns out, see [11], that all "stable" (2g − 2 + n > 0) differentials W C g,n produced by this recursion on the curve (19) can be obtained by recursion (1)-(3) starting with the following harmonic oscillator curve from the family (4): Moreover, the recursion on the curve (22) also produces W C 1,1 which required a special treatment in [13,21]. The next theorem is a corollary of results from [13,21] and [11]. Theorem 1. Differentials W C g,n (17) satisfy the Eynard-Orantin topological recursion on the harmonic oscillator curve (22).
Proof. Note that the following change of variables transforms the curve (4) into the curve (19)x +ỹ + 1/ỹ = 0 , which implies the following relation on the respective local parameters: t = − z. With this identification, the recursion kernel K H coincides with the kernel (21) from [13] if we put c 2 = 2 , that is if we specialize to the curve (22).
Given that the initial differential W 0,1 does not enter the recursion formula (1) (it is only used for obtaining the recursion kernel K), the only difference in running the recursion for the curves (19) and (22) is due to the difference between the initial differentials W C 0,2 and W H 0,2 . However, a careful examination of the recursion formula (1) shows that starting at the indices (g, n) satisfying 2g −2+n ≥ 2 in the left hand side, the differential W 0,2 only enters in the following combination: W 0,2 (q * , p k ) − W 0,2 (q, p k ). This quantity is obviously the same for W 0,2 = W H 0,2 (z 1 , z 2 ) and W 0,2 = W C 0,2 (t 1 , t 2 ). Therefore, starting from the second generation of W g,n , that is from the indices (g, n) such that 2g − 2 + n ≥ 2, the recursion formula (1) applied to the harmonic oscillator curve and the recursion from [13] coincide. It can be shown by direct computation, see [11], that the recursion for the curve (22)  Once the W H g,n (z 1 , . . . , z n ) have been obtained by topological recursion, it is simple to extract the C g,n (µ 1 , . . . , µ n ) using From now on we will use the identifications from the proof of Theorem 1, namely t = − z and c 2 = 2, and write W H g,n (t 1 , . . . , t n ) for the differentials after these substitutions have been made. We first invert Eq. (18), choosing the sign in order to be in agreement with Eq.(23), Had we chosen not to include the factor (−1) n in Eq.(23), a positive sign would have been required in Eq. (24). We will also need After expressing the W H g,n (t 1 , . . . , t n ) in terms of the variables w 1 , . . . , w n , we expand the results in powers of e −w i . According to Eq.(23), the coefficient of e − w,µ dw 1 . . . dw n , where (µ 1 , µ 2 , . . . , µ n ) ∈ Z n + , is equal to (−1) n C g,n (µ 1 , . . . , µ n ). As an example, consider Expressed in terms of w 1 , this becomes Taylor expanding, we obtain We therefore obtain For calculating the numbers C 1,1 , the power of the topological recursion approach is evident, as we have a closed form expression for C 1,1 (µ 1 ) instead of having to use the laborious recursion relation (16), which requires an ever increasing number of terms as µ 1 increases. Even though Eq.(23) defines only "stable" (2g − 2 + n > 0) differentials by the Laplace transform, let us consider the "unstable" W H 0,1 and W H 0,2 . For W H 0,1 (t 1 ), we obtain in terms of w 1 which we recognize as the generating function of the Catalan numbers minus 1/(2s 2 1 ), see [13,21]. To be precise, where the n-th Catalan number is given by while C 0,1 (n) is zero when the argument is odd. Consider now W 0,2 (t 1 , t 2 ). It is given by As shown in [13], the second term generates the C 0,2 (µ 1 , µ 2 ). Going to the variables w 1 , w 2 and using the notation e −w i = s i , we find from which one can compute the C 0,2 (µ 1 , µ 2 ). Let us first introduce the function where [x] denotes the integer part of the real number x. In terms of this function, we find which agrees with [13]. We find for W 0,3 : which, using once more Eq.(23), is equal to We can now obtain a closed form expression for the coefficients C 0,3 (µ 1 , µ 2 , µ 3 ): where g(µ i ) was defined in Eq.(28). Proceeding similarly, one can obtain closed form formulas for any given C g,n (µ 1 , . . . , µ n ). In the appendix the expressions for C 0,4 (µ 1 , . . . , µ 4 ) and C 1,2 (µ 1 , µ 2 ) are given. Calculating expressions for W H g,n and C g,n for larger values of the indices poses no technical difficulties but they are quite lengthy.
Remark 2. For a given C g,n (µ 1 , . . . , µ n ), the sum of the degrees µ i satisfies an inequality that can be derived from the Euler relation (13). Replacing e by 1 2 µ i in Eq.(13), we obtain Clearly the sum of the degrees must be even, as noted previously, but they satisfy an additional constraint coming from the fact that the number of faces is at least equal to one, giving This shows for example that C 1,1 (µ) is nonzero at the condition that µ ≥ 4 as is made explicit in the general formula, Eq.(25). The smallest degrees giving a nonzero value of C 0,4 (µ 1 , . . . µ 4 ) satisfy µ 1 +µ 2 +µ 3 +µ 4 = 6, in agreement with the expression given in the appendix. Two other examples that will be of use in Section 6.2 are that C 1,2 (µ 1 , µ 2 ) is nonzero only for µ 1 + µ 2 ≥ 6 and C 1,3 (µ 1 , µ 2 , µ 3 ) is nonzero at the condition that µ 1 + µ 2 + µ 3 ≥ 8.

Rooted graphs
It is convenient to introduce a root in a ribbon graph in order to remove the nontrivial automorphisms of the graph.

Definition 6.
A rooted graph is an unmarked ribbon graph with a distinguished half-edge, the root of the graph. The vertex incident to the root is called the root vertex.

Remark 3.
A ribbon graph consisting of one vertex and no edges is considered to be a rooted graph.
Definition 7. An isomorphism, or a rooted isomorphism, between two rooted graphs is an isomorphism between the ribbon graphs that maps the root to the root.
An isomorphism of a rooted graph to itself is called a rooted automorphism of the graph. For a given rooted graph, the group of its rooted automorphisms is trivial, see [25]. In [18] the following generalization of the concept of a rooted graph was introduced.
Definition 8. An N -rooted graph is the data of a ribbon graph, Γ = (H, α, σ), with the choice of N distinct ordered vertices, called the root vertices, and the choice of N half-edges, called the root half-edges, or roots, such that each root half-edge is incident to one of the root vertices. We call the kth root the root half-edge incident to the kth root vertex.
In other words, an N -rooted graph is obtained from a ribbon graph by choosing N distinct vertices, labeling them with numbers from 1 to N , and at each of the chosen vertices placing an arrow on one of the half-edges incident to it.
Definition 9. An isomorphism, or an N -rooted isomorphism, between two N -rooted graphs is is an isomorphism between the underlying ribbon graphs that maps kth root to the kth root.
Two isomorphic N -rooted graphs are identified. Similarly, an N -rooted automorphism of an N -rooted graph is an automorphism of the underlying ribbon graph which preserves the set of N root vertices pointwise and maps roots to roots. Clearly, the only N -rooted automorphism of an N -rooted graph is the identity.

Counting N -rooted graphs
We have shown how to obtain the generalized Catalan numbers C g,n from the topological recursion on the harmonic oscillator curve (22). Here we show that one can express the number of N -rooted maps in terms of the C g,n . In the case N = 1 we get the formula for one-rooted maps obtained in [25]. Let µ = (µ 1 , . . . , µ n ) be a partition of an even integer 2e into n strictly positive parts. It is convenient to regroup the parts µ i into groups of equal values, that is we suppose that among the parts of µ there are ρ(µ) distinct values with k i copies of the value α i for i = 1, . . . , ρ(µ). Clearly, for µ = (µ 1 , . . . , µ n ) we have Given e ∈ N, let us denote by m N (e) the number of distinct N -rooted graphs with e edges.
Theorem 2. Let the numbers C g,n (µ 1 , . . . , µ n ) be as defined in Section 4.1, and e, N positive integers. The number m N (e) of N -rooted graphs with e edges is given by where [ 1+e−n 2 ] denotes the integer part of the argument. Note that for a given choice of N, the minimum possible value e may take is N − 1.
Proof. Using notation from Section 4, let Γ v ∈ G g,n (µ 1 , . . . , µ n ) and let Γ be its underlying unmarked graph. There are k 1 ! · · · k ρ(µ) ! ways to mark vertices of Γ so that the resulting marked graph is in G g,n (µ 1 , . . . , µ n ). Among these ways there might be equivalent ones -those giving rise to identical marked graphs. If there is a non-trivial unmarked automorphism φ ∈ Aut(Γ)/Aut v (Γ), which acts non-trivially on the set of vertices, then for every ordering of vertices Γ v there is an equivalent ordering given by φ(Γ v ). Therefore the number of distinct marked graphs Γ v ∈ G g,n (µ 1 , . . . , µ n ) having Γ as the underlying unmarked graph is Let us denote by D Γ g,n (µ 1 , . . . , µ n ) the contribution to the number D g,n (µ 1 , . . . , µ n ) of all the marked graphs whose underlying graph is Γ: g,n (µ 1 , . . . , µ n ) = Γv∈Gg,n(µ 1 ,...,µn) Γ is the underlying unmarked graph for Γv Then we have where the summation is over all distinct unmarked graphs Γ for which there exists a marking Γ v ∈ G g,n (µ 1 , . . . , µ n ) having Γ as the underlying unmarked graph. Using this notation and definition (14) of the number D g,n , we deduce from Eq. (34) Now note that the third sum in the right hand side of (33) can be seen as two nested sums: where the first sum in the right hand side is over all (unordered) partitions µ of 2e and the second sum is taken over the orderings of the n-tuple (µ 1 , µ 2 , . . . , µ n ). Here an ordering is a multiset permutation of the n-tuple (µ 1 , µ 2 , . . . , µ n ), that is a permutation not distinguishing between repeated values. Let us use the following notation: denote by τ an ordering of µ = (µ 1 , µ 2 , . . . , µ n ) and denote the resulting n-tuple by τ (µ) = (µ . Consider for example one partition of 6 given by µ = (µ 1 , µ 2 , µ 3 ) = (1, 1, 4); there are three different orderings of the triple: τ 1 (µ) = (µ 3 ) = (4, 1, 1). Let us now fix N ≤ n and consider the following sum over all orderings of µ τ ∈ orderings of (µ 1 , µ 2 ,...,µn) For the previous example of (µ 1 , µ 2 , µ 3 ) = (1, 1, 4), for which there are three orderings, let us consider the case N = 2. Then the above sum over all orderings would give 1 · 1 + 1 · 4 + 4 · 1 = 9. This expression can be rewritten summing over all permutation of the µ i 's treating the repeated values as distinct. Denoting by S n the symmetric group of permutations, we have τ ∈ orderings of (µ 1 , µ 2 ,...,µn) We can write this sum over all permutation of n values as follows: where the factor (n − N )! comes from the permutations of the remaining (n − N ) values of µ i not entering the product in the numerator. The last sums give the number of ways to choose N ordered roots in the graph Γ disregarding the fact that there might be choices producing equivalent N -rooted graphs. Introducing notation R Γ N for the number of choices of an ordered subset of N half-edges in a given graph Γ, we obtain τ ∈ orderings of (µ 1 , µ 2 ,...,µn) Denote by m Γ N (e) the contribution to the number m N (e) of all the N -rooted graphs whose underlying unrooted unmarked graph is Γ. Every non-trivial automorphism φ ∈ Aut(Γ) allows for identification of N -rooted graphs included in the number R Γ N . Therefore, the contribution of Γ to m N (e) is On the other hand, obtaining |Aut(Γ)| from (35) and R Γ N from (37), we have Summing this over all distinct unmarked graphs Γ for which there exists a marking Γ v ∈ G g,n (µ 1 , . . . , µ n ) having Γ as the underlying unmarked graph, we see that the contribution to m N (e) that comes from a given partition µ of 2e is given by Now, using (15) and summing (38) over all unordered partitions (µ 1 , . . . , µ n ) of 2e with n positive parts, we obtain the contribution to m N (e) of all the graphs of genus g with n vertices. Summing further over all possible values of g and n and determining the summation limits using Eqs. (13) and (31), we obtain the statement of the theorem. 2

Counting Feynman diagrams
We can now state the relation between the N-rooted graphs counted by m N (e) as given in Eq.(33) and Feynman diagrams. Our first result is that, as proven in [18], m N (e) counts the number of many-body Feynman diagrams, or QED diagrams when Furry's theorem is not valid (due to the nature of the ground state) and, in particular, tadpoles are present. However we will show below how Eq.(33) may be trivially modified to remove all tadpole diagrams or to enforce Furry's theorem. The number m N (e) also counts the number of connected Feynman diagrams in the quantum field theory of a two scalar fields, one real and one complex, with for only interaction the cubic term Aφ † φ. It is using this latter quantum field theory that the number of Feynman diagrams was determined using the path integral approach in [18]. In this correspondence, N represents the number of external electron lines and e is the number of internal photons lines (we consider diagrams with no external photon lines). The order in the coupling constant is therefore simply 2e. In the sums of Eq.(33), the index n counts the total number of electrons lines in the Feynman diagram, both internal and external. In the language of Feynman diagrams it is then obvious that, for a fixed number e of photons, the smallest value of n is N (when all electron lines are external lines) and the maximum value of n is e + 1 (which occurs when N − 1 photons connect the external lines together and the remaining e + 1 − N photons are part of tadpoles so that there are e + 1 − N fermion loops). The degrees µ 1 , . . . , µ n specify the number of photon lines connected to each of the fermion lines in the diagram. Since there are no external photon lines, we clearly have n i=1 µ i = 2e, which is twice the number of photon lines and the order in the coupling constant. We must warn against a possible source of confusion here: in the Euler relation, Eq.(13), the number n counts the number of vertices in the ribbon graph, which does not represent the number of vertices in the corresponding Feynman diagram but the number of electron lines. To make this more clear, let us describe how to associate a ribbon graph to a Feynman diagram. To do so, one must draw all photon lines connected to electron loops on the outside of the electron loop. In addition, all photon lines connected to a given external electron line must be drawn on the same side of the electron line. Then the photon lines (but not the electron lines) are thickened to turn them into ribbons and the external electron lines and electron loops are shrunk into small disks which become the vertices of the corresponding ribbon graph. The number of vertices in the ribbon graph is then equal to the number of electron lines in the corresponding Feynman diagram and the number of ribbons connecting the vertices is the number of photon lines in the Feynman diagram. As an example, a three point function Feynman diagram is shown in Figure 3 with its corresponding permutations and the corresponding ribbon graph is shown in Figure 4. Remark 4. The genus g that appears in the coefficients C g,n refers to the genus of the corresponding ribbon graph, which is straightforward to determine. It is however possible to determine the genus directly from the Feynman diagram without closing the external electron lines. The number of faces is equal to the total number of closed paths necessary to cover both sides of all ribbons and all segments of electron lines connecting different ribbons. Note that the segments of the electron lines between the two sides of each ribbon are never covered. Here it is understood that when one exits the Feynman diagram through one extremity of an external electron line, one then re-enters it through the second extremity. Once the number of faces is determined this way, one uses Euler's formula, to obtain the genus where, as already noted, e is the number of photon lines and n is the number of electron lines.
Example 4. Consider the Feynman diagram of Figure 5. The corresponding ribbon graph is shown in Figure 6 with the two paths (one made of a dashed line and the second shown as a continuous line) needed to cover the graph. The number of faces is then two and since e = 4 and n = 2, the genus of the ribbon graph corresponding to this Feynman diagram is equal to one.
Example 5. As a second example, consider the ribbon graph of Figure 4. In that case, three paths are required to cover the graph so there are three faces. There are four vertices so n = 4 and there are seven edges so e = 7, giving a genus g = 1.
Remark 5. Since we are considering diagrams with no external photon lines and N external fermion lines, there are n−N fermion loops and the number of loops due to the photon propagators is e+1−n, if e is the number of photons. We therefore obtain the following result: the total number of loops (in the sense of Feynman diagrams) is given by e + 1 − N . In other words, the number of N -rooted graphs with e edges is equal to the number of Feynman diagrams with e + 1 − N loops. This number is never negative since, for a given N , the smallest possible value of e is N − 1. It is a simple matter to modify the formula (33) to count special types of Feynman diagrams. For example, it is trivial to exclude all diagrams with tadpoles by imposing that all closed electron loops must connect to more than one photon. Recall that in Eq.(33), the first N indices refer to the external electron lines and the remaining indices, from N + 1 to n refer to electron loops. To eliminate all tadpole diagrams, it is therefore only necessary to multiply the right hand side of Eq.(33) by a product of Heaviside functions forcing the degrees of all the electron loops be at least equal to two: where we use the convention H[x] = 1 for x ≥ 0. It is also easy to enforce Furry's theorem. This amounts to imposing that the degrees of all the electron loops be even, which is achieved by simply multiplying Eq.(33) by  Consider the next term in the series, corresponding to two photon lines, e = 2. The formula gives Using Eqs.  which corresponds, for N = 1, to the diagram with one photon connecting the external fermion line to a first fermion loop, and a second photon line going from this first fermion loop to a second fermion loop, which is a tadpole. Clearly the term with C 0,3 (1, 2, 1) leads to the same diagram. Combining these two contributions and using C 0,3 (1, 2, 1) = 2 from Eq.(30), we find which means that there is one such diagram. Consider now the term 1 2 C 0,3 (2, 1, 1) = 1 .
This corresponds to the unique diagram with two tadpoles attached to the external electron line. The term C 0,2 (3, 1) = 3 in m 1 (2) counts the number of Feynman diagrams with one external electron line, one closed fermion loop, three electron-photon vertices on the external line and only one photon attached to the fermion loop. There are clearly three such diagrams corresponding to the tadpole attached before, between, or after the one loop self energy correction to the electron propagator. The term C 1,1 (4) in m 1 (2) corresponds to a Feynman diagram with one electron line, n = 1, one external electron line, N = 1, and two photons (since the number fo photons is equal to half the sum of the degrees) and whose ribbon graph is of genus one. The ribbon graph is shown in Figure 1 and the corresponding Feynman diagram is presented in Figure 7. The ribbon graph has one face, one vertex and two edges, leading to g = 1 according to Eq.(42).
The presence of non trivial automorphisms in Applying Furry's theorem here means discarding the terms with three vertices for which the degree of the third vertex is odd (the first two degrees giving the number of vertices on the two external electron lines). This leaves m 2 (2) (QED) = C 0,2 (1, 3) + C 0,2 (3, 1) + C 0,2 (2, 2) + 1 2 C 0,3 (1, 1, 2) 7 Expressing the WKB expansion in terms of the coefficients C g,n .
We have now seen how applying topological recursion to the harmonic oscillator curve generates the multi-differentials W H g,n which may be used to both construct the WKB expansion of the wave functions and to calculate the coefficients C g,n which we used to count QED Feynman diagrams. The formulas needed to obtain the WKB expansion are given in Eqs. (10) and (12), while the equations necessary to calculate the C g,n are Eqs. (23) and (24). These two calculations imply that it is possible to express the WKB expansion in terms of the coefficients C g,n . For example, consider S 2 (x) = 1 24c 2 where c is the constant that appeared in our elliptic curve and whose square we found to be c 2 = 2. We find it convenient to leave it as a parameter here to show the explicit dependence of S 2 on c. The x independent term in Eq.(49) is inconsequential as it contributes only an overall factor to the wave function. Using Eqs. (10) and (12), one finds with the coefficients C 1,1 and C 0,3 given in Eqs. (25) and (30). This expression requires some explanations. As mentioned previously, the C g,n (µ 1 , . . . , µ n ) are taken to be zero whenever one of the degrees µ i is zero, except for C 0,1 (0) = 1. In the above equation, the C 0,3 are given by the same equation as the C 0,3 , Eq.(30), except that we allow the degrees to be zero. This expression shows explicitly how a coefficient in the WKB expansion of the harmonic oscillator wavefunctions can be expressed in terms of the coefficients C g,n (µ 1 , . . . , µ n ) and we have seen how the same coefficients can be used to count Feynman diagrams in many body physics or in QED.
One can verify that this indeed reproduces the Taylor expansion of W 1,2 given in Eq.(8) after making the change of variable