A Thomae-like Formula: Algebraic Computations of Theta Constants

We give an algebraic method to compute the fourth power of the quotient of any even theta constants associated to a given non-hyperelliptic curve in terms of geometry of the curve. In order to apply the method, we work out non-hyperelliptic curves of genus 4, in particular, such curves lying on a singular quadric, which arise from del Pezzo surfaces of degree 1. Indeed, we obtain a complete 2-level structure of the curves by studying their theta characteristic divisors via exceptional divisors of the del Pezzo surfaces as the structure is required for the method.


Introduction
Computations of theta constants are closely related to a classical problem that asks which complex principally polarized abelian varieties arise as Jacobian varieties of curves. The problem is called the Schottky problem and goes back to Riemann [18,19,9]. In addition, the topic has many applications in different areas such as theoretical physics [4] via integrable systems, and cryptography [23] via AGM-style point counting algorithms [20] and isogeny based cryptography [13].
Let g ≥ 0 be an integer. Denote M g the moduli space over C of curves of genus g and A g the moduli space of complex principally polarized abelian varieties of dimension g. The Torelli map j : M g → A g maps the isomorphism class of a curve to the isomorphism class of its Jacobian with its canonical polarization. The Schottky problem is to characterize the locus of Jacobians J g which is defined to be the closure of j(M g ) in A g . Mumford showed that a principally polarized abelian variety can be written as an intersection of explicit quadrics in a projective space [15]. The coefficients of these quadrics are determined by theta constants denoted by ϑ[q](τ ), where τ is a Riemann matrix for a specific choice of bases of regular differentials and homology and [q] ∈ F g 2 ⊕ F g 2 is a characteristic. Thomae-like formulas express these theta constants in terms of geometry of the curve. So the formulas can be seen as an explicit description of the Torelli map. In the case of a hyperelliptic curve given by where Ω 1 is the first half of a period matrix and U is a set of indices depending on the characteristic [q] [21,Page 218].
Let C be a non-hyperelliptic curve of genus g over a field k ⊆ C and τ be a fixed period matrix. When C is of genus 3, for any two even theta characteristics p 1 , p 2 we have (1) ϑ where [β i , β j , β k ] is the determinant of the coefficients of the equations β i , β j and β k which are certain lines labeled via some combinatorial data with respect to C [22, page 162] and n = 0, 1 can be computed depending on p 1 , p 2 . We call this Thomae-like formula Weber's formula. In this article, we mainly present a generalization of Weber's formula for any genus by getting motivated from [16,Remark 1].
Theorem 1.1. Let A i 's and B i 's be fixed representatives for the contact points of C with specific hyperplanes for i = 1, . . . , g − 1. For any two even characteristics p 1 , p 2 , we have the quotients of explicitly computable homogeneous quadratic forms Q r i andQ s i in g variables such that where d 1 , d 2 are the values of products of linear forms defining certain hyperplanes at the points A i and B i 's and n = 0, 1 is given purely in terms of p 1 , p 2 .
We define the Jacobian of C as the quotient C g /(Z g + τ Z g ) with respect to a normalized period matrix τ in the Siegel upper half space H g . Denote it Jac(C). A complete 2-level structure of C is represented via the defining equation(s) of the image of C under the canonical embedding and certain divisors on the curve with a suitable labeling as follows. Such divisors are called theta characteristic divisors. There are two kinds of theta characteristic divisors, even and odd, which are determined by the parities of the dimensions of the associated Riemann-Roch spaces. The odd theta characteristic divisors correspond to some geometric objects called multitangents on the canonical model of C. For instance, these objects are called bitangents when g = 3 and tritangents when g = 4. On the other hand, there is a canonical correspondence between the theta characteristic divisors on C and the quadratic forms on Jac(C) [2] over F 2 , where Jac(C) [2] denotes the 2-torsion subgroup of Jac(C). The quadratic forms are labeled through some combinatorial data which is called an Aronhold basis. For instance, the labeling which appears in Weber's formula is due to an Aronhold basis. The complete 2-level structure plays a role for the generalization of Weber's formula.
The paper is organized as follows. Section 2 mainly recalls some mathematical background as a base of the sequel, such as quadratic forms over F 2 , theta functions and characteristics, theta characteristic divisors, multitangents and their relations. We discuss the part reviewing quadratic forms in a coordinate-free setting peculiarly. We prove a coordinate-free version of [17,Theorem A1.1] which is about obtaining an Aronhold basis. At the same time, we give another way of the labeling in terms of coordinates by using Steiner sets. Section 2 might be considered also as a compact collection about the geometric, algebraic, combinatorial structures of non-hyperelliptic curves of genus g and the link among them.
In Section 3, we prove Theorem 1.1. As a consequence of the theorem, we give Algorithm 2 to compute the fourth power of the quotient of even theta constants associated to any given non-hyperelliptic curve.
In Section 4, in order to apply the algorithm, we study particularly curves of genus 4 since we have Weber's formula for the case of genus 3. Especially the ones which arise from del Pezzo surfaces of degree 1 are worked out because their geometric, algebraic and combinatorial properties are more accessible. We present a way to obtain a complete 2-level structure of these curves by finding an Aronhold basis thanks to geometry of the surface via some results in Section 2. We exhibit Example 4.1 to apply the way and finally use the example for an explicit computation with our algorithm.

