1 Introduction

Let V be a finite-dimensional unitary representation of a compact Lie group G. The action of G on the underlying real symplectic manifold of V is Hamiltonian and admits a homogeneous quadratic moment map. The symplectic quotient \(M_0\) at the zero level of this moment map is usually singular but has the structure of a symplectic stratified space, i.e., is stratified into smooth symplectic manifolds; see [30]. The Poisson algebra of smooth functions on \(M_0\) has an \({\mathbb {N}}\)-graded Poisson subalgebra \({\mathbb {R}}[M_0]\) of real regular functions on \(M_0\), the polynomial functions on \(M_0\) as a semialgebraic set.

This paper continues a program to compute the Hilbert series of \({\mathbb {R}}[M_0]\) for various choices of G with particular attention to the first few coefficients of the Laurent expansion of the Hilbert series around 1, here denoted \(\gamma _0, \gamma _1, \ldots \). The case when \(G = {\mathbb {S}}^1\) is the circle was handled in [21], the case \(G = {\text {SU}}_2\) was treated in [14], and analogous computations for the Hilbert series of the algebras of off-shell (i.e. classical) invariants were given in [8, 9]. Here, we consider the case \(G = {\mathbb {T}}^2\), the first step towards understanding those cases where \({\text {rank}} G > 1\).

The Hilbert series and its first two Laurent coefficients have played an important role in the study of classical invariants. Hilbert first computed \(\gamma _0\) for irreducible representations of \({\text {SL}}_2\) in [23], and computations of the Hilbert series or its Laurent coefficients in this case have been considered by several authors; see for example [2,3,4,5,6, 24,25,26, 32, 33, 36]. When G is finite, it is well known that the first two Laurent coefficients are determined by the order of G and the number of pseudoreflections it contains; see [35,   Lemma 2.4.4]. The meanings of the \(\gamma _m\) more generally have been investigated in [1] and [28,   Chapter 3].

For symplectic quotients, the Hilbert series continues to be a valuable tool for understanding the graded algebra of regular functions. Certain properties of a graded algebra, such as Cohen-Macaulayness and Gorensteinness, can be verified using the Hilbert series [34], and this has been used to check the Gorenstein property for symplectic quotients in [16, 20]. Additionally, the Hilbert series has been used to distinguish between symplectic quotients that are not (graded regularly) symplectomorphic [11, 22], and as a heuristic to identify potentially symplectomorphic symplectic quotients [18].

One stumbling block in the computation of the Hilbert series is the occurrence of degeneracies, collections of weights that are not in general position that introduce singularities in the Molien-Weyl integrand. In the case of \(G = {\mathbb {T}}^2\), these degeneracies occur when certain triples of vectors associated to the columns of the weight matrix are collinear; see Definition 1. Such degeneracies complicate attempts to compute the Molien-Weyl integral and the Laurent coefficients of the Hilbert series for all representations uniformly. In previous computations [8, 9, 14, 21], the removability of these singularities was handled in a manner specific to each case. In this paper, we provide a general explanation for the removability of those singularities which can be used in applications of the Molien-Weyl theorem for any reductive group; see Lemmas 1 and 2. For the lowest-degree coefficient of the Laurent expansion, we detail explicit computations to indicate the nature of the cancellations involved in removing these singularities; see Sect. 4.2.

After reviewing the framework and relevant background information in Sect. 2, we turn to the computation of the Hilbert series in Sect. 3. The first main result of this paper is Corollary 1, giving a formula for the Hilbert series of \({\mathbb {R}}[M_0]\) corresponding to an arbitrary \({\mathbb {T}}^2\)-representation in terms of the weight matrix A. This result is stated in terms of the Hilbert series \({\text {Hilb}}_A^{ on }(t)\) of an algebra that does not always coincide with the regular functions \({\mathbb {R}}[M_0]\) on the symplectic quotient \(M_0\) of the representation with weight matrix A and assumes that A is in a specific standard form. However, there is no loss of generality; we explain in Sect. 2.1 that the Hilbert series of \({\mathbb {R}}[M_0]\) can be computed as \({\text {Hilb}}_A^{ on }(t)\) for some A, and in Sect. 2.2 that A can always be put in standard form with no change to \({\text {Hilb}}_A^{ on }(t)\). This approach greatly simplifies the computations in Sect. 3.1. The formula for \({\text {Hilb}}_A^{ on }(t)\) takes its simplest form in Theorem 3 with additional hypotheses on the representation that are described in Sect. 2.2. The formula suggests a (not particularly fast) algorithm that we describe in Sect. 3.3.

In Sect. 4, we turn to the computation of the first four Laurent coefficients, which are given in Theorems 4 and 5. These computations require results of Smith [31] on the number of solutions of a system of linear congruences, which we recall in Sect. 2.3. After demonstrating the removability of the singularities in the degenerate cases, we illustrate the cancellations in the rational expression of the lowest-degree Laurent coefficient in Sect. 4.2. We expect that the numerators of the resulting rational functions admit combinatorial descriptions in terms of some sort of generalization of Schur polynomials, and such a description would yield closed form expressions for the Laurent coefficients in the degenerate case. We hope that this paper leads to progress in this direction. Finally, in Sect. 4.4, we briefly describe methods we have used to efficiently compute the first Laurent coefficient in the presence of these singularities.

2 Background

2.1 Symplectic quotients associated to representations of \({\mathbb {T}}^2\)

In this section, we give a concise summary of the construction and relevant background for symplectic quotients by the 2-torus. The reader is referred to [21] for more details; see also [11, 17, 22].

Throughout this paper, we fix the compact Lie group \({\mathbb {T}}^2\) and consider finite-dimensional unitary representations \(V \simeq {\mathbb {C}}^n\) of \({\mathbb {T}}^2\). Such a representation can be described by a weight matrix

$$\begin{aligned} A = \begin{pmatrix} a_{11} &{} a_{12} &{} \cdots &{} a_{1n} \\ a_{21} &{} a_{22} &{} \cdots &{} a_{2n} \end{pmatrix} \in {\mathbb {Z}}^{2\times n}, \end{aligned}$$

where the action of \((z_1,z_2)\in {\mathbb {T}}^2\) on \((x_1,x_2,\ldots ,x_n)\in {\mathbb {C}}^n\) is given by

$$\begin{aligned} (z_1,z_2)\cdot (x_1,x_2,\ldots ,x_n) = \big ( z_1^{a_{11}}z_2^{a_{21}} x_1, z_1^{a_{12}}z_2^{a_{22}} x_2,\ldots , z_1^{a_{1n}}z_2^{a_{2n}} x_n \big ). \end{aligned}$$

We will often use \(V_A\) to indicate that V is the representation with weight matrix A, or simply V when A is clear from the context. The representation is faithful if and only if A has rank 2 and the \(\gcd \) of the \(2\times 2\) minors of A is equal to 1; [11,   Lemma 1]. Applying to A elementary row operations that are invertible over \({\mathbb {Z}}\) corresponds to changing the basis of \({\mathbb {T}}^2\) and hence does not change the representation. Note that the \({\mathbb {T}}^2\)-action on V extends to a \(({\mathbb {C}}^\times )^2\)-action with the same description.

With respect to the underlying real manifold of V and symplectic structure compatible with the complex structure, the action of \({\mathbb {T}}^2\) is Hamiltonian, and identifying the Lie algebra \({\mathfrak {g}}\) of \({\mathbb {T}}^2\) (and hence its dual) with \({\mathbb {R}}^2\), the moment map \(J^A: V\rightarrow {\mathfrak {g}}^*\) (denoted J when A is clear from the context) is given by

$$\begin{aligned} J_i^A(x_1,\ldots ,x_n) = \frac{1}{2}\sum \limits _{j=1}^n a_{ij} x_j \overline{x_j}, \quad i=1,2. \end{aligned}$$

The real \({\mathbb {T}}^2\)-invariant variety \(Z = Z_A = J^{-1}({\mathbf {0}}) \subset V\) is called the shell, and the symplectic quotient is the space \(M_0 = M_0^A = Z/{\mathbb {T}}^2\). The symplectic quotient has a smooth structure given by the Poisson algebra \({\mathcal {C}}^\infty (M_0) = {\mathcal {C}}^\infty (V)^{{\mathbb {T}}^2}/{\mathcal {I}}_Z^{{\mathbb {T}}^2}\), where \({\mathcal {C}}^\infty (V)^{{\mathbb {T}}^2}\) denotes the \({\mathbb {T}}^2\)-invariant smooth \({\mathbb {R}}\)-valued functions on V, \({\mathcal {I}}_Z\) is the ideal of \({\mathcal {C}}^\infty (V)\) of functions vanishing on Z, and \({\mathcal {I}}_Z^{{\mathbb {T}}^2} = {\mathcal {I}}_Z\cap {\mathcal {C}}^\infty (V)^{{\mathbb {T}}^2}\). Equipped with this structure, the symplectic quotient \(M_0\) has the structure of a symplectic stratified space, see [30].

The algebra \({\mathcal {C}}^\infty (M_0)\) contains an \({\mathbb {N}}\)-graded Poisson subalgebra \({\mathbb {R}}[M_0]\) of real regular functions on \(M_0\), whose construction we now describe. Let \({\mathbb {R}}[V]^{{\mathbb {T}}^2}\) denote the graded algebra of \({\mathbb {T}}^2\)-invariant polynomials over \({\mathbb {R}}\) on V. For emphasis, we will refer to \({\mathbb {R}}[V]^{{\mathbb {T}}^2}\) as the algebra of off-shell invariants. After tensoring with \({\mathbb {C}}\), \({\mathbb {R}}[V]^{{\mathbb {T}}^2} \otimes _{\mathbb {R}}{\mathbb {C}}\) is isomorphic to \({\mathbb {C}}[V\oplus V^*]^{{\mathbb {T}}^2} = {\mathbb {C}}[V\oplus V^*]^{({\mathbb {C}}^\times )^2}\), where \(V^*\) denotes the dual representation; letting \((y_1,\ldots ,y_n)\) denote coordinates for \(V^*\) dual to the coordinates \((x_1,\ldots ,x_n)\), V is the subset of \(V\oplus V^*\) given by \(y_i = \overline{x_i}\) for each i. The weight matrix of the representation \(V\oplus V^*\) is given by \((A|-A)\), corresponding to the cotangent lift of the original representation. The algebra \({\mathbb {C}}[V\oplus V^*]^{{\mathbb {T}}^2}\) is generated by a finite set of monomials which can be computed by the algorithm described in [35,   Section 1.4].

We are interested in the quotient \({\mathbb {R}}[V]^{{\mathbb {T}}^2}/I_J^{{\mathbb {T}}^2}\), where \(I_J\) is the ideal generated by the components \(J_1, J_2\) of the moment map and \(I_J^{{\mathbb {T}}^2} = I_J\cap {\mathbb {R}}[V]^{{\mathbb {T}}^2}\) is the invariant part; note that the monomials \(x_j \overline{x_j}\) are invariant so that \(J_1, J_2 \in {\mathbb {R}}[V]^{{\mathbb {T}}^2}\). The closely related algebra of real regular functions on \(M_0\) is given by \({\mathbb {R}}[M_0] = {\mathbb {R}}[V]^{{\mathbb {T}}^2}/I_Z^{{\mathbb {T}}^2}\), where \(I_Z\) is the subalgebra of polynomials on V that vanish on Z and \(I_Z^{{\mathbb {T}}^2} = I_Z\cap {\mathbb {R}}[V]^{{\mathbb {T}}^2}\).

