Two-Loop Scattering Amplitudes from Ambitwistor Strings: from Genus Two to the Nodal Riemann Sphere

We derive from ambitwistor strings new formulae for two-loop scattering amplitudes in supergravity and super-Yang-Mills theory, with any number of particles. We start by constructing a formula for the type II ambitwistor string amplitudes on a genus-two Riemann surface, and then study the localisation of the moduli space integration on a degenerate limit, where the genus-two surface turns into a Riemann sphere with two nodes. This leads to scattering amplitudes in supergravity, expressed in the formalism of the two-loop scattering equations. For super-Yang-Mills theory, we import `half' of the supergravity result, and determine the colour dependence by considering a current algebra on the nodal Riemann sphere, thereby completely specifying the two-loop analogue of the Parke-Taylor factor, including non-planar contributions. We also present in appendices explicit expressions for the Szego kernels and the partition functions for even spin structures, up to the relevant orders in the degeneration parameters, which may be useful for related investigations in conventional superstring theory.


Contents
1 Introduction

Motivation
String theory has provided a variety of crucial insights into quantum field theory, opening the way to remarkable dualities and motivating new principles to constrain effective field theories. Nonetheless, one of the oldest insights, and perhaps the most basic one, remains as powerful as ever: the striking rearrangement of perturbative field theory, seen as the low-energy limit of perturbative string theory. In fact, certain scattering amplitudes in field theory, particularly in the presence of supersymmetry, were first computed with the aid of string theory, as in Ref. [1] and many others. The appeal of this programme is that the string theory worldsheet allows for the use of powerful techniques of two-dimensional conformal field theory, leading to a formalism that is strikingly different from the traditional Feynman diagram expansion of perturbative field theory. The worldsheet provides, for instance, a picture for the scattering of closed strings as the 'double copy' of the scattering of open strings [2]. This leads directly to formulae that relate scattering amplitudes in gravity and in gauge theory, which have been explored to great effect, especially since a diagrammatic version of this double copy was proposed [3,4]. While the lessons from perturbative string theory are very encouraging, there is a clear limitation: string perturbation theory is very challenging beyond the first few orders; see e.g. [5][6][7][8][9][10][11][12]. The computation of loop corrections requires higher-genus string worldsheets, whose mathematical description is highly elaborate and not fully developed. An understanding of this description seems necessary or at least very helpful even if we are only interested in the low-energy field theory limit.
This limitation was recently put into a new, more hopeful perspective with a new understanding that at least certain massless perturbative field theories can be described directly by a string-type theory. The spectrum of such strings coincides with that of the corresponding field theory, and no low-energy limit is required. These are the ambitwistor strings proposed by Mason and Skinner [13]. They are inspired by Witten's seminal model of a twistor string associated to four-dimensional gauge theory [14]. The twistor string leads to beautiful expressions for tree-level scattering amplitudes in gauge theory as residue integrals in the moduli space of a Riemann sphere [15]. These expressions were more recently extended into an elegant formalism to describe tree-level massless scattering in any spacetime dimension, for a variety of theories, by Cachazo, He and Yuan (CHY) [16][17][18][19]. The construction of ambitwistor strings was guided by the requirement of reproducing the CHY formulae [13,20,21].
Given that ambitwistor strings are supposed to directly describe perturbative field theories, an obvious question is what happens at loop level. In conventional string theory, the field theory limit (α → 0) is associated to a degeneration limit of the moduli space; for instance, at one loop the limit is such that α Im(τ ) stays finite, where τ is the torus modulus [1]. Higher-genus mathematical objects, like Jacobi theta functions, give way to much simpler expressions in that limit. How is this to happen for ambitwistor strings, which are already field theories, and possess no α parameter? The answer was given in Refs. [22][23][24], following genus one [25,26] and genus two [27] studies: the residue integral in moduli space localises on a degenerate limit simply via the use of the residue theorem. The resulting worldsheet is a Riemann sphere with nodes (pairs of identified points), through which flow the loop momenta. This provides a new formalism that extends the CHY representation from tree-level amplitudes to loop-level integrands. The type of formula for the loop integrands is naturally interpreted as a forward limit of tree-level amplitudes [23,[28][29][30][31][32][33][34][35], in the spirit of the Feynman tree theorem.
In this paper, we will construct the two-loop formulae obtained from ambitwistor strings for loop integrands in type II supergravity and in super-Yang-Mills theory. The detailed derivation from the genus-two ambitwistor string will put into firm footing some heuristic aspects of our earlier analysis [24], and will extend the four-point formulae presented there to any number of particles. The elaborate technical content of our analysis indicates that the precise approach that we employ here may be too challenging at higher loops. We hope, however, that our results will be sufficient to identify an easier generalisation route directly from the nodal Riemann sphere, possibly along the lines of the 'gluing operator' [34].
Before proceeding with a summary of our main results, we provide here a brief survey of work on ambitwistor strings, for the benefit of the reader unfamiliar with this topic. As we mentioned, they were proposed in [13] as worldsheet chiral conformal field theories reproducing the CHY formulae for tree-level scattering amplitudes [17]. The first examples of ambitwistor strings described the treelevel amplitudes of type II supergravity, super-Yang-Mills theory (in a heterotic-type model) and the bi-adjoint φ 3 scalar theory. Later on, in [20,21], a variety of other models -distinguished by the worldsheet matter content and symmetries -were engineered in order to reproduce CHY formulae for several interesting theories of massless particles [19,36], including Einstein-Yang-Mills, Dirac-Born-Infeld and the non-linear sigma model. Other variations on the models of Mason and Skinner include: a pure spinor version of the supergravity and super-Yang-Mills models [37,38]; a version based on twistor variables for theories in four spacetime dimensions [39], with preliminary work at one loop [40]; a derivation of the anomalies of the type II theory on a curved background [41], leading to the supergravity equations of motion as the consistency condition for the background; studies of the soft behaviour of amplitudes based on the relation of ambitwistor space to null infinity [42][43][44]; an ambitwistor string field theory construction [45]; a class of models adapted to the projective null cone, describing certain conformal field theories [46]; models describing certain higher-derivative theories [47]; and a calculation of the three-point amplitude for scattering on plane wave backgrounds [48]. Along with these studies, there is important work on the precise connection of ambitwistor stringschiral theories with a massless spectrum -to conventional string theory, in particular to the null string [49][50][51][52][53][54][55]. Figure 1: The bi-nodal Riemann sphere, with nodes parametrised by σ 1 ± and σ 2 ± representing the two loops of field theory.

Summary of results
We present here a summary of our final formulae for type II supergravity and super-Yang-Mills theory at two loops. In both cases, the amplitude is expressed as 1 M n = d 10 1 d 10 where σ A ∈ {σ 1 ± , σ 2 ± , σ i } are punctures on the sphere associated to loop momenta insertions (± I for σ I ± ) and the external particles (i = 1, · · · , n). The loop integrand is therefore written as a CHYtype integral, with the integration completely localised on the solutions to the two-loop scattering equations: (1.2c) In the supergravity case, we derive our formula from the genus-two ambitwistor string amplitude, which is based on the genus-two scattering equations involving the period matrix. The crucial ingredient in the derivation is the residue theorem on moduli space. We use it to turn the genus-two formula into a formula on the bi-nodal Riemann sphere; see fig. 1. The latter formula is based on what are more appropriately called the two-loop scattering equations (1.2). The result for supergravity follows from the asymptotics of the (maximal non-separating) degeneration limit leading to the bi-nodal Riemann sphere. We focused on the even spin structures contribution (the full result for kinematics in d < 10), and on NS-NS external states with polarisation tensors µ i˜ ν i , which form a basis for general NS-NS states. The supergravity result is I (2), sugra n = I (2) n ( ) I (2) n (˜ ) 1 In this summary of results, we have chosen to extract the form degree of I (2) n , E A and other objects into the overall d n+4 σ A in eq. (1.1). This is the most common notation in the scattering equations literature. In the body of this paper, however, we keep the form degrees of each object, so the reader should bear this in mind when comparing the expressions here with those in other sections.
where I (2) n is the analogue of the chiral integrand in conventional superstring theory, receiving contributions from all spin structures, I (2) n = I NS n + I R2 n + I R1 n + I RR n . (1.4) The ten even spin structures are naturally grouped into contributions corresponding to states running in the loops: 2 denotes the q a 1 q b 2 coefficient in the Taylor expansion of the pfaffian of M around q 1 = q 2 = 0; the vanishing of the modular parameters q 1 and q 2 is the degeneration limit corresponding to the bi-nodal Riemann sphere. The definition of the matrices M , dependent on the states running in the loop and on the external polarisations, is given in section 6.3. Finally, the cross ratio in eq. (1.3) ensures the absence of certain unphysical poles that are allowed by the two-loop scattering equations. While ref. [24] first pointed out the need for this cross ratio, here we provide a derivation from first-principles based on the degeneration from the genus-two surface. In particular, the introduction of the cross ratio enables the extension of the domain of integration of the remaining genus-two modular parameter q 3 , allowing for the final formula to be expressed as a moduli integral on the bi-nodal Riemann sphere, constrained only by the two-loop scattering equations. Apart from the cross ratio, which is a new feature at two loops, we want to emphasise the similarity of our type II supergravity formula to the tree-level formula of CHY [17], based on the pfaffian of a matrix analogous to our matrices, and to the one-loop formula of ref. [22], which also includes contributions from different spin structures.
The super-Yang-Mills result is closely related to the final supergravity formula. In this case, however, we propose an expression directly on the bi-nodal Riemann sphere, instead of performing a delicate degeneration limit from a genus-two super-Yang-Mills formula (which may not even exist). The colour dependence is determined from a current algebra correlator on the sphere, in the spirit of the heterotic string, and the two nodes are represented by a sum over the colour indices of the corresponding current algebra insertions. The formula for the scattering of gluons with polarisation vectors µ i is I where I (2) n was introduced in eq. (1.4), and the colour dependence is carried by the two-loop 'Parke-Taylor factor', (1) ], T a γ (2) ], T a γ(3) ], · · · ], T a γ(n+2) ]T a 1 − ) δ a 1 + ,a 1 − δ a 2 + ,a 2 − 1 + γ(1) γ(2) γ(3) · · · γ(n + 2) 1 − , (1. 7) where (ijk · · · l) ≡ (σ i − σ j )(σ j − σ k ) · · · (σ l − σ i ). The sum is over permutations of the n + 2 punctures {σ 2 ± , σ i }, i.e., the punctures σ ± 1 are fixed. We denote the set of permutations by S n+2 (and not S n+2 ) because we restrict the permutations to satisfy the following ordering of the nodal punctures: (1 + · · · 2 + · · · 2 − · · · 1 − ); there are therefore (n + 2)!/2 valid permutations. This restriction plays a role analogous to that of the cross ratio in eq. (1.3): it ensures the absence of unphysical poles. As in the supergravity case, our super-Yang-Mills formula is strongly reminiscent of the tree-level formula of CHY [17] and the one-loop formula of ref. [22].
The detailed definition of the ingredients in eq. (1.4) leading to I (2) n as described in this paper makes use of two extra marked points, x 1 and x 2 , which are not part of the CHY-type integration in (1.1). These are associated with a gauge choice, the location of the supersymmetry picture-changing operators at genus two, analogous to conventional superstring theory. We prove that our formulae do not depend on this gauge choice, but leave for future work the possibility of simplifying the formulae with a smart choice of these physically irrelevant marked points. In this paper, we merely check how this simplification occurs in practice for the four-point formula.
The expressions given here describe type II supergravity and super-Yang-Mills theory in d = 10 (except for odd spin structures, which we did not consider). Formulae for theories in fewer spacetime dimensions are obtained via dimensional reduction as usual. In the case of reduction on a 6-torus, the corresponding four-dimensional theories are N = 8 supergravity and N = 4 super-Yang-Mills theory. While all four-dimensional supergravities are expected to be ultraviolet divergent in perturbation theory, and therefore do not possess an S-matrix, one can still define a loop integrand at any loop order. Indeed, this has been the subject of intense work that aims to study in detail the ultraviolet properties; see [56] for recent results in N = 8 supergravity. Our ten-dimensional 'amplitudes' are understood in this context -the result is the loop integrand itself.

Outline of paper
The paper is organised as follows. In section 2, we review the type II ambitwistor string, its relation to the tree-level CHY formulae for scattering amplitudes, and the one-loop extension of this story. Section 3 is a brief introduction to Riemann surfaces, with particular emphasis on genus two. We construct the type II ambitwistor string amplitude on a genus-two surface in section 4. In section 5, we discuss in detail the localisation of the genus-two amplitude on a degenerate limit of the moduli space, via the residue theorem. This procedure leads to an expression for the type II amplitude on a bi-nodal Riemann sphere, which we develop in full detail in section 6. Section 7 presents the analogous formula on the bi-nodal Riemann sphere for super-Yang-Mills amplitudes. We conclude in section 8 with a discussion of future directions.

Type II ambitwistor string
The action of the type II ambitwistor string can be written as The fields take values in the following line bundles: In CFT language, this means that these worldsheet fields have a single component (hence sections of line bundles) with the following conformal weight: (0, 0) for X, (1, 0) for P , (1/2, 0) for ψ,ψ, (−1, 1) for e,ẽ, and (−1/2, 1) for χ,χ. Moreover, ΠΩ denotes fermionic form-fields. Notice that, in our notation, ∂ = dz∂z, so that each term in the action is a top form on the Riemann surface Σ. The bosonic fields e,ẽ (known as Beltrami differentials) and the fermionic fields χ,χ are Lagrange multipliers enforcing the constraints P 2 = 0 and P · ψ = P ·ψ = 0 that are associated to symmetries of the action. The constraint enforced by e is the vanishing of the chiral stress-energy tensor, generating holomorphic diffeomorphisms, On the other hand,ẽ is associated to the 'ambitwistor gauge transformation', affecting only the bosonic fields, δ α X µ = α η µν P ν , δ α P µ = 0 , δ α e = 0 , δ αẽ =∂α − α∂e + e∂α .
The fermionic symmetries are worldsheet supersymmetries. The transformation associated to χ is and analogously forχ. Ambitwistor space is the space of null geodesics of complexified spacetime, which in this paper is simply complexified Minkowski spacetime. The features of the action (2.1) that effectively lead to a supersymmetrised version of ambitwistor space as the target space are (i) the constraint P 2 = 0, together with the associated 'ambitwistor gauge transformation', which identifies points in the cotangent bundle that lie along the same geodesic, and (ii) the N = 2 supersymmetric extension of the constraint P 2 = 0 and the associated transformations. Notice that there is a crucial difference with respect to the conventional type II string. The 'square' of each supersymmetry transformation is not the transformation generated by the stress-tensor, but the one generated by P 2 ,

BRST quantization
We now proceed to quantise the ambitwistor string, according to the BRST procedure. We follow closely the presentation in [25,34]. We start by introducing two bc and two βγ ghost systems for the gauge symmetries, In CFT language, the conformal weights for the fermionic ghosts are (2, 0) for b,b, and (−1, 0) for c,c, while for the bosonic ghosts we have (3/2, 0) for β,β, and (−1/2, 0) for γ,γ.
For worldsheet gravity, we proceed in a similar manner as in string theory: we simply set e = 0 and integrate over the moduli space of the Riemann surface. Moreover, the ghosts bc play the usual role in vertex operators. Whileẽ is not the complex conjugate of e, the gauge fixing of both e andẽ still leads to a measure on moduli space, albeit one that completely localises the integration, as we shall see in a moment.
After setting e = 0, the symmetry transformations associated toẽ and χ,χ vary these fields only within a fixed Dolbeault (∂) cohomology class. Since these cohomology classes are finite dimensional, the functional integrations over these fields are effectively reduced to finite-dimensional integrals after gauge fixing (apart from the ghosts). In anticipation of the inclusion of vertex operators, we consider the cohomology classes of a Riemann surface with n maked points {z i } at which the gauge transformations are required to vanish. Now, sinceẽ ∈ Ω 0,1 Σ, T Σ , it is∂-closed. Its cohomology class is denoted as H 0,1 Σ, T Σ (−z 1 ... − z n ) and has dimension n + 3g − 3, so we can span it with a basis of Beltrami differentials {µ r }, with r = 1, . . . , n + 3g − 3. Similarly, the cohomology class for χ orχ is H 0,1 Σ, T 1/2 Σ (−z 1 ... − z n ) and has dimension n + 2g − 2, so we can span it with a basis {χ α }, with α = 1, . . . , n + 2g − 2. Gauge fixing the∂-exact part of the fields to zero corresponds to adding a gauge-fixing term to the action of the form where s r are bosonic parameters and ζ α ,ζ α are fermionic parameters. The gauge-fixing procedure introduces finite-dimensional integrations over the s r and the ζ α ,ζ α , as well as over the fermionic parameters q r = Q • s r and the bosonic parameters = Q • ζ α ,˜ = Q •ζ α . Moreover, it introduces functional integrations over the Nakanishi-Lautrup fields H = Q •b and G = Q • β,G = Q •β. All these parameters and fields arise from the gauge-fixing term (2.7). 2 Let us consider the parts of the path integral associated withẽ. The important terms in the complete action are Integrating outẽ field fixes H = P 2 /2. The integrations over s r and q r then lead to the insertions of picture changing operators (PCOs) The role of the insertions of Σ µ rb is similar to that in conventional string theory. In particular, they (i) absorb thec ghosts in vertex operators, for µ r chosen to extract the residue at a marked point y r , giving yrb , and (ii) at higher genus, saturate the zero-modes integration, for µ r chosen to extract the value of the field at a point, givingb(y r ). The delta functions, for which the definition is 2πiδ(z) =∂(1/z), are the novel feature of ambitwistor strings. They impose the constraint P 2 = 0, which, as we shall see later, fully localises the measure on the Riemann surface moduli space and leads to the scattering equations. A comment is in order regarding the asymmetry of gauge fixing between e andẽ. The role played by the Beltrami differentials that span the deformation of the complex structure e, which we will callμ r , is to provide the conventional measure on (the chiral bosonic) moduli space of the Riemann surface. Therefore, the insertions of Σμ r b differ from those of Σ µ rb beyond the change of chirality, and this affects the measure of the path integral, as we shall discuss in section 4.1.
The parts of the path integral associated with χ andχ are treated in a similar manner to that in type II string theory. In particular, they lead to the insertions of PCOs, We are left with the following OPEs: 13) and similarly for 'tilded' fields. In the remainder of this paper, we will be typically drop the differential symbols, where it should be obvious how these should be reinstated to provide for expressions of the appropriate weight. The central charge is computed in a similar manner as in conventional type II string theory, giving 3(d − 10). This is twice the result in the conventional string, because it is effectively the sum of its chiral and anti-chiral central charges. The critical dimension is the same, d = 10. Only in d = 10 is the BRST operator nilpotent: where

Vertex operators
Vertex operators are elements of the BRST cohomology, and in an ambitwistor string these always correspond to massless states. Notice that there is no mass scale, whereas in standard string theory this is provided by the inverse string length. In the case of the type II ambitwistor string, the states (and their interactions) are those of type II supergravity. Before we proceed, let us point out that, since all the fields are left-moving, there are more options in the GSO projection [47]. We are only considering here the GSO projection analogous to that in type II string theory, where the projection is applied independently to left-moving and right-moving states; the analogue states in our case are left-moving 'untilded' and 'tilded' states. A basis for fixed vertex operators can be built from elements where U andŨ take the forms familiar from conventional string theory for the Neveu-Schwarz (NS) sector and the Ramond (R) sector. In contrast to standard string theory however, all the operators are left-moving in the ambitwistor case. We will only consider here the scattering of NS-NS external states, so that General NS-NS polarisation tensors can be obtained from linear combinations of these µ˜ ν states. Along with the massless condition, k 2 = 0, BRST closure requires that · k =˜ · k = 0. For the Ramond sector vertex operators, see e.g. [25,34]. Of course, even though we will only consider NS-NS external states, all states run in the loops. Indeed, the Ramond vertex operators would be crucial if we tried to reproduce the results of the present paper using a gluing operator, as was accomplished in [34] at one loop. The effect of the supersymmetry-related PCOs (2.11) is familiar from superstring theory. For marked points x α coinciding with fixed vertex operator locations z i , we get On the other hand, for the PCOs (2.10), there is a crucial difference with respect to string theory. Let us use the notation for the standard Serre duality pairing. If a Beltrami differential µ r is such that it extracts a residue at a marked point y r , and if we take this point to coincide with the vertex operator locations z i , we get, taking into account also the gauge fixing related to e, and the integrated vertex operator is

Scattering equations and CHY formulae
We discussed above how the constraint P 2 = 0 is imposed in terms of PCOs after gauge fixing. There are n + 3g − 3 of such PCOs, and this is precisely the dimension of the moduli space M g,n of the genus-g Riemann surface with n marked points. Therefore, the integration over M g,n is fully localised at a set of critical points in moduli space. The problem of finding the complete critical set has only been addressed at genus zero, and this is an important motivation for turning the problem for M g,n into one for M 0,n+2g , as we will achieve in this paper for g = 2.
In this section, let us consider the case of the Riemann sphere for illustration. The n−3 moduli are associated to the locations {z i } of the n−3 integrated vertex operators, and the basis {µ r } is naturally chosen so as to extract the residues of P 2 at those points, as in (2.17). The important observation is that P µ is determined, up to zero modes, by integrating out X µ in the path integral. Suppose we have n vertex operators, each depending on X µ only through the plane wave factor e ikiX(zi) . Then we can integrate out the P X system exactly. For the zero mode of X µ , we get a delta function imposing momentum conservation, i k i = 0, as in string theory. For the non-zero modes of X µ , we get a delta functional imposing the constraint∂ (2.18) It says that P µ is a meromorphic differential with simple poles at z = z i with residues k i . This constraint holds at any genus, but only at genus zero does it fully determine P µ due to the absence of zero modes (solutions to the homogeneous equation). We get 3 Since k 2 i = 0, it is clear that P 2 is a meromorphic quadratic differential with only simple poles at σ = σ i . Then the statement that P 2 = 0 on the sphere is equivalent to the statement that Res σi P 2 = 0, ∀σ i . These residues give the scattering equations, There are only n − 3 linearly independent equations, due to the 3 identities i E i σ q i = 0 for q = 0, 1, 2. This is consistent with the fact that {σ i } is only meaningful up to SL(2, C) coordinate transformations on the sphere. Up to these SL(2, C) transformations, the scattering equations determine (n − 3)! solutions. These are the critical points at which the integration over M 0,n in the ambitwistor string amplitude is fully localised. The direct way of evaluating the amplitude is to sum over the contributions from each solution {σ sol i } to the scattering equations, where, after the first equality, the delta functions factor is independent of the chosen n − 3 linearly independent equations, and, after the second equality, 1/J represents a factor coming from the measure. This is precisely the CHY representation of the amplitude, which motivated the construction of the ambitwistor string. For the type II ambitwistor string, the result is the CHY formula for a gravity amplitude, presented in [17], where all details can be found. At tree level, i.e., on the Riemann sphere, the amplitude for NS-NS external states is the same in type II supergravity and in the bosonic Einstein-dilaton-B-field gravity (or NS-NS gravity). In fact, if for the external states we take linear combinations of basis states µ˜ ν corresponding to gravitons, then the amplitude is the same as in pure Einstein gravity. For the factorisable external states µ˜ ν , the CHY integrand factorises, I NS-NS = I( i ) I(˜ i ). The object I, dependent on the momenta k i and polarisations i of the external states, as well as on the marked points σ i , has a beautiful expression in terms of the Pfaffian of a matrix, and we will construct its two-loop analogue later on.
The formula for I NS-NS exhibits a double copy relation between gravity and gauge theory, since an amplitude in Yang-Mills theory has the same building block I( i ) in its CHY integrand: where the a i are the Lie algebra indices of the external gluons.
Finally, notice that the CHY formula (2.21) turns out to be valid in any number of dimensions, even though the type II ambitwistor string is only critical in d = 10 dimensions, since this is the only dimension where the BRST operator is nilpotent.

One loop: from the torus to the nodal Riemann sphere
The scattering equations on a genus-one Riemann surface (torus) were first discussed in [25]. The main difference with respect to the genus-zero case discussed above is that the PCOs imposing P 2 = 0 cannot all be chosen to extract the residue at a marked point. While there are n PCOs for n vertex operator marked points, only n − 1 of the latter are associated to the moduli space M 1,n , due to translation invariance (analogous to SL(2, C) on the sphere). Therefore, only n − 1 of the PCOs can be of the type (2.17). The remaining PCO may be chosen to set P 2 (z 0 ) = 0 for a point z 0 not coincident with the other marked points. We get an amplitude of the form Res zi P 2 I (1) , (2.22) where we chose to deal with translation invariance by fixing z 1 (due to linear dependence, the residue of P 2 at z 1 vanishes if the residues at z i>1 vanish). The relation of this formula to (2.21) is clear, but there are new features. One is that the integration over M 1,n includes an integration over the modular parameter τ of the torus, and the new scattering equation, P (z 0 ) 2 = 0, may be thought of as being associated to this modulus, in the same way as the others are associated to the vertex operator locations. The other new feature is the integration over the zero mode of P µ , which is required in the path integral by the fact that, on the torus, P µ is determined by the equation (2.18) only up to a zero mode µ dz, with µ constant.
The new type of constraint, P (z 0 ) 2 = 0, can be expressed in an alternative way, as was also pointed out in [25]. This will be more useful for us at genus two. After imposing the scattering equations of type Res zi P 2 = 0, we are left with a holomorphic P 2 , i.e., it has no poles. The only possibility is that P 2 = u dz 2 , and one can show that u → 2 as τ → i∞. Defining u in this manner, we can substitute the insertionδ P (z 0 ) 2 in (2.22) by the insertionδ(u dz 2 ). At higher genus, the same argument can be used to write P 2 = u IJ ω I ω J in terms of holomorphic differentials ω I , after imposing the residue-type scattering equations.
Ref. [25] determined the type II supergravity integrand I . This is reminiscent of the tree-level result, but now I (1) ( i ) is not related to a single Pfaffian, but to a linear combination of these, since there are contributions from the four spin structures of the torus. We will briefly discuss the spin structures of Riemann surfaces below. Moreover, ref. [25] also checked the modular invariance of the amplitude, i.e., the invariance under the identifications τ ∼ τ + 1 ∼ −1/τ , where the inversion identification requires µ → τ µ .   While the formula (2.22) satisfies all tests, its evaluation is very hard due to the appearance of Jacobi theta functions in the genus-one scattering equations. Ref. [22] provided a major simplification, by noticing that the integration over τ , which is part of the integration over M 1,n , can be localised at τ = i∞, or equivalently at q = 0 for q = e 2πiτ . This is accomplished via an integration by parts, moving the derivative∂ 1/P (z 0 ) 2 away from this constraint. Equivalently, it can be seen as an application of the residue theorem to the fundamental domain of τ , and it relies on the modular invariance of the original genus-one amplitude. The localisation gives a degenerate torus, equivalent to a Riemann sphere with a pair of identified points called a node; see figure 2 and 3 for illustration. Changing to coordinates σ more appropriate to describe a sphere, the final result is with the two extra marked points representing loop momentum insertions.
In the limit q → 0, we have After applying the residue theorem, the original constraint P (z 0 ) 2 = 0 is no longer enforced, and therefore P 2 does not vanish on the nodal sphere. Indeed, P 2 has double poles at σ + and σ − , and therefore the quadratic differential of interest with only simple poles is P 1 = P 2 − 2 ω 2 . Using this differential, the one-loop scattering equations can be written compactly as Res σ A P 1 = 0, ∀σ A . The end result is a CHY-type formula of the loop integrand. In this formula, we can actually take the loop momentum to lie in d dimensions, whereas on the torus d = 10 was essential for modular invariance. The type II supergravity formula on the nodal sphere takes the form I 0 (˜ i ). While no ambitwistor string model for super-Yang-Mills theory has been studied on the torus, ref. [22] took the one-loop formula (2.23) in the same spirit as the CHY approach, and proposed a formula for super-Yang-Mills theory based on the principle of the double copy. With a suitable one-loop generalisation of the colour part, it takes the form I 0 SYM = I (1) 0 ( i ) I PT(1) (a i ). Ref. [23] extended these formulae to the cases of non-supersymmetric Yang-Mills theory and gravity.
In this paper, we shall follow the same steps, now from genus two to the bi-nodal Riemann sphere. We leave the non-supersymmetric extension for a future publication.
To conclude, let us also mention work on an alternative approach to the loop-level scattering equations, based on the (hyper)elliptic parametrisation of the Riemann surfaces [58][59][60][61][62].

The toolkit at genus two
In this section, we review the main tools used to study conformal field theories on higher-genus Riemann surfaces: the Green's functions and partition functions for chiral bc and βγ systems of any conformal weight. To this end, we discuss basic objects of the theory of (compact) Riemann surfaces, with particular attention to the genus-two case. This lays the basis for the review of Szegő kernels and the Verlinde formulas for the partition function. We refer the reader to Fay's classic reference [63] and to the string theory references [5,6,64] for detailed expositions.

The basics
For a genus-g Riemann surface, we choose a homology basis of cycles A I and B I , I = 1, . . . , g, such that the intersection form is canonical, #(A I , B J ) = δ IJ = −#(B J , A I ); see figure 4 for g = 2. The is a discrete group that acts on the homology basis as M B A , leaving the intersection form invariant. There are g linearly independent holomorphic 1-forms ω I on a genus-g Riemann surface. These are known as holomorphic Abelian differentials or as Abelian differentials of the first kind. They can be chosen to have normalised A-periods, 4 The matrix Ω IJ defined in this manner can be proven to be symmetric, and it is known as the period matrix. Under a modular transformation (3.1), the period matrix transforms as At genus two, Ω has 3 independent components, and we will find it convenient to define the variables q 11 = e iπ Ω11 , q 22 = e iπ Ω22 , q 12 = e 2iπ Ω12 .

(3.4)
A standard choice of fundamental domain representing the genus-two moduli space is defined by the following conditions: Later on, we will study in detail a singular limit of the moduli space, where both q 11 and q 22 vanish. This corresponds to a non-separating degeneration of the surface, with the pinching of both A I cycles, leading to a genus-zero degenerate surface. This surface is a Riemann sphere with two nodes (pairs of identified points), one per collapsed A I cycle.
The g holomorphic Abelian differentials ω I also define the Abel map, given a base point z 0 on the Riemann surface. For a divisor 5 d 1 z 1 + d 2 z 2 + . . . + d m z m of degree d 1 + d 2 + . . . + d m , the Abel map takes the form (3.6) In particular, z 1 − z 2 → z1 z2 ω I . The integration is over any curve connecting the initial and final points, and so the map is naturally thought of modulo the integration over cycles A I and B I , otherwise it is multiple valued. Given the periods of ω I in (3.2), the Abel map can be seen as a single-valued map from a point or a divisor on the Riemann surface Σ into the Jacobian variety, defined as J(Σ) ≡ C g /{Z g + ΩZ g }. 4 For any Riemann surface given by a hyperelliptic curve, y 2 = 2g−2 a=1 (x−xa), a (non-normalised) basis of holomorphic Abelian differentials is given by x I−1 dx/y, with I = 1, . . . , g. All genus-two Riemann surfaces are hyperelliptic, but this is not true at higher genus. 5 A divisor is mainly used to represent zeros or singularities of meromorphic functions or differentials. In particular, d 1 z 1 + d 2 z 2 + . . . + dmzm denotes behaviour of order (z − zr) dr at the points zr of the surface.

Jacobi theta functions and spin structures
The Jacobi theta functions are defined on ζ ∈ C g as where Ω is the period matrix and κ = (κ |κ ) denotes the theta characteristic, with κ , κ ∈ C g . We are interested in characteristics corresponding to spin structures, i.e., such that κ , κ ∈ (Z/2Z) g ; we will be more explicit below. The parity property of theta functions, agrees with the designation of spin structures as even/odd according to whether 4κ · κ is even/odd. The argument ζ ∈ C g of interest for the theta functions is typically related to a point or a divisor of the Riemann surface Σ via the Abel map, defined above. Throughout the paper, we will often denote the argument directly as a divisor, with the Abel map implicit. The theta functions are quasi-periodic on the lattice {Z g + ΩZ g }. For M, N ∈ Z g , we have Since the exponential factor is nowhere vanishing, the divisor of a theta function is well defined on the Jacobian J(Σ). An important result in the theory of theta functions is the Riemann vanishing theorem. Let us denote ϑ(ζ) = ϑ[0](ζ). The theorem states that (3.10) for some g − 1 points z r on Σ. The divisor −z 1 − z 2 · · · − z g−1 maps to C g via the Abel map, while ∆ ∈ C g is the Riemann vector of constants, which is defined as Before proceeding, let us return to the spin structures. There exist 4 g spin structures at genus g, of which 2 g−1 (2 g + 1) are even and 2 g−1 (2 g − 1) are odd. They label the choice of periodic/anti-periodic boundary conditions of a 1/2-form (world-sheet spinor) on the A I and B I cycles. At genus two, there are 16 spin structures. We write them here explicitly for illustration, in the form κ = (κ |κ ), using the conventions of [10]: the 10 even spin structures, for which we reserve the label δ, 12) and the 6 odd spin structures, for which we reserve the label ν, For the various relations between even and odd spin structures, see [10]. The ambitwistor string path integral contains, just as its standard superstring counterpart, a sum over spin structures of worldsheet spinors. Certain combinations of the spin structures correspond to states propagating along each B I cycle: Neveu-Schwarz (NS) states for κ I = 0 and Rammond (R) states for κ I = 1. The following table shows which spin structures contribute to the four types of states (NS/R along cycles B 1 /B 2 ): δ 5 , δ 6 , ν 1 , ν 3 δ 9 , δ 0 , ν 5 , ν 6 (3.14) This splitting of the sum over spin structures will allow us to select the propagating states and potentially to consider theories with or without sypersymmetry. In the limit that will be important to us later, where both q 11 and q 22 vanish, it is straightforward to extract the first few orders in q 11 and q 22 of the genus-two theta functions, which will be relevant for our calculations,

Prime form, Szegő kernels and meromorphic differentials
We are now in a position to define several types of differentials on a Riemann surface that will be useful. Let us first define the prime form. Consider an odd spin structure ν. The 1-form g I=1 ∂ I ϑ[ν](0) ω I is holomorphic, its 2g − 2 zeros are quadratic, and its square root defines (up to an overall sign) a holomorphic 1/2-form h ν . The prime form is defined as It is a holomorphic (−1/2)-form in both z and w, with a unique simple zero at z = w, The prime form is independent of the choice of odd spin structure ν used for its definition. We recall that the Abel map is implicit in the argument of the theta function, z − w → z w ω I . For each even spin structure δ, the Szegő kernel is defined as .
It is a (1/2)-form in both z and w, with a simple pole at z = w, and it is holomorphic elsewhere. The Szegő kernel plays the role of fermionic Green's function for a bc-system with weight 1/2 and even spin structure δ, and thus arises in the correlation functions of the world-sheet spinor fields ψ andψ of the ambitwistor string. In particular, The prime form is single valued when z goes around an A I -cycle, but it has non-trivial monodromy around a B I -cycle, (3.21) It can, however, be used to define single-valued differentials of interest. 6 There is a normalised Abelian differential of the second kind defined by In this case, it is actually a 1-form in both z and w, with a double pole at z = w, and it is holomorphic elsewhere. Its A-periods vanish and its B-periods are 2πi ω I (w) for z around B I , where ω I are the holomorphic (i.e., first-kind) Abelian differentials from (3.2). The prime form also defines a class of normalised Abelian differentials of the third kind as This is a 1-form with a pair of simple poles with ±1 residues, and it is holomorphic elsewhere. Again, its A-periods vanish. Suppose that we want to solve the following equation for a differential p = p(z)dz, for some constants q i satisfying i q i = 0 . We recall that 2πiδ(z) =∂(1/z) . We can re-express the equation as∂ where z * is an arbitrary point. So p is a meromorphic differential with simple poles at z i of residue q i , and with no pole at z * due to i q i = 0 . On a genus-g Riemann surface, the general solution can be written as where the c I are the g constants of integration of the homogeneous equation, each associated to an Abelian differential of the first kind, and the ω i, * are Abelian differentials of the third kind, with residue 1 at z i and residue −1 at z * . We will later on make use of this result, with the ambitwistor worldsheet field P µ playing the role of p, and with the external momenta k iµ playing the role of the charges q i .

Zero modes and partition functions of chiral bc and βγ systems
Using the holomorphic Abelian differentials, the theta functions and the prime form, it is possible to construct a prominent class of objects relevant to the study of conformal field theories on Riemann surfaces, namely the partition functions of chiral fermionic bc or bosonic βγ systems. The number of zero modes of∂ λ , i.e., the operator∂ acting on a worldsheet field of integer or half-integer weight λ, is given by, for g ≥ 2, for λ < 0 or λ = 1/2 with even spin structure, 1 for λ = 0 or λ = 1/2 with odd spin structure, g for λ = 1, (2λ − 1)(g − 1) for λ ≥ 3/2. The cases with λ ∈ {0, 1/2, 1} actually apply at any genus. For λ = 0, the zero mode is the constant function. For λ = 1, the g zero modes correspond to the Abelian holomorphic differentials. For even (odd) spin structures, there is no (one) zero mode of∂ 1/2 , the worldsheet Dirac operator.
Consider a system with weights λ for b (or β) and 1 − λ for c (or γ), and denote Q = 2λ − 1. The partition function is defined such that the zero modes are saturated. For instance, for a bc system with λ > 1, the partition function is the determinant of∂ acting on c, 7 where the prime in det denotes the saturation of zero modes, without which the path integral would vanish; the saturation is produced by the Q(g − 1) insertions of b, which absorb the zero modes.
The partition function therefore depends on the z i . The manner in which the various ingredients of the amplitude will appear, among them the partition functions of several chiral systems, leads to the cancellation of all dependences of this type. In the case λ = 1/2, which is relevant for the Ψ µ and Ψ µ systems of the ambitwistor string, the partition function is (det∂ 1/2;[κ] ) 1/2 , where κ denotes the spin structure. For a βγ system with λ ≥ 3/2, the partition function is (det∂ 1−λ ) −1 . Each of these determinants is 'primed' whenever zero modes require care, for either of the conjugate fields.
With the help of bosonisation, Ref. [64] computed the determinant of det∂ 1−λ in all these cases. 8 Here, we just quote the results. For λ = 1, and specifying the spin structure (only relevant for half-integer λ), where σ is a g/2-form defined by the ratio Notice that, in our notation, the partition function is a differential form, whereas in some works, such as [64], only the determinant is defined as the differential form. 8 See also Ref. [65] for an alternative approach.
which is independent of the points r I . It follows from the Riemann vanishing theorem that σ has neither zeroes nor poles. In the special case λ = 1, relevant for the P X system of the ambitwistor string, the partition function is given by (det ∂ 0 ) −1 = Z −1 .

Deligne-Mumford compactification and non-separating degenerations
Later on, we will see that the full two-loop amplitude localises on a singular boundary of the moduli space, where both q 11 and q 22 vanish. This boundary divisor describes a non-separating degeneration of the surface where both A I -cycles collapse to a point. The resulting surface is a Riemann sphere with a node (pair of identified points) corresponding to the each pinched A I -cycle.
To this end, we review briefly the Deligne-Mumford compactification of the moduli space of Riemann surfaces, with special focus on the non-separating degenerations. More details can be found in the original papers [63,66].  A lightning review of the Deligne-Mumford compactification. The moduli space M g,n of Riemann surfaces with punctures is not compact because nodal surfaces arising from the contraction of a homology cycle are not included. The Deligne-Mumford compactification M g,n of the moduli space [66] is obtained by adding these nodal curves as "divisors at infinity" [57]. These divisors correspond to the possible degenerations of the Riemann surface Σ, and are characterised by whether the contracted homology cycle is trivial over M g,0 or not. In the former case, they are known as separating degenerations D sep g,n , and they split Σ into two components while partitioning the punctures accordingly. The nodal singularity adds an additional puncture on each surface, so that where g = g 1 + g 2 and n = n 1 + n 2 ; see figure 5b for illustration. Non-separating degenerations, on the other hand, give rise to a surface of lower genus g − 1, while adding two (identified) punctures corresponding to the node, as illustrated in figure 5a .This behaviour of the moduli space plays a crucial role in worldsheet theories, where it corresponds to a factorisation behaviour similar to the cut of a Feynman diagram; see e.g. [57] for a recent review in the context of superstring theory. For the ambitwistor string, we are most interested in the maximal non-separating divisor D max g,n , defined as the divisor degenerating g non-trivial homology cycles, as in fig. 6. In the second part of this article, we prove that the two-loop supergravity amplitude localises on this boundary divisor, and can thus be formulated over a bi-nodal Riemann sphere. Figure 6: The maximal non-separating degeneration D max 2,n at genus two, corresponding to a bi-nodal Riemann sphere.
The non-separating degeneration.
We now discuss the non-separating degeneration of a Riemann surface in terms of its holomorphic differentials and its period matrix.
Consider the non-separating degeneration of the A g -cycle, and denote the corresponding modular parameter by q gg = exp(iπΩ gg ). At the boundary divisor, the cycle A g shrinks to a single point and forms a node, whose locations we denote by z g + and z g − . Due to the relation (3.2) between the normalised holomorphic differentials and the period matrix, the parameter q gg must tend to zero, and we can thus give the asymptotics of both the holomorphic differentials ω I and the period matrix Ω IJ as a series expansion in q gg . In particular, the holomorphic differentials ω I<g approach the basis of holomorphic differentials ω (g−1) I on the lower-genus Riemann surface, while ω g turns into the normalised (on the lower-genus surface) Abelian differential of the third kind with simple poles at the node, ω g + ,g − . The precise asymptotics are given by Fay's degeneration formula [63], Here, ω g is a meromorphic differential with poles of order three at z g + and z g + , and v g + , v g − are differentials of the second kind with a double pole at the nodal points z g + and z g − , respectively; see [5,63] for details. 9 For the period matrix, the asymptotics read Just as the holomorphic differentials, the period matrix thus descends to the lower-genus Riemann surface, while the entries Ω Ig and Ω gI encode the Abel map image of the node divisor. When studying non-separating degenerations, it is often convenient to choose a parametrisation of the period matrix adapted to the problem. This will be especially important in the ambitwistor string, where non-separating boundary divisors associated to the pinching of different A-cycles contribute. We will thus frequently make use of the following parametrisation: This parametrisation has the advantage of isolating the contribution from each non-separating boundary divisor. In particular, the limits τ 1 → i∞ or τ 2 → i∞ directly correspond, respectively, to the pinching of the A 1 or A 2 -cycle in figure 4. Moreover, pinching the cycle A 1 + A 2 implies that τ 3 → i∞, as can be seen from a modular transformation exchanging the roles of τ 3 and τ 2 . In the original representation (3.4) of the period matrix, the latter degeneration requires an additional blow-up procedure to resolve τ 1,2 remaining finite. In analogy with eq. (3.4), we may further define The benefit of this parametrisation of the moduli is that it neatly identifies the non-separating boundary divisors as q r = 0.

The genus-two type II amplitude
With the tools introduced in the last section at hand, we can now return to the type II ambitwistor string. Picking up where we left off in section 2, we calculate the n-point correlator on a genus two Riemann surface. The calculation closely mirrors the analogous procedure in the RNS superstring [7][8][9][10][11][12], and leads to modular invariant expressions for the amplitude; which we prove in section 4.7. This close similarity may come as a surprise, given the conceptual differences: the ambitwistor string is inherently chiral 10 and formulated over a bosonic -not supersymmetric -Riemann surface. We will see the details of how this plays out throughout this section, both in general and for the simplest non-trivial example, the four-point amplitude.
In addition to modular invariance, another feature familiar from the one-loop amplitude persists at genus two: the localisation of the moduli integral 11 on the scattering equations. As we will see throughout the next few sections, these two properties -modular invariance and localisation on the scattering equations -jointly localise the amplitude on the non-separating boundary divisor through the use of a residue theorem. The resulting formulation on a (bi-)nodal Riemann sphere will be the focus of section 5 and section 6. 9 The differentials v g ± are such that v g ± (z) = 1 4 ω(z, z g ± )/dz g ± , with ω(z, w) given in (3.22). Fortunately, we will not need the precise form of the subleading terms in (3.37) in this paper. 10 So no analogue of the chiral splitting procedure [8,67] of the RNS superstring is necessary. 11 Excluding the Pµ zero modes, whose integration corresponds to the loop integration.
For simplicity, we will restrict ourselves to type II amplitudes with NS-NS external states, i.e., external states corresponding to linear superpositions of graviton, dilaton and B-field. Moreover, we will consider only the contribution from the 10 even spin structures. The 6 odd spin structures do not contribute to the four-point amplitude, which we will analyse in detail, or to any n-point amplitude where the kinematics is restricted such that it spans only 9 or fewer spacetime dimensions. This is because an odd spin structure contains one zero mode of ψ µ and one zero mode ofψ µ (for each µ), as discussed in (3.29). The fermionic integration over these two sets of 10 zero modes leads to two 10-dimensional Levi-Civita symbols whose indices must be contracted to external polarisations, external momenta or loop momenta, due to the structure of the correlator (see [25] at genus one). If the latter quantities only span 9 or fewer dimensions, then the contribution of the odd structures to the amplitude vanishes. The restriction of the kinematics is relevant to study four-dimensional N = 8 supergravity and other supergravities obtained by dimensional reduction; likewise for the study of four-dimensional N = 4 super-Yang-Mills, from the super-Yang-Mills expressions to be constructed later. The contributions from odd spin structures will obviously also satisfy modular invariance and localisation on the scattering equations.

The correlator
The main object of this section is the n-point genus-two correlator of the ambitwistor string. Formally, this correlator is where the O i are vertex operators representing external particles. The proper BRST definition of the correlator was discussed in section 2, and the result is where the integrated vertex operators are given by In the following, we will focus first on three salient features of this expression: (i) the double sum over spin structures, which incorporates the GSO projection, (ii) the distinct choice of Beltrami differentialŝ µ s and µ r , which arose from the gauge fixing of e andẽ, respectively, and (iii) the scattering equations, both those included in the integrated vertex operators V i , given by (2.17), and the remaining three equations, which together impose P 2 = 0.
GSO projection. As in the conventional RNS superstring, we project onto the correct degrees of freedom using the GSO projection, which amounts to summing over spin structures in the path integral formalism. We implement the GSO projection independently for ψ andψ, and denote the corresponding spin structures by κ andκ, respectively. This fixes the amplitude up to relative phases η κ between spin structures, which are determined by modular invariance and unitarity [68]. 12 We will see later in detail for even spin structures how modular invariance fixes the relative phases.
For simplicity, we will only discuss the contribution from the even spin structures δ to the amplitude. This restriction is possible because modular invariance preserves the distinction between even and odd spin structures, and thus each individual sector of spin structures (even or odd) is modular invariant. 13 Moreover, as discussed above, the odd spin structures do not contribute to amplitudes in dimensions d ≤ 9, or to amplitudes with n ≤ 4 external particles. 14 Choice of beltrami differentials. The amplitude (4.2) can be simplified further by a judicious choice of basis for the genus-two Beltrami differentials and their fermionic counterparts. We recall from our discussion of PCOs in section 2 that 3g − 3 Beltrami differentials, which at genus two we denote as {µ r } 3 r=1 , can be conveniently chosen to evaluate the field they are paired with at points y r not coincident with the particle punctures. The same applies to the fermionic counterparts {χ α } 2 α=1 and {χ α } 2 α=1 at points x α . That is, 15 The full amplitude must of course be independent of the choice of x α and y r , and this will serve as an important check for our final expressions.
Recall also that the choice of Beltrami differentialsμ s associated to the gauge fixing of e was distinct from that for the gauge fixing ofẽ, µ r . In particular, the choice of the three extra Beltrami differentials {μ s } 3 r=1 relates them to the genus-two period matrix, while for {µ r } 3 r=1 we took (4.4). Since we have reviewed the basic facts on holomorphic differentials in the last section, we can explicitly relate the factors μ s b and µ r b in (4.2). This will make the correlator symmetric between the bc and thebc systems. In particular, Here, φ t denotes a basis of holomorphic quadratic differentials, and in the last step we have chosen φ t = ω I ω J in order to simplify the expression. We conclude that 16 (4.6)

The scattering equations
Let us now focus on the scattering equations and the P X-system. The only dependence of the correlator on X is in the kinetic term P ·∂X and in the plane wave factors e iki·X of the vertex operators. Similarly to conventional string theory, the integration over the (constant) zero mode of X leads to a delta function, which imposes the constraint of momentum conservation, The integration over the non-zero modes of X leads to another delta function that localises P to its classical value through∂ As discussed at the end of section 3.3, on a genus-two Riemann surface this is solved by where ω i, * is a meromorphic differential of the third kind with residues ±1 at the point z i and at an arbitrary reference point z * . The residue at z * vanishes from eq. (4.8) due to momentum conservation. We suggestively denote the zero mode parameters of P µ by 1µ and 2µ . If the meromorphic differential ω i, * is normalised (i.e., has vanishing A-periods), then I µ = A I P µ . Naturally, the path integral will involve an integration over 1µ and 2µ . Moreover, the localisation of P introduces a Jacobian factor of (det ∂ 0 ) −10 = Z −10 , as discussed in section 3.4. The constraint P 2 = 0 is imposed in the gauge fixing procedure via n + 3g − 3 delta functions, which are of two types, according to the choice of Beltrami differentials µ r inδ( µ r P 2 ). The first is the type included in the n integrated vertex operators (2.17). In this case, µ i extracts the residue at the puncture z i , for i = 1, · · · , n,δ On the support of these n scattering equations, P 2 is holomorphic, and therefore it can be expressed in terms of the holomorphic differentials ω I as P 2 = u IJ ω I ω J , for some u IJ . In our choice leading to the simplification (4.6), the remaining 3g − 3 = 3 scattering equations are associated to Beltrami differentials that extract the value of the field at a point y r , (4.10) Notice that, in the absence of vertex operators, this implies that u IJ = I · J = 0 for all I, J.
Putting all this together, the amplitude is given by where we have pulled theδ-functions out of the path integral with the understanding that the P X integral has been performed, and has localised P to its classical value (4.8). In the following sections, we will evaluate the remaining correlator.
In principle, the integration over the moduli space of the Riemann surface M 2,n in (4.11) is completely localised on the solutions to the genus-two scattering equations, Res zi P 2 = 0 , i = 1 · · · , n , u IJ = 0 , I, J = 1, 2 . In practice, it seems hopeless to solve these equations explicitly. The formula for the genus-two n-point amplitude studied in this section seems, therefore, impractical. We will see in later sections, however, how it can be turned into a much more manageable formula on the Riemann sphere. In the meantime, we will describe several simplifications of (4.11) at genus two.

The moduli space of the ambitwistor string at genus two
As seen in the correlator (4.11), the complete moduli space of the ambitwistor string not only includes the moduli space of marked Riemann surfaces M g,n , but also the moduli corresponding to the zero modes of the field P µ ∈ Ω 0 (Σ, K Σ ). At genus two, the latter consist of 1 µ and 2 µ , as in (4.8), which are both integrated over the full ten-dimensional momentum space. Clearly, this should be interpreted as the loop momenta integration, but there are two important subtleties, which we discuss now.
The first subtlety is related to the contour of integration. For it to correspond to a field-theorylike loop integration, the contour should be a middle-dimensional slice of C 20 . Naively, this should be the real slice, but it turns out that the loop momenta transform as → (cΩ + d) under a modular transformation (3.3). This requires a more careful definition of the genus-two integration contour, which we will not attempt here. Of course, the ten-dimensional supergravity amplitude is not defined, even if the loop integrand can be constructed, so when we talk of "amplitude" here, this is an abuse of language. However, for a sufficiently dimensionally-reduced formula that potentially converges at genus two (apart from expected infrared divergences), it would be interesting to understand this point better. In any case, after we have turned our genus-two formula into a formula on the bi-nodal sphere, the structure of a field-theory-like integrand becomes clear [22], and then it is possible to use dimensional regularisation and to define an appropriate i -prescription [29].
The second subtlety is that the way in which 1 µ and 2 µ , the moduli of P µ , appear in the correlator is asymmetric. Recall that we defined the fundamental domain of the period matrix according to a set of inequalities in (3.5), including the condition (ii): This leads to an asymmetry in 1 µ , 2 µ and 1 µ + 2 µ , which is unnatural from the point of view of the fieldtheory loop interpretation. 17 To address this, we can symmetrise over the different parametrisations of the zero modes of P µ , namely 14) Effectively, we are symmetrising over the orderings of the inequalities (4.13). The full amplitude is then 17 To see this asymmetry in action, consider the subset of scattering equations u IJ = 0 and the modular parameters (3.4). As we shall see in section 5, it is possible to show that, for the maximal non-separating boundary divisor q II = e iπΩ II → 0, we have u II = 2 I + q II F I + O(q 2 II ). Now, the inequality (4.13) implies that |q 22 | ≤ |q 11 |. Therefore, in a double-degenerate limit |q 22 | |q 11 | 1, the existence of solutions to the scattering equations implies that µ . To define this expression more rigorously, we can solve P µ by P µ = c I µ ω I + n i=1 k i µ ω i, * , and insert an identity of the form in the amplitude. The different charts are then given by different choices of cycles A I , with e.g.
for the parametrisation α = 1, and ( A 1 , A 2 ) = (A 2 , A 1 ) for the parametrisation α = 2. We recover the same expressions given above after integrating out the charges c I µ . While this is a cumbersome prescription for the amplitude, it is actually equivalent to a much simpler representation. To see this note that eq. (4.14) forces the zero modes I µ to transform nontrivially under modular transformations to ensure that P µ is of homogeneous (vanishing) modular weight. Using this, we can apply a modular transformation to relate all six terms in the amplitude to M , but now with different inequalities for the imaginary parts of period matrix. This is most easily established for the modular transformation relating M (2) n to M (1) n , which just exchanges the cycles (A 1 , B 1 ) ↔ (A 2 , B 2 ). This implies ω 1 ↔ ω 2 , and so we conclude that this modular transformation also exchanges 1 ↔ 2 and Ω 11 ↔ Ω 22 . Applying these transformations to M .
The sum in (4.15) now combines to the single expression, where the integration domain for the modular parameters is simply defined by Since this space plays an important role for the ambitwistor string, let us denote it by M 2 , where the notation is chosen to reflect its close relation to the moduli space M g of Riemann surfaces. The definition (4.18) naturally extends to the surface with vertex operators insertions, in which case the space is M 2,n . We conclude that the amplitude is given by (4.11) with P = P (1) = I µ ω I + n i=1 k i µ ω i, * , but integrated over M 2,n and the loop momenta.
Before proceeding to calculate this amplitude, let us briefly comment on two aspects of the moduli space M g,n . Due to its close relation to M g,n , the compactification of M g,n can be defined in full analogy to the Deligne-Mumford compactification. However, note that a new feature emerges: instead of a single non-separating boundary divisor, M g,n contains three distinct non-separating boundary divisors, each corresponding to a different degeneration of the Riemann surface; see figure 8 in section 5.1 for illustration. In contrast to string theory, where all of these degenerations would be the same after a modular transformation, they represent here genuinely different degenerations, with different loop momenta associated to each homology cycle.
An important conclusion from our discussion here is that it would be both interesting and fruitful to study the ambitwistor string moduli space more deeply. Important work in this context has been done by refs. [50] and [20], but especially extensions to higher genus remain largely an open problem, on which the treatment given here could shed some light. We postpone this topic for future investigation.

The chiral partition function
Defining the chiral partition function As observed in section 2, a crucial property of the ambitwistor string action is that, after gauge fixing, it is free and linear. In particular, this means that we can decompose the correlator in eq. (4.11) into the correlators over the different tilded and untilded fields, where we have defined 'chiral' partition functions (in analogy to the RNS superstring) by (4.20b) In particular, since both tilded and untilded fields obey the same OPEs, it is sufficient to evaluate Z chi [δ] -the result will extend straighforwardly to Z chi [δ]. It is worth highlighting at this point a major difference with respect to the conventional RNS string: the ambitwistor string is inherently chiral, and there is no sense of chiral splitting into left-and right-moving sectors, since the latter sector does not exist. However, in analogy with the chiral splitting in the RNS string [67], the ambitwistor string correlator exhibits a 'chiral contribution squared' (not absolute squared), as we have seen in eq. (4.19). Indeed, we have Since all fields in Z chi [δ] are βγ systems, the chiral partition function is easily constructed using the results of Verlinde & Verlinde [64] reviewed in section 3.4. We read off λ b = 2, λ β = 3/2 and λ ψ = 1/2 from the field definitions, and therefore Inserting explicitly eq. (3.32), the full chiral partition function is thus where we have abbreviated the ghost divisors for readability, and ∆ is the vector of Riemann constants (3.11). We reiterate here that the final amplitude is independent of the choice of x α and y r , although this is not manifest at this stage. In fact, Z chi [δ] by itself has to be independent of y r since the rest of the partition function is manifestly independent of these punctures. We will see this explicitly below.
Simplifying the chiral partition function. For dealing with the chiral partition function, we will rely on the simplifications achieved in [10,12] for conventional superstring theory, where the same object appears. In [10], it was shown that the chiral partition function (4.23) can be written as Here, Z 0 is a (−1, 0) form in both x 1 and x 2 , and is proportional to the bosonic string partition function Z B , where Ψ 10 ≡ δ ϑ[δ](0) 2 is a modular form of weight 10. While eq. (4.25) still depends on x α (as it must -after all, the remaining correlator in eq. (4.19) depends on x α as well), the above formula is indeed manifestly independent of y r , as advertised above. Following [12], and in view of the calculations involved in simplifying the scattering amplitude, it will moreover be useful to make a special choice for the two marked points x α : we will take them to be the zeros of a holomorphic (1, 0) form , As before, ∆ is the vector of Riemann constants (3.11), and 2κ is an arbitrary full period, i.e., 2κ ∈ Z 2 ⊕ ΩZ 2 . In fact, the condition that the marked points x α are the zeroes of a holomorphic differential is, in terms of the Abel map, that x 1 + x 2 − 2∆ = 2κ. Notice that, at genus two, a holomorphic differential is defined up to a constant multiple by the location of its two zeros, and the normalisation used here is chosen for convenience. With this choice for the marked points x α , the chiral partition function can be simplified to Using these parameters, requiring the amplitude to be independent of the choice of x α is equivalent to requiring independence of x 1 and κ. We will see in the calculation of the four-point amplitude how simplifies various calculations; see e.g. appendix A.
The GSO projection and the cosmological constant: To conclude the derivation of the partition function of the type II ambitwistor string, we still need to impose the GSO projection. As at genus one, the requirement of modular invariance fixes all relative phases among even spin structures. Indeed, ref. [10] proved that all relative phases in the GSO projection at genus two are unique, and equal. This amounts to η δ = ηδ = 1 . (4.29) We will derive these phases explicitly for the ambitwistor string in section 4.7. The vacuum amplitude can then be evaluated easily: the remaining correlator in (4.19) over the ψ system leads to a factor of S δ (x 1 , x 2 )P (x 1 ) · P (x 2 ), and the result forψ is analogous (withδ). The GSO sum in (4.19) therefore vanishes as a consequence of the identity which is one of the identities proven in [12] and listed in our eq. (A.1a). Thus, the cosmological constant vanishes in the ambitwistor string. A very similar argument, and the corresponding vanishing identities eq. (A.1b) through eq. (A.1g), imply that all n-point amplitudes with n < 4 vanish as well.

The amplitude
We have obtained the following expression for the amplitude: Just as we have observed for the partition function, the free ambitwistor string action guarantees that the remaining correlator in the loop integrand I splits into tilded and untilded systems. We can therefore evaluate each contribution independently, where we defined the 'chiral' (untilded) integrand by and similarly for the tilded integrand withδ. We can evaluate the correlator to find where the (2n + 2) × (2n + 2) matrix M (2) δ is given by The formula for the genus-two n-point scattering amplitude presented here is the main result of section 4. In the remainder of this section, we will discuss the simplifications occurring for n = 4, in section 4.6, and then we will show explicitly that the n-point formula satisfies the stringent constraint of modular invariance, in section 4.7.
As we have already mentioned, the genus-two scattering equations, which in principle localise the integration over the moduli space of the Riemann surface in the formula above, are too hard to solve explicitly. We cannot, therefore, evaluate directly the genus-two formula given in this section. We will show in section 5 how to turn it into a much simpler formula on the Riemann sphere.

The four-particle amplitude
The formula for the genus-two n-point scattering amplitude presented above includes a sum over spin structures. This sum builds up the contributions of particle states running in the loops, both bosons and fermions, as we discussed in (3.14). Since we are dealing with a supersymmetric theory, we expect that this sum provides a significant simplification. Indeed, this is what happens in the conventional RNS superstring.
Fortunately, for our purposes, we can rely on the superstring work [12], where the important identities for the four-particle amplitude were proven. These identities for sums over spin structures involving the chiral partition functions and the Szegő kernels are listed in the appendix A for convenience. As a consequence of the identities, the only non-vanishing contributions to the four-point amplitude come from terms where the two picture changing operators P · ψ(x 1 ) and P · ψ(x 2 ) are contracted, leading to a factor of P (x 1 )·P (x 2 ) S δ (x 1 , x 2 ). The identities actually allow for an even stronger conclusion: since all terms with less than five Szegő kernels vanish, the diagonal terms C ii = i · P (z i ) do not contribute at four points. This leaves us with only two contraction cycles that both evaluate to the same permutation-invariant result (A.2b), (4.37) Since all worldsheet contractions contribute the same factor, we can extract a kinematic prefactor K from each Pfaffian Pf M (2) δ , given by i , and similarly K = K( →˜ ) for the tilded system. Using this, the four-point loop integrand becomes (4.39) We can further simplify this loop integrand by adding a judicious choice of terms that vanish on the support of the scattering equations. Notice that this gives us considerable freedom in the representation of the integrand: since the Beltrami differentials {µ r } n+3 r=1 form a basis of H 0,1 (Σ, T Σ (−z 1 − ... − z n )), we are free to add any term containing µ P 2 = 0 , (4.40) where µ ∈ H 0,1 (Σ, T Σ (−z 1 − ... − z n )) is a linear combination of the Beltrami differentials used in the gauge fixing. Taking inspiration from the superstring [12], a particularly convenient choice for this differential is The factors c α in this definition are given by (z) = c 1 ∆(x 1 , z) = c 2 ∆(x 2 , z), where we used the (standard, though unfortunate) notation and we stress that ∆ ij is unrelated to the vector of Riemann constants ∆.
In the RNS string at genus two [12], the Beltrami differential µ x plays a role in proving that the amplitude is independent of the PCO gauge slice, i.e., the choice of χ α andχ α which determines the marked points x α . While the details of the calculations are quite different in the ambitwistor string -where µ x is associated to terms that vanish on the support of the scattering equationswe will see below that µ x effectively leads to similar simplifications of the amplitude. Many useful identities involving the factors c α have been derived in [12], and we have listed the relevant equations in appendix A.2 for convenience. In particular, let us highlight the relations to the holomorphic differentials and the partition function, where z * is an arbitrary marked point. Moreover, we find that µ x obeys where we made use of the identity (4.43a). This implies that, on the support of the scattering equations, we are free to add the following to the loop integrand: We can now define a quantity that agrees with P (x 1 )·P (x 2 ) on the support of the scattering equations, with the very convenient property that all dependence on the zero modes I µ of P µ has been eliminated.
We can simplify ℘ (x 1 , x 2 ) by using the definition of c 1,2 as well as the identity (4.43c) involving the holomorphic one-form (z), (4.47) Let us now revisit the integrand (4.39) and simply substitute P (x 1 ) · P (x 2 ) by ℘ (x 1 , x 2 ), since these objects agree on the support of the scattering equations. The factor c 1 c 2 ∂ (x 1 )∂ (x 2 ) from ℘ (x 1 , x 2 ) then combines with the partition function Z 0 as in the identity (4.43b), and we can further choose the arbitrary marked point to coincide with one of the vertex operators, z * = z 4 . This leads to the integrand As a last step, we can mirror again the superstring calculation [12] and simplify Y by using the Jacobi-like relations Repeated application of these identities leads to the following compact expression for the integrand: which is manifestly independent of the marked points x α and the associated holomorphic differential . This concludes the derivation of the four-point amplitude from the RNS ambitwistor string. Luckily, it has revealed some manipulations that will be useful later on, namely the introduction of the object ℘ (x 1 , x 2 ) in substitution of P (x 1 ) · P (x 2 ), which is valid on the support of the genus-two scattering equations.
The type II supergravity four-point amplitude was previously derived from the pure spinor ambitwistor string in [27], following earlier results from the (non-minimal) pure spinor superstring [69][70][71]. As such, it formed the basis of preliminary work on using global residue theorems to localise genus-two supergravity amplitudes on bi-nodal Riemann spheres [24], where the four-point loop integrand was also matched to a known for of the integrand, thereby checking its validity. While [24] relied on factorisation arguments to account for certain factors, we give a full derivation of the global residue theorems and the resulting n-point amplitudes on the bi-nodal Riemann sphere in section 5 and section 6.

Modular and gauge invariance
In this section, we discuss two essential checks on the amplitude: independence of the PCO gauge slice χ α andχ α (i.e., of the marked points x α ), and modular invariance. Both will play a crucial role for the residue theorem applied in the next section, where only a judicious choice of representation of the integrand and scattering equations will lead to a localisation on the maximal non-separating degeneration.

Independence of x α
The amplitude -and therefore the chiral integrand I chi n -must be independent of the PCO gauge slice defined by the marked points x α . This constitutes an important check of our results and is easily proven using Liouville's theorem. In the following, we verify the absence of poles in x α on the support of the scattering equations, and hence that the integrand is bounded. Liouville's theorem then guarantees that the chiral integrand I chi n is constant in x α . 18 By inspection of (4.34), it is evident that there are only two types of potential poles involving x α : (A) when the insertions of the two PCOs coincide, x 1 − x 2 = ε, (B) when one of the PCOs collides with a vertex operator, x α − z i = ε. 19 Case A. Let us first consider the coefficients of poles in x 1 − x 2 = ε. The only sources of these poles are the measure Z chi [δ] ∼ ε −1 and the component A x1 x2 = ε −1 (P (x 1 ) 2 + O(ε)) of the Pfaffian. At order O(ε −2 ), the integrand therefore contains only terms proportional to P 2 (x 1 ), which vanish on the support of the scattering equations. The subleading term at order O(ε −1 ) is also trivial, since the rows and columns corresponding to x 1 and x 2 are identical, and therefore the matrix M (2) ε −1 is degenerate. Case B. Consider now poles in x α − z i = ε, from one of the PCOs contracting with an integrated vertex operator. The partition functions do not contribute to this pole, and the leading term at O(ε −2 ) originating from the A i,xα vanishes trivially due to k 2 to leading order O(ε −1 ) . Similarly to the case A above, the matrix M (2) ε −1 becomes degenerate, with identical rows and columns for x α and i, for any a , (4.53) and so the coefficient of the potential pole vanishes.
Using Liouville's theorem, the chiral integrand I chi n is thus independent of the choice of the insertion points x α of the picture changing operators.
Looking ahead to the degeneration to the nodal Riemann sphere in section 5, it is worth highlighting a fundamental difference between case A and case B. While the coefficient of (x α − z i ) −1 vanishes on the support of the vertex scattering equations µ i P 2 = 0 alone (even off the support of the moduli scattering equations, u IJ = 0), the absence of the pole in x 1 − x 2 relies on the support of all scattering equations to guarantee that P 2 = 0. This distinction will play an important role when applying the global residue theorem to localise on the non-separating degeneration: applying the residue theorem relaxes two of the constraints u IJ = 0, and therefore P 2 = 0 on the resulting lower-genus Riemann surface. 18 Notice that the chiral integrand I chi n is a function of xα, i.e., it has form degree zero in dxα. This can be checked from the definitions of the ingredients in (4.35). The amplitude would not be well defined otherwise. 19 Throughout this section, we use ε to denote a small separation of marked points on the Riemann surface.

Modular invariance
The GSO projection plays a crucial role in the ambitwistor string by restricting to the correct degrees of freedom for type II supergravity. In the path integral formalism, the GSO projection is implemented via the sum over spin structures, and modular invariance restricts the relative phases in that sum, as asserted at the end of section 4.4. After that section, we postponed a more detailed discussion in favour of calculating the full amplitude (4.32). Here, we return to the question of modular invariance by deriving the phase factors explicitly, and conclude with an direct proof of modular invariance for the n-point amplitude. Further details on the modular properties of theta functions and chiral partition functions can be found in Refs. [5,10,63,64].
The basics. Recall from section 3 that the modular group Sp(4, Z) acts on the period matrix Ω IJ and on the holomorphic Abelian differentials ω I as For the integrand and the scattering equations to be well-defined, the one-form P µ given by (4.8) must transform homogeneously under modular transformations. We will see soon that the meromorphic differentials in P µ are invariant under modular transformations, and therefore the holomorphic part, I µ ω I , must also be invariant. This implies in turn that the loop momenta I µ must absorb the transformation of the Abelian differentials ω I : (4.55) The integration over the loop momenta therefore has modular weight +10, and the integration over the modular parameters Ω and the localisation on the scattering equations have weight −3 each, For fields of half integer weight, the transformation of the partition function further depends on the action of the modular group on the spin structures. Following Ref. [5,10], this is most conveniently expressed when the spin structures are assembled into a single column vector, Here, diag(m) denotes the column vector containing the diagonal elements of the matrix m. The Jacobi theta functions then transform as [5,63,64] ϑ with the argument ζ of the theta function and the phase ϕ defined by Moreover, (M ) = (a, b, c, d) denotes a transformation-dependent phase factor satisfying (M ) 8 = 1, whose specific form is not important since it will cancel out in the chiral partition function, as we shall see below. For more details on (M ), including detailed tables for the generators of the modular group, the interested reader is referred to [10,64].
Prime form, Szegő kernels and the partition function. Proceeding in analogy to section 2, we are now in a position to review the modular properties of the key objects relevant for CFTs on highergenus Riemann surfaces: the propagators and the partition functions. In particular, the modular behaviour of the prime form follows directly from eq. (4.58), This property ensures that the Abelian differentials of the third kind ω w1,w2 are invariant under the action of the modular group Sp(2g, Z). As for the Szegő kernels S δ , we have a relation among different (even) spin structures, This extends immediately to the Pfaffians Pf M (2) δ after taking into account the invariance of P µ discussed above, Pf M Since modular transformations interpolate between different even spin structures, the Pfaffians are not modular forms, despite having trivial modular weight. Only the full amplitude, when summed over spin structures with appropriate phase factors, will be modular invariant. The action of the modular group on a chiral determinant det∂ 1−λ associated to partition functions of chiral bc and βγ systems was derived in Ref. [64], where the phase factor ϕ depending on the weight λ is given by ϕ(κ, λ) = ϕ(κ) + 2(2λ − 1) κ · α +κ · α . (4.64) We can now assemble these ingredients to study the action of modular transformations on the ambitwistor chiral partition function (4.22), From eq. (4.63), we see that Z chi has modular weight 2 + 5 · 1 2 − 3 2 − 5 · 1 = −2. The factor (M ) cancels between the fermionic and the bosonic systems, and the remaining phase simplifies to e iπδϕ with iπδ ϕ = 4iπ κ ·κ − κ · κ +κ · α −κ · α .  to the chiral integrand for any single spin structure is not a modular form because modular transformations involve different spin structures. Since each contribution carries no modular weight, however, it is straighforward to construct a modular invariant object by summing over spin structures with appropriate coefficients to absorb any relative phases, leading to the chiral integrand δ Z chi [δ]Pf M (2) δ . Since all phases in eq. (4.67) are trivial, this concludes our proof of η δ = 1 for all even spin structures.
To summarise, the amplitude transforms under modular transformations as follows: Modular weights of each factor are indicated in blue, and evidently sum to zero. All phase factors cancel as discussed above, and so the full expression is modular invariant.
Modular invariance for four particles. For amplitudes with four external particles, the analysis of modular invariance simpifies considerably. It is sufficient to observe that due to eq. (4.54), The chiral integrand is therefore a modular form of weight −4, and combines with the modular measure and the scattering equations to a modular form of weight −10, balancing the modular weight +10 from the loop integration: Modular invariance vs finiteness. To conclude, let us briefly comment on an important aspect of modular invariance in the ambitwistor string. In contrast to standard string theory, modular invariance does not restrict the ambitwistor string correlators to a compact integration domain, since the integration over the loop momenta I remains non-compact. Importantly, this means that the amplitudes are not expected to be finite, but contain in fact the ultraviolet divergence of the loop integration expected for maximal supergravity in ten dimensions.

From genus two to the nodal Riemann sphere
As a correlator in the genus expansion of the ambitwistor string, the supergravity amplitude (4.33) is the natural generalisation of lower loop orders. This higher-genus representation has many desirable aspects: it manifests both modular invariance and the localisation on the scattering equations, and it makes a wide array of string theory techniques available due to the close similarity of the amplitudes. The underlying mathematical structure, however, becomes increasingly challenging at higher genus, and obscures the relation to known rational field theory integrands. While these are expected consequences of working with a 'stringy' representation, they raise the question of how a manifestly rational loop integrand can possibly appear from the higher-genus formalism of the ambitwistor string -especially in the absence of the string parameter α governing the degeneration of the string moduli space in the field theory limit.
At one loop, a resolution of this problem was offered in [22,23]. The ambitwistor string amplitudes can be localised on the non-separating boundary divisor, rather than the higher-genus scattering equations, via the residue theorem in the moduli space M 1,n . This residue theorem moves the integration contour from a pole defined by the scattering equations to the only other simple pole in the integrand, the boundary divisor D non-sep 1,n ∼ = M 0,n+2 . The resulting integrand -localised on the non-separating boundary of the moduli space -is naturally formulated over a nodal Riemann sphere, with the loop momentum running through the node. This representation of the amplitude has the advantage of reducing the computationally challenging ambitwistor higher-genus expressions to simple formulae on nodal Riemann spheres that are manifestly rational, and thus easier to match to known field theory integrands. Moreover, integrands are known not only for supergravity, but also for super-Yang-Mills theory [22], bi-adjoint scalar theory [28,30], pure Yang-Mills theory and gravity [23], are valid in any dimension d and can be obtained directly from the nodal Riemann sphere [34].
In this section, we extend this argument to genus two. We have seen above that the two crucial properties necessary for applying a residue theorem -modular invariance and localisation on the scattering equations -persist at two loops. Our goal is therefore to localise the amplitudes on the maximal non-separating boundary divisor D max 2,n ∼ = M 0,n+4 by using the residue theorem in the moduli space M 2,n , reducing the genus-two surface to a bi-nodal Riemann sphere as proposed in [24]. While higher-genus residue theorems are in general subtle to implement, the degeneration can be achieved iteratively by two uses of the residue theorem, each collapsing a single A-cycle. The first step is to move the integration contour to the boundary divisor corresponding to a nodal torus D non-sep The residue theorem approach outlined above assumes directly that the amplitude only has poles at the scattering equations -constituting the pole at which the amplitude is formulated on the highergenus surface -and the non-separating boundary divisor. This is indeed true for the genus-two integrand, so the first application of the residue theorem is straightforward. The resulting expression on the nodal torus, however, contains in general many poles besides the divisor D non-sep 1,n+2 and the scattering equations, leading to a variety of unwanted terms from the second application of the residue theorem. While this may seem like an obstruction to obtaining an amplitude on a bi-nodal Riemann sphere, there is considerable freedom in the choice of the integrand: any basis of Beltrami differentials may be chosen to define the scattering equations (see section 4.2), and the integrand is only defined modulo terms proportional to the scattering equations. 20 In section 5.1 and section 5.2, we demonstrate that we can use this freedom to construct an integrand containing only poles at the maximal nonseparating boundary divisor and the scattering equations. Using this representation, we can finally apply the residue theorem to localise the amplitude on the boundary divisor D max 2,n .
In section 5.3, we discuss the mapping of the remaining modular parameter on D max 2,n to the binodal Riemann sphere. While any appropriate map could be chosen, we use a convenient trick to simplify the calculation. By extending the domain of integration to the full complex plane, using modular invariance, the modulus maps to a cross-ratio of the marked points parametrising the nodes. The extension of the integral to the full complex plane is unique if we require D max 2,n and the scattering equations to remain the only poles of the integrand. Using the global residue theorem, the ambitwistor string correlator then localises straightforwardly on the bi-nodal Riemann sphere. We conclude with a discussion of the resulting formula for n-point two-loop amplitudes in section 6.
Given the particularly technical nature of the discussion in this section, and for the benefit of the time-constrained reader who may want to skip on the details, we will present a brief summary of the results at the beginning of section 6.

The scattering equations
The core idea of this section is to use the global residue theorem to localise ambitwistor string amplitudes on the non-separating boundary divisor, rather than the higher-genus scattering equations. A necessary prerequisite for this to work is that the only simple pole of the integrand -besides the scattering equations, of course -is the maximal non-separating boundary divisor D max 2,n ⊂ M 2,n . While this is certainly not true for all representations of the integrand, we will construct a representation of the integrand for which it holds. Since D max 2,n is a divisor of co-dimension two, we will analyse the global residue theorem iteratively, considering at each step a co-dimension one divisor, Here, we will focus on part 1 -finding the basis of Beltrami differentials -while section 5.2 tackles constructing the integrand. Since both parts are interlinked, we will assume the existence of such an integrand for the remainder of this section.
Let us work in the parametrisation (3.39) of the period matrix adapted to studying non-separating degenerations, All non-separating degenerations are represented by τ r = i∞ for some r ∈ {1, 2, 3}, and so (5.2) parametrises the moduli space near all non-separating boundary divisors D non-sep 2,n of M 2,n . Of particular convenience are the exponentiated variables q r , defined in analogy with eq. (3.4) to be This leads to the following integration measure for the period matrix; where the poles at the non-separating boundary divisors, now given by q r = 0, are manifest. We will verify in section 5.2 and section 6.3 explicitly that q r = 0 and the scattering equations are the only simple poles of the integrand.
To capture the freedom we have in representing the amplitude, let us use a generic basis u r = µ r P 2 for the moduli scattering equations. In the amplitude eq. (4.32), this comes in general at the cost of a Jacobian factor associated to the change of basis for the Beltrami differentials. (In our case that Jacobian will turn out to be trivial.) For the purpose of discussing the residue theorem, it will be useful to introduce the following short-hand notation for the amplitude: This compact notation is designed to exhibit only the moduli scattering equations u r , while the remaining scattering equations as well as all other dependences remain implicit. The original representation eq. (4.32) of the two-loop amplitude corresponds to M n = R(u 11 , u 22 , u 12 ) in this new notation. The goal of the remainder of section 5.1 is to express the u r in terms of the u IJ such that the amplitude localises on the bi-nodal Riemann sphere. The result will be given in eq. (5.24).
Let us first explore how the global residue theorem plays out with this generic set of scattering equations, u r = 0. Since the two-loop amplitude is fully localised over the moduli space M 2,n , we can use the residue theorem to move the integration contour away from one of the poles defined by the scattering equations, say u 2 = 0. Since q r = 0 are the only other poles, this leads to three contributions, each localised on a non-separating boundary divisor, as illustrated in figure 8. The novel feature, compared to standard worldsheet theories, is that all three terms on the right hand side contribute on the moduli space M 2,n of the ambitwistor string. They represent genuinely distinct degenerations due to the different loop momenta associated to each homology cycle, and cannot be related by modular transformations without relabelling the loop momenta. 22 All three terms in (5.6) are formulated over a nodal torus, and since the amplitude localises over D non-sep 2,n ∼ = M 1,n+2 , we are free to apply another residue theorem. However, applying this second residue theorem does not localise the amplitude on the bi-nodal Riemann sphere. A short calculation 22 Contrast this with conventional worldsheet theories formulated over M 2,n , for whom the non-separating degeneration is unique on the fundamental domain. Concretely, this implies that, for the bosonic string, only the second term is relevant due to the definition of the fundamental domain (3.5): q 2 = 0 automatically implies q 1 = 0, and similarly for q 3 . Both R(u 1 , q 1 , u 3 ) and R(u 1 , q 3 , u 3 ) vanish for generic momenta after an appropriate blow-up procedure to regulate the limit. + + Figure 8: After applying the global residue theorem, the amplitude localises on three different nodal tori, corresponding to the boundary divisors q r = 0 for r ∈ {1, 2, 3}.
shows that unless two of the above terms vanish, the amplitude receives contributions from nodal tori as well as the bi-nodal Riemann sphere,  where we represented explicitly only the contributions coming from the first term on the right-hand side of eq. (5.6). This not only demonstrates that the amplitude, formulated using a generic basis for the scattering equations, fails to localise on the bi-nodal sphere after applying the residue theorem on moduli space, but also suggests a resolution: choose a basis of scattering equations such that two of the terms contributing to each residue theorem vanish.
To find this basis, let us investigate the asymptotics of the scattering equations on the nodal tori q r = 0. Clearly, it depends on the behaviour of the holomorphic differentials and the period matrix in the non-separating degeneration limit, reviewed in section 3.5. For concreteness, let us focus on R(q 2 , u 1 , u 3 ). In the limit q 2 → 0, the holomorphic differential ω 2 associated to the degenerating A 2 -cycle develops simple poles at the node, while ω 1 descends to the holomorphic differential dz on the torus. In this case, Fay's degeneration formula eq. (3.37) gives the asymptotics 23 where the node is parametrised by z 2 + and z 2 − , and ω 2 + ,2 − (z) denotes the Abelian differential of the third kind with simple poles at the node; see fig. 9. The subleading term at O(q 2 2 ) vanishes due to the translation invariance of the torus. The asymptotics of the period matrix, given in eq. (3.38), imply that the component Ω 11 of the period matrix descends to the modular parameter τ of the torus, while the off-diagonal entries Ω 12 = z 2 + z 2 − dz = z 2 + − z 2 − encode the moduli associated to the node, By fixing the translation invariance of the torus, we can align the modulus Ω 12 directly with the location of the node by fixing one of the nodal points, for example Ω 12 = z 2 + using z 2 − = 0. Note that τ is indeed integrated over the fundamental domain, since τ = Ω 11 with Re(τ ) ∈ [− 1 2 , 1 2 ] by (i) of 23 It is clear from eq. (3.37) that the first correction to (5.8a) is of order O(q 4 2 ), since we have ω 1 (z g ± ) = dz g ± for the torus. This is not important in our analysis, and a correction of order O(q 2 2 ), which occurs at higher genus, would suffice. eq. (3.5), while the condition (iii) implies that |Ω 11 | > 1. 24 We will discuss the range of the remaining modulus Ω 12 = z 2 + − z 2 − in detail in section 5.3. Figure 9: The non-separating boundary divisor q 2 = 0, corresponding to a nodal torus. The node is parametrised by z 2 + and z 2 − .
Fay's degeneration formula now allows us to calculate the asymptotics of the scattering equations on the nodal torus. Since ω 2 develops simple poles at the node, u 22 and u 12 can be identified as the coefficients of the second and first order pole at z 2 + of P 2 , respectively. Moreover, with ω 1 = dz to leading order, the remaining scattering equation u 11 = u (1) becomes the coefficient of the (single) quadratic holomorphic differential dz 2 on the torus. The scattering equations on R(q 2 , u 1 , u 3 ) thus take the following form: This means that u 22 = 2 2 is associated to the pole at the node, while the other scattering equations descend to the nodal torus: u 11 = u (1) becomes the modular scattering equation associated to q = e 2iπτ , while u 12 turns into a vertex scattering equation E (1) 2 + for the nodal point z 2 + with momentum 2 . 25 Moreover, let us highlight that the amplitude on the nodal torus R(u 1 , q 2 , u 3 ) does not localise on u 2 = 0 -this is precisely the constraint relaxed by applying the residue theorem -so, if we take u 2 = u 22 , (5.10) does not imply a cut of the loop momentum 2 .
Of course, the exact same arguments can be applied to the amplitude R(u 1 , q 1 , u 3 ) on the nodal torus q 1 = 0, but with reversed roles for the holomorphic differentials ω I . Let us denote the node resulting from the degeneration of the A 1 -cycle by z 1 + and z 1 − . Then Fay's degeneration formula implies that and likewise Ω 22 = τ , Ω 12 = z 1 + − z 1 − to leading order. By identifying the coefficients of the single and double pole of P 2 at the nodal point z 1 + , we find the following asymptotics for the scattering 24 Using the modular transformation a = d = 0 0 0 1 and c = −b = 1 0 0 0 25 Notice that both loop momenta 1 and 2 appear linearly in E equations: Again, the roles are reversed with respect to eq. (5.10), so that u 11 = 2 1 becomes the momentum squared flowing through the node, while u 22 and u 12 descend to the scattering equations on the nodal torus.
Given these asymptotics, let us return to our objective of constructing a basis of scattering equations such that only a single term contributes to the residue theorem. From (5.12a), it is evident how to choose the scattering equation u 1 in order to make R(u 1 , q 1 , u 3 ) vanish for generic loop momenta, Strictly speaking, we have not yet seen that the choice u 1 = u 11 precludes contributions of the form δ 2 1 to the cut of the amplitude. We will revisit this question at the end of this section, where we show that no additional terms contribute to the amplitude on a cut.
Having fixed u 1 = u 11 , we also have to choose u 2 = u 22 in order to preserve the symmetry between the degenerations of the cycles A 1 and A 2 . This is a natural requirement, because the amplitude should be unaffected by our choice of relaxing the scattering equation u 1 or u 2 first. However, this implies that we require R(q 3 , u 1 , u 3 ) = 0 to obtain a formulation of the amplitude on the bi-nodal sphere.  Figure 10: The form of the scattering equations at q 3 = 0 can be determined from the scattering equations at q 1 = 0 by using a modular transformation to relate the degenerations. In particular, the loop momenta transform as 1 , 2 ↔ 1 + 2 , 2 .
Notice that calculating the asymptotics of the scattering equations for the contribution R(q 3 , u 1 , u 3 ) requires an additional step, compared to (5.10) and (5.12): to use Fay's degeneration formula, we need to exchange the role of τ 3 with e.g. τ 1 via a modular transform. We will do this below, but let us first take a look at the result. At q 3 = 0, the scattering equations become as q 3 → 0 , (5.14a) with F IJ (q 1 , q 2 ) = 0 but F 11 (q 1 , q 2 )+F 22 (q 1 , q 2 )+F 12 (q 1 , q 2 ) = 0; see also fig. 11. This implies that we cannot choose u 3 = u 12 , as we might have guessed, because R(u 22 , q 3 , u 3 ) = R(u 22 , q 3 , u 12 ) = 0, 26 and thus the amplitude would receive contributions from a nodal torus. To see what linear combination of the u IJ we should choose instead for u 3 , we will need to prove the degeneration (5.14) using modular invariance.
Proof. The main idea is to exchange the roles of τ 1 and τ 3 using a modular transformation. Consider therefore the modular transformation M with In terms of the basis of homology cycles, this corresponds to 16) so this transformation indeed exchanges the cycle A 1 with A 1 + A 2 , see figure 11. Using eq. (4.54) for the modular transformations of the period matrix, we also confirm directly that this exchanges τ 1 and τ 3 , Recalling the discussion of modular invariance, eq. (4.54) and eq. (4.55) describe the behaviour of the holomorphic differentials, as well as the loop momenta, Note that 1 = 1 + 2 is the loop momentum flowing through the cycle A 1 = A 1 + A 2 as illustrated in figure 11. With the above properties, the modular transformation maps P µ to As before, we can use the support of the particle scattering equations to write P 2 as a holomorphic quadratic differential, now in the basis ω I of holomorphic differentials, At this stage, we are able to use Fay's degeneration formula for the differentials ω 1 , ω 2 to investigate the limit q 3 =q 1 → 0 of the scattering equations. This now mirrors exactly the procedure from above. Denoting the locations of the node resulting from the degeneration of the A 1 -cycle by z 3 + and z 3 − , we find that By identifying the coefficients of the poles of P 2 at the nodal point z 3 + , we can again extract the asymptotics for the scattering equations; We stress that this has now the same interpretation as for the nodal tori q 1 = 0 or q 2 = 0: the scattering equation u 11 = 2 1 = ( 1 + 2 ) 2 becomes the momentum squared flowing through the node, while u 22 and u 12 descend to the scattering equations on the nodal torus. In particular, these scattering equations evidently depend on the modular parameter q 2 22 = q and the modulus of the node, τ 3 = −τ 1 = z 3 − − z 3 + . In turn, this implies that all of , depend on the modular parameters q 1 and q 2 . We arrive therefore at (5.14), upon identifying F IJ as given above, and comparing to (5.20) to show that F 11 (q 1 , q 2 ) + F 22 (q 1 , q 2 ) + F 12 (q 1 , q 2 ) = 0.
This discussion now allows us to construct u 3 such that R(q 3 , u 2 , u 3 ) vanishes for generic loop momenta. From (5.20) and in analogy with the argument for the torus q 1 = 0, we must take u 3 = u 11 = u 11 + u 12 + u 22 , because so that R(u 2 , q 3 , u 3 ) = 0 for generic loop momenta. We will discuss the cut ( 1 + 2 ) 2 = 0 shortly.
To summarise, we conclude that the residue formula (5.6) only results in a single contribution from the non-separating boundary divisor D non-sep 2,n if we choose the scattering equations Note that the Jacobian associated to this basis choice is trivial, so the integrand I chi n of the amplitude is unaffected. In the next section, we construct a representation of this integrand that does not contain poles on support of the scattering equations -part 2 in our roadmap outlined at the beginning of section 5.1. Once proven on the nodal torus, we can again apply the residue theorem to localise the amplitude on the bi-nodal Riemann sphere, All other terms vanish due to our choice of scattering equations, R(q 1 , u 1 , u) = R(q 2 , u 2 , u) = R(q 3 , u 3 , u) = 0 , for any u . (5.26) Before proceeding, let us highlight briefly an interpretation of the relations (5.26). Since the maximal non-separating boundary divisor D max 2,n has co-dimension two in the (n + 3)-dimensional moduli space M 2,n , the full residue theorem localising on D max 2,n is two-dimensional as well. However, the relations (5.26) effectively diagonalise this two-dimensional residue theorem, reducing it to two consecutive residue theorems in separate variables.
Contribution on a cut. While the above discussion seems to suggest that contributions from cuts are subtle and need to be treated with care, they actually represent the simplest scenario. To see this, let us investigate the genus-two amplitude R(u 1 , u 2 , u 3 ) on the cut 2 2 = 0. From (5.10), we see that this cut forces u 2 ∝ q 2 , and thus trivially . (5.27) This is indeed the same result we obtained for generic loop momenta after the first use of the residue theorem. If furthermore 2 1 = 0 and ( 1 + 2 ) 2 = 0, applying a single residue theorem is sufficient to localise the full amplitude on R(q 1 , q 2 , u 3 ) 2 2 =0 . Note that this exactly matches the result obtained from a cut of the amplitude (5.25) on the bi-nodal sphere D max 2,n , so the cut commutes with the residue theorem.
Similarly, for a cut in one of the other loop momenta, 2 1 = 0 or ( 1 + 2 ) 2 = 0, we find respectively that the amplitude is given by After using the residue theorem (twice for ( 1 + 2 ) 2 = 0), the result is again the same as taking a cut of the amplitude (5.25) on the bi-nodal sphere D max 2,n . This analysis extends straightforwardly to multiple cuts, and thus the two-loop amplitude localises on the maximal non-separating degeneration irrespective of the loop momentum configuration.

The integrand
Throughout the last section, we assumed the existence of a representation of the integrand I chi n that does not contain poles on the support of the scattering equations. Let us now return to this point and explicitly construct this representation.
It is easily checked that the integrand of (4.33) does not have poles on the genus-two Riemann surface for generic kinematics, because poles in the location of vertex operators z i −z j correspond -via the scattering equations -to factorisation channels of the amplitude. Moreover, recall from section 4.7 that there are no poles associated to the PCO gauge slice x α , so no additional poles contribute in the first residue theorem. However, since this PCO gauge invariance relies on the support of all scattering equations, we expect the integrand to develop poles in x α on the nodal torus D non-sep 2,n . This can be made explicit. Once on the nodal torus, one of the genus-two holomorphic differentials becomes meromorphic, ω 2 = ω 2 + ,2 − (z), and the modular parameter τ 3 = z 2 + −z 2 − encodes the location of the node. The terms in the Pfaffian containing a factor of P (x α ), thus develop simple poles in the modular parameter q 3 . While the coefficients of A xα,j and C xα,j still vanish on the support of the scattering equations, 27 the coefficient of A x1 x2 is non-zero on the nodal torus. If the amplitude is represented using the integrand (4.35), the second application of the residue theorem thus leads to a contribution from the poles q 3 = e 2iπxα of P (x 1 ) · P (x 2 ). Of course, the full amplitude remains invariant under different PCO gauge choices, but fails to localise on the bi-nodal sphere. Luckily, we have already seen how to eliminate these poles when discussing the four-particle amplitude in section 4.6. In that case, the full amplitude is proportional to A x1 x2 , and we used a linear combination of the scattering equations determined by the Beltrami differential (4.41), to simplify P (x 1 ) · P (x 2 ) to ℘ (x 1 , x 2 ). This procedure characteristically removes the terms in P (x 1 ) · P (x 2 ) proportional to the holomorphic differentials, and will thus eliminate poles in q 3 on the nodal torus. Generalising from four to n particles, we indeed find Note that while the right hand side of (5.30) still depends on x 1 and x 2 , the coefficient of the pole in x 1 − x 2 vanishes manifestly when multiplied by the partition function due to eq. (4.43b). Moreover, the coefficients of the poles in x α − z i vanish because the Pfaffian matrix becomes degenerate at this order; the relevant calculation proceeds in close analogy to the discussion in section 4.7.
We can thus use ℘ (x 1 , x 2 ) to define a representation of the integrand free of poles in the modular parameters.
In summary, we will use the following representation of the amplitude for the residue theorem: Just as in eq. (4.35), the chiral integrand is defined by but in contrast to the original representation, the (2n + 2) × (2n + 2) matrix M (2) δ is now given by 27 The argument is completely analogous to the one presented in section 4.7.
As discussed above, A xα,j and C xα,j do not give rise to poles in q 3 because the respective coefficients still vanish on the nodal torus on the support of the vertex scattering equations. The integrand therefore meets our requirement of not containing poles on the nodal torus D non-sep 2,n , and we can proceed with the second application of the residue theorem,(5.25) as indicated in the previous section. Note that the discussion presented here bears a close resemblance to the issues arising from the scattering equations in the last section: while the degeneration to the nodal torus was straightforward, only a specific representation of the integrand allows for a further application of the residue theorem to fully localise on the maximal non-separating degeneration. These strong requirements on the representation of the integrand to localise on higher non-separating degenerations seem to be a general feature that we strongly expect to extend to higher genus.

Integration over the moduli
As discussed over the course of the last two sections, a suitable representation of the two-loop amplitude localises on the maximal non-separating boundary divisor D max 2,n after applying a global residue theorem. One last subtlety remains to be resolved: the isomorphism D max 2,n ∼ = M 0,n+4 with the bi-nodal Riemann sphere. While Fay's degeneration formulae (5.8) already incorporates this map to the nodal Riemann sphere, more care is needed with the remaining modulus τ 3 of the period matrix. One way to see this is as follows. Recall first that, due to modular invariance, the integration over the moduli runs over the fundamental domain, so that |q r | < 1. On the other hand, on the bi-nodal Riemann sphere, τ 3 is expected to correspond to the location of one of the nodes upon fixing the other nodal points using Möbius invariance (see Fays' degeneration formula for the period matrix (5.9)), and q 3 = e 2πiτ3 should thus be unconstrained. 28 Evidently, this implies that the isomorphism D max 2,n ∼ = M 0,n+4 is non-trivial.
There exists however a nice way to trivialise D max 2,n ∼ = M 0,n+4 using modular invariance: extend the integration domain for the modular parameter q 3 to the full complex plane. This method also has the advantage of considerably simplifying the degeneration because it obviates the construction of an explicit map from D max 2,n to M 0,n+4 . Let us see how this trivialisation works in more detail. Since we are interested in extending the domain of integration to the full complex plane, the natural modular transformation to consider is q 12 = 1/q 12 , where we recall that q 3 = q 12 = e 2πiΩ12 . This suggests that the extension of q 3 to the full complex plane is best seen in the parametrisation (3.4) of the period matrix, which we will use in what follows. Explicitly, the modular transformation q 12 = 1/q 12 is given by At the level of the homology cycles, this means confirming that the modular transformation (5.35) indeed corresponds to q 12 = 1/q 12 . The behaviour of the holomorphic differentials and the zero modes I µ can be read off from eq. (4.54) and eq. (4.55), Let us schematically write the two-loop amplitude (5.31) as where the second equality holds due to modular invariance, as just discussed. The amplitude can thus be expressed as and where the integration is unconstrained and runs over full complex plane. Of course, there are many possible choices for f (q 12 ) if we only require it to be subject to f (q 12 ) + f (1/q 12 ) = 1. In the context of the residue theorem, however, there is an additional natural requirement: f (q 12 ) should not introduce poles into the integrand. Equivalently, we can demand that the maximal non-separating boundary divisor D max 2,n remains the only global residue (apart from the one that defines the original amplitude). The simplest example f (q 12 ) = 1/2 fails this additional requirement, because it introduces a pole as q 12 → ∞. In fact, requiring the integrand to remain holomorphic on the support of the scattering equations implies uniquely that While this naively introduces a pole at q 12 = 1, the amplitudes of type II supergravity (5.31) vanish on the separating degeneration. This can be understood intuitively in analogy with the superstring, where only massive poles contribute to this channel [72], which are absent in the ambitwistor string. An explicit proof for four particles was given in [27], and we extend this argument to all n in appendix C.
Having extended the domain of integration to trivialise the map to the bi-nodal sphere, let us return to the parametrisation (3.39) of the period matrix. With q 12 = q 3 , the amplitude is given by Since no new poles are introduced by f (q 12 ) = f (q 3 ), the amplitude 29 localises on the maximal nonseparating divisor D max 2,n, after applying the global residue theorem. At this stage, the isomorphism D max 2,n ∼ = M 0,n+4 is trivial, and τ 3 is determined by Fay's degeneration formula (5.9).

The amplitude on the bi-nodal Riemann sphere
Let us briefly summarise our conclusions from section 5. In section 5.3, we established that we can trivialise the isomorphism D max 2,n ∼ = M 0,n+4 by extending the domain of integration for the modular parameter q 3 from the fundamental domain to the full complex plane, using modular invariance. This introduces a factor of f (q 3 ) = (1 − q 3 ) −1 into the integrand. We will work with the representation given in eq. (5.32) of the integrand, as well as the basis (5.24) for the scattering equations, M n = dµ 2,n I n 1 1 − q 3 ≡ R(u 1 , u 2 , u 3 ) . (6.1) 29 Here, In is chosen in the representation established in the last two sections.
In a slight abuse of notation, we denote the amplitude again by R(u 1 , u 2 , u 3 ), which denotes the residue at u r = 0. Since the only simple poles of the integrand are the scattering equations and q r = 0, 30 the amplitude can be localised on the non-separating degenerations D non-sep 2,n ∼ = M 1,n+2 using the residue theorem. This residue theorem moves the contour from one of the scattering equations, e.g. u 2 , 31 to circle the poles at q r = 0. With the choice (5.24) for u r , only one pole contributes to the residue theorem since The residue theorem thus results in a single contribution D non-sep 2,n ∼ = M 1,n+2 on a nodal torus, Using the representation (5.32) of the integrand, the only simple pole on the torus (apart from the one where the amplitude is defined) sits at the non-separating boundary divisor D non-sep Therefore, a second application of the residue theorem localises the amplitude onto the nodal Riemann sphere D max 2,n , again using R(u 2 , q 2 , u 3 ) = R(q 3 , q 2 , u 3 ) = 0. Since we trivialised the isomorphism D max by extending the domain of integration for q 3 , the resulting amplitude is formulated directly over the nodal Riemann sphere.

The measure on the bi-nodal Riemann sphere
Let us introduce the coordinate σ ∈ CP 1 on the (bi-nodal) Riemann sphere, to distinguish it from the previous coordinate z at higher genus. Then the σ i denote the locations of the n marked points associated to the external particles, while σ 1 ± and σ 2 ± denote the location of the nodes; see figure 12 for illustration. Figure 12: The bi-nodal Riemann sphere, with nodes parametrised by σ 1 ± and σ 2 ± .
In this notation, Fay's degeneration formula for the holomorphic differentials (3.37) gives the following asymptotics to order O(q 2 1 , q 2 2 ), Since the isomorphism D max 2,n ∼ = M 0,n+4 is trivial after extending the domain of integration for q 3 , Fay's degeneration formula for the period matrix (3.38) straighforwardly determines the asymptotics for the remaining modular parameter, where we introduced the notation (ij) ≡ σ i − σ j . The exponentiated parameter q 3 = e 2πiΩ12 thus becomes the cross-ratio of the location of the nodes, The Möbius symmetry of the Riemann sphere allows us to fix three of the marked points. For practical calculations, a convenient choice is given by the gauge σ 1 − = 1, σ 2 + = 0 and σ 2 − = ∞, leading to q 3 = σ 1 + encoding the location of the remaining node. To arrive at an SL(2, C)-invariant representation of the amplitude, however, we will not choose a specific gauge and instead quotient by the volume of the symmetry group, Using the asymptotics for the holomorphic differentials and the moduli, we can now take a closer look at the remaining ingredients for the amplitude. The expression (6.8) for q 3 leads directly to Moreover, we already established the degeneration of the two scattering equations relaxed by the residue theorems in section 5.1: the limit q 1 , q 2 → 0 forces u 1 = 2 1 and u 2 = 2 2 . Therefore, the SL(2, C)-invariant representation of the amplitude on the bi-nodal Riemann sphere is given by where σ A ∈ {σ 1 ± , σ 2 ± , σ i }. In this expression, the scattering equations u 3 and E i ≡ µ i P 2 as well as the chiral integrands I chi n are evaluated implicitly on the maximal non-separating divisor q 1 = q 2 = 0. We will derive the explicit form of the scattering equations in the next section, and discuss the asymptotics of the chiral integrand in section 6.3. Notice also that the pre-factor ( 2   1  2 2 ) −1 of the loop integrand arises from the poles that were relaxed in the residue theorem, (u 1 u 2 ) −1 ; see also eq. (6.13) below.

The scattering equations on the bi-nodal Riemann sphere
Let us first focus on the asymptotics of the scattering equations on the bi-nodal Riemann sphere. From the degeneration of the holomorphic differentials (6.6), we obtain P µ as 32 where ω i, * are the meromorphic differentials on the Riemann sphere. The form of P µ strongly resembles the forward limit of the tree-level solution P (0) µ , but with n + 4 legs, two of which have been identified pairwise with equal-opposite loop momenta I µ . Notice that, as expected from a forward limit, the loop momenta are off-shell, 2 I = 0. The particle scattering equations E i ≡ µ i P 2 , calculated as the residue of P 2 at the vertex operator insertions σ i , degenerate straightforwardly to the bi-nodal sphere. Moreover, u 1 = u 11 and u 2 = u 22 are given respectively by the coefficients of the quadratic differentials ω 2 1 + ,1 − and ω 2 2 + ,2 − in P 2 . As discussed in section 5.1, this simply implies that Following the discussion in section 5.1, we choose the remaining scattering equation to take the form u 3 = u 11 + u 22 + u 12 = 2 1 + 2 2 + u 12 , so only u 12 remains to be determined on the nodal Riemann sphere. A convenient way to do so is to calculate the residue at σ 1 + of the quadratic differential (6.14) Of course, we could have chosen alternatively to calculate u 12 as the residue at any of the other three nodal points, consistent with the SL(2, C) Möbius symmetry of the Riemann sphere. The full set of scattering equations {u 3 , E i } can thus be expressed in a manifestly SL(2, C)-invariant form, We recover u 3 , dressed by a factor of ω I + ,I − (σ J ± ), upon fixing the SL(2, C) symmetry. 33 The scattering equations (6.15) can be written more compactly by introducing an auxiliary quadratic differential Both the nodal and the particle scatttering equations are then given by the residues of P 2 at the marked points, The three linear relations among these n + 4 scattering equations -encoding the Möbius invariance of the Riemann sphere -are given by A σ q A E A = 0 , for q = 0, 1, 2 , (6.18) in this notation. Both the form of these relations and the construction of the scattering equations (6.17) are strongly reminiscent of the tree-level case, where the SL(2, C)-invariant form of the scattering equations has been studied in [73]. Note, however, that while the scattering equations (6.17) bear a close structural resemblance with the tree-level scattering equations E i = Res σi P 2 in the forward limit, the defining quadratic differential has to be modified from P 2 (whose vanishing we relaxed in the residue theorem) to P 2 at two loops. A nice interpretation of the analogous feature at one loop was given recently in [34]: the full amplitude can be constructed directly from the Riemann sphere by introducing a 'gluing operator' that effectively creates the node. BRST invariance requires this operator to contain a non-local term compensating for the off-shell state running through the node, which in turn leads to an effective BRST operator Q ⊃ c 2 P 2 − 2 ω 2 +,− ≡ c 2 P 2 . It would be interesting to give a similar interpretation to the quadratic differential P 2 at two loops.
Using the Möbius-invariant form of the scattering equations introduces an additional factor of the Jacobian J into the amplitude. The full two-loop integrand I n is then given by the CHY-type formula, The additional quotient by SL(2, C) refers to the choice of scattering equations, and leads to the usual Fadeev-Popov factor. Moreover, we rescaled the chiral integrands I chi n by a factor of the Jacobian 20) and analogously I n defined in this manner has form degree one and vanishing SL(2, C)-weight in each of the marked points, including the nodes σ 1 + , σ 1 − , σ 2 + and σ 2 − . The full expression is thus manifestly invariant under both the SL(2, C) fixing any three of the marked points, and the SL(2, C) associated to the choice of n + 1 out of the n + 4 scattering equations. Finally, notice that the product ofδ delta functions has (1, 0)-form degree −1 and (0, 1)-form degree 1 in each of the punctures, since E A = Res σ A P 2 (σ) has (1, 0)-form degree 1. The total form degree of the expression under the integral is therefore of the appropriate type for the integration over the moduli space: a (1, 1) form in each of the punctures. 34 The formula above, with I n further simplified as below in (6.27), is the main result of this paper for supergravity.

The chiral integrand on the bi-nodal Riemann sphere
The last missing ingredient is the chiral integrand on the maximal non-separating boundary divisor D max 2,n . In particular, we are interested in the asymptotics of the Szegő kernels as well as the partition functions Z chi [δ] around q 1 = q 2 = 0.
By the definition (3.18), the behaviour of the Szegő kernels near the boundary divisor depends on the Jacobi theta functions and the prime form E(z, w). While the degeneration of the theta functions can be obtained straightforwardly from eq. (3.15), the expansion of the prime form needs more care. First note that Fay's degeneration formula (3.37) ensures that the subleading O(q 1 , q 2 ) contribution to the holomorphic differentials ω I vanishes, so subleading terms in the prime form E can only originate from the theta functions. A short calculation shows that these terms cancel, and so 35 Therefore, the subleading asymptotics of the Szegő kernels depend only on the behaviour of the theta function near the non-separating boundary divisor. With the expansion (3.15) of the theta function, the Szegő kernels can be grouped into NS-NS, NS-R, R-NS and R-R Szegő kernels as follows: All expansions are given to order o(q 1 q 2 ), which suffices for our purposes, and the notation for the Szegő kernels is chosen to reflect the sector of the spin structure according to (3.14). The explicit form of the respective orders can be found in appendix D.1. Below, we will primarily make use of the relative signs in the expansion (6.22). The other ingredient in the integrand are the partition functions, whose asymptotics are completely determined by the degeneration of the prime form and the theta functions. To order o(1) in the degeneration parameters, we find All details and the explicit form of the NS-NS, NS-R, R-NS and R-R partition functions can be found in appendix D.2. Note in particular that the highest pole in the partition functions is of order q −1 1 q −1 2 , so it is indeed sufficient to expand (6.22) only to order o(q 1 q 2 ). With the asymptotics (6.22) and (6.23), we can proceed to study the chiral integrand on the bi-nodal Riemann sphere, Let us first check explicitly that all terms of order q −1 1 , q −1 2 and q −1 1 q −1 2 cancel. 36 As a first check, this is easily verified for four external particles from the degeneration of the relations in appendix A. To generalise this cancellation to n points, we will rely on the relative signs in the partition functions and the Szegő kernels for the different spin structures. Explicitly, we find that the contribution to the chiral integrand at order q −1 1 q −1 2 vanishes due to the sign differences in the NS-NS spin structures, 36 Recall that we assumed this in the degeneration to the nodal Riemann sphere; if not, q 1 = 0 and q 2 = 0 would not have been simple poles.
To improve readability, we introduced the notation Pf M NS q a 1 q b 2 to indicate that the matrix M is defined using the NS-NS Szegő kernels introduced in (6. 22), and evaluated at order q a 1 q b 2 for a, b = 0, 1. 37 In particular, all signs due to different spin structures have been extracted, and only contribute an overall factor -which of course vanishes in (6.25). The calculation for the chiral integrand at order q −1 1 then proceeds in complete analogy, The same argument holds for I chi , with the R1 spin structures contributing instead of R2. The leading contribution of the chiral integrand is thus of order one, proving the assertion that q 1 = 0 and q 2 = 0 are indeed simple poles of the integrand. 38 The full chiral integrand is therefore given by the O(1) contribution on the bi-nodal sphere, where we defined NS-NS, NS-R, R-NS and R-R integrands Just as on the genus two Riemann surface, ten different terms contribute to the amplitude, as can be easily seen from the expansions (6.28). However, these terms are not aligned with the spin structures any more, but rather reflect the sector as well as the asymptotics of the degeneration. The (2n + 2) × 37 That is, to order o(q 1 q 2 ), we have Pf M δ (S δ → S NS ) and S NS ≡ n 1 ,n 2 ≥0 q n 1 1 q n 2 2 S (n 1 ,n 2 ) NS . 38 While we do not need the equivalent statement for q 3 here, note that it can be proven by the same methods after exchanging the roles of τ 1 and τ 3 using a modular transformation.
(2n + 2) matrices M are defined as before by where S ∈ {NS, R1, R2, RR} denotes the types of states propagating through the nodes. All expressions for the partition functions and the Szegő kernels can be found in appendix D. To find the asymptotics of ℘ (x 1 , x 2 ) on the bi-nodal Riemann sphere, note that the holomorphic differential degenerates to and thus, from the definition (σ) = c α ∆(x α , σ), In particular, the expression for and c α is only valid for x 1 and x 2 related by as can be seen from eq. (4.43a). The two identities for are related straightforwardly by (6.32), and it is easily checked that x 1 and x 2 are the unique zeroes of .
Using the simplified form of ℘ (x 1 , x 2 ) derived in eq. (4.47), we thus arrive at The two-loop supergravity integrand I n from (6.19), with I n as described here, is the main result of this section. Below, we will briefly derive the simplifications for four external particles, and discuss some basic checks for the formula.
The four-particle amplitude. As expected from the genus two results, the four-particle amplitude simplifies considerably. Degenerating directly from the expression (4.48) found in section 4.6, the integrand reduces to where we rescaled the integrand again by the Jacobian form J, This agrees directly with the four particle supergravity integrand given in [24]. Instead, we could have chosen to work with the general form of the integrand as a sum over spin structures, and only simplified the formula after the residue theorem, when the amplitude is localised on the bi-nodal Riemann sphere -the result agrees with eq. (6.34). As shown in [24], this integrand indeed reproduces the known four-point integrand of supergravity [74], if both the planar and the non-planar double boxes are written in the 'mostly-linear' representation of the propagators. This representation can be achieved from the standard representation via the use of partial fraction identities and shifts in the loop momenta, and is related to the Q-cut construction [29].
The two-loop integrand (6.34) can be shown to match known supergravity integrands exactly for four external particles [24]. To generalise this to n points, a proof of the formula (6.27) could in principle be given by studying the behaviour of the amplitude near the boundary of the (sphere) moduli space to establish the standard field theory factorisation properties of the integrand. In practice, a full factorisation proof of (6.27) is beyond the scope of this paper due to the Ramond states flowing through the nodes. 39 As a first step towards factorisation, we show below that the amplitude only contains physical poles. Since the absence of unphysical poles relies on properties of the two-loop scattering equations (6.15) established in previous work [24], we include a brief review for completeness.

Separating degenerations.
The key feature of the scattering equations, at both tree and loop level, is that they relate factorisation channels of the amplitude to the boundary of the moduli space M g,n . This characteristic is preserved when degenerating to the bi-nodal Riemann sphere, and the potential poles are completely determined by the scattering equations via for some subset D of the vertex operators coalescing to a point σ D . The poles arising from such separating degenerations have been classified in [24]. With K D µ = i∈D k i µ denoting the sum of external momenta in D, the scattering equations encode the poles described in table 1. This highlights two important features of the amplitude (6.19).
(i) Most notably, we observe that the poles containing only one of the loop momenta are linear. The loop integrand is therefore represented in the 'mostly-linear' propagator representation (as opposed to Feynman propagators), related to the Q-cut construction of ref. [29]. This representation of the integrand can be obtained from the standard representation by generalised 'partial fraction identities' of the form where 1/D i denote standard Feynman propagators. In particular, the right-hand side of the above relation contains only one quadratic propagator, given by 2 up to shifts in the loop (ii) The other important aspect in table 1 are the unphysical poles 1 + 2 2 + 2 1 − 2 · K D + K 2 D . Since these poles do not correspond to factorisation channels of the loop integrand, they must be absent from I n , which serves as an important check for our formula.degeneration From table 1, the scattering equations relate these unphysical poles to separating divisors D sep 0,n+4 that retain σ 1 + and σ 2 − (together with some subset σ i for i ∈ D) on one component of the separating degeneration, while σ 1 − and σ 2 + lie on the other sphere; see fig. 13. Of course, the presence of this unphysical divisor on the moduli space does not imply that the loop integrand contains a pole there -indeed, a CHY-type formula does not necessarily realise all factorisation channels encoded in the scattering equations. We can test for the presence or absence of the unphysical pole by probing the behaviour of the integrand close to the boundary divisor. While it is possible to verify the absence of the unphysical poles explicitly from the form of the integrand (6.27), the calculation is quite involved. Luckily, there is a much more elegant solution relying exclusively on properties of the amplitude already discussed in the degeneration to the bi-nodal Riemann sphere. To see this, note that the separating boundary divisors containing the unphysical poles correspond to q 3 = ∞ according to eq. (6.8), since either σ 1 + and σ 2 − coalesce, leading to (1 + 2 − ) = 0, or σ 1 − and σ 2 + , giving (1 − 2 + ) = 0. The limit q 3 → ∞, on the other hand, has already been studied in section 5.3, where we established the absence of a pole in the amplitude. Let us briefly recall the argument here.
Modular invariance guarantees that the integrand I n in M n = |q12|<1 dµ 2,n I n = |q12|>1 dµ 2,n I n , (6.38) has a simple pole at q 3 = q 12 = ∞, related to the pole at q 3 = 0 by the modular transformation q 12 ↔ 1/q 12 . After trivialising the isomorphism D max 2,n ∼ = M 0,n+4 by extending the domain of integration over q 3 however, the full amplitude contains a factor of f ( which cancels the pole at q 3 = ∞. The final expression on the bi-nodal sphere is thus finite at q 3 → ∞, and does not contain the unphysical pole 1 + 2 2 + 2 1 − 2 · K D + K 2 D . The argument presented here highlights the interplay between the form of the amplitude on the bi-nodal sphere and the residue theorem: the absence of a pole at q 3 = ∞ ensured both that the amplitude would localise on the sphere after applying the residue theorem, and that only physical factorisation channels are realised. To gain some additional intuition for this unphysical pole, let us briefly revisit the original formula (4.33) on the genus-two Riemann surface. The n + 3 genus-two scattering equations did not contain an equivalent of the unphysical pole -modular invariance guarantees both that the integrand has a simple pole at q 3 = ∞ and that the scattering equations relate this to the (physical) pole 1 + 2 ± K D 2 .
After the degeneration to the nodal Riemann sphere, however, the remaining (independent) n + 1 scattering equations do not relate these poles, so the pole at q 3 = ∞ assumes the unphysical form seen above -which must of course be absent from the loop integrand, because the original loop integrand did not contain the unphysical pole. In the residue theorem, this is implemented concretely by the map D max 2,n ∼ = M 0,n+4 , which provides the additional factor f (q 3 ) that cancels the pole at infinity.
Degenerate solutions. The scattering equations (6.15) on the nodal Riemann sphere encode an additional, more subtle unphysical pole: a Gram determinant of Mandelstam variables that can be localised on the so-called 'degenerate solutions' to the loop scattering equations [30]. 40 These degenerate solutions appear due to the form of the scattering equations for the nodal points: the two constraints associated to the same node have the same functional form, Solutions to the scattering equations thus fall into two classes, regular solutions where σ I + and σ I − localise on different roots, and 'degenerate solutions' with σ I + = σ I − for at least one of I = 1, 2. The latter class accounts for the unphysical Gram determinant pole at Let us recall why poles of this type are absent at one loop, where their potential to appear was first observed. Note in this context that, while modular invariance at higher genus places strict requirements on the worldsheet theories, one of the main strengths of the representation on the nodal sphere is its versatility. Integrands have been proposed for a variety of theories in various dimensions, ranging from supergravity and super Yang-Mills [22] to theories with less supersymmetry like pure Yang-Mills theory, NS-gravity and the bi-adjoint scalar theory [23,28]. For these theories, two different strategies have been developed to establish the absence of the Gram determinant pole. The simplest case is that of supersymmetric theories, whose integrands vanish on the degenerate solutions, so no further analysis is necessary. For non-supersymmetric theories on the other hand, the contribution from the unphysical pole can be shown to vanish after integration because it is homogeneous in the loop momentum. This distinction between the behaviour of supersymmetric and non-supersymmetric theories on degenerate solutions is closely linked to the UV behaviour of the theory [23], because the only solutions that contribute as → ∞ become degenerate in that limit. In particular, the fact that the integrand vanishes on the degenerate solutions is associated to the absence of bubbles in a diagrammatic representation of the loop integrand. We may thus naturally expect some of the above discussion to carry over to two loops. Indeed, we will find below that, in analogy to one loop, the two-loop supergravity integrand vanishes on the degenerate solutions.  With this background in mind, let us return to the scattering equations on the bi-nodal Riemann sphere (analysed in detail in [24]). In generalising from one to two loops, a new feature appears: the degenerate solutions can be further split into three types, best summarised by fig. 14. Note however that all three types of degenerate solutions satisfy σ I + = σ I − for at least one node I = 1, 2, so they all imply q 3 = 1, or equivalently τ 3 = τ 12 = 0.
Conveniently, we have encountered this divisor before in section 5.3 on the genus-two Riemann surface, in the context of trivialising the isomorphism D max 2,n ∼ = M 0,n+4 . As discussed there, the amplitude at a given spin structure scales as O(1) in τ 3 → 0, even in the presence of additional punctures on both components of the degeneration. To show further that the supergravity integrand vanishes on the degenerate solutions, and thus that the Gram determinant pole is absent, consider the type A configuration, where no additional punctures are present on one of the tori. Clearly, this factorisation channel vanishes in the genus-two representation of the amplitude, because all n-point one-loop amplitudes for n < 4 vanish in type II supergravity. On the bi-nodal sphere, both the leading and the subleading contribution from the degenerate solutions thus vanish, and the chiral integrand scales as O(τ 3 ).
This argument is easily generalised to degenerate solutions of type B and type C, using respectively that one-loop and two-loop n-point amplitudes vanish for n < 4. Note, moreover, that this argument for the absence of degenerate solutions relies on considering the full amplitude, including the sum over spin structures -no such cancellations are expected for any individual spin structure, or the contribution from just the NS sector of the amplitude, for example. As mentioned above for one loop, this behaviour is expected from the known UV properties of those theories.
In conclusion, the chiral integrand for type II supergravity at two loops behaves as for all types of degenerate solutions. Including the factor of f (q 3 ) ∼ τ −1 3 , the full integrand thus vanishes on the degenerate solutions, and only the N reg = (n+1)!−4n!+4(n−1)!+6(n−3)! regular solutions contribute to the supergravity amplitude. 41 Since the Gram determinant poles can be localised on the degenerate solutions, this precludes unphysical poles from contributing to the amplitude.

Super-Yang-Mills amplitudes
In the preceding sections, we have succeeded in obtaining an n-point formula for supergravity scattering amplitudes at two loops. We started on a genus-two surface but our final result is a formula on the bi-nodal sphere, which provides a dramatic simplification. Though technically much more challenging, our procedure mirrors that followed at one loop [22]. We can now proceed to mirror another accomplishment of Ref. [22] by constructing an n-point formula for super-Yang-Mills theory, now at two loops. The formula will generalise the four-point results of [24].

Parke-Taylor factor on the bi-nodal Riemann sphere
There are three main concerns in achieving our goal of describing super-Yang-Mills amplitudes. The first is that we have no expression on the genus-two surface, as we had in the case of supergravity. So we cannot follow a straightforward derivation from the degeneration limit to a nodal sphere. In fact, this apparent obstruction happens already at one loop. However, one of the lessons of [22] is that, while the degeneration is important in order to obtain a formalism on the nodal sphere, the new formalism can then be extended to a variety of theories, in particular gauge theory, without recourse to the higher-genus surface (where it may not even be possible to define those theories). Ref. [34] fully exploited this idea at one loop by re-deriving the formulas obtained in [22,23] directly from a non-local one-loop 'gluing operator' representing the node of the sphere. To conclude, we will simply work directly on the (bi-)nodal sphere. The second concern comes from the description of colour in the ambitwistor string formalism [13], which is analogous to that in the heterotic string [77] (and also Nair's observation [78]). Colour degrees of freedom are introduced via a current algebra, which leads to Parke-Taylor factors. For instance, at three points, where we denote (ij) = σ i − σ j as usual. There is a difficulty at higher points, where unwanted multi-trace terms appear in the correlation function. Some constructions avoid these terms, but they also have limitations [21]. In this paper, as in [13], we will simply discard the multi-trace terms, since this directly gives a valid formula for gauge-theory amplitudes. It will be useful to have in mind a 41 Details on the counting can be found in [24], appendix B.
certain representation of the tree-level result. Suppose we have an n-point tree-level amplitude: the colour part of the CHY formula [17] can be written as 42 , T a γ(4) ], · · · ], T a γ(n−1) ]T an ) 1 γ(2) γ(3) γ(4) · · · γ(n − 1) n , (7.2) where we denote the Parke-Taylor denominators by (123 · · · m) = (12)(23) · · · (m1). The third concern is that the cross ratio appearing in the supergravity formula (6.19), originating in the genus-two fundamental domain, signals a requirement that did not exist at tree level or at one loop. As we mentioned in section 6.4, the practical role of that cross ratio on the nodal sphere is to forbid unphysical factorisation channels. Our proposed formula for gauge theory will satisfy the same factorisation requirement. The solution to this problem was already mentioned in [24]. It suffices to restrict the orderings of the loop insertions in the colour part in the manner to be described momentarily.
We are now in a position to present the n-point two-loop formula for super-Yang-Mills theory. It is analogous to the supergravity formula (6.19), and it reads M n = d 10 1 d 10 where I n is given by n I PT (2) n .
(7.5) This formula should be compared with the tree-level analogue (7.2). The two-loop formula is very similar, but has four extra 'particles', corresponding to the loop insertions 1 ± and 2 ± , whose colour indices we contract for each node. The two insertions 1 ± play now the special role of 1 and n in (7.2), so that the sum is over permutations of all the remaining n + 2 insertions. In fact, the sum in (7.5) is over a restricted set of permutations (hence the prime in S n+2 ): we require that the ordering of loop insertions is (1 + · · · 2 + · · · 2 − · · · 1 − ), which leads to S n+2 having (n + 2)!/2 elements; that is, we drop terms with ordering (1 + · · · 2 − · · · 2 + · · · 1 − ), where the dots represent external particles. The reason for this is that the forbidden terms would lead to unphysical factorisation channels, the same type of unphysical channels that were eliminated by the cross-ratio in the supergravity case. We leave a more detailed exposition of the factorisation argument to future work, where we intend to provide field theory proofs of at least some of our ambitwistor-string-derived formulae.

Colour trace decomposition
While our two-loop Parke-Taylor formula (7.5) contains only single traces when seen as an (n + 4)-particle-like expression, we know it must give rise to single-trace, double-trace and triple-trace contributions. These contributions arise due to the colour index contractions δ a 1 + ,a 1 − and δ a 2 + ,a 2 − , together with the use of the completeness relation for the fundamental representation generators of the Lie algebra of SU(N c ), After the use of this identity, the Parke-Taylor formula takes the known form where tr(12 · · · ) ≡ tr(T a1 T a2 · · · ) is a colour trace, and {12 · · · m} −1 ≡ {m · · · 21} denotes the inverse ordering. The sums in (7.7) are over non-cyclic permutations of the n external particles or of partitions of these. The elements introduced above completely determine the trace decomposition coefficients. For instance, the planar contribution (the leading order in N c ) is The sum runs over all the order-respecting splittings ρ = (ρ 1 , ρ 2 , ρ 3 ), where a set ρ r may be empty. The remaining notations should be clear: δ |ρ2|,0 is 1 if ρ 2 is empty and is 0 otherwise; cyc(ρ) denotes sum over cyclic permutations of ρ; the last term corresponds (up to sign) to the same expression for the inverse ordering. Notice that, while this expression does not resemble the one presented in [24] for n = 4, they are actually equivalent. We can also identify the terms in the leading non-planar correction: where the inversion terms in the last line are only included for |ρ 1 | > 2 and/or |ρ 2 | > 2.
We have obtained these formulae for the trace coefficients C P ρ and C NP,2 ρ1,ρ2 by inference from the complete result (7.5) for four and five particles, and will not attempt a proof here. In fact, there are different representations, due to (KK-type [80]) identities among expressions with Parke-Taylor denominators. For instance, we find that we can also write each trace coefficient as and (7.11) A very helpful consistency test of these formulae was provided by the relations among trace coefficients studied in [81][82][83], which we checked up to five points.

Discussion
In this paper, we have constructed new formulae based on the two-loop scattering equations for the n-particle two-loop integrands in supergravity and in super-Yang-Mills theory. We started by constructing a formula derived from the ambitwistor string at genus two in the case of supergravity. We then turned this formula into a much simpler one at genus zero via the residue theorem on the genus-two moduli space. Finally, we proposed an analogous genus-zero formula for the n-particle twoloop integrand of super-Yang-Mills theory. A summary of the results was given in section 1.2. We stress that we have presented results for the loop integrands, since the ten-dimensional amplitudes are not defined due to the ultraviolet divergence of the loop integration, as expected from these field theories. Loop integrands for theories in fewer spacetime dimensions are obtained via dimensional reduction as usual, including for N = 4 super-Yang-Mills theory and N = 8 supergravity in four dimensions, if we reduce from 10d on a 6-torus.
Our results provide the two-loop extension of the one-loop formulae constructed in [22]. The developments of the one-loop story point therefore towards the next obvious steps. One goal is to present analogous formulae for the two-loop integrands of non-supersymmetric theories, as in [23]. The RNS formalism used here, where we consider separately contributions from the various spin structures, is helpful in that regard, since it is clear that the non-supersymmetric theories should arise entirely from the four NS-NS spin structures. This is work in progress. Obviously, our formulae admit further simplifications from the choice of gravitino gauge slice (the marked points x 1 , x 2 ) and, in the supersymmetric case, from the sum over all even spin structures. Indeed, it would be interesting to compare our results to the known expressions for the five-point two-loop integrand in both supergravity and super-Yang-Mills theory [84][85][86].
Another very interesting direction is to re-derive our formulae from a two-loop 'gluing operator' directly on the Riemann sphere, obviating the intricacies of higher-genus surfaces. This was achieved at one loop in [34]. Indeed, the heavy machinery involved in our calculations suggests that higher-loop results require a different approach. A major motivation for us is that the two-loop case may be sufficient to reveal important parts of the all-loop structure.
The formulae presented here for the loop integrands are of CHY type: they are expressed as moduli integrals on the sphere that localise on the solutions to the two-loop scattering equations. While such formulae have many interesting properties, it is important to obtain standard formulae for the loop integrand, depending only on the kinematic invariants. The goal is the extension of what was achieved in [33,35] at one loop. As in those works, there is the prospect of clarifying the colour-kinematics duality at loop level [3,4], using the ambitwistor string as a first-principles tool.
It would also be important to provide proofs for our loop-integrand formulae, e.g., based on factorisation as in [23] at one loop. Beyond the loop integrand, the ultimate objective is, of course, to obtain the scattering amplitude, particularly in the four-dimensional case, and hopefully to contribute beyond the state-of-the-art level to the phenomenology-oriented computation of gauge theory amplitudes. with x 1 + x 2 − 2∆ = 2κ ∈ Z 2 ⊕ ΩZ 2 . Here, we collect useful identities available due to this gauge choice: where the c α are defined via (z) = c 1 ∆(x 1 , z) = c 2 ∆(x 2 , z), and z * is an arbitrary marked point. As above, the interested reader is referred to the original string theory literature [12] for details and proofs.
Clearly, all terms M  n . As a warm-up, let us briefly revisit this here before proceeding. Since P (2) µ is related to P where we reset the notation for the period matrix to Ω again for convenience. Using again the modular properties reviewed in section 4.7, the period matrix transforms into Ω = Ω 11 Ω 12 + Ω 11 Ω 12 + Ω 11 Ω 11 + Ω 22 + 2Ω 12 , (B.11) while the holomorphic differentials and the loop momenta map to ω 1 , ω 2 = ω 1 + ω 2 , ω 2 , 1 , 2 = 1 − 2 , 2 , (B.12) Again substituting by while keeping the new differential ω I , the modular transformation M 3 maps P From the original inequalities 0 < 2Im(Ω 12 ) ≤ Im(Ω 11 ) ≤ Im(Ω 22 ) as well as the modular transformation of the period matrix (B.11), we again conclude that the integration domain for the modular parameters transforms to 0 < Im( Ω 11 ) ≤ 2Im( Ω 12 ) ≤ Im( Ω 22 ) , (B.14) in agreement with section 4.3. and thus we confirm that after a modular transformation, the amplitude is integrated over 0 < Im( Ω 11 ) ≤ 2Im( Ω 22 ) ≤ Im( Ω 12 ) . (B.17) α = 5: Note that α = 5 closely resembles α = 3 discussed above: we are interested in a modular transformation M 5 that maps P and we confirm that both the holomorphic differentials and the loop momenta behave as expected, ω 1 , ω 2 = ω 1 , ω 2 + ω 1 , 1 , 2 = 1 , 2 − 1 , (B.20) The modular transformation M 3 therefore maps P n can again be composed of the modular transformations M 5 and M 2 ; M 6 = M 5 • M 2 . As above, this is best understood at the level of the field P , where M 2 interchanges the coefficients of the holomorphic differentials, thereby mapping P (6) µ to P (5) µ . Since we just discussed this case, we only state the important transformation properties under M 6 . In particular, the period matrix behaves as where E I (z, w|Ω II ) are the prime forms on the respective tori Σ I , and y I denote the extra puncture encoding the node on each torus. In particular, this implies the following asymptotics for the meromorphic differentials where ω (1) w1,w2 (z) are the meromorphic differentials on the tori, and dw/w denotes the differential on the annulus. Upon distributing the marked points on the two tori, eqs. (C.5) and (C.6) provide all the asymptotics needed to study P µ in the separating degeneration, j, * (z) + K µ ω (1) y2, * (z) + O(τ ) for z ∈ Σ 2 , (C.8b) P µ (w) = K µ dw w + O(τ ) for w ∈ A τ , (C.8c) where K µ = i∈Σ1 k i,µ is the momentum flowing through the cylinder. The scattering equations thus descend to the separating degeneration as expected, with n I particle scattering equations on the torus Σ I , as well as a modular parameter scattering equation u II = 0 enforcing P 2 = 0 on Σ I . The remaining scattering equation is naturally associated to the annulus (see also [27]), and can be expressed as on the support of the other constraints. Therefore, neither the integrand nor the scattering equations contribute to a pole in Ω 12 ∝ τ , and the full amplitude (5.42) can have at most a simple pole in 1− q 12 .
To establish that the integral actually vanishes as τ → 0, consider again the integrand as defined in eq. (5.32). Since the amplitude is independent of the PCO gauge slice, let us choose both x α to be located on the connecting cylinder. This is the best we can do after chosing x α to be the zeros of the differential (z) due to the consistency condition Clearly, this is only satisfied if both x α lie on the cylinder or on the same torus. 43 Choosing the former with both x α on the cylinder, the Szegő kernels S δ (x α , z i ) vanish to order O(τ 1/4 ) due to the asymptotics of the prime form (C.6), 44 while the component A x1 x2 = ℘ (x 1 , x 2 )S δ (x 1 , x 2 ) of the Pfaffian behaves as O(τ ) on the support of the scattering equation u 3 , ℘ (x 1 , x 2 ) = K 2 dx 1 dx 2 The leading order contribution to the pfaffian Pf M δ is therefore of order O(τ 1/2 ), with the rows and columns associated to x α contributing τ 1/4 each. Moreover, the partition functions (4.28) are of order O(1) in this gauge, and the chiral integrand thus behaves as I chi n = O(τ 1/2 ) for each spin structure. Consequently, I chi nĨ chi n vanishes on the separating degeneration as O(τ ), confirming that f q 12 = O(τ −1 ) does not introduce a new pole in the integrand. 45 Evidently, the discussion above is specific to q 12 → 1, and the integrand will not vanish for other values of q 12 . Proving the uniqueness of f is then straightforward: (5.41) is the only function satisfying (5.40) with at most a simple pole in 1 − q 12 that vanishes as q 12 → ∞, as required to retain D non-sep 2,n as the only pole.
Since this will play an important role in establishing the absence of degenerate solutions on the bi-nodal Riemann sphere, note that it is sufficient to consider the contribution from a single spin structure to establish the absence of a pole in τ . The full integrand -including the sum over spin structures -actually vanishes to higher order in τ if no additional punctures are present on one of the tori, because all n-point amplitudes for n < 4 vanish in type II supergravity. On the bi-nodal sphere, this argument ensures the absence of a certain type of unphysical pole, discussed in detail in section 6.4, and thereby provides an important check on the amplitude.

D Degeneration of the Szegő kernels and the Partition functions
In this section, we give explicit expressions for the Szegő kernels and the partition functions of even spin structures near the non-separating boundary divisor, up to the relevant orders in the degeneration parameters. These degeneration formulae underly our results in section 6, and lead in particular to the representation (6.27) of the two-loop chiral integand from the bi-nodal Riemann sphere.
Beyond the scope of this article, the non-separating degeneration also plays an important role in superstring theory, for example in the field theory limit (see e.g. [89]) or for modular graph functions [90][91][92]. Due to the strong similarity between the ambitwistor string and string theory, the expressions given here may prove useful in these contexts as well.

D.1 Degeneration of the Szegő Kernels
We will focus first on the degeneration of the Szegő kernels. Throughout this section, we will work to order o(q 1 , q 2 ) since this is the highest pole present in the partition functions Z chi [δ]; see below. As discussed in section 6, all subleading terms in the asymptotics of the prime form cancel (6.21), See also [88] for further details on the degeneration of the Szegő kernels, and how to obtain them from a sewing mechanism of lower-genus Riemann surfaces. 45 If we had chosen instead the PCO gauge where both xα lie on the same torus, the Pfaffian would have been of order one, while the partition function contributes O(τ 1/2 ) for each spin structure. Evidently, this again leads to I chi n = O(τ 1/2 ). and thus the degeneration of the Szegő kernels depends only on the behaviour of the theta function near the non-separating boundary divisor. Using the expansion eq. (3.15) for the theta functions, the Szegő kernels for the NS-NS spin structures only differ by signs and can be summarised conveniently as follows, S δ1 (z, w) = S term of the partition function, Z (−1,0) R2 and defined the following product of cross-ratios: To conclude, we give the (single) term in the expansion of the Ramond-Ramond partition functions to the relevant order, where we used the following definition for the cross-ratios,