Theta Characteristics
In this section, we review some basic definitions and results about quadratic forms over F 2 , theta functions and characteristics, theta characteristic divisors, multitangents and their relations devoted to the proof of Theorem 1.1. We refer to the classical source [8] for this part.
2.1. Quadratic forms over F 2 . Let g ≥ 1 be an integer and V be a vector space of dimension 2g over F 2 . We fix a bilinear, non-degenerate, alternating form , on V . Since Char F 2 = 2, there exists a basis {e 1 , . . . , e g , f 1 , . . . , f g } such that the matrix M g associated to the bilinear form , is where 0 g , I g are the zero, identity g × g matrices respectively. In other words, e i , e j = f i , f j = 0 and e i , f j = δ ij for all 1 ≤ i, j ≤ g. Such a basis is called a symplectic basis. We say that q : Let QV denote the set of all quadratic forms on (V, , ).
The vector space V has an action on QV. Indeed, we define the quadratic form q + v by (q + v)(u) = q(u) + v, u for any q ∈ QV and v ∈ V . Since the form , is nondegenerate, the action is free. The equality #V = #QV implies that the action is also transitive. So, for any two quadratic forms q, q ′ ∈ QV, there is a unique vector v = q + q ′ such that v, u = q(u) + q ′ (u).
In other words, the space QV is a homogeneous space for V . This implies that the disjoint union V QV is an F 2 -vector space of dimension 2g + 1.
We now define an invariant on quadratic forms which plays an important role in the classification of quadratic forms over F 2 . Definition 2.1. Let {e 1 , . . . , e g , f 1 , . . . , f g } be a symplectic basis of (V, , ). We define the Arf invariant a(q) of a quadratic form q by A quadratic form q is called odd (resp. even) if a(q) = 1 (resp. a(q) = 0). Let QV − (resp. QV + ) denote the set of all odd (resp. even) quadratic forms.
The Arf invariant does not depend on the choice of symplectic basis. The invariant splits the quadratic forms into two classes QV − and QV + which have the cardinalities 2 g−1 (2 g − 1) and 2 g−1 (2 g + 1) respectively.
2.1.1. Quadratic forms in terms of coordinates. We may introduce the quadratic forms also in terms of coordinates by fixing a symplectic basis.
2.1.2. Aronhold Basis. Let S = {q 1 , . . . , q 2g+1 } be a set of linearly independent vectors of the vector space V QV, where all the vectors lie in QV. Then any vector q ∈ V QV can be written as the sum α i q i with α i = 0, 1 ∈ Z. We define the length of q as the sum α i . Denote it #q. So we have 0 ≤ #q ≤ 2g + 1. We remark that if q is in the coset QV then #q is odd, since the sum of two quadratic forms corresponds to a unique vector in V .
Definition 2.2. The set S = {q 1 , . . . , q 2g+1 } is called an Aronhold basis if the Arf invariant of any element q only depends on #q modulo 4.
An Aronhold basis exists [10, Proposition 2.1]. Now, we introduce fundamental sets of V which are closely related with the Aronhold bases, and see how to obtain an Aronhold basis from a fundamental set.