For “sufficiently large” representations V, the ideal \(I_Z\) is generated by the two components \(J_1, J_2\) of the moment map, i.e., \(I_J = I_Z\), which implies that \(I_J^{{\mathbb {T}}^2} = I_Z^{{\mathbb {T}}^2}\). This is the case, for example, when the \(({\mathbb {C}}^\times )^2\)-action on V is stable, meaning that the principal isotropy type consists of closed orbits; see [19,   Theorem 3.2 and Corollary 4.3]. When the representation is not stable, there is a stable \(({\mathbb {C}}^\times )^2\)-subrepresentation \(V^\prime \) of V that has the same shell, symplectic quotient, and algebra of real regular functions; see [22,   Lemma 3]; see also [11,   page 10] and [37,   Lemma 2]. As a brief summary of the results in these references applied to the situation at hand: \(I_Z\) is generated by \(J_1\) and \(J_2\) if and only if there are no coordinates \(x_i\) that vanish identically on the shell, equivalently, when A can be put in the form (D|C) where D is a \(2\times 2\) diagonal matrix with negative diagonal entries and C has nonnegative entries and no zero rows. When this condition fails, \(V^\prime \) is constructed by setting to zero any \(x_i\) that vanishes on the shell and hence deleting the corresponding column in A. Note in particular that \({\mathbb {R}}[M_0]\) can always be computed as \({\mathbb {R}}[V^\prime ]^{{\mathbb {T}}^2}/I_{J|_{V^\prime }}^{{\mathbb {T}}^2}\) for a subrepresentation \(V'\) of V.

The Hilbert series of a finitely generated graded algebra \(R = \bigoplus _{d=0}^\infty R_d\) over a field \({\mathbb {K}}\) is the generating function of the dimension of \(R_d\),

$$\begin{aligned} {\text {Hilb}}_{R}(t) = \sum \limits _{d=0}^\infty t^d \dim _{{\mathbb {K}}} R_d. \end{aligned}$$

The Hilbert series has a radius of convergence of at least 1 and is the power series of a rational function in t; see [10,   Section 1.4]. For a representation of \({\mathbb {T}}^2\) as above, we let \({\text {Hilb}}_A^{ off }(t)\) denote the Hilbert series of the algebra \({\mathbb {R}}[V]^{{\mathbb {T}}^2}\) of off-shell invariants and let \({\text {Hilb}}_A^{ on }(t)\) denote the Hilbert series of the algebra \({\mathbb {R}}[V]^{{\mathbb {T}}^2}/I_J^{{\mathbb {T}}^2}\). By [21,   Lemma 2.1], we have the simple relationship

$$\begin{aligned} {\text {Hilb}}_A^{ on }(t) = (1 - t^2)^2{\text {Hilb}}_A^{ off }(t). \end{aligned}$$
(1)

As a consequence, it follows that \({\text {Hilb}}_A^{ on }(t)\) depends only on the cotangent lift with weight matrix \((A|-A)\) and not on A. However, it is possible that two representations have isomorphic cotangent lifts while \(I_Z^{{\mathbb {T}}^2} = I_J^{{\mathbb {T}}^2}\) for one and not the other. Hence, the algebra of real regular functions \({\mathbb {R}}[M_0]\) depends on the representation and not merely the cotangent lift.

Example 1

Let

$$\begin{aligned} A = \begin{pmatrix} -1 &{} 0 &{} -1 \\ 0 &{} -1 &{} -1 \end{pmatrix} \end{aligned}$$

and

$$\begin{aligned} B = \begin{pmatrix} -1 &{} 0 &{} 1 \\ 0 &{} -1 &{} 1 \end{pmatrix}. \end{aligned}$$

Then the cotangent lift of the representation with weight matrix A has weight matrix

$$\begin{aligned} (A|-A) = \left( \begin{array}{ccc|ccc} -1 &{} 0 &{} -1 &{} 1 &{} 0 &{} 1 \\ 0 &{} -1 &{} -1 &{} 0 &{} 1 &{} 1 \end{array}\right) , \end{aligned}$$

which is clearly isomorphic to the cotangent lift with weight matrix \((B|-B)\) by simply permuting columns. The moment map associated to A is

$$\begin{aligned} J_1^A(x_1,x_2,x_3)&= - \frac{1}{2}\big ( x_1 \overline{x_1} + x_3\overline{x_3} \big ) \\ J_2^A(x_1,x_2,x_3)&= - \frac{1}{2}\big ( x_2 \overline{x_2} + x_3\overline{x_3} \big ), \end{aligned}$$

so that the corresponding shell \(Z_A\) is the origin and the symplectic quotient \(M_0^A\) is a point. Because each \(x_i\) vanishes on the shell, the representation \(V^\prime \) is the origin, and \({\mathbb {R}}[M_0^A]\) is given by \({\mathbb {R}}[V_A^\prime ]^{{\mathbb {T}}^2}/I_{J^A|_{V^\prime }}^{{\mathbb {T}}^2} = {\mathbb {R}}\).

However, the moment map associated to B is

$$\begin{aligned} J_1^B(x_1,x_2,x_3)&= \frac{1}{2}\big ( - x_1 \overline{x_1} + x_3\overline{x_3} \big ) \\ J_2^B(x_1,x_2,x_3)&= \frac{1}{2}\big ( - x_2 \overline{x_2} + x_3\overline{x_3} \big ), \end{aligned}$$

and the shell \(Z_B\) has real dimension 4 and \(M_0^B\) has real dimension 2. In this case, each \(x_i\) obtains a nonzero value on the shell, and \({\mathbb {R}}[M_0^B]\) is equal to the algebra \({\mathbb {R}}[V_B]^{{\mathbb {T}}^2}/I_{J^B}^{{\mathbb {T}}^2}\).

Representations with weight matrices A and B are equivalent if B can be obtained from A by permuting columns and elementary row operations over \({\mathbb {Z}}\). For the cotangent lift, because transposing a column of A with the corresponding column of \(-A\) corresponds to multiplying the column by \(-1\), the representations corresponding to \((A|-A)\) and \((B|-B)\) are equivalent if B can be obtained from A by permuting columns, elementary row operations over \({\mathbb {Z}}\), and multiplying columns by \(-1\). In the sequel, we will take advantage of this fact and put A into a standard form given in Definition 1. Note that, if we begin with a weight matrix B such that \({\mathbb {R}}[M_0^B] = {\mathbb {R}}[V_B]^{{\mathbb {T}}^2}/I_{J^B}^{{\mathbb {T}}^2}\), replacing B with a matrix A in standard form may break this relationship; we may have \({\mathbb {R}}[M_0^A] \ne {\mathbb {R}}[V_A]^{{\mathbb {T}}^2}/I_{J^A}^{{\mathbb {T}}^2}\) as in Example 1 above. However, as \({\text {Hilb}}_B^{ on }(t)\) depends only on the cotangent lift, we still have \({\text {Hilb}}_B^{ on }(t) = {\text {Hilb}}_A^{ on }(t)\). That is, the change to standard form may cause \({\text {Hilb}}_A^{ on }(t)\) to no longer describe \({\mathbb {R}}[M_0^A]\), but it still describes the algebra \({\mathbb {R}}[M_0^B]\) associated to the symplectic quotient associated to B. For this reason, we state our results in terms of \({\text {Hilb}}_A^{ on }(t)\) in standard form with no loss of generality.

2.2 Standard form and degeneracies

Let \(A \in {\mathbb {Z}}^{2\times n}\) be the weight matrix of a linear representation of \({\mathbb {T}}^2\) on \({\mathbb {C}}^n\). To avoid trivialities, we assume that there are no trivial subrepresentations, i.e., A has no zero columns. Let \(d_{ij}\) denote the \(2\times 2\) minor associated to columns i and j, i.e., \(d_{ij} = a_{1i} a_{2j} - a_{2i} a_{1j}\). Recall that the \(d_{ij}\) satisfy the Plücker relations [29,   page 138]. That is, for any indices \(i_0, i_1, i_2\) and j, we have

$$\begin{aligned} d_{i_1 i_2} d_{i_0 j} - d_{i_0 i_2} d_{i_1 j} + d_{i_0 i_1} d_{i_2 j} = 0. \end{aligned}$$
(2)

Definition 1

We say that a weight matrix \(A\in {\mathbb {Z}}^{2\times n}\) is:

  1. (i)

    Faithful if \({\text {rank}}A = 2\) and the \(\gcd \) of the set of \(2\times 2\) minors of A is 1;

  2. (ii)

    In standard form if \(a_{1i} > 0\) for each i;

  3. (iii)

    Generic if it is in standard form, \(a_{1i}\ne a_{1j}\) for \(i\ne j\), and \(d_{ij} + d_{ik} + d_{jk} \ne 0\) for each distinct ijk;

  4. (iv)

    Completely generic if it is in standard form, generic, and \(d_{ij} + d_{jk} + d_{ki} \ne 0\) for each distinct ijk; and

  5. (v)

    Degenerate if it is in standard form and is not generic.

If A is generic, by transposing i and j in the condition \(d_{ij} + d_{ik} + d_{jk} \ne 0\), we also have that \(d_{ij} - d_{ik} - d_{jk} \ne 0\) for each distinct ijk.

The condition that the weight matrix is faithful is equivalent to the representation being faithful; see Sect. 2.1. The condition \(d_{ij} + d_{ik} + d_{jk} = 0\) can be interpreted geometrically as corresponding to the three vectors \({\mathbf {a}}_i, - {\mathbf {a}}_j, {\mathbf {a}}_k \in {\mathbb {R}}^2\) being collinear, while \(d_{ij} + d_{jk} + d_{ki} = 0\) corresponds to the three vectors \({\mathbf {a}}_i, {\mathbf {a}}_j, {\mathbf {a}}_k\) being collinear. Hence, if A is generic, then for any distinct ijk, the vectors \({\mathbf {a}}_i, - {\mathbf {a}}_j, {\mathbf {a}}_k\) are not collinear; if A is completely generic, then for any choice of ijk and any choice of signs, \(\pm {\mathbf {a}}_i, \pm {\mathbf {a}}_j, \pm {\mathbf {a}}_k\) are not collinear.

We may assume that A is faithful and in standard form with no loss of generality, i.e., without changing \({\text {Hilb}}_A^{ on }(t)\). Specifically, if A is not faithful, we may replace \({\mathbb {T}}^2\) with \({\mathbb {T}}^2/K\) where K is the subgroup acting trivially, yielding a representation of \({\mathbb {T}}^{{\text {rank}}A}\) with the same symplectic quotient, see [11,   Lemma 2]. Similarly, we may ensure that each \(a_{1i} \ne 0\) by adding any but finitely many scalar multiples of the second row to the first and then can put A in standard form by multiplying columns by \(-1\). Note that if \(n \le 2\), then either the representation is not faithful or there are no nontrivial invariants, so we can assume that \(n > 2\).

It is clear that multiplying columns by \(-1\) will change whether A is in standard form, and elementary row operations over \({\mathbb {Z}}\) can change a degenerate weight matrix to a generic one. Hence, for representations corresponding to weight matrices A and B such that the cotangent lifts \((A|-A)\) and \((B|-B)\) describe equivalent representations, and hence \({\text {Hilb}}_A^{ on }(t)\) and \({\text {Hilb}}_B^{ on }(t)\) coincide, it is possible that A is degenerate while B is generic.

Example 2

The weight matrix

$$\begin{aligned} A = \begin{pmatrix} 2 &{} 1 &{} 4 \\ 1 &{} -1 &{} 1 \end{pmatrix} \end{aligned}$$

is degenerate as \(d_{12} + d_{13} + d_{23} = 0\). Adding twice the second row to the first and then multiplying the second column by \(-1\) yields

$$\begin{aligned} B = \begin{pmatrix} 4 &{} 1 &{} 6 \\ 1 &{} 1 &{} 1 \end{pmatrix}, \end{aligned}$$

which is generic. As \((A|-A)\) and \((B|-B)\) are weight matrices of equivalent representations, \({\text {Hilb}}_A^{ on }(t) = {\text {Hilb}}_B^{ on }(t)\).

However, there are degenerate weight matrices that cannot be made generic by these changes of bases, e.g.,

$$\begin{aligned} A = \begin{pmatrix} 1 &{} 1 &{} 1 \\ 0 &{} 1 &{} 1 \end{pmatrix}. \end{aligned}$$

Finally, observe that the condition \(d_{ij} + d_{ik} + d_{jk} \ne 0\) for all distinct ijk is not invariant under multiplying columns by \(-1\). However, as a consequence of the geometric characterization described above, the condition that both \(d_{ij} + d_{ik} + d_{jk} \ne 0\) and \(d_{ij} + d_{jk} + d_{ki} \ne 0\) for all distinct ijk is invariant under multiplying columns by \(-1\). Of course, any of these conditions is invariant under elementary row operations applied to A.

2.3 Counting solutions of systems of linear congruences

In this section, we recall results concerning the number of solutions of a system of linear congruences due to Smith [31]; see [27] for a modern discussion. We begin with the following folklore result; see [31,   Art. 14*, p. 314] and [27,   p. 369].

Theorem 1

Let A be a nonzero \(m\times n\) matrix over a PID R. Then A can be decomposed into \(A = PSQ\), where P is an invertible \(m\times m\) matrix, Q in an invertible \(n\times n\) matrix, S is an \(m\times n\) matrix with nonzero entries only on the main diagonal, and the main diagonal entries \(a_i\) \((1\le i\le \min \{m,n\})\) of S satisfy \(a_i | a_{i+1}\) for all i. In particular, there exists an \(1\le r\le \min \{m,n\}\) such that the values \(a_i\ne 0\) for \(i\le r\) and \(a_i = 0\) for \(i > r\).

The elements \(a_i\) are unique up to multiplication by a unit, and the matrix S is called a Smith normal form of A. For \(R= {\mathbb {Z}}\), we will assume the canonical choice \(a_i \ge 0\).

Less well-known is the following additional statement; see [31,   Art. 14*, p. 314] and [27,   p. 370].

Proposition 1

Let A be a nonzero \(m\times n\) matrix over a PID R with Smith normal form S. For \(1\le i\le \min \{m,n\}\), let \(\varDelta _i\) denote a \(\gcd \) of the \(i\times i\) minors of A. Then \(\varDelta _i = \prod _{k=1}^i a_k\) up to multiplication by a unit. In particular, setting \(\varDelta _0 = 1\), up to multiplication by a unit we have \(a_i = \varDelta _{i}/\varDelta _{i-1}\) for \(1\le i\le r+1\).

Proof

It is easily verified that the row and column operations used to compute the Smith normal form S from A do not affect the \(\varDelta _i\). Thus, A and S share the same \(\varDelta _i\), while \(\varDelta _i \sim \prod _{k=1}^i a_k\) is obvious for S. \(\square \)

We then have the following.

Theorem 2

([31,   Art. 17, p. 320 and Art. 18*, p. 324]) Let A be a nonzero \(m\times n\) matrix over \({\mathbb {Z}}\) with Smith normal form S and let \(N > 1\) be an integer. Then the number of distinct solutions \({\mathbf {x}}\in ({\mathbb {Z}}/N{\mathbb {Z}})^n\) of the homogeneous system of congruences \(A {\mathbf {x}} \equiv {\mathbf {0}} \mod N\) is

$$\begin{aligned} N^{n-r}\prod _{i=1}^r \gcd (\varDelta _{i}/\varDelta _{i-1},N) = N^{n-\min \{m,n\}}\prod _{i=1}^{\min \{m,n\}} \gcd (a_i,N). \end{aligned}$$

Proof

Let \(A = PSQ\) denote a Smith decomposition of A over \({\mathbb {Z}}\). We interpret all matrices over \({\mathbb {Z}}/N{\mathbb {Z}}\). Then \(A {\mathbf {x}} \equiv {\mathbf {0}}\) is equivalent to \(P^{-1}A {\mathbf {x}}\equiv SQ {\mathbf {x}} \equiv {\mathbf {0}}\), while \({\mathbf {x}}\mapsto Q{\mathbf {x}}\) defines an automorphism of \(({\mathbb {Z}}/N{\mathbb {Z}})^n\). In particular, using the substitution \({\mathbf {y}}= Q{\mathbf {x}}\), \(A {\mathbf {x}} \equiv {\mathbf {0}}\) has as many distinct solutions as the system of equations \(S {\mathbf {y}} \equiv {\mathbf {0}}\). For \(1\le i \le r\), the equation \(a_iy_i \equiv 0 \mod N\) has \(\gcd (a_i,N)\) distinct solutions with \(a_i = \varDelta _{i}/\varDelta _{i-1}\). For \(r< i \le n\), \(y_i\) is a free variable with N distinct solutions. \(\square \)

With this, we have the following, which will be needed in the sequel.

Proposition 2

Let \(n > 2\), let \(A\in {\mathbb {Z}}^{2\times n}\) be a weight matrix of rank 2, and let g denote the \(\gcd \) of the set of \(2\times 2\) minors \(d_{ij}\) of A. For each \(i\ne j\) such that \(d_{ij} \ne 0\), the number of pairs \((\xi ,\zeta )\) of \(d_{ij}\)th roots of unity such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for each \(k\ne i,j\) is given by \(g |d_{ij}|\). In particular, if A is faithful, then this number is equal to \(|d_{ij}|\).

Proof

First assume that A is faithful so that \(\varDelta _2 = 1\). By fixing a primitive \(d_{ij}\)th root of unity \(\xi _0\), we can identify the set of \((\xi ,\zeta )\) with \(({\mathbb {Z}}/d_{ij}{\mathbb {Z}})^2\) via \((\xi ,\zeta ) = (\xi _0^x,\xi _0^y)\). Then the conditions \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for each \(k\ne i,j\) coincide with the system of congruences

$$\begin{aligned} \begin{pmatrix} d_{i1} &{} d_{j1} \\ d_{i2} &{} d_{j2} \\ \vdots &{} \vdots \\ d_{in} &{} d_{jn} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \equiv {\mathbf {0}} \mod d_{ij}, \end{aligned}$$
(3)

where the rows \((d_{ii}, d_{ji})\) and \((d_{ij}, d_{jj})\) are removed so that the coefficient matrix is of size \((n-2)\times 2\).

If \(n = 3\), then there is only one \(k\ne i,j\), so Eq. (3) is the single congruence \(x d_{ik} + y d_{jk} \equiv 0 \mod d_{ij}\). By Theorem 2, the number of solutions to this congruence is given by \(|d_{ij}|\gcd (\varDelta _1,d_{ij}) = |d_{ij}|\gcd (d_{ik},d_{jk},d_{ij}) = |d_{ij}|\), as A is faithful.

For \(n \ge 4\), Theorem 2 implies that the number of solutions to Eq. (3) is \(\gcd (a_2, d_{ij}) \gcd (\varDelta _1, d_{ij})\), where \(\varDelta _1 = \gcd \{d_{ik}, d_{jk} : k \ne i,j \}\). As A has rank 2 and \(d_{ij}\ne 0\), we have \(\varDelta _1\ne 0\), so that \(a_2 = \varDelta _2/\varDelta _1\) where \(\varDelta _2\) is the \(\gcd \) of the \(2\times 2\) minors of the \((n-2)\times 2\) coefficient matrix of Eq. (3); hence, the number of solutions is equal to \(\gcd (\varDelta _2/\varDelta _1, d_{ij}) \gcd (\varDelta _1, d_{ij})\).

Applying the Plücker relations, Eq. (2) with \(i_0 = k_2\), \(i_1 = i\), \(i_2 = k_1\), we have that the \(2\times 2\) submatrix corresponding to rows \(k_1, k_2\) of the coefficient matrix of Eq. (3) has determinant

$$\begin{aligned} d_{i k_1} d_{j k_2} - d_{j k_1} d_{i k_2} = d_{i j} d_{k_1 k_2}. \end{aligned}$$
(4)

Thus,

$$\begin{aligned} \varDelta _2&= \gcd \{d_{i k_1} d_{j k_2} - d_{j k_1} d_{i k_2} : k_1,k_2\ne i,j \} \\ {}&= \gcd \{d_{ij}d_{k_1 k_2} : k_1,k_2\ne i,j \} \\ {}&= d_{ij}\varDelta _2^\prime , \end{aligned}$$

where \(\varDelta _2^\prime = \gcd \{d_{k_1 k_2} : k_1,k_2\ne i,j \}\). Then the number of solutions is given by

$$\begin{aligned} \gcd (\varDelta _2/\varDelta _1, d_{ij}) \gcd (\varDelta _1, d_{ij})&= \frac{1}{\varDelta _1} \gcd (d_{ij}\varDelta '_2, d_{ij}\varDelta _1) \gcd (\varDelta _1, d_{ij}) \\ {}&= \frac{|d_{ij}|}{\varDelta _1} \gcd (\varDelta '_2,\varDelta _1) \gcd (d_{ij},\varDelta _1). \end{aligned}$$

Noting that \(\gcd (\varDelta _2^\prime , \varDelta _1, d_{ij}) = 1\) as A is faithful, \(\gcd (\varDelta _2^\prime ,\varDelta _1)\) and \(\gcd (d_{ij},\varDelta _1)\) are relatively prime, and we can write the number of solutions as

$$\begin{aligned} \frac{|d_{ij}|}{\varDelta _1} \gcd (\varDelta _2^\prime ,\varDelta _1) \gcd (d_{ij},\varDelta _1)&= \frac{|d_{ij}|}{\varDelta _1} \gcd (d_{ij}\varDelta _2^\prime ,\varDelta _1) \\ {}&= \frac{|d_{ij}|}{\varDelta _1} \gcd (\varDelta _2,\varDelta _1) \\ {}&= |d_{ij}| \gcd (\varDelta _2/ \varDelta _1,1)=|d_{ij}|. \end{aligned}$$

If A is not faithful so that \(g > 1\), we may apply the above result to conclude that there are \(|d_{ij}|/g\) pairs \((\eta ,\nu )\) of \(|d_{ij}|/g\)th roots of unity such that \({\eta ^{d_{ik}/g} \nu ^{d_{jk}/g} = 1}\) for all \(k\ne i,j\). Considering the surjective homomorphism \({({\mathbb {Z}}/d_{ij}{\mathbb {Z}})^2\rightarrow ({\mathbb {Z}}/(d_{ij}/g){\mathbb {Z}})^2}\) given by component-wise multiplication by g completes the proof. \(\square \)

3 Computation of the Hilbert Series

In this section, we give a formula for the Hilbert series \({\text {Hilb}}_A^{ on }(t)\) of a representation \(V_A\) of \({\mathbb {T}}^2\), analogous to the formula given in [21,   Theorem 3.1]. We start with a formula for the completely generic case in Theorem 3 which we then extend to the generic and degenerate case in Corollary 1.

3.1 A first formula

Here we have the following.

Theorem 3

Let \(n > 2\) and let \(A\in {\mathbb {Z}}^{2\times n}\) be a faithful completely generic weight matrix. The Hilbert series \({\text {Hilb}}_A^{ on }(t)\) is given by

$$\begin{aligned} \sum \frac{1}{d_{ij}^2 \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(d_{ij} + d_{ik} + d_{jk})/d_{ij} } \big ) \big (1 - \xi ^{-d_{ik}} \zeta ^{-d_{jk}} t^{(d_{ij} - d_{ik} - d_{jk})/d_{ij} } \big ) } \end{aligned}$$
(5)