Proposition 2.4. A is an Aronhold basis.
Proof. First of all, we show that A spans V QV. Suppose that v ∈ V . Note that, the condition of being azygetic for a fundamental set implies that any subset of F with 2g elements forms a basis of V . Since any 2g-subset of F forms a basis, we can write v = v i 1 + · · · + v in as a linear combination of vectors in F . Thanks to the completeness property of F , we may assume that n is even. So v = q i 1 + · · · + q in , since Char F 2 = 2. Now suppose that q ′ is a quadratic form, then q + q ′ is a vector v ∈ V . We write v + w = v i 1 + · · · + v in as a linear combination of v 1 , . . . , v 2g . We may assume that n is odd because of the completeness property in Definition 2.3. Now, we have Therefore it forms a basis for V QV since dim V QV = 2g + 1.
Now, we need to show that the Arf invariant of any quadratic form only depends on its length modulo 4. We start to prove it by starting with the quadratic forms in A. So we compute Both cases are equal modulo 2. So we have a(q 1 ) = · · · = a(q 2g+1 ). We show that a(q ′′ ) = a(q ′ ) + 1 for any q ′ , q ′′ ∈ QV with #q ′′ = #q ′ + 2.
Since all the quadratic forms in A have the same Arf invariant, we have a(q ′′ ) = a(q ′ ) + 1. The Aronhold bases enable us to determine the Arf invariant of any quadratic form.
Proof. Any quadratic form q can be written uniquely as a linear combination of quadratic forms in A, and a(q) depends only on #q modulo 4. So if we count the lengths of the quadratic forms which are 1 modulo 4 as follows, 2g + 1 i = 2 g−1 (2 g + 1) for g = 0, 1 (mod 4), 2 g−1 (2 g − 1) for g = 2, 3 (mod 4) then the proposition follows since we have 2 g−1 (2 g − 1) and 2 g−1 (2 g + 1) odd and even quadratic forms respectively.
Remark 2.7. Now, we can determine the Arf invariant of any quadratic form from its length, since we know the Arf invariant of a quadratic form of length 1.

2.1.3.
Labeling. We consider an Aronhold basis {q 1 , . . . , q 2g+1 }. Any quadratic form can be written uniquely as the sum of odd many q i 's.
Thanks to Proposition 2.6, we can determine whether a quadratic form is even or odd from its length.
In addition, we can label any quadratic form by an odd cardinality subset of {1, . . . , 2g + 1} of odd cardinality. For an odd number k in {1, . . . , 2g + 1}, the set I := {i 1 , . . . , i k } labels the quadratic form q = k j=1 q i j uniquely since the linear expression is unique. We call such a set I the label. We denote q I the quadratic form q. For our purpose, we are interested in labeling the quadratic forms. But, incidentally, note that any vector in V can be labeled via even cardinality subsets of {1, . . . , 2g + 1} in the same way as the quadratic forms are labeled.
Let I 1 , . . . , I k be the labels for some quadratic forms on V with k is odd. Since QV V is a vector space over F 2 , the pairs of the same quadratic forms and the vectors are cancelled in the sum q I 1 + · · · + q I k . So it is labeled by I 1 △ . . . △I k , where △ denotes the symmetric difference of set.
Finally, notice that once we fix an Aronhold basis the labeling is naturally unique.
A syzygetic triad {q 1 , q 2 , q 3 } can be completed into a set of four quadratic forms that adds up to zero. Such a set is called a syzygetic tetrad. By Definition 2.8, any 3-subset of this tetrad forms a syzygetic triad. Being syzygetic reflects on the labeling of quadratic forms as follows. Suppose that q I i is a quadratic form labelled by I i ⊂ {1, . . . , 2g + 1} for 1 ≤ i ≤ 4. Notice that, {q I i | i = 1, . . . , 4} is a syzygetic tetrad if and only if I 1 △ . . . △I 4 = ∅ since being syzygetic for q I i 's means that Syzygetic tetrads yield some sets called Steiner sets which classify syzygetic tetrads of odd quadratic forms. Definition 2.9. For any v ∈ V , we define the Steiner set Remark 2.10. There are 2 2g − 1 Steiner sets. Each Steiner set has 2 g−2 (2 g−1 − 1) elements paired by the translation q → q +v. Such two pairs form a syzygetic tetrad.
Remark 2.11. A characterization for an odd quadratic form q to belong to S v is the equality q(v) = 0 holds. It follows from a(q + v) = a(q) + q(v). Also note that Corollary 2.12. Equation (4) enables us to determine a symplectic basis so that a labeling from the set of Steiner sets as follows. Let S be the set of all the Steiner sets. Now, we can construct a subset Note that the vectors corresponding to each element of S ′ form a symplectic basis of V . Call them e 1 , . . . , e g , f 1 , . . . , f g respectively. Now, we can write the coordinates of a given quadratic form q on V with respect to e 1 , . . . , e g , f 1 , . . . , f g thanks to Remark 2.11. More precisely, we can compute the coordinates q(e i ), q(f i ) by checking whether q is contained in S i , S ′ i or not for i = 1, . . . g. This procedure gives a labeling which is defined in Section 2.1.3 in terms of coordinates.

2.2.
Theta functions and characteristics. In this part, we review basic definitions and properties of theta functions, and we see how to relate them with the quadratic forms.
Let g ≥ 0 and be the Siegel upper half space consisting of g × g complex matrices with positive definite imaginary part.
This is an analytic function on C g × H g . The evaluation of ϑ[q](z, τ ) at z = 0 is called a theta constant (Thetanullwert) (with characteristic [q]), which is denoted by [17, Theorem I.2], the theta function ϑ ǫ ǫ ′ is even (resp. odd) if and only if ε · ε ′ = 0 (resp. = 1). In addition, note that a characteristic [q] is odd if and only if the theta constant ϑ[q](τ ) is identically 0 for all τ ∈ H g . We also have that [17, Theorem I.3] Using the notation of Section 2.1.1, we identify a characteristic [q] modulo 2 with a quadratic form over F 2 which is denoted by q. The quadratic from q 0 defined in (2) is identified with the characteristic 0 0 . Conversely, fixing a symplectic basis, if we start with a quadratic form q then we write q = ǫ ǫ ′ with entries {0, 1} in terms of coordinates. We associate ǫ ǫ ′ to the characteristic of the theta function The characteristic ǫ ǫ ′ has only an impact on the sign of the theta function because of Equation (6). From now on, we only use characteristics with entries 0, 1. Now, we specify a particular symplectic vector space over F 2 related to algebraic curves. From now on, unless otherwise stated, we let C to be a non-hyperelliptic curve of genus g > 0 C and ω = (ω 1 , . . . , ω g ) be a basis of regular differentials on C. Let δ = (δ 1 , . . . , δ 2g ) be a symplectic basis of H 1 (C, Z) such that the intersection pairing has the matrix 0 g I g I g 0 g with I g and 0 g are the g × g identity and zero matrices respectively.
With respect to these choices, the period matrix of C is where , We consider a second basis η = (η 1 , . . . , η g ) of regular differentials obtained by This matrix is called the Riemann matrix. We let Jac(C) = C g /(Z g + τ Z g ).