where the sum is over all ij such that \(d_{ij} > 0\) and all \(\xi \) and \(\zeta \) such that \(\xi ^{d_{ij}} = \zeta ^{d_{ij}} = 1\).

Proof

For \(t=0\), the formula holds trivially, as we have \({\text {Hilb}}_A^{ on }(0)=\dim _{\mathbb {R}}{\mathbb {R}}=1\). Thus, we may assume \(t\ne 0\). By the Molien-Weyl Theorem [10,   Section 4.6.1], the Hilbert series of the off-shell invariants is given by the iterated integral over the torus \({\mathbb {T}}^2\)

$$\begin{aligned} \frac{1}{(2\pi \sqrt{-1})^2} \int \limits _{{\mathbb {S}}^1} \int \limits _{{\mathbb {S}}^1} \frac{dz_1 dz_2}{z_1 z_2 \prod \limits _{i=1}^n (1 - t z_1^{a_{1i}} z_2^{a_{2i}})(1 - t z_1^{-a_{1i}} z_2^{-a_{2i}})}. \end{aligned}$$
(6)

In order to compute this integral, we define \(N = \prod _{i=1}^n a_{1i}\) and perform the substitution \(z_2 = w^N\) to yield

$$\begin{aligned} \frac{1}{(2\pi \sqrt{-1})^2} \int \limits _{{\mathbb {S}}^1} \int \limits _{{\mathbb {S}}^1} \frac{dz_1 dw}{z_1 w \prod \limits _{i=1}^n (1 - t z_1^{a_{1i}} w^{N a_{2i}})(1 - t z_1^{-a_{1i}} w^{- Na_{2i}})}. \end{aligned}$$

Assume \(|t| < 1\) and \(|w| = 1\) and define the integrand

$$\begin{aligned} F_{t,w}(z) = \frac{1}{zw \prod \limits _{i=1}^n (1 - t z^{a_{1i}} w^{N a_{2i}})(1 - t z^{-a_{1i}} w^{- Na_{2i}})}. \end{aligned}$$

We first consider the integral of \(F_{t,w}(z)\) over \(z \in {\mathbb {S}}^1\).

Note that as each \(a_{1i} > 0\), we can express

$$\begin{aligned} F_{t,w}(z) = \frac{z^{-1 + \sum _{i=1}^n a_{1i}} }{w\prod \limits _{i=1}^n (1 - t z^{a_{1i}} w^{N a_{2i}})(z^{a_{1i}} - t w^{- Na_{2i}})} \end{aligned}$$

to see that \(F_{t,w}(z)\) is holomorphic at \(z = 0\). As \(|t| < 1\) and \(|w| = 1\), each of the factors \((1 - t z^{a_{1i}} w^{N a_{2i}})\) is nonzero on the unit disk. Hence, the relevant poles are solutions to \(z^{a_{1i}} - t w^{- Na_{2i}} = 0\), of the form \(z = \eta t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}\) where \(\eta \) is a fixed \(a_{1i}\)th root of unity. Note that as \(|\eta t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}| = |t|^{1/a_{1i}}\) and A is completely generic, the poles are distinct, i.e., each i and \(a_{1i}\)th root of unity \(\eta \) corresponds to a distinct pole.

Fix an i and express \(F_{t,w}(z)\) as

$$\begin{aligned} \frac{z^{a_{1i} - 1}}{w(1 - t z^{a_{1i}} w^{N a_{2i}})(z^{a_{1i}} - t w^{- Na_{2i}}) \prod \limits _{\begin{array}{c} j=1 \\ j \ne i \end{array}}^n (1 - t z^{a_{1j}} w^{N a_{2j}})(1 - t z^{-a_{1j}} w^{- Na_{2j}})}. \end{aligned}$$

Fix an \(a_{1i}\)th root of unity \(\eta _0\), expand the factor

$$\begin{aligned} (z^{a_{1i}} - t w^{- Na_{2i}})&= (z - \eta _0 t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}) \prod \limits _{\begin{array}{c} \eta ^{a_{1i}}=1 \\ \eta \ne \eta _0 \end{array}} (z - \eta t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}), \end{aligned}$$

and note that

$$\begin{aligned}&\prod \limits _{\begin{array}{c} \eta ^{a_{1i}}=1 \\ \eta \ne \eta _0 \end{array}} (\eta _0 t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}} - \eta t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}})\\&\qquad = \big (\eta _0 t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}\big )^{a_{1i} - 1} \prod \limits _{\begin{array}{c} \eta ^{a_{1i}}=1 \\ \eta \ne 1 \end{array}} (1 - \eta ) = a_{1i} \big (\eta _0 t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}\big )^{a_{1i} - 1}. \end{aligned}$$

Therefore, the residue of \(F_{t,w}(z)\) at \(z = \eta _0 t^{1/a_{1i}} w^{- Na_{2i}/a_{1i}}\) is given by

$$\begin{aligned} \frac{(wa_{1i})^{-1}(1 - t^2)^{-1}}{ \prod \limits _{j\ne i} (1 - \eta _0^{a_{1j}} t^{1 + a_{1j}/a_{1i}} w^{N (a_{2j} - a_{1j} a_{2i}/a_{1i})} ) (1 - \eta _0^{-a_{1j}} t^{1 - a_{1j}/a_{1i}} w^{- N(a_{2j} - a_{1j} a_{2i}/a_{1i})} )}. \end{aligned}$$

Letting \(q_i = \prod _{j\ne i} a_{1j} = N/a_{1i}\), we can express this residue as

$$\begin{aligned} \frac{1}{wa_{1i}(1 - t^2) \prod \limits _{j\ne i} (1 - \eta _0^{a_{1j}} t^{1 + a_{1j}/a_{1i}} w^{q_i d_{ij}} ) (1 - \eta _0^{-a_{1j}} t^{1 - a_{1j}/a_{1i}} w^{- q_i d_{ij}} )}. \end{aligned}$$

Summing residues over each choice of i and corresponding roots of unity \(\eta \), the outer integral is given by

$$\begin{aligned} \sum _{i=1}^n \sum _{\eta ^{a_{1i}} = 1} \frac{(2\pi \sqrt{-1})(wa_{1i})^{-1} (1 - t^2)^{-1}}{ \prod \limits _{j\ne i} (1 - \eta ^{a_{1j}} t^{1 + a_{1j}/a_{1i}} w^{q_i d_{ij}}) (1 - \eta ^{-a_{1j}} t^{1 - a_{1j}/a_{1i}} w^{- q_i d_{ij}})}. \end{aligned}$$
(7)

Note that formally \(t^{1/a_{1i}}\) is well-defined only after fixing a branch of the logarithm. However, Eq. (7) sums over all the distinct \(a_{1i}\)th roots of t and is therefore well-defined independently of the chosen branch. We set

$$\begin{aligned} \beta _{ij}(\eta ,w) = (1 - \eta ^{a_{1j}} t^{1 + a_{1j}/a_{1i}} w^{q_i d_{ij}}) (1 - \eta ^{-a_{1j}} t^{1 - a_{1j}/a_{1i}} w^{- q_i d_{ij}}) \end{aligned}$$
(8)

and then can express Eq. (7) succinctly as

$$\begin{aligned} (2\pi \sqrt{-1}) \sum _{i=1}^n \sum _{\eta ^{a_{1i}} = 1} \frac{1}{w a_{1i} (1 - t^2) \prod \limits _{j\ne i} \beta _{ij}(\eta ,w)}. \end{aligned}$$

Note that for fixed t, this function is rational in w.

Fix a value of i and an \(a_{1i}\)th root of unity \(\eta \). We now proceed with the integral of the corresponding term of Eq. (7) with respect to w.

For each j, the first factor of \(\beta _{ij}(\eta ,w)\) has a root on the unit disk if and only if \(d_{ij} < 0\), while the second factor has a root if and only if \(1 - a_{1j}/a_{1i}\) and \(d_{ij}\) have the same sign. Note also that \(1 - a_{1j}/a_{1i} = 0\) is impossible as A is completely generic (and hence in standard form).

We consider the roots of the first factor of \(\beta _{ij}(\eta ,w)\). Assume \(d_{ij} < 0\). Express \(1/\big (wa_{1i}(1 - t^2) \prod \limits _{j\ne i} \beta _{ij}(\eta ,w)\big )\) as

$$\begin{aligned} \frac{w^{- q_i d_{ij} - 1}}{a_{1i}(1 - t^2)(w^{- q_i d_{ij}} - \eta ^{a_{1j}} t^{1 + a_{1j} /a_{1i}}) (1 - \eta ^{-a_{1j}} t^{1 - a_{1j}/a_{1i}} w^{-q_i d_{ij}}) \prod \limits _{k\ne i,j} \beta _{ik}(\eta ,w) }, \end{aligned}$$