Let us denote
with λ, µ ∈ Z g for 1 ≤ i ≤ g. Now, we let W be the Z-module generated by e 1 , . . . , e g , f 1 , . . . , f g so that Thanks to Equation (7), Weil pairing defines a nondegenerate symplectic form on V . We may induce the symplectic basis of V via e i , f i 's. Now thanks to identifications in Section 2.1.1, the theory of quadratic forms on V is coherent with the theta characteristics and (λ, µ) modulo 2. We denotev ∈ V the class of v, where the class is identified with the vector (λ (mod 2), µ (mod 2)). So the quadratic form q +v is the quadratic form associated to the theta characteristic [q] + v .
2.3. Theta characteristic divisors. In this section, we introduce theta characteristic divisors of C. Moreover, we explain the link between such divisors and the quadratic forms on Jac(C) [2] over F 2 . For more results and detailed explanations, we refer to [2,Chapter 1].
Let C d be the d-fold symmetric product of C which is identified with the set of effective divisors of degree d. Fix a point Q on C. The Abel-Jacobi map is defined by The map depends on the choice of the fixed point Q. Also, the value of the integral depends on the path chosen to integrate, however, u d (D) is well defined in Jac(C). It is possible to extend u d to noneffective divisors of degree d. Abel's theorem [2,Chapter 1] assures that this map is invariant under the linear equivalence between divisors. Denote Pic(C) the Picard group of C and Pic d (C) the subgroup of the divisor classes of degree d in Pic(C). By Abel's theorem, u d leads to a bijection from Pic d (C) into Jac(C). Moreover, it induces an isomorphism between the group Pic 0 (C) of the divisor classes of degree 0 in Pic(C) and the Jacobian Jac(C). We keep these identifications in mind while we are studying theta characteristic divisors in the following part.
with the characteristic 0 0 .
Since it is an analytic function on C g × H g and quasi periodic with respect to the lattice Z g + τ Z g given by [id, τ ] it defines a divisor Θ of Jac(C) which is the zero divisor of ϑ(z, τ ).
We denote ℓ(D) the dimension of the Riemann-Roch space of D. The following theorem allows us to relate certain divisors with quadratic forms.
Theorem 2.14 (Riemann Singularity Theorem). Let κ be the canonical divisor of C. There exists a unique divisor class we have a correspondence between theta characteristic divisors of C and quadratic forms on Jac(C) [2] over F 2 as follows.
If v is given by (λ, µ) with respect to a fixed symplectic basis then by Theorem 2.14 and Equation (7) we have We identify q D 0 with q 0 that is defined in Equation (2). Furthermore, any theta characteristic divisor D is linearly equivalent . We can associate D to the quadratic form since mult v (Θ) is equal to the multiplicity of ϑ[q D ](z, τ ) at 0 and the latter has the same parity as q D . Thanks to Equation (3) and Theorem 2.14, we have for any w ∈ V . Conversely, any quadratic form q defines a divisor Remark 2.15. To sum up, there is a one-to-one correspondence between the set of quadratic forms on Jac(C) [2] over F 2 and the set of theta characteristic divisors. Moreover, an odd (resp. even) theta characteristic corresponds to an odd (resp. even) quadratic form. In the following section, we discuss extrinsic geometric objects which correspond to the theta characteristic divisors.
Let D be an effective theta characteristic divisor of C. We call D a vanishing theta Definition 2. 16. We call such a hyperplane a multitangent.
Remark 2.17. When g = 3, the dimension of the Riemann-Roch space of any theta characteristic divisor is either 0 or 1 because C is non-hyperelliptic. There are 28 multitangents, in this case these geometric objects are known as bitangents.
For g = 4, first of all, for any theta characteristic divisor D, ℓ(D) = 0, 1 or 2 because of Clifford's theorem for divisors [2,Chapter III]. The multitangents are known as tritangents in this case. There are 120 tritangents which correspond to the effective odd characteristic divisors. To be more specific, the canonical model of C lies on a smooth quadric if and only if there is not a vanishing theta characteristic divisor. In this case, we have exactly 120 tritangents. Otherwise, C lies on a singular quadric Q, then there is a unique effective even theta characteristic divisor, call D e . The dimension ℓ(D e ) = 2. So there is a one dimensional family of tritangents, that pass through the node of Q. The tritangents which correspond to the effective odd theta characteristic divisors are the ones which do not pass through the node of Q.
Note that, such a curve arises from a del Pezzo surface of degree 1 which follows from [14,Theorem 24.4.iii]. In Section 4, we come back to this subject.
Remark 2.18. Everything aside, if C is a general curve of genus g, then ℓ(D) = 0, 1 for any theta characteristic divisor D. So there is a unique hyperplane H D if D is an effective odd theta characteristic divisor. In this case, notice that we have exactly 2 g−1 (2 g − 1) multitangents. For the generality condition, we refer to [11].