and then the factor \((w^{- q_i d_{ij}} - \eta ^{a_{1j}} t^{1 + a_{1j} /a_{1i}})\) in the denominator can be expressed as

$$\begin{aligned} (w - \nu _0 \eta ^{- a_{1j} /(q_i d_{ij})} t^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})}) \prod \limits _{\begin{array}{c} \nu ^{-q_i d_{ij}} = 1 \\ \nu \ne \nu _0 \end{array}} (w - \nu \eta ^{- a_{1j} / (q_i d_{ij})} t^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})}) \end{aligned}$$

where \(\nu _0\) is a \(-q_i d_{ij}\)th root of unity. Hence, poles corresponding to the vanishing of the first factor of \(\beta _{ij}(\eta ,w)\) are of the form

$$\begin{aligned} \tau _1(i,j,\eta ,\nu _0) := \nu _0 \eta ^{- a_{1j} /(q_i d_{ij})} t^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})}. \end{aligned}$$

Note that \(|\tau _1(i,j,\eta ,\nu _0)| = |t|^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})} = |t|^{- (a_{1i} + a_{1j})/(N d_{ij})}\), and, for \(j\ne k\) (and both distinct from i), we have \((a_{1i} + a_{1j})/d_{ij} = (a_{1i} + a_{1k})/d_{ik}\) if and only if \(d_{ij} - d_{ik} - d_{jk} = 0\). That is, the hypothesis that A is completely generic implies that the poles \(\{ \tau _1(i,j,\eta ,\nu _0) : j\ne i, \nu _0^{-q_i d_{ij}} = 1 \}\) are distinct.

The residue at \(\tau _1 = \tau _1(i,j,\eta ,\nu _0)\) is given by

$$\begin{aligned}&\frac{\tau _1^{- q_i d_{ij} - 1}a_{1i}^{-1}(1 - t^2)^{-1} \left( \prod \limits _{k\ne i,j} \beta _{ik}(\eta ,\tau _1)\right) ^{-1}}{ \prod \limits _{\begin{array}{c} \nu ^{-q_i d_{ij}} = 1 \\ \nu \ne \nu _0 \end{array}} (\tau _1 - \nu \eta ^{- a_{1j} / (q_i d_{ij})} t^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})}) (1 - \eta ^{-a_{1j}} t^{1 - a_{1j} / a_{1i}} \tau _1^{-q_i d_{ij}}) } \\ {}&\quad \quad \quad = \frac{-1}{N d_{ij} (1 - t^2)^2 \prod \limits _{k\ne i,j} \beta _{ik}(\eta ,\tau _1) }. \end{aligned}$$

Substituting \(\tau _1 = \nu _0 \eta ^{- a_{1j} /(q_i d_{ij})} t^{- (1 + a_{1j}/a_{1i})/(q_i d_{ij})}\) into the definition of \(\beta _{ik}\) in Eq. (8), we have

$$\begin{aligned} \beta _{ik}(\eta ,\tau _1)&= \Big (1 - \nu _0^{q_i d_{ik}} \eta ^{a_{1k} - a_{1j}d_{ik} / d_{ij} } t^{(d_{ij}(a_{1i} + a_{1k}) - d_{ik}(a_{1i} + a_{1j}))/(d_{ij}a_{1i}) }\Big )\times \\ {}&\quad \quad \quad \Big (1 - \nu _0^{- q_i d_{ik}} \eta ^{-a_{1k} + a_{1j}d_{ik} / d_{ij} } t^{(d_{ij}(a_{1i} - a_{1k}) + d_{ik}(a_{1i} + a_{1j}))/(d_{ij}a_{1i}) }\Big ). \end{aligned}$$

Simplifying the exponents using the identity \(a_{1i}d_{jk} + a_{1j}d_{ki} + a_{1k}d_{ij} = 0\), we express this residue \(R_1\) as

$$\begin{aligned} -R_1^{-1}&=N d_{ij} (1 - t^2)^2 \prod \limits _{k\ne i,j}\Big ( \big (1 - \nu _0^{q_i d_{ik}} \eta ^{- a_{1i} d_{jk} /d_{ij} } t^{(d_{ij} - d_{ik} - d_{jk})/d_{ij} } \big )\times \\ {}&\quad \quad \quad \big (1 - \nu _0^{- q_i d_{ik}} \eta ^{a_{1i} d_{jk}/ d_{ij} } t^{(d_{ij} + d_{ik} + d_{jk})/d_{ij} } \big ) \Big ). \end{aligned}$$

Let \(\zeta = \eta ^{-a_{1i}/d_{ij}}\) and \(\xi = \nu _0^{q_i}\), and then

$$\begin{aligned} \sum _{\begin{array}{c} \eta ^{a_{1i}} = 1 \\ \nu _0^{-q_i d_{ij}} = 1 \end{array}} R_1 = \sum _{\begin{array}{c} \zeta ^{-d_{ij}} = 1 \\ \xi ^{-d_{ij}} = 1 \end{array}} R_1^\prime \end{aligned}$$

where

$$\begin{aligned} R_1^\prime = \frac{d_{ij}^{-2} (1 - t^2)^{-2}}{ \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(d_{ij} - d_{ik} - d_{jk})/d_{ij} } \big ) \big (1 - \xi ^{- d_{ik}} \zeta ^{- d_{jk}} t^{(d_{ij} + d_{ik} + d_{jk})/d_{ij} } \big ) }. \end{aligned}$$
(9)

Once again, the formalism of choosing a fixed branch of the logarithm for the substitution \(\zeta = \eta ^{-a_{1i}/d_{ij}}\) was replaced here by the process of averaging over distinct roots of unity.

We now turn to roots of the second factor of \(\beta _{ij}(\eta ,w)\). We first assume that \(d_{ij} > 0\) and \(1 - a_{1j}/a_{1i} > 0\), i.e., \(a_{1i} > a_{1j}\). In this case, we express the integrand \(1/\big (w a_{1i}(1 - t^2) \prod \limits _{j\ne i} \beta _{ij}(\eta ,w)\big )\) as

$$\begin{aligned} \frac{w^{q_i d_{ij} - 1}}{a_{1i}(1 - t^2)(1 - \eta ^{a_{1j}} t^{1 + a_{1j}/a_{1i}} w^{q_i d_{ij}}) (w^{q_i d_{ij}} - \eta ^{-a_{1j}} t^{1 - a_{1j}/a_{1i}}) \prod \limits _{k\ne i,j} \beta _{ik}(\eta ,w) }, \end{aligned}$$

and factor \((w^{q_i d_{ij}} - \eta ^{-a_{1j}} t^{1 - a_{1j}/a_{1i}})\) into

$$\begin{aligned} (w - \nu _0\eta ^{-a_{1j}/(q_i d_{ij})}t^{(1 - a_{1j}/a_{1i})/(q_i d_{ij})}) \prod \limits _{\begin{array}{c} \nu ^{q_i d_{ij}=1} \\ \nu \ne \nu _0 \end{array}} (w - \nu \eta ^{-a_{1j}/(q_i d_{ij})}t^{(1 - a_{1j}/a_{1i})/(q_i d_{ij})}), \end{aligned}$$

where \(\nu _0\) is a \(q_i d_{ij}\)th root of unity. The corresponding simple poles occur when w is equal to \(\tau _2(i,j,\eta ,\nu _0):= \nu _0\eta ^{-a_{1j}/(q_i d_{ij})} t^{(1 - a_{1j}/a_{1i})/(q_i d_{ij})}\). As \(|\tau _2(i,j,\eta ,\nu _0)| = |t|^{(a_{1i} - a_{1j})/(N d_{ij})}\), \((a_{1i} - a_{1j})/d_{ij} = (a_{1i} - a_{1k})/d_{ik}\) if and only if \(d_{ij} - d_{ik} + d_{jk} = 0\), and \((a_{1i} - a_{1j})/d_{ij} = -(a_{1i} + a_{1k})/d_{ik}\) if and only if \(d_{ij} + d_{ik} - d_{jk} = 0\), the fact that A is completely generic implies that these poles are all distinct, and are distinct from the poles \(\tau _1\) above. A computation similar to the previous case expresses the residue \(R_2\) as

$$\begin{aligned} R_2^{-1}&= N d_{ij} (1 - t^2)^2 \prod \limits _{k\ne i,j} \Big (\big (1 - \nu _0^{q_i d_{ik}} \eta ^{-a_{1i}d_{jk}/d_{ij}} t^{(d_{ij} + d_{ik} - d_{jk})/ d_{ij}}\big )\times \\ {}&\quad \quad \quad \big (1 - \nu _0^{-q_i d_{ik}} \eta ^{a_{1i}d_{jk}/d_{ij}} t^{(d_{ij} - d_{ik} + d_{jk})/ d_{ij} } \big )\Big ). \end{aligned}$$

Applying the same substitutions as in the previous case, we have

$$\begin{aligned} \sum _{\begin{array}{c} \eta ^{a_{1i}} = 1 \\ \nu _0^{q_i d_{ij}} = 1 \end{array}} R_2 = \sum _{\begin{array}{c} \zeta ^{d_{ij}} = 1 \\ \xi ^{d_{ij}} = 1 \end{array}} R_2^\prime \end{aligned}$$

where \(R_2^\prime \) is given by

$$\begin{aligned} \frac{d_{ij}^{-2} (1 - t^2)^{-2}}{ \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(d_{ij} + d_{ik} - d_{jk})/ d_{ij}}\big ) \big (1 - \xi ^{- d_{ik}} \zeta ^{-d_{jk}} t^{(d_{ij} - d_{ik} + d_{jk})/ d_{ij} } \big ) }. \end{aligned}$$
(10)

If \(d_{ij} < 0\) and \(1 - a_{1j}/a_{1i} < 0\), i.e., \(a_{1i} < a_{1j}\), a practically identical computation identifies simple poles of the form \(\tau _2(i,j,\eta ,\nu _0) = \nu _0 \eta ^{- a_{1j} / (q_i d_{ij})} t^{(1 - a_{1j} / a_{1i})/ (q_i d_{ij})}\) with residue \(R_2\), while our standard substitution results in the slightly modified equation

$$\begin{aligned} \sum _{\begin{array}{c} \eta ^{a_{1i}} = 1 \\ \nu _0^{q_i d_{ij}} = 1 \end{array}} R_2 = \sum _{\begin{array}{c} \zeta ^{d_{ij}} = 1 \\ \xi ^{d_{ij}} = 1 \end{array}} -R_2^\prime . \end{aligned}$$

Combining these computations, it follows that the integral in Eq. (6) is given by

$$\begin{aligned} -4\pi ^2 \sum \limits _{i=1}^n \left( \sum \limits _{\begin{array}{c} j = 1 \\ j \ne i, d_{ij}< 0 \end{array}}^n \quad \sum _{\begin{array}{c} \zeta ^{-d_{ij}} = 1 \\ \xi ^{-d_{ij}} = 1 \end{array}} R_1^\prime + \sum \limits _{\begin{array}{c} j = 1 \\ j \ne i, d_{ij}> 0 \\ a_{1i} > a_{1j} \end{array}}^n \quad \sum _{\begin{array}{c} \zeta ^{d_{ij}} = 1 \\ \xi ^{d_{ij}} = 1 \end{array}} R_2^\prime + \sum \limits _{\begin{array}{c} j = 1 \\ j \ne i, d_{ij}< 0 \\ a_{1i} < a_{1j} \end{array}}^n \quad \sum _{\begin{array}{c} \zeta ^{d_{ij}} = 1 \\ \xi ^{d_{ij}} = 1 \end{array}} -R_2^\prime \right) . \end{aligned}$$

Switching the roles of i and j as well as substituting \(\zeta \mapsto \xi ^{-1}\) and \(\xi \mapsto \zeta ^{-1}\) in the third sum yields the negative of the second sum, leaving only the first sum. Then switching the roles of i and j as well as \(\zeta \) and \(\xi \) in the first sum, the off-shell Hilbert series is given by

$$\begin{aligned} \sum _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \;\; \sum \limits _{\begin{array}{c} \xi ^{d_{ij}}=1 \\ \zeta ^{d_{ij}} = 1 \end{array}} \frac{d_{ij}^{-2} (1 - t^2)^{-2} }{ \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(d_{ij} + d_{ik} + d_{jk})/d_{ij} } \big ) \big (1 - \xi ^{-d_{ik}} \zeta ^{-d_{jk}} t^{(d_{ij} - d_{ik} - d_{jk})/d_{ij} } \big ) }. \end{aligned}$$

Applying Eq. (1) ( [21,   Lemma 2.1]), \({\text {Hilb}}_A^{ on }(t)\) is the product of \((1 - t^2)^2\) and the off-shell Hilbert series, completing the proof. \(\square \)

3.2 Analytic continuation

Revisiting Theorem 3, there is no particular reason why the final expression in Eq. (5) should depend on the additional condition \(d_{ij}+d_{jk}+d_{ki}\ne 0\) for every distinct ijk. Yet again, if A is degenerate, then there are distinct ijk such that \(d_{ij} - d_{ik} - d_{jk} = 0\), and Eq. (5) fails to be well-defined due to division by zero in the case of \(\xi =\zeta =1\). Specifically, as \((a_{1i} + a_{1j})/d_{ij} = (a_{1i} + a_{1k})/d_{ik}\), the poles identified in the computation in the Proof of Theorem 3 are not distinct and hence are not simple poles. Hence, the computation does not apply. Nevertheless, the result of Theorem 3 can be extended to the case of general generic and degenerate A with the help of analytic continuation.

Lemma 1

Let C be a simple closed curve, f(z) be a continuous function on C, and \(\tau \) be interior to C. Then

$$\begin{aligned} \lim \limits _{(\tau _1,\ldots ,\tau _m)\rightarrow (\tau ,\ldots ,\tau )} \int \limits _C \frac{f(z)\,dz}{\prod \limits _{i=1}^m (z - \tau _i)} = \int \limits _C \frac{f(z)\,dz}{(z - \tau )^m}. \end{aligned}$$

Proof

Let \(g(z,\tau _1,\ldots ,\tau _m) = f(z)/\big (\prod _{i=1}^m (z - \tau _i)\big )\) denote the integrand as a function of z and the \(\tau _i\). Let D denote a closed \(\epsilon \)-ball about \(\tau \) that is contained in the interior of C, and then \(g(z,\tau _1,\ldots ,\tau _m)\) is continuous on the compact set \(C\times D^m\). It follows that \(g(z,\tau _1,\ldots ,\tau _m)\) is bounded by a constant on this set, and the result follows from an application of the dominated convergence theorem. \(\square \)

If \(f(z) = g(z)/h(z)\) is a rational function, where h(z) has no zeros on or inside C, then we can understand the limit in Lemma 1 as follows. Choosing the \(\tau _i\) distinct inside C, we have

$$\begin{aligned} \frac{1}{2\pi \sqrt{-1}}\int \limits _C \frac{g(z)\,dz}{h(z)\prod \limits _{i=1}^m (z - \tau _i)} = \sum \limits _{i=1}^m \frac{g(\tau _i)}{h(\tau _i)\prod \limits _{\begin{array}{c} j=1\\ j\ne i \end{array}}^m (\tau _i - \tau _j)}, \end{aligned}$$

which we rewrite as a single rational fraction \(\frac{p(\tau _1,\ldots ,\tau _m)}{q(\tau _1,\ldots ,\tau _m)}\) with common denominator

$$\begin{aligned} q(\tau _1,\ldots ,\tau _m) = \prod _{i=1}^m h(\tau _i)\prod _{1\le j < k \le m} (\tau _k - \tau _j). \end{aligned}$$

Note that by definition \(\frac{p(\tau _1,\ldots ,\tau _m)}{q(\tau _1,\ldots ,\tau _m)}\) is symmetric in the \(\tau _i\) while \(q(\tau _1,\ldots ,\tau _m)\) is alternating. Therefore, the numerator \(p(\tau _1,\ldots ,\tau _m)\) is an alternating polynomial in the \(\tau _i\) and hence divisible by the Vandermonde determinant \(\prod _{1\le j < k \le m} (\tau _k - \tau _j)\), i.e.,

$$\begin{aligned} p(\tau _1,\ldots ,\tau _m) = s(\tau _1,\ldots ,\tau _m)\prod \limits _{1\le j < k \le m} (\tau _k - \tau _j) \end{aligned}$$

for some symmetric polynomial s in the \(\tau _i\). Therefore, the singularities at \(\tau _i = \tau _j\) are removable, and we can express the integral as

$$\begin{aligned} \frac{p(\tau _1,\ldots ,\tau _m)}{q(\tau _1,\ldots ,\tau _m)} = \frac{s(\tau _1,\ldots ,\tau _m)}{\prod _{i=1}^m h(\tau _i)}. \end{aligned}$$

In the Proof of Theorem 3, each of the integrands of the iterated integral is a rational function. Hence, using Lemma 1, we can perturb the poles with multiplicity and apply the same computation. In more detail, in the integral with respect to z, if multiple poles that are solutions of factors of the form \(z^{a_{1i}} - t w^{- Na_{2i}} = 0\) coincide, we may perturb these factors by replacing t with a separate variable \(t_i\) in each, resulting in a rational function in z that has only simple poles in the unit disk. We then compute the integral of this function and then take the limit as the \(t_i \rightarrow t\). Similarly, in the second integral with respect to w, we may similarly perturb t in factors associated to common poles, compute the integral of the resulting rational function with only simple poles, and then take the limit as these perturbed variables return to t. In order to state the resulting formula, we express the perturbed variables \(t_i\) in the form \(t_i = t^{p_i}\) where \(p_i\) is near 1 and the exponent is defined using a fixed branch of the logarithm that is defined on a neighborhood of t. See [21,   page 52] for more details on this approach in a similar computation. Then, taking advantage of the continuity of power functions within the domain of the fixed branch of \(\log \), we have the following.

Corollary 1

Let \(n > 2\) and let \(A\in {\mathbb {Z}}^{2\times n}\) be a faithful weight matrix in standard form. The Hilbert series \({\text {Hilb}}_A^{ on }(t)\) is given by the limit as \(X\rightarrow A\) of

$$\begin{aligned} \sum \frac{d_{ij}^{-2}}{\prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(c_{ij} + c_{ik} + c_{jk})/c_{ij} } \big ) \big (1 - \xi ^{-d_{ik}} \zeta ^{-d_{jk}} t^{(c_{ij} - c_{ik} - c_{jk})/c_{ij} } \big ) } \end{aligned}$$
(11)

where the sum is over all ij such that \(d_{ij} > 0\) and all \(\xi \) and \(\zeta \) such that \(\xi ^{d_{ij}} = \zeta ^{d_{ij}} = 1\), the \(x_{ij}\) are real parameters approximating the \(a_{ij}\), \(X = (x_{ij})\), \(c_{ij} = x_{1i} x_{2j} - x_{2i} x_{1j}\), and the power functions are computed using a fixed branch of the logarithm. In particular, \({\text {Hilb}}_A^{ on }(t)\) is given by

$$\begin{aligned} \sum \frac{d_{ij}^{-2}}{ \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(d_{ij} + d_{ik} + d_{jk})/d_{ij} } \big ) \big (1 - \xi ^{-d_{ik}} \zeta ^{-d_{jk}} t^{(d_{ij} - d_{ik} - d_{jk})/d_{ij} } \big ) }, \end{aligned}$$
(12)

where the sum is as in Eq. (11), for any faithful generic weight matrix A.

Remark 1

Using Eq. (1), Corollary 1 also yields a formula for the Hilbert series \({\text {Hilb}}_A^{ off }(t)\) of the off-shell invariants of the cotangent lift of the representation associated to A, i.e., the usual real invariants of the representation with weight matrix A, or equivalently the complex invariants of the representation with weight matrix \((A|-A)\). Explicitly,

$$\begin{aligned} {\text {Hilb}}_A^{ off }(t) = \frac{{\text {Hilb}}_A^{ on }(t)}{(1 - t^2)^2}. \end{aligned}$$

3.3 An algorithm to compute the Hilbert series

As in the case of circle quotients treated in [21], Eq. (12) indicates an algorithm to compute the Hilbert series \({\text {Hilb}}_A^{ on }(t)\) in the case of a generic weight matrix that we now describe. First, for a ring R containing \({\mathbb {Q}}\), let \(R(\!(t)\!)\) denote the ring of formal Laurent polynomials in t over R, and for \(d\in {\mathbb {N}}\), define the operator \(U_{d,t}: R(\!(t)\!)\rightarrow R(\!(t)\!)\) by

$$\begin{aligned} U_{d,t} \left( \sum \limits _{m\in {\mathbb {Z}}} F_m t^m \right) = \sum \limits _{m\in {\mathbb {Z}}} F_{md} t^m. \end{aligned}$$
(13)

This operator generalizes that defined in [21,   Section 4] and has similar properties. Specifically, for \(F(t) = \sum _{m\in {\mathbb {Z}}} F_m t^m\),

$$\begin{aligned} U_{d,t}\big (F(t)\big ) = \frac{1}{d}\sum \limits _{\zeta ^d = 1} F\big ( \zeta \root d \of {t} \big ). \end{aligned}$$
(14)

The idea behind the algorithm is to interpret Eq. (12) in terms of composing operators of the form \(U_{d,t}\). Specifically, we can write

$$\begin{aligned} {\text {Hilb}}_A^{ on }(t) = \sum _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \big ( U_{d_{ij},s} \circ U_{d_{ij},t} \big )(\varPhi _{ij}(s,t))\Big |_{s=t} \end{aligned}$$

where

$$\begin{aligned} \varPhi _{ij}(s,t) := \frac{1}{d_{ij}^2 \prod \limits _{k\ne i,j} \big (1 - s^{ d_{ik} } t^{ d_{ij} + d_{jk} } \big ) \big (1 - s^{ -d_{ik} } t^{ d_{ij} - d_{jk} } \big ) }. \end{aligned}$$
(15)

Using Eq. (14), note that if \(F(s,t) = P(s,t)/Q(s,t)\) where P and Q are polynomials in t with coefficients in \({\mathbb {Q}}[s,s^{-1}]\), \(\delta = {\text {deg}}_t P(s,t) - {\text {deg}}_t Q(s,t)\) where \({\text {deg}}_t\) means the degree as a polynomial in t, then \(U_{d,t}\big (F(s,t)\big ) = P_d(s,t)/Q_d(s,t)\) where \(P_d\) and \(Q_d\) are polynomials in t with coefficients in \({\mathbb {Q}}[s,s^{-1}]\) such that

$$\begin{aligned} {\text {deg}}_t Q_d(s,t) = {\text {deg}}_t Q(s,t)\quad \text{ and }\quad {\text {deg}}_t P_d(s,t) - {\text {deg}}_t Q_d(s,t) \le \lfloor \delta /d \rfloor . \end{aligned}$$
(16)

With these observations, the algorithm is as follows.

Given a generic weight matrix A, fix ij such that \(d_{ij} > 0\) and define the function \(\varPhi (s,t) = \varPhi _{ij}(s,t)\) as in Eq. (15). Then do the following:

  1. 1.

    For each factor \((1 - s^p t^q)\) in the denominator such that \(q < 0\), multiply the numerator and denominator by the monomial \(-s^{-p} t^{-q}\) so that all powers of t in the denominator are nonnegative. Let P(st) and Q(st) denote the resulting numerator and denominator, respectively. Define \(\delta = {\text {deg}}_t P(s,t) - {\text {deg}}_t Q(s,t)\).

  2. 2.

    Define the function \(Q_1(s,t)\) by replacing each of the factors of the form \((1 - s^p t^q)\) in Q(st) via the rule

    $$\begin{aligned} (1 - s^p t^q) \longmapsto \big (1 - s^{p d_{ij}/\gcd (d_{ij},q)} t^{q/\gcd (d_{ij},q)} \big )^{\gcd (d_{ij},q)}. \end{aligned}$$

    Then \(Q_1(s,t)\) is the denominator of \(U_{d_{ij},t}\big (P(s,t)/Q(s,t)\big )\).

  3. 3.

    To compute the numerator \(P_1(s,t)\) of \(U_{d_{ij},t}\big (P(s,t)/Q(s,t)\big )\), first compute the Taylor series of P(st)/Q(st) with respect to t at \(t = 0\) up to degree \(d_{ij}\big ( \lfloor \delta /d_{ij} \rfloor + {\text {deg}}_t Q_1(s,t) \big )\). Apply \(U_{d_{ij},t}\) to this Taylor series using the description in Eq. (13), multiply the output series by \(Q_1(s,t)\), and delete all terms with \({\text {deg}}_t\) larger than \(\lfloor \delta /d_{ij} \rfloor + {\text {deg}}_t Q_1(s,t)\). Call the result \(P_1(s,t)\), and then \(U_{d_{ij},t}\big (P(s,t)/Q(s,t)\big ) = P_1(s,t)/Q_1(s,t)\).

  4. 4.

    For each factor \((1 - s^p t^q)\) in the denominator of \(P_1(s,t)/Q_1(s,t)\) such that \(p < 0\), multiply the numerator and denominator by the monomial \(-s^{-p} t^{-q}\) so that all powers of s in the denominator are nonnegative. Let \(P_2(s,t)\) and \(Q_2(s,t)\) denote the resulting numerator and denominator, respectively. Define \(\delta ^\prime = {\text {deg}}_s P_2(s,t) - {\text {deg}}_s Q_2(s,t)\).

  5. 5.

    Define the function \(Q_3(s,t)\) by replacing each of the factors of the form \((1 - s^p t^q)\) in \(Q_2(s,t)\) via the rule

    $$\begin{aligned} (1 - s^p t^q) \longmapsto \big (1 - s^{p/\gcd (d_{ij},p)} t^{q d_{ij}/\gcd (d_{ij},p)} \big )^{\gcd (d_{ij},p)}. \end{aligned}$$

    Then \(Q_3(s,t)\) is the denominator of \(U_{d_{ij},s}\big (P_2(s,t)/Q_2(s,t)\big )\).

  6. 6.

    To compute the numerator \(P_3(s,t)\) of \(U_{d_{ij},s}\big (P_2(s,t)/Q_2(s,t)\big )\), first compute the Taylor series of \(P_2(s,t)/Q_2(s,t)\) with respect to s at \(s = 0\) up to degree \(d_{ij}\big ( \lfloor \delta ^\prime /d_{ij} \rfloor + {\text {deg}}_s Q_3(s,t) \big )\). Apply \(U_{d_{ij},s}\) to the result using the description in Eq. (13), multiply the output by \(Q_3(s,t)\), and delete all terms with \({\text {deg}}_s\) larger than \(\lfloor \delta ^\prime /d_{ij} \rfloor + {\text {deg}}_s Q_3(s,t)\). The result is \(P_3(s,t)\), and \(U_{d_{ij},s}\big (P_2(s,t)/Q_2(s,t)\big ) = P_3(s,t)/Q_3(s,t)\).

Apply the above process for each ij such that \(d_{ij} > 0\), sum each of the resulting terms \(P_3(s,t)/Q_3(s,t)\), and substitute \(s = t\) in the sum. The result is \({\text {Hilb}}_A^{ on }(t)\).

This algorithm has been implemented on Mathematica [38] and is available from the authors upon request. It does not perform particularly well. The largest bottleneck appears to be the computation of Taylor series expansions; even for \(2\times 4\) weight matrices with single-digit entries, the algorithm can require series expansions up to degrees in the hundreds, which are computationally very expensive. It can handle many \(2\times 3\) and some \(2\times 4\) examples. However, it does not perform better than computing the off-shell invariants using the package Normaliz [7] for Macaulay2 [13] and using the resulting description to compute the Hilbert series, and this latter method has often been more successful. As an example, in the case of weight matrix

$$\begin{aligned} A = \begin{pmatrix} 1 &{} 2 &{} 3 &{} 4 &{} 5 \\ 0 &{} 1 &{} 2 &{} 2 &{} 1 \end{pmatrix}, \end{aligned}$$

the invariants and Hilbert series were computed using Normaliz and Macaulay2 in under four hours on a computer with one core and 5GB RAM, while the algorithm described here ran out of memory on a machine with 16GB RAM. The Hilbert series in this case is given by