Computation of Theta Constants
In this section, we apply results from Section 2 to prove Theorem 1.1. This enables us to obtain Algorithm 2. Recall that C is a non-hyperelliptic curve of genus g. Throughout the section, we fix a Riemann matrix τ of C associated a normalized regular differentials η as introduced in Section 2.3. Thus we do not write τ in the notation of theta functions and constants. Recall that we denote D q the corresponding effective theta characteristic divisor to the quadratic form q. In addition, fix a theta hyperplane H Dq and also a linear polynomial β q ∈ C[X 1 , . . . , X g ] such that H Dq is the hyperplane with equation β q = 0. We abuse the notation by identifying the canonical model of C with itself. In addition, we expect the reader to be aware all the identifications which are described in Section 2 among quadratic forms, theta characteristics, theta characteristic divisors and multitangents.
We begin with two even characteristics p 1 , p 2 and write p 1 + p 2 = q 1 + q 1 . Let D q 1 , D q 1 be the theta characteristics divisors associated to q 1 , q 1 . We write where A i 's (respectively B i 's) are the tangency points of the multitangent β q 1 (respectively β q 1 ) for i = 1, . . . , g − 1. Let T = T 1 + · · · + T 2g−3 be an arbitrary generic effective divisor of degree 2g − 3 on C and be κ = 2(A 1 + · · · + A g−1 ). By fixing a point P 0 on C, we introduce According to Riemann theorem [17, Theorem V.1], f i,T (P ) is a regular section of a line bundle over C, and if f i,T is not identically zero then its zero divisor (f i,T ) 0 has degree g and satisfies For each i = 1, 2, we can find an open cover {U i,α } α of C such that for each k = 1, . . . , 2g −3 there exists α k for which T k is not a pole of t (j) i,α k for any j = 1, . . . , 2g −3.
We define χ i,T as the family of the following rational functions (10) χ on U α for all α. Therefore, the sections χ i,T and t i,α 's. Since χ i,T (T j ) = 0 for 1 ≤ j ≤ 2g − 3, we see that (χ 1,T ) 0 = T + R i , where R i is an effective divisor of degree g, uniquely defined by R i + T ∼ κ + D p i . Now Proof. The proof is a direct generalization of [16, Lemma 3.1, Lemma 3.2].
From this we get that We denote √ q a (fixed) section (Abelsche Function) of the line bundle associate to D q for a quadratic form q. We write P √ q instead of √ q(P ) to express all the following matrices relatively more decent. Let be the sets of g − 1 many distinct pairs such that Remark 3.2. Notice that r i , r i ∈ S p 1 +q 1 and s i , s i ∈ S p 1 +q 1 for i = 1, . . . , g − 1. For each align in Equation (11), we have 2 g−2 (2 g−1 − 1) pairs of odd quadratic forms satisfying them, see Remark 2.10.
Assume that we can set the following expressions Once we make the choice in Equation (12), the quotient χ 1,T (A 1 )/χ 2,T (A 1 ) take the indeterminate form 0/0, so we need firstly to resolve this ambiguity.
Note that A i q 1 r j r j = 0 and A i q 1 s j s j = 0, since A i is in the zeroes of the divisors Div q 1 r j r j and Div q 1 s j s j for i = 1, . . . , g − 1 and j = 1, . . . , g − 1. By using these identities, we have and where g T (P ) = P √ q 1 T 2 √ q 1 · · · T g−1 √ q 1 A 1 √ q 1 · · · A g−1 √ q 1 . Now, let P = A 1 and T i = A i for i = 2, . . . , g − 1. So we have 3.2. Rewriting The Quotient. In order to have (−1) a(q 0 +p 1 +p 2 ) ϑ[p 1 ](0) 4 ϑ[p 2 ](0) 4 , we need to compute χ 2,T ′ (A 1 ) 2 χ 1,T ′ (A 1 ) 2 thanks to Equation (13). Notice that χ 2 1,T ′ , χ 2 2,T ′ are sections of the same line bundle corresponding to 3κ. So their quotient is a rational function on the curve. All the following computations in this section are carried out to find this rational function. Now, we suppose that T ′ = A 2 + · · · + A g−1 + B 1 + · · · + B g−1 . Therefore, we have Note that A i q 1 r j r j = 0, A i q 1 s j s j = 0 and B i q 1 r j r j = 0, B i q 1 s j s j = 0 for i = 1, . . . , g − 1, j = 1, . . . , g − 1. Then we have where After making similar computations for χ 2,T ′ , we have then the following quotient In the following part, we reorganize the quotient in order to express it with some elementary functions. For that reason, we complete all the pairs of quadratic forms appearing in the matrices above to syzygetic tetrads as follows.
Let {r g , r g } and {s g , s g } be any other two pairs of quadratic forms from S p 1 +q 1 and S p 1 +q 1 such that r g + r g = p 1 + q 1 and s g + s g = p 1 + q 1 different than any {r i , r i } and {s i , s i } for i = 1, . . . , g −1 respectively. Then we divide each row of the matrices by one of T ′ i r g r g and T ′ i s g s g with a suitable T ′ i among A 1 , . . . , A g−1 , B 1 , . . . , B g−1 for each i = 2, . . . , 2g − 3. Hence we have where d 1 = B 1 r g r g · · · B g−1 r g r g A 1 s g s g · · · A g−1 s g s g and d 2 = B 1 s g s g · · · B g−1 s g s g A 1 r g r g · · · A g−1 r g r g .
3.2.1. Computing the Quadrics. Now, all the entries of the four matrices in Equation (14) are formed by a syzygetic tetrad of quadratic forms. Without loss of generality, we show how to obtain an elementary function by using such a tetrad only on the entries with r i , r i 's. Among 2 g−2 (2 g−1 − 1) − g pairs, we consider one more pair {r g+1 , r g+1 } from S p 1 +q 1 satisfying r g+1 + r g+1 = p 1 + q 1 different than any pairs {r i , r i } for i = 1, . . . , g. Recall that the corresponding odd theta characteristic divisors to r i , r i are denoted by D r i , D r i . It follows from [8, Chapter 8] that D r i + D r i + D r g+1 + D r g+1 is cut out by a quadric Q r i in P g−1 . We can compute the quadric by computing the linear system of quadrics that pass through the points in the support of the aforementioned divisors. Denote the quadric Q s i which exists for the tetrads among s i , s i 's. So, we have the following equalities between the following divisors on C Div √ r i r i It implies that there are constants c r,ig , c s,ig ∈ C such that √ r i r i In the light of the computations above, we rewrite χ 2,T ′ (A 1 )/χ 1,T ′ (A 1 ) in terms of the corresponding quadrics and take the square of the quotient. Note that the constants in Equation (15) appear in the numerator and denominator of the quotient χ 2,T ′ (A 1 )/χ 1,T ′ (A 1 ) in the same way, so they are cancelled out. We do not include them in the quotient . Therefore, Equation (13) implies Theorem 1.1.