$$\begin{aligned}&\frac{1}{(1-t^3)(1-t^4)(1-t^9)(1-t^{10})(1-t^{11})(1-t^{15})} \Big (1 + 3t^2 + 3t^3 + 7t^4 + 11t^5 \\&\quad + 19t^6 + 31t^7 + 47t^8 + 68t^9 + 92t^{10} + 121t^{11} + 153t^{12} + 188t^{13} + 232t^{14} \\&\quad + 273t^{15} + 318t^{16} + 359t^{17} + 393t^{18} + 426t^{19} + 454t^{20} + 475t^{21} + 491t^{22} \\&\quad + 496t^{23} + 491t^{24} + 475t^{25} + 454t^{26} + 426t^{27} + 393t^{28} + 359t^{29} + 318t^{30} \\&\quad + 273t^{31} + 232t^{32} + 188t^{33} + 153t^{34} + 121t^{35} + 92t^{36} + 68t^{37} + 47t^{38} \\&\quad + 31t^{39} + 19t^{40} + 11t^{41} + 7t^{42} + 3t^{43} + 3t^{44} + t^{46}\Big ). \end{aligned}$$

4 Computation of the Laurent coefficients

Let \(A \in {\mathbb {Z}}^{2\times n}\) be a faithful weight matrix in standard form with \(n > 2\). As in Sect. 3, we let \(d_{ij}\) denote the \(2\times 2\) minor associated to columns i and j. If A is degenerate, we approximate the \(a_{ij}\) with real parameters \(x_{ij}\) and let \(c_{ij} = x_{1i} x_{2j} - x_{2i} x_{1j}\) to assume that \(c_{ij} + c_{ik} + c_{jk} \ne 0\) for each distinct ijk. Let \(X = (x_{ij})\), define \(H_{X,i,j,\xi ,\zeta }(t)\) by

$$\begin{aligned} \frac{1}{c_{ij}d_{ij} \prod \limits _{k\ne i,j} \big (1 - \xi ^{d_{ik}} \zeta ^{d_{jk}} t^{(c_{ij} + c_{ik} + c_{jk})/c_{ij} } \big ) \big (1 - \xi ^{-d_{ik}} \zeta ^{-d_{jk}} t^{(c_{ij} - c_{ik} - c_{jk})/c_{ij} } \big ) }, \end{aligned}$$
(17)

and assume throughout this section that the power functions are defined using a fixed branch of \(\log t\) such that \(\log 1 = 0\). Let

$$\begin{aligned} H_X(t) = \sum _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \quad \sum \limits _{\begin{array}{c} \xi ^{d_{ij}}=1 \\ \zeta ^{d_{ij}} = 1 \end{array}} H_{X,i,j,\xi ,\zeta }(t), \end{aligned}$$
(18)

so that a minor adaptation of Eq. (11) (by setting one instance of \(d_{ij}\) equal to \(c_{ij}\) in each term) can be expressed as

$$\begin{aligned} {\text {Hilb}}_A^{ on }(t) = \lim _{X\rightarrow A} H_X(t). \end{aligned}$$
(19)

In this section, we consider the Laurent expansion

$$\begin{aligned} {\text {Hilb}}_A^{ on }(t) = \sum \limits _{m=0}^\infty \gamma _m(A) (1 - t)^{m - d}, \end{aligned}$$
(20)

where \(d =2(n-2)\) is the Krull dimension of the algebra \({\mathbb {R}}[V]^{{\mathbb {T}}^2}/I_J^{{\mathbb {T}}^2}\), and compute explicit formulas for \(\gamma _0\) and \(\gamma _2\). By the proof of [16,   Theorem 1.3], the algebra \({\mathbb {R}}[V]^{{\mathbb {T}}^2}/I_J^{{\mathbb {T}}^2}\) is graded Gorenstein, which in particular implies that \(\gamma _1 = 0\) and \(\gamma _2 = \gamma _3\); see [16,   Definition 1.1 and Corollary 1.8] or [15,   Theorem 1.1].

Our approach is to compute the Laurent coefficients of \(H_X(t)\) for a choice of X such that \(c_{ij} + c_{ik} + c_{jk} \ne 0\) for each distinct ijk. Hence, we will need the following result to extend our computations to the limit as \(X\rightarrow A\).

Lemma 2

Let \(f_{{\mathbf {x}}}(t)\) be a family of meromorphic function depending continuously on finitely many parameters \({\mathbf {x}} = (x_1,\ldots ,x_m)\). Let \(t_0\in {\mathbb {C}}\), and assume that there are open neighborhoods O of \(t_0\) in \({\mathbb {C}}\) and U of \({\mathbf {a}} = (a_1,\ldots ,a_m)\) in \({\mathbb {C}}^m\) such that for all \({\mathbf {x}}\in U\), the only pole of \(f_{{\mathbf {x}}}(t)\) in O is at \(t = t_0\). Then for each \(d \in {\mathbb {Z}}\), the degree d Laurent coefficient of \(f_{{\mathbf {x}}}(t)\) at \(t = t_0\) converges to the degree d Laurent coefficient of \(f_{{\mathbf {a}}}(t)\) at \(t = t_0\) as \({\mathbf {x}}\rightarrow {\mathbf {a}}\).

Proof

Let P be a simple closed positively-oriented curve in O about \(t_0\) and let \(d\in {\mathbb {Z}}\). Then the degree d Laurent coefficient of \(f_{{\mathbf {x}}}(t)\) at \(t_0\) is given by

$$\begin{aligned} \frac{1}{2\pi \sqrt{-1}} \int _P \frac{f_{{\mathbf {x}}}(t)\, dt}{(t - t_0)^{d+1}}. \end{aligned}$$

Let \(D \subset U\) be the closure of a neighborhood of \({\mathbf {a}}\) in \({\mathbb {C}}^m\), and then as \(P\times D\) is compact, the continuous function \(f_{{\mathbf {x}}}(t)\) is bounded on \(P\times D\). Then by the Dominated Convergence Theorem, we have

$$\begin{aligned} \lim \limits _{{\mathbf {x}}\rightarrow {\mathbf {a}}} \frac{1}{2\pi \sqrt{-1}} \int _P \frac{f_{{\mathbf {x}}}(t)\, dt}{(t - t_0)^{d+1}} = \frac{1}{2\pi \sqrt{-1}} \int _P \frac{f_{{\mathbf {a}}}(t)\, dt}{(t - t_0)^{d+1}}, \end{aligned}$$

completing the proof. \(\square \)

4.1 The first Laurent coefficient

Here, we consider the coefficient \(\gamma _0(A)\) in the expansion in Eq. (20) and prove the following.

Theorem 4

Let \(n > 2\) and \(A\in {\mathbb {Z}}^{2\times n}\) be a faithful weight matrix in standard form. The pole order of \({\text {Hilb}}_A^{ on }(t)\) at \(t = 1\) is \(2n - 4\), and the first nonzero Laurent coefficient \(\gamma _0(A)\) of \({\text {Hilb}}_A^{ on }(t)\) is given by

$$\begin{aligned} \gamma _0(A) = \lim \limits _{X\rightarrow A} \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{ c_{ij}^{2n-5} }{ \prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk}) }, \end{aligned}$$
(21)

where the \(x_{ij}\) are real parameters approximating the \(a_{ij}\), \(X = (x_{ij})\), and \(c_{ij} = x_{1i} x_{2j} - x_{2i} x_{1j}\). In particular, for each ijk such that \(d_{ij} > 0\), the singularities in Eq. (21) corresponding to \(d_{ij} - d_{ik} - d_{jk} = 0\) and \(d_{ij} + d_{ik} + d_{jk} = 0\) are removable.

For the special case of a generic weight matrix A, we have the simplified formula

$$\begin{aligned} \gamma _0(A) = \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{ d_{ij}^{2n-5} }{ \prod \limits _{k\ne i,j} (d_{ij} - d_{ik} - d_{jk})(d_{ij} + d_{ik} + d_{jk}) }. \end{aligned}$$
(22)

Throughout this section, we fix \(x_{ij}\) and corresponding \(c_{ij}\) such that each \(c_{ij} - c_{ik} - c_{jk} \ne 0\) and each \(c_{ij} + c_{ik} + c_{jk} \ne 0\). For each fixed \(i\ne j\) such that \(d_{ij} > 0\) and \(d_{ij}\)th roots of unity \(\xi \) and \(\zeta \), the pole order of the term \(H_{X,i,j,\xi ,\zeta }(t)\) given by Eq. (17) is equal to \(2(n - s - 2)\) where \(s = s(i,j,\xi ,\zeta )\) is the number of \(k\ne i,j\) such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} \ne 1\). The maximum pole order is \(2n - 4\), which occurs for instance when \(\xi = \zeta = 1\). A term has a pole of order \(2n - 4\), and hence contributes to \(\gamma _0\), if and only if \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for each \(k\ne i,j\).

Now, fix \(i\ne j\) with \(d_{ij} > 0\). By Proposition 2, the number of pairs \((\xi , \zeta )\) of \(d_{ij}\)th roots of unity such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for all \(k\ne i,j\) is equal to \(d_{ij}\). For each such \((\xi ,\zeta )\), we have

$$\begin{aligned} H_{X,i,j,\xi ,\zeta }(t) = \frac{1}{c_{ij} d_{ij} \prod \limits _{k\ne i,j} \big (1 - t^{(c_{ij} + c_{ik} + c_{jk})/c_{ij} } \big ) \big (1 - t^{(c_{ij} - c_{ik} - c_{jk})/c_{ij} } \big ) }, \end{aligned}$$

implying that

$$\begin{aligned} \sum H_{X,i,j,\xi ,\zeta }(t) = \frac{1}{c_{ij} \prod \limits _{k\ne i,j} \big (1 - t^{(c_{ij} + c_{ik} + c_{jk})/c_{ij} } \big ) \big (1 - t^{(c_{ij} - c_{ik} - c_{jk})/c_{ij} } \big ) }, \end{aligned}$$
(23)

where the sum is over all \(\xi \) and \(\zeta \) such that \(\xi ^{d_{ij}}=\zeta ^{d_{ij}} = 1\), and such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for all \(k\ne i,j\). Recalling that we define \(t^y\) using a fixed branch of \(\log t\) such that \(\log 1 = 0\), we have the Laurent expansion

$$\begin{aligned} \frac{1}{1 - t^y} = \frac{1}{y(1 - t)} + \frac{y - 1}{2y} + \frac{y^2 - 1}{12y}(1 - t) + \cdots . \end{aligned}$$
(24)

Hence, the degree \(4 - 2n\) coefficient of the Laurent series of Eq. (23) at \(t = 1\) is given by

$$\begin{aligned} \frac{ c_{ij}^{2n-5} }{ \prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk}) }. \end{aligned}$$

Summing over \(i\ne j\) such that \(d_{ij}> 0\), yields the following.

Lemma 3

Assume \(c_{ij} + c_{ik} + c_{jk} \ne 0\) for each distinct ijk. Then the degree \(4 - 2n\) coefficient of the Laurent series of the function \(H_X(t)\) defined in Eq. (18) is given by

$$\begin{aligned} \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{ c_{ij}^{2n-5} }{ \prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk}) }. \end{aligned}$$
(25)

Observe in Eqs. (17) and (18) that there are finitely many values of \(\xi ^{d_{ik}}\zeta ^{d_{jk}}\), and hence that there is an open neighborhood O of \(t = 1\) in \({\mathbb {C}}\) such that when the \(x_{ij}\) are sufficiently close to the \(a_{ij}\), the only pole of \(H_X(t)\) in O occurs at \(t = 1\). Hence, Theorem 4 follows from Lemmas 2 and 3 and Eq. (19).

4.2 Cancellations in the first Laurent coefficient

In the case of the one-dimensional torus considered in [21] and [8], the first Laurent coefficient \(\gamma _0\) is given by an expression similar to Eq. (21). In that case, the removability of the singularities was understood by interpreting this expression as the quotient of a determinant, which was therefore divisible by the Vandermonde determinant in the weights. The result is a description of the numerator after the cancellations as a Schur polynomial, and hence a closed form expression for \(\gamma _0\). This in particular leads to a quick proof that \(\gamma _0\) is always positive.

In the case at hand, Theorem 4 guarantees that the singularities in the expression for \(\gamma _0(A)\) in Eq. (21) are removable, just as in the one-dimensional case. However, we have not obtained a similar combinatorial description of the expression for \(\gamma _0(A)\) after the cancellations. In particular, we conjecture that \(\gamma _0(A)\) is always positive for a faithful weight matrix in standard form, and such a description would be useful to prove this claim. It could as well lead to more efficient computation of the \(\gamma _m(A)\) for specific degenerate A.

In this section, we describe an approach to understanding these cancellations through brute force computations and end with a discussion of small values of n. See Sect. 4.4 for a method to compute \(\gamma _0(A)\) for specific examples of degenerate weight matrices A without having to perform the cancellations in general.

First, let us be more explicit about the cancellations in Eq. (25). We combine the sum in Eq. (25) into a single rational function of the form

$$\begin{aligned} \frac{\sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij}> 0 \end{array}} c_{ij}^{2n - 5}\!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,q)\ne (i,j) \\ (q,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{pq} + c_{pr} + c_{qr}) \!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,r)\ne (i,j) \\ (q,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{qr} - c_{pq} - c_{pr}) \!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,q)\ne (i,j) \\ (p,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{pq} - c_{pr} - c_{qr}) }{\prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr} > 0 \end{array}} (c_{pq} + c_{pr} + c_{qr})(c_{qr} - c_{pq} - c_{pr})(c_{pq} - c_{pr} - c_{qr})}. \end{aligned}$$
(26)

Note that we continue to express the limits of the products and sums in terms of the \(d_{ij}\) to emphasize that the signs of the \(c_{ij}\) and \(d_{ij}\) coincide. Note further that if \(c_{pq} > 0\) and \(c_{qr} \ge 0\), the hypothesis that A is in standard form so that each \(a_{1i} > 0\) (and hence each \(x_{1i} > 0\)) implies that \(c_{pr} \ge 0\) as well. That is, the factors of the form \((c_{pq} + c_{pr} + c_{qr})\) are always positive when the \(x_{ij}\) approximate a weight matrix in standard form, and only the other singularities are relevant. Hence, the cancellations amount to the numerator of Eq. (26) being divisible by the factors of the form \((c_{qr} - c_{pq} - c_{pr})\) and \((c_{pq} - c_{pr} - c_{qr})\), and the desired combinatorial description is an expression for the polynomial

$$\begin{aligned} \frac{\sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij}> 0 \end{array}} c_{ij}^{2n - 5} \!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,q)\ne (i,j) \\ (q,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{pq} + c_{pr} + c_{qr}) \!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,r)\ne (i,j) \\ (q,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{qr} - c_{pq} - c_{pr}) \!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr}> 0 \\ (p,q)\ne (i,j) \\ (p,r)\ne (i,j) \end{array}} \!\!\!\!\!\!\! (c_{pq} - c_{pr} - c_{qr}) }{\prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr} > 0 \end{array}} (c_{qr} - c_{pq} - c_{pr})(c_{pq} - c_{pr} - c_{qr})}. \end{aligned}$$
(27)