Remark 3.3.
With respect to the proof, we need not only to compute the Steiner sets S p 1 +q 1 and S p 1 +q 1 in terms of the multitangents but also label them with respect to a symplectic basis. Namely, we need to compute a complete 2-level structure of the curve. We refer to [7,Algorithm 3.2] to obtain all the Steiner sets from the set of multitangents, which uses the geometric characterization of being syzygetic as we use in Section 3.2.1. One can compute the multitangents with some algebraic geometric methods involving Gröbner bases, resultants etc. For the latter, we remind Corollary 2.12. Nevertheless, we need to point out that neither computing the Steiner sets which is equivalent to computing of the quadrics described in Section 3.2.1 nor computing the multitangents is generally a low-cost task from the computational perspective.
Thanks to Theorem 1.1, we establish Algorithm 2. We firstly give a preliminary algorithm in order to prepare the contents of Algorithm 2.

Algorithm 1: Preliminary Computation
Input: C, canonical model of the curve in P g−1 . Output: S, set of all Steiner sets in which all the multitangents labeled with appropriate characteristics with respect to a symplectic basis. 1: Compute the multitangents. 2: Compute the Steiner Sets. 3: Label all the multitangents as described in Corollary 2.12. 4: return S.

Algorithm 2: Theta Constants
Input: • C, canonical model of the curve in P g−1 .
• Even characteristics p 1 , p 2 ∈ Z g 2 ⊕ Z g 2 with respect to the labeling obtained by Algorithm 1.
1: Set the Steiner sets S p 1 +q 1 and S p 1 +q 1 with q 1 + q 1 = p 1 + p 2 . 2: Set randomly g + 1 many r i , r i and s i , s i in S p 1 +q 1 and S p 1 +q 1 respectively for i = 1, . . . , g + 1. 3: Call the multitangents β q 1 , β q 1 and compute the contact points A 1 , . . . , A g−1 and B 1 , . . . , B g−1 of β q 1 and β q 1 with C respectively. 4: Call the multitangents β r i , β r i and β s i , β s i for i = 1, . . . , g + 1 and compute their contact points with C. 5: Now compute the quadrics Q r i , Q r g and Q s i , Q s g for i = 1, . . . , g − 1 via the tangency points computed in Step 4. 6: Check whether Q r i 's and Q s i 's are linearly independent for i = 1, . . . , g − 1 separately. If one of them fails to be linearly independent then restart the procedure from Step 2. 7: Compute d 1 and d 2 .
8: return The algorithm has been implemented in MAGMA [5] and available on https://turkuozlum.wixsite. In the code file, there are supplemental codes computing a complete 2-level structure of C when C is a non-hyperelliptic curve of genus 4 lying on a quadric cone.

Remark 3.4.
Step 7 in Algorithm 2 has a conditional statement. This situation arises from the choices in Equation (12). Indeed, these choices can rarely fail to be the bases of L(D p 1 + κ) or L(D p 2 + κ). However we can control it computationally by checking the linear dependence of the quadrics forming the quotient We actually anticipate the following conjecture holds.

Applying the Algorithm in genus 4
In this section, we apply the algorithm on an example of a curve of genus 4. We avoid the case of genus 3 to use for the application since Weber's formula given in Equation (1) does the job. However, we shall note that our formula and Weber's formula coincide on all the examples we have tried as we have expected, because we obtain our formula from Weber's formula immediately after several algebraic computations applied to it. Now assume that the genus of C is 4. The canonical model is given by the complete intersection of a quadric Q and a cubic surface R in P 3 . We call such a curve a space sextic. A space sextic lies on either a smooth quadric or a quadric cone. For the application, we focus on the ones lying on a quadric cone since they provide a relatively efficient way to obtain a complete 2-level structure.