The goal of this section is to give an alternate and more explicit demonstration that this is indeed a polynomial.

It is important to recall that the \(c_{ij}\) are not independent variables; due to their dependence on the \(x_{ij}\) they satisfy the Plücker relations, see Eq. (2). In general, the singularities in question are only removable if Eq. (26) is interpreted as a function in the \(x_{ij}\) rather than treating the \(c_{ij}\) as independent variables.

Lemma 4

As a polynomial in the \(x_{ij}\), the numerator of Eq. (26) is divisible by the product of \((c_{pq} - c_{pr} - c_{qr})\) such that \(d_{pq}, d_{qr} > 0\).

Proof

Let F denote the numerator of Eq. (26), and let \(F_{ij}\) denote the summand of F corresponding to \(i\ne j\) such that \(d_{ij} > 0\). Note that for fixed pqr, the polynomial \((c_{pq} - c_{pr} - c_{qr})\) as a quadratic polynomial in the \(x_{ij}\) has no linear factors, hence is reducible. It is therefore sufficient to show that F is divisible by each such factor individually.

Pick IJK such that \(d_{IJ}, d_{JK} > 0\). We will demonstrate that F is contained in the ideal generated by the Plücker relations and \((c_{IJ} - c_{IK} - c_{JK})\). First note that each summand of F contains \((c_{IJ} - c_{IK} - c_{JK})\) explicitly as a factor except \(F_{IJ}\) and \(F_{IK}\) so that we may restrict our attention to \(F_{IJ} + F_{IK}\). Both of these summands contain the factors

$$\begin{aligned} \prod \limits _{\begin{array}{c} d_{pq}, d_{qr}> 0 \\ (p,q),(q,r)\ne \\ (I,J), (I,K) \end{array}} (c_{pq} + c_{pr} + c_{qr}) \prod \limits _{\begin{array}{c} d_{pq}, d_{qr}> 0 \\ (p,r),(q,r)\ne \\ (I,J), (I,K) \end{array}} (c_{qr} - c_{pq} - c_{pr}) \prod \limits _{\begin{array}{c} d_{pq}, d_{qr} > 0 \\ (p,q),(p,r)\ne \\ (I,J), (I,K) \end{array}} (c_{pq} - c_{pr} - c_{qr}), \end{aligned}$$

so that we may express \(F_{IJ} + F_{IK}\) as a product of the above polynomial and the remaining factors, where the latter can be expressed as

$$\begin{aligned}&c_{IJ}^{2n - 5} (c_{JK} - c_{IJ} - c_{IK}) \prod \limits _{\begin{array}{c} r, \\ d_{Kr}> 0 \end{array}} (c_{IK} + c_{Ir} + c_{Kr}) (c_{IK} - c_{Ir} - c_{Kr})\times \\ {}&\quad \prod \limits _{\begin{array}{c} p, \\ d_{pI}> 0 \end{array}} (c_{pI} + c_{pK} + c_{IK}) (c_{IK} - c_{pI} - c_{pK}) \!\!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} q \ne J, \\ d_{Iq}, d_{qK}> 0 \end{array}} \!\!\!\!\!\!\! (c_{qK} - c_{Iq} - c_{IK}) (c_{Iq} - c_{IK} - c_{qK}) \\ {}&\; + c_{IK}^{2n - 5} (c_{IJ} + c_{IK} + c_{JK}) \prod \limits _{\begin{array}{c} r \ne K \\ d_{Jr}> 0 \end{array}} (c_{IJ} + c_{Ir} + c_{Jr}) (c_{IJ} - c_{Ir} - c_{Jr})\times \\ {}&\quad \prod \limits _{\begin{array}{c} p, \\ d_{pI}> 0 \end{array}} (c_{pI} + c_{pJ} + c_{IJ}) (c_{IJ} - c_{pI} - c_{pJ}) \!\!\!\!\!\!\!\! \prod \limits _{\begin{array}{c} q, \\ d_{Iq}, d_{qJ} > 0 \end{array}} \!\!\!\!\!\!\! (c_{qJ} - c_{Iq} - c_{IJ}) (c_{Iq} - c_{IJ} - c_{qJ}). \end{aligned}$$

In the first summand, it is helpful to think of the indices p, q, and r as ranging over those columns of A that, as vectors in \({\mathbb {R}}^2\), lie below \((a_{1I},a_{2I})\) (for p), between the \((a_{1I},a_{2I})\) and \((a_{1K},a_{2K})\) (for q), and above \((a_{1J},a_{2J})\) (for r), and similarly for the second summand. Applying the substitution \(c_{IJ} = c_{IK} + c_{JK}\) in the factor \((c_{JK} - c_{IJ} - c_{IK})\) in the first summand yields \(- 2c_{IK}\), and applying \(c_{IK} = c_{IJ} - c_{JK}\) in \((c_{IJ} + c_{IK} + c_{JK})\) in the second summand yields \(2c_{IJ}\). Noting that each index value not equal to IKJ appears exactly once as a p, q, or r in each of the above summands so that the total number of three-term factors in each summand is \(2n - 6\), we express this as

$$\begin{aligned} -2 c_{IJ} c_{IK}&\prod \limits _{r, d_{Kr}> 0} c_{IJ}(c_{IK} + c_{Ir} + c_{Kr}) c_{IJ}(c_{IK} - c_{Ir} - c_{Kr}) \times \\ {}&\prod \limits _{p, d_{pI}> 0} c_{IJ}(c_{pI} + c_{pK} + c_{IK}) c_{IJ}(c_{IK} - c_{pI} - c_{pK}) \times \\ {}&\prod \limits _{\begin{array}{c} q \ne J, \\ d_{Iq}, d_{qK}> 0 \end{array}} c_{IJ}(c_{qK} - c_{Iq} - c_{IK}) c_{IJ}(c_{Iq} - c_{IK} - c_{qK}) \\\quad + 2 c_{IJ} c_{IK}&\prod \limits _{\begin{array}{c} r \ne K, \\ d_{Jr}> 0 \end{array}} c_{IK}(c_{IJ} + c_{Ir} + c_{Jr}) c_{IK}(c_{IJ} - c_{Ir} - c_{Jr}) \times \\ {}&\prod \limits _{p, d_{pI}> 0} c_{IK}(c_{pI} + c_{pJ} + c_{IJ}) c_{IK}(c_{IJ} - c_{pI} - c_{pJ}) \times \\ {}&\prod \limits _{q, d_{Iq}, d_{qJ} > 0} c_{IK}(c_{qJ} - c_{Iq} - c_{IJ}) c_{IK}(c_{Iq} - c_{IJ} - c_{qJ}). \end{aligned}$$

We will now rewrite the first summand to see that it is equal to the negative of the second summand. Distributing a \(c_{IJ}\) into each three-term factor, we apply the Plücker relations of Eq. (2) \(c_{IJ}c_{Kr} - c_{IK}c_{Jr} + c_{Ir} c_{JK} = 0\), \(c_{pI}c_{JK} - c_{pJ}c_{IK} + c_{pK} c_{IJ} = 0\), and \(c_{Iq}c_{JK} - c_{IJ}c_{qK} + c_{IK} c_{qJ} = 0\), so the first summand becomes

$$\begin{aligned}&-2 c_{IJ} c_{IK}\times \\ {}&\prod \limits _{r, d_{Kr}> 0}\!\! (c_{IJ}c_{IK} + c_{IJ}c_{Ir} + c_{IK}c_{Jr} - c_{Ir} c_{JK}) (c_{IJ}c_{IK} - c_{IJ}c_{Ir} - c_{IK}c_{Jr} + c_{Ir} c_{JK}) \times \\ {}&\prod \limits _{p, d_{pI}> 0} (c_{IJ}c_{pI} - c_{pI}c_{JK} + c_{pJ}c_{IK} + c_{IJ}c_{IK}) (c_{IJ}c_{IK} - c_{IJ}c_{pI} + c_{pI}c_{JK} - c_{pJ}c_{IK}) \times \\ {}&\prod \limits _{\begin{array}{c} q\ne J \\ d_{Iq}, d_{qK} > 0 \end{array}}\!\!\!\! (c_{Iq}c_{JK} + c_{IK} c_{qJ} - c_{IJ}c_{Iq} - c_{IJ}c_{IK}) (c_{IJ}c_{Iq} - c_{IJ}c_{IK} - c_{Iq}c_{JK} - c_{IK} c_{qJ}). \end{aligned}$$

Applying the relation \(c_{IJ} - c_{IK} - c_{JK} = 0\), we rewrite this as

$$\begin{aligned} -2 c_{IJ} c_{IK}&\prod \limits _{r, d_{Kr}> 0} (c_{IJ}c_{IK} + c_{IK}c_{Ir} + c_{IK}c_{Jr}) (c_{IJ}c_{IK} - c_{IK}c_{Ir} - c_{IK}c_{Jr}) \times \\ {}&\prod \limits _{p, d_{pI}> 0} (c_{IK}c_{pI} + c_{pJ}c_{IK} + c_{IJ}c_{IK}) (c_{IJ}c_{IK} - c_{IK}c_{pI} - c_{pJ}c_{IK}) \times \\ {}&\prod \limits _{\begin{array}{c} q\ne J, \\ d_{Iq}, d_{qK} > 0 \end{array}} (c_{IK} c_{qJ} - c_{IK}c_{Iq} - c_{IJ}c_{IK}) (c_{IK}c_{Iq} - c_{IJ}c_{IK} - c_{IK} c_{qJ}). \end{aligned}$$

Recalling the assumption that \(c_{IJ}, c_{JK} > 0\) and reorganizing factors, this is equal to the negative of the second summand, completing the proof. \(\square \)

An almost identical argument yields the following.

Lemma 5

As a polynomial in the \(x_{ij}\), the numerator of Eq. (26) is divisible by the product of \((c_{qr} - c_{pq} - c_{pr})\) such that \(d_{pq}, d_{qr} > 0\).

Combining Lemmas 4 and 5, it follows that Eq. (26), as a rational function in the \(x_{ij}\), can be expressed in the form

$$\begin{aligned} \frac{S}{\prod \limits _{\begin{array}{c} p,q,r \\ d_{pq}, d_{qr} > 0 \end{array}}(c_{pq} + c_{pr} + c_{qr})}, \end{aligned}$$
(28)

where S is a polynomial in the \(x_{ij}\) that is equal to the expression in Eq. (27) on its domain.

When \(n=3\), the cancellations can be dealt with by hand; in this case, they occur even if the \(c_{ij}\) for \(i < j\) are treated as independent variables (i.e., without applying the Plücker relations), and the resulting numerator \(S = 1\) is constant. When \(n = 4\), S has 14 terms in the \(c_{ij}\); when \(n = 5\), the cancellations involved a Gröbner basis computation that took five days on a PC and yielded an S with 1961 terms in the \(c_{ij}\). Of course, when \(n > 3\), the number of terms is not unique due to the Plücker relations.

4.3 The next three Laurent coefficients

We now turn to the computation of the next Laurent coefficients and prove the following.

Theorem 5

Let \(n > 2\) and let \(A\in {\mathbb {Z}}^{2\times n}\) be a faithful weight matrix in standard form. Then \(\gamma _1(A) = 0\) and

$$\begin{aligned} \gamma _2(A)= & {} \gamma _3(A) = \lim \limits _{X\rightarrow A} \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{- c_{ij}^{2n - 7} \sum \limits _{p\ne i,j} (c_{ip} + c_{jp})^2}{12\prod \limits _{ k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}\nonumber \\&+ \sum \limits _{p=1}^n \frac{g_p - 1}{12} \gamma _0(A_p), \end{aligned}$$
(29)

where the \(x_{ij}\) are real parameters approximating the \(a_{ij}\), \(X = (x_{ij})\), \(c_{ij} = x_{1i} x_{2j} - x_{2i} x_{1j}\), \(A_p\) is the weight matrix formed by removing column p from A, and \(g_p\) is the \(\gcd \) of the \(2\times 2\) minors of \(A_p\). In particular, for each ijk such that \(d_{ij} > 0\), the singularities in Eq. (29) corresponding to \(d_{ij} - d_{ik} - d_{jk} = 0\) and \(d_{ij} + d_{ik} + d_{jk} = 0\) are removable.

For the special case of a generic weight matrix A, we have the simplified formula

$$\begin{aligned} \gamma _2(A)= & {} \gamma _3(A) = \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{- d_{ij}^{2n - 7} \sum \limits _{p\ne i,j} (d_{ip} + d_{jp})^2}{12\prod \limits _{k\ne i,j} (d_{ij} - d_{ik} - d_{jk})(d_{ij} + d_{ik} + d_{jk})} \nonumber \\&+ \sum \limits _{p=1}^n \frac{g_p - 1}{12} \gamma _0(A_p). \end{aligned}$$
(30)

Proof

We first compute \(\gamma _1(A)\). Note that the fact that \(\gamma _1(A) = 0\) follows from the results of [16] as noted after Eq. (20) above. We verify this explicitly here on the way towards the computation of \(\gamma _2(A)\).

Based on the observations after the statement of Theorem 4 and continuing to use the same notation, we need to consider terms \(H_{X,i,j,\xi ,\zeta }(t)\) of pole order \(2(n - s - 2)\) where \(s = 0\) or 1; recall that \(s = s(i,j,\xi ,\zeta )\) denotes the number of k such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} \ne 1\). In particular, there are no terms with pole order \(2n - 3\), so only terms where \(s = 0\) contribute to \(\gamma _1(A)\).

Using Eq. (24) and the Cauchy product formula, the degree \(5 - 2n\) coefficient of the Laurent expansion of the term \(H_{X,i,j,\xi ,\zeta }(t)\) is computed by choosing a \(p\ne i,j\), multiplying the degree 0 coefficient of the expansion of \(1/(1 - t^{(c_{ij} + c_{ip} + c_{jp})/c_{ij} })\) or \(1/(1 - t^{(c_{ij} - c_{ip} - c_{jp})/c_{ij} })\) with the degree \(-1\) coefficient of the other factors, and summing over all choices of p and the factor from the pair. That is, the degree \(5 - 2n\) coefficient of a term \(H_{X,i,j,\xi ,\zeta }(t)\) such that \(s = 0\) is given by