Space Sextics Lying on a Singular Quadric.
Assume that Q is a quadric cone. In this case, C has a vanishing even theta constant. The characteristic of this constant is corresponding to the unique effective even theta characteristic divisor for which the dimension of the Riemann-Roch space is 2. The corresponding extrinsic geometric object is a one dimensional family of tritangents. Each plane in this family passes through the node of Q. In the meantime, for each effective odd theta characteristic divisor, there is a unique tritangent. There are 120 of them. 4.1.1. The Canonical Model and Tritangents. Such a space sextic is constructed from a del Pezzo surface of degree 1 [7, Proposition 5.1]. Its geometry is more transparent compared to the other case thanks to the geometric structure of the del Pezzo surfaces.
Let S be a del Pezzo surface of degree 1. The surface S is isomorphic to the blow up of P 2 at 8 points in general position, say P 1 , . . . , P 8 . We denote P = {P 1 , . . . , P 8 }. We treat S as the blow up. The anticanonical model for S is a sextic hypersurface in P(1 : 1 : 2 : 3). We can compute this model by starting with P 1 , . . . , P 8 . If we consider the projection π : P(1 : 1 : 2 : 3) → P(1 : 1 : 2) then it is generically 2-1 branched along a curve C ′ . If we embed P(1 : 1 : 2) as a singular quadric surface in This disposition enables us to compute the defining equations of C and the equations of the tritangents starting with P. Indeed, the map between S and C gives a 2-1 correspondence between the exceptional curves on S and tritangents of C. The exceptional curves are the images of the following pairs in P 2 denoted by (0,6), (1,5), (2,4), (3,3) respectively.
(0,6) The point P i and the sextic vanishing triply at P i and doubly at the other seven points. (1,5) The line through {P i , P j } and the quintic vanishing at all eight points and doubly at the six points in P\{P i , P j }. (2,4) The conic through P \{P i , P j , P k } and the quartic vanishing at P and doubly at P i , P j , P k . (3,3) The cubic vanishing doubly at P i , non-vanishing at P j , and vanishing singly at P\{P i , P j } and the cubic vanishing doubly at P j , non-vanishing at P i , and vanishing singly at P\{P i , P j }. For a detailed explanation, we refer [7]. Moreover, we do not have only the equations but also a complete 2-level structure of C as follows.

4.1.2.
Labeling. The configuration of exceptional curves on S enables us to label the tritangents with appropriate characteristics in a coordinate-free way. In the following part, we show how to obtain a labeling which is explained in Section 2.1.3 Let E 1 , . . . , E 8 be the exceptional divisors lying above P 1 , . . . , P 8 under the blowup map and κ S be the canonical divisor of S. Suppose that ρ : Pic S → Pic C be the natural restriction homomorphism. Let ·, · be the Weil pairing on Pic(C) [2]. Set v i := ρ(E i +κ S ) and v 9 = 8 i=1 then {v 1 , . . . , v 9 } is a fundamental set of Pic(C) [2] i.e. ρ(E i + κ S ), ρ(E j , κ S ) = 1 if i = j which follows from [24, Theorem 2.1]. Now, we consider ρ(−κ S ). It is an even theta characteristic divisor by [24,Lemma 2.4(ii)]. We take the quadratic form q := q ρ(−κ S ) corresponding to the theta characteristic divisor ρ(−κ S ). We define q i := q + v i + v 9 for i = 1, . . . , 9. It follows from Proposition 2.4 that the set {q 1 , . . . , q 9 } forms an Aronhold basis of Pic(C) [2] Q Pic(C) [2]. Hence, we can express all the quadratic forms in terms of q 1 , . . . , q 9 and label them via subsets of {1,. . . ,9} which is formed by the indices of the points P 1 , . . . , P 8 and an extra index 9 as follows.
This labeling determines the parities of quadratic forms depending on only the cardinality of the label by definition of Aronhold basis and distinguishes them from each other, which follows from Remark 2.7.
Furthermore, we can specify which quadratic form corresponds to which exceptional divisor on S by finding the corresponding theta characteristic divisor. We give the following table for the correspondence and refer [6, Section 1.2.3] for the computations.
Example 4.1. Let k = C. We consider the following 8 points in P 2 (k). The defining equations of the curve C of genus 4 are the following equations.
The list of the equations of the tritangents and their corresponding labels are computed as follows.  However, since we know how to obtain the complete level structure for the curves lying on a quadric cone, we could deform numerically a complete 2-level structure of an initial curve lying on a quadric cone to a target curve, namely the curve we want to have a complete 2-level structure, lying on smooth quadric by using the mathematical software Bertini [3]. For a related work, see [