$$\begin{aligned}&\sum \limits _{p\ne i,j} \frac{ c_{ij}^{2n - 6}}{c_{ij}^2\prod \limits _{k\ne i,j,p} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}\\&\quad \times \Bigg ( \left( \frac{c_{ij}}{c_{ij} + c_{ip} + c_{jp}}\right) \frac{(c_{ij} - c_{ip} - c_{jp})/c_{ij} - 1}{2(c_{ij} - c_{ip} - c_{jp})/c_{ij}}\\&\quad + \left( \frac{c_{ij}}{c_{ij} - c_{ip} - c_{jp}}\right) \frac{(c_{ij} + c_{ip} + c_{jp})/c_{ij} - 1}{2(c_{ij} + c_{ip} + c_{jp})/c_{ij}} \Bigg ) = 0, \end{aligned}$$

confirming that \(\gamma _1(A) = 0\) (which also follows from the results of [15, 16] as described above).

For the degree \(6 - 2n\) coefficient, we first consider the contribution of terms \(H_{X,i,j,\xi ,\zeta }(t)\) with \(s = 0\). The contribution is computed similarly to above, except that we consider the products of the degree 1 coefficient of a factor corresponding to \(p\ne i,j\) with the degree \(-1\) coefficients of the other factors, and the degree 0 coefficient of two factors corresponding to \(p,q\ne i,j\) with the degree \(-1\) coefficients of the other factors.

In the first case, we have

$$\begin{aligned}&\sum \limits _{p\ne i,j} \frac{ c_{ij}^{2n - 6}}{c_{ij}^2\prod \limits _{k\ne i,j,p} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}\\&\qquad \times \Bigg ( \left( \frac{c_{ij}}{c_{ij} + c_{ip} + c_{jp}}\right) \frac{(c_{ij} - c_{ip} - c_{jp})^2/c_{ij}^2 - 1}{12(c_{ij} - c_{ip} - c_{jp})/c_{ij}}\\&\qquad + \left( \frac{c_{ij}}{c_{ij} - c_{ip} - c_{jp}}\right) \frac{(c_{ij} + c_{ip} + c_{jp})^2/c_{ij}^2 - 1}{12(c_{ij} + c_{ip} + c_{jp})/c_{ij}} \Bigg )\\&\quad = \frac{ c_{ij}^{2n - 8} \sum \limits _{p\ne i,j} (c_{ip} + c_{jp})^2}{6 \prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}. \end{aligned}$$

Summing over all terms \(H_{X,i,j,\xi ,\zeta }(t)\) and recalling that for each \(i\ne j\) with \(d_{ij} > 0\), there are by Proposition 2\(d_{ij}\) pairs \((\xi ,\zeta )\) such that \(s = 0\), we have

$$\begin{aligned} \sum \limits _{\begin{array}{c} i\ne j,\\ d_{ij} > 0 \end{array}} \frac{ c_{ij}^{2n - 7} \sum \limits _{p\ne i,j} (c_{ip} + c_{jp})^2}{6\prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}. \end{aligned}$$
(31)

In the second case, we first consider the situation where both factors \(1/(1 - t^{(c_{ij} + c_{ip} + c_{jp})/c_{ij} })\) and \(1/(1 - t^{(c_{ij} - c_{ip} - c_{jp})/c_{ij} })\) contribute a degree 0 coefficient for some \(p\ne i,j\) while the remaining factors corresponding to \(k\ne i,j,p\) contribute their degree \(-1\) coefficient. Summing over all relevant terms, a calculation very similar to those above yields the contribution

$$\begin{aligned} \sum \limits _{\begin{array}{c} i\ne j,\\ d_{ij} > 0 \end{array}} \frac{- c_{ij}^{2n - 7} \sum \limits _{p\ne i,j} (c_{ip} + c_{jp})^2}{4\prod \limits _{k\ne i,j} (c_{ij} - c_{ik} - c_{jk})(c_{ij} + c_{ik} + c_{jk})}. \end{aligned}$$
(32)

In addition, we need to consider the situation where distinct \(p,q\ne i,j\) with \(p<q\) each contribute the degree 0 coefficient of one of their corresponding factors \(1/(1 - t^{(c_{ij} + c_{ir} + c_{jr})/c_{ij} })\) and \(1/(1 - t^{(c_{ij} - c_{ir} - c_{jr})/c_{ij} })\) where \(r = p\) or q. An easy calculation shows that in this case terms cancel, and the total contribution is zero.

We now consider the contribution of \(H_{X,i,j, \xi ,\zeta }(t)\) where \(s = 1\), i.e., \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for all \(k\ne i,j\) except one, say \(k = p\). Such a term corresponds to a choice of ij and a solution \((\xi ,\zeta )\) to \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\), \(k\ne i,j\) for the weight matrix \(A_p\in {\mathbb {Z}}^{2\times (n-1)}\) formed by removing the pth column. If \(A_p\) is faithful, then the number of pairs \((\xi ,\zeta )\) such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for all \(k\ne i,j,p\) is \(d_{ij}\) by Proposition 2, hence each such pair satisfies \(\xi ^{d_{ip}} \zeta ^{d_{jp}} = 1\) by counting. It follows that there are no \(H_{X,i,j,\xi ,\zeta }(t)\) with \(s = 1\) corresponding to \(A_p\). Similarly, if \(A_p\) has rank 1, then there are no \(i,j\ne p\) such that \(d_{ij} > 0\) and hence no corresponding terms \(H_{X,i,j,\xi ,\zeta }(t)\) in \(H_X(t)\).

If \(A_p\) is not faithful and the \(2\times 2\) minors of \(A_p\) have \(\gcd \) \(g_p > 1\), then there are \(g_p d_{ij}\) pairs \((\xi ,\zeta )\) to consider such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for all \(k\ne i,j,p\), again by Proposition 2. Identifying the set of pairs of \(d_{ij}\)th roots of unity with \(({\mathbb {Z}}/d_{ij}{\mathbb {Z}})^2\), the set of \((\xi ,\zeta )\) such that \(\xi ^{d_{ik}} \zeta ^{d_{jk}} = 1\) for \(k\ne i,j,p\) forms a subgroup of order \(g_pd_{ij}\). As \(\xi ^{d_{ip}} \zeta ^{d_{jp}} = 1\) for \(d_{ij}\) of these pairs, \((\xi ,\zeta )\mapsto \xi ^{d_{ip}} \zeta ^{d_{jp}}\) is a homomorphism to \({\mathbb {Z}}/d_{ij}{\mathbb {Z}}\) with kernel of order \(d_{ij}\). Therefore, the image of this homomorphism corresponds to a cyclic subgroup of \({\mathbb {Z}}/d_{ij}{\mathbb {Z}}\) of size \(g_p\), which means that the homomorphism \((\xi ,\zeta )\mapsto \xi ^{d_{ip}} \zeta ^{d_{jp}}\) maps onto the group of \(g_p\)th roots of unity, and for each \(g_p\)th root of unity \(\eta \), there are \(d_{ij}\) pairs \((\xi ,\zeta )\) such that \(\xi ^{d_{ip}} \zeta ^{d_{jp}} = \eta \).

Fixing ijp and \((\xi ,\zeta )\) such that \(\xi ^{d_{ip}} \zeta ^{d_{jp}} =\eta \ne 1\), \(H_{X,i,j,\xi ,\zeta }(t)\) is of the form

$$\begin{aligned} H_{X,i,j,\xi ,\zeta }(t) = \Big ( c_{ij}^2 \big (1 - \eta t^{(c_{ij} + c_{ip} + c_{jp})/c_{ij} } \big ) \big (1 - \eta ^{-1} t^{(c_{ij} - c_{ip} - c_{jp})/c_{ij} } \big ) \\ \prod \limits _{k\ne i,j,p} \big (1 - t^{(c_{ij} + c_{ik} + c_{jk})/c_{ij} } \big ) \big (1 - t^{(c_{ij} - c_{ik} - c_{jk})/c_{ij} } \big ) \Big )^{-1} \end{aligned}$$

and has a pole order of \(2n - 6\). Using the expansion in Eq. (24) as well as

$$\begin{aligned} \frac{1}{1 - \nu t^y} = \frac{1}{1 - \nu } - \frac{\nu y}{(\nu - 1)^2}(1 - t) + \cdots , \end{aligned}$$

the coefficient of degree \(2n - 6\) of \(H_{X,i,j,\xi ,\zeta }(t)\) is given by

$$\begin{aligned} \frac{c_{ij}^{2n-6}}{c_{ij}^2(1 - \eta )(1 - \eta ^{-1}) \prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) } \\= \frac{-c_{ij}^{2n-8} }{\prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) } \left( \frac{ \eta }{ (1 - \eta )^2 } \right) . \end{aligned}$$

Summing over all \((\xi ,\zeta )\) corresponding to the fixed ijp such that \(\xi ^{d_{ip}} \zeta ^{d_{jp}} \ne 1\), we have

$$\begin{aligned} \sum \limits _{\begin{array}{c} \xi ^{d_{ij}} = \zeta ^{d_{ij}} = 1 \\ \xi ^{d_{ip}} \zeta ^{d_{jp}} = \eta \ne 1 \end{array}}&\frac{-c_{ij}^{2n-8} }{\prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) } \left( \frac{ \eta }{ (1 - \eta )^2 } \right) \\ {}&= \frac{-c_{ij}^{2n-7} }{\prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) } \sum \limits _{\eta ^{g_p} = 1, \eta \ne 1} \left( \frac{ \eta }{ (1 - \eta )^2 } \right) \\ {}&= \frac{c_{ij}^{2n-7} (g_p^2 - 1)}{12\prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) }, \end{aligned}$$

where the sum over \(\eta \) is computed using [12,   Equation (3.11)]. Summing over each p and \(i\ne j\) with \(d_{ij} > 0\), we obtain

$$\begin{aligned} \sum \limits _{p=1}^n \frac{g_p^2 - 1}{12} \sum \limits _{\begin{array}{c} i\ne j, \\ d_{ij} > 0 \end{array}} \frac{c_{ij}^{2n-7}}{\prod \limits _{k\ne i,j,p} (c_{ij} + c_{ik} + c_{jk})(c_{ij} - c_{ik} - c_{jk}) } = \sum \limits _{p=1}^n \frac{g_p^2 - 1}{12}\gamma _0(A_p). \end{aligned}$$

Combining this with Eqs. (31) and (32), and applying Lemma 2 identically as in the Proof of Theorem 4, completes computation of \(\gamma _2(A)\). That \(\gamma _2(A) = \gamma _3(A)\) follows from [16,   Theorem 1.3 and Corollary 1.8]. \(\square \)

Remark 2

As discussed in Sect. 4.2 for \(\gamma _0(A)\), a combinatorial description of the expression for \(\gamma _2(A)\) in Theorem 5 after the cancellations is desirable. The cancellations in the second sum involving \(\gamma _0(A_p)\) are as described in Lemmas 4 and 5, and we have verified that the cancellations for \(n = 3, 4\) occur analogously in the first sum.

Remark 3

Using Eq. (1), an immediate consequence of Theorems 4 and 5 is an explicit formula for the first four Laurent coefficients \(\gamma _m^{ off }(A)\) of the off-shell invariants; see Remark 1. Specifically, the pole order of \({\text {Hilb}}_A^{ off }(t)\) at \(t = 1\) is \(2n - 2\), and we have the following

$$\begin{aligned} \gamma _0^{ off }(A) = \gamma _1^{ off }(A)&= \frac{\gamma _0(A)}{4}, \\ \gamma _2^{ off }(A)&= \frac{3\gamma _0(A) + 4\gamma _2(A)}{16}, \\ \gamma _3^{ off }(A)&= \frac{\gamma _0(A) + 4\gamma _2(A)}{8}. \end{aligned}$$

4.4 Computing the Laurent coefficients

In the case of a generic weight matrix A, Theorems 4 and 5 can be used to compute \(\gamma _0(A)\) and \(\gamma _2(A)\) with little difficulty. However, if A has degeneracies, then as was noted in Sect. 4.2, an expression for \(\gamma _0(A)\) with the singularities removed can be very expensive to compute, even for representations as small as \(n = 5\). Here, we briefly describe a method that has been successful to more efficiently compute \(\gamma _0(A)\) for degenerate A with values of n as large as 10.

Given a weight matrix \(A\in {\mathbb {Z}}^{2\times n}\), the algorithm first tests that A is faithful and in standard form, and terminates if either of these hypotheses does not hold. Let

$$\begin{aligned} A(u_1,\ldots ,u_n) = \begin{pmatrix} a_{11}u_1 &{} a_{12}u_2 &{} \cdots &{} a_{1n}u_n \\ a_{21}u_1 &{} a_{22}u_2 &{} \cdots &{} a_{2n}u_n \end{pmatrix} \end{aligned}$$

so that \(A(1,\ldots ,1) = A\), and let \(D_{pq}(u_1,\ldots ,u_n) =d_{pq}u_pu_q\) denote the minor of \(A(u_1,\ldots ,u_n)\) corresponding to columns p and q. For each \(1\le i,j\le n\) with \(d_{ij} > 0\), the denominator \(\prod _{k\ne i,j} (d_{ij} - d_{ik} - d_{jk})(d_{ij} + d_{ik} + d_{jk})\) of the corresponding term in Eq. (21) with the substitution \(c_{pq} = d_{pq}\) for each pq is evaluated. If the denominator is nonzero, then the term is computed directly from the matrix with the above substitutions. If the denominator vanishes, then the term is computed by substituting \(c_{pq} = D_{pq}(u_1,\ldots ,u_n)\) for each pq. The sum of the resulting terms is combined into a single rational fraction of the form in Eq. (26) in the indeterminates \(u_1,\ldots ,u_n\) with many of the singularities in that expression already removed. The remaining singularities can be removed by factoring and cancelling or by polynomial division of the numerator by the principal ideal generated by the product of factors of the denominator that vanish when each \(u_i = 1\).

This method has been implemented on Mathematica [38] and is available from the authors upon request. Unlike the algorithm to compute the complete Hilbert series described in Sect. 3.3, it has the benefit of not being as sensitive to the size of the entries of A. For weight matrices with no degeneracies, it is simply arithmetic and hence fast, and the computational expense grows with the number of degeneracies and only slowly with the n and the size of the weights. It has successfully computed \(\gamma _0(A)\) for weight matrices as large as \(2\times 10\) with multiple degeneracies in a matter of minutes.