Knots and Their Related $q$-Series

We discuss a matrix of periodic holomorphic functions in the upper and lower half-plane which can be obtained from a factorization of an Andersen-Kashaev state integral of a knot complement with remarkable analytic and asymptotic properties that defines a ${\rm PSL}_2({\mathbb Z})$-cocycle on the space of matrix-valued piecewise analytic functions on the real numbers. We identify the corresponding cocycle with the one coming from the Kashaev invariant of a knot (and its matrix-valued extension) via the refined quantum modularity conjecture of [arXiv:2111.06645] and also relate the matrix-valued invariant with the 3D-index of Dimofte-Gaiotto-Gukov. The cocycle also has an analytic extendability property that leads to the notion of a matrix-valued holomorphic quantum modular form. This is a tale of several independent discoveries, both empirical and theoretical, all illustrated by the three simplest hyperbolic knots.


Introduction
In this paper, which is a companion of [32], we want to tell a story about q-series and quantum invariants of knots that seems to us very interesting.The story started 11 years ago with the challenge to compute the asymptotic expansion at q → 1 of a q-hypergeometric series that appeared in the evaluation of a tetrahedron quantum spin network.As it turned out, when q = e 2πiτ with τ tending to zero on the positive imaginary axis, the asymptotics were oscillatory (with approximate oscillation 0.32306), and after some experimentation, it was found that the oscillation was given by the volume of the simplest hyperbolic (figure eight) knot, divided by 2π.The appearance of the 4 1 knot was a bit strange, since this knot has little to do with the tetrahedral spin network (or its complement) in Euclidean or hyperbolic 3-dimensional space.This strange coincidence persisted further, where it was found by a numerical computation that the first and the second terms in the asymptotic expansion were, after some minor normalization, rational numbers with numerator 11 and 697, respectively.A search in our databases revealed that the number 697 appears as the second coefficient in the asymptotic expansion of the 4 1 knot, whereas the number 11 appears as the first coefficient.This was surely not an accident!Using numerical methods, we were able to match the asymptotics of the Kashaev invariant of the 4 1 knot to the radial asymptotics of the above q-series to over 100 terms.
So, our q-series was certainly attached to an invariant of the 4 1 -knot.A systematic collection of such knot invariants (indexed by a pair of integers) was given by the 3D-index of Dimofte-Gaiotto-Gukov [11,12], and in fact, our q-series could be re-written as a q-hypergeometric sum G 0 (q) related to the 3D-index, and nearly, but not quite, matched to the so-called total 3Dindex.An illegitimate (i.e., formal, but divergent) computation of the total 3D-index suggested that the latter should equal to G 0 (q) 2 , but a computation showed that it did not agree.Further attempts to identify the quotient of the total 3D-index by G 0 (q) did not produce any results.
The next source of q-series attached to knots was the state-integral of Andersen-Kashaev [4].Although the latter is an analytic function of τ in the cut plane C ′ = C \ (−∞, 0], it was well known in the physics literature (see [5]) that it should factorize into a finite sum of products of q-series times q-series, where q = e 2πiτ and q = e −2πi/τ .In fact, Kashaev and the first author exactly did so for the state-integral of the 4 1 knot (and for one dimensional state-integrals in general) and found out a second q-series G 1 (q) [27].What is more, the total 3D-index of the 4 1 knot experimentally was checked to be the product G 0 (q)G 1 (q), a statement that can be proven rigorously.
We next looked at asymptotics of the vector (G 0 (q), G 1 (q)) of q-series of the 4 1 knot when q approaches a root of unity e 2πiα (for a rational number α), and without a surprise this time, we found the pair of asymptotic series Φ (σ 1 ) α (2πiτ ) and Φ (σ 2 ) α (2πiτ ) (corresponding to the geometric representation of the 4 1 knot and its complex conjugate) that appear in a refinement of the quantum modularity conjecture [32].Replacing the q and q-series in the state integral when q is near a root of unity by their asymptotic expansions produced a bilinear combination of factorially divergent series which are convergent power series!This phenomenon was illustrated by a dramatic drop in the growth rate of the 150-th coefficient of the corresponding power series.
Having understood the story for the simplest hyperbolic knot, we observed two new phenomena.One is quadratic relations (which are trivial for the 4 1 knot) for the vector of 3 q-series (inside and outside the unit disk) for the 5 2 knot, and for the vector of 6 q-series for the (−2, 3, 7)-pretzel knot.Another is the presence of a level, being 2 for the (−2, 3, 7)-pretzel knot, presumably related to the fact that its Newton polygon has half-integer slopes.
Returning to the case of the 4 1 knot, the factorization of its state-integral suggested that we look at a bilinear q and q-combination of the vector (G 0 (q), G 1 (q)) of q-series where now q = e 2πiγ(τ ) for a fixed element γ of SL 2 (Z) (the case of the original state-integral being the one with γ = 0 −1 1 0 ).A priori, this function is analytic only for τ ∈ C \ R, but a numerical computation revealed that this function is analytic on a cut plane C γ .This suggested an extension of the Andersen-Kashaev state integral that depends on an element γ of SL 2 (Z), and even more to an SL 2 (Z)-version of the Faddeev quantum dilogarithm, which is studied in current joint work of Kashaev and the authors [28].
A closer look at the asymptotics of the vector (G 0 (q), G 1 (q)) as q approaches 1, shows that they were given by linear combinations of a pair of asymptotic series Φ (σ 1 ) (2πiτ ) and Φ (σ 2 ) (2πiτ ).This suggested that suitable linear combination of the vector (G 0 (q), G 1 (q)) should be simply asymptotic to one of the two Φ (σ j ) (2πiτ ) series above.However, this statement is incorrect.Instead, the radial asymptotics when q = e 2πiτ and τ tends to zero in a fixed ray arg(τ ) = θ 0 depend on the ray, but different rays detect asymptotic expansions of the form e −2πim/τ Φ (σ j ) (2πiτ ) for m a nonnegative integer.When arg(τ ) = π/2, these exponentially small corrections cannot be numerically observed, however when arg(τ ) is near 0 or π, one can indeed see a multiple of these series e −2πim/τ Φ (σ j ) (2πiτ ), appearing, and what is more, the multiple is an integer number.This phenomenon is already hinted by the bilinear factorization of the state-integral as a finite sum of products of q-series times q-series, and was glimpsed in the present work, and studied more extensively in the work of Gu-Mariño and the first author [22,23].This lead to a matrix whose entries are descendant q-series indexed by the integers with G (0) 0 (q) = G 0 (q) and G (1) 1 (q) = G 1 (q).The matrix of descendant q-series defined for |q| ̸ = 1 lead to a matrix of asymptotic series, and to a matrix-valued PSL 2 (Z)-cocycle whose value at 0 −1 1 0 is given by a matrix of descendant Andersen-Kashaev state-integrals and whose value at γ ∈ SL 2 (Z) is given by the matrix of descendant state-integral invariants of [28].
The two matrix-valued cocycles, one from [32] and the other one from the current paper agree at the rational numbers.This follows from a second factorization property of the state-integrals at rational points [26].This leads to the notion of a holomorphic quantum modular form, a generalization of a mock modular form, whose realization as periodic functions at rational numbers was the focus of [32] and whose realization as periodic holomorphic functions in C \ R was the focus of our paper.
In this paper, we will have a number of statements called "Observations", all of which were first observed empirically, but of which some are now proved and others still conjectural.We will indicate this individually in each case.
A preliminary draft of this paper was already written in 2012 but then not published because we kept finding new results which made the older versions obsolete.In the present paper, the relation to the perturbative series and functions on roots of unity treated in [32] have finally become clear.Related aspects of this work appeared in [13,14,21,27,36,37].Modular linear q-difference equations were introduced in [29].An extension of the matrix-valued q-series to a matrix of one additional row and column that sees the trivial PSL 2 (C)-representation was given in [24].A detailed study of the asymptotics of the full 3D-index (as opposed to its total version discussed here) and of the related Turaev-Viro invariant was given in [30].A detailed study of the 6 × 6 matrix of q-series associated to the (−2, 3, 7)-pretzel knot is given by Ni An and Yunsheng Li in [1].
Finally, we mention that this story of quantum knot invariants (i.e., 3-manifolds with torus boundary) extends to the case of the Witten-Reshetikhin-Turaev of closed hyperbolic 3-manifolds, as confirmed by Campbell Wheeler in his Ph.D. Thesis [51,52].
2 How the q-series arise

The quantum modularity conjecture
In this section, we tell the rather amusing story of how we purely accidentally found a q-series whose asymptotics near roots of unity agreed with the divergent perturbative series arising from the volume conjecture and the quantum modularity conjecture for the 4 1 knot, and how a series of further numerical experiments led to the final picture that is described in this paper.
A knot K has two famous quantum invariants, the (colored) Jones polynomial J K N (q) ∈ Z q, q −1 and the Kashaev invariant ⟨K⟩ N ∈ Q for N ∈ N. (Both definitions will be omitted since they aren't used here and can be found in many places [39,41,50].)Murakami-Murakami [48] found that ⟨K⟩ N is the value of J K N (q) at q = ζ N and this is the formula that we will need.For any knot it can in principle be made explicit.For instance, with (q; q) n := n j=1 (1 − q j ) being the usual q-Pochhammer symbol and ζ N = e 2πi/N .The Kashaev invariant can be extended equivariantly to a function J on complex roots of unity.Moreover, it is known by the work of Murakami and Murakami [48] that the (similarly defined) invariant J K (−1/N ) for any knot K is equal to the knot invariant ⟨K⟩ N defined by Kashaev [41].
The famous volume conjecture of Kashaev states that for any hyperbolic knot K the logarithm of ⟨K⟩ N is asymptotically equal to CN as N tends to infinity, where C equals the (complexified) hyperbolic volume of the knot divided by 2πi.There are very few cases for which the volume conjecture has been rigorously proved, but for the 4 1 knot it is quite easy using the Euler-Maclaurin formula and standard asymptotic techniques, because all of the terms in (2.1) are positive, and one finds the much more precise formula with Φ(h) defined by where V is the hyperbolic volume of the knot and where Φ(h) is the formal power series with algebraic coefficients (which up to a common factor all lie in the trace field Q √ −3 of the 4 1 knot) having the form with a j ∈ Q, the first values being given by j 0 1 A proof of (2.1) is given in [6] and in [32].A weaker asymptotic formula with Φ(h) replaced by its constant term a 0 was proved by Andersen and Hansen [3].
2.2 A q-series G 0 (q) The surprising discovery that we made, completely by accident, is that there is a close connection between the asymptotic expression occurring here and the radial asymptotics of the function in the unit disk defined by The infinite sum in (2.4) occurred in the work of the first author on the stability of the coefficients of the evaluation of the regular quantum spin network [21, Section 7], and in the course of a numerical investigation of its asymptotics as q → 1 we discovered empirically the following: Observation 2.1.We have to all orders in τ as τ tends to 0 along any ray in the interior of the upper half-plane.
It was to achieve this simple statement that we included the factor (q; q) ∞ in (2.4).The proofs of this observation and the subsequent ones in this section are sketched in the appendix.Our next discovery were two further formulas for G 0 that we found empirically.
Observation 2.2.We have (q; q) n (q; q) m = ∞ n=0 (−1) n q n(n+1)/2 (q; q) 2 n . (2.6) A proof of the above equation was given by S. Zwegers (see Appendix A.1).These expressions are of interest because, unlike the original series in (2.4) whose origin had no obvious connection with the 4 1 knot, these series are related to it: the first one, which was shown to us by T. Dimofte, is typical of the series occurring in his work with Gaiotto and Gukov [11,12,20] on the 3D index of a triangulation, while the second one is typical of those occurring in the work of Dimofte and the first author on q-series associated to ideal triangulations of cusped 3-manifolds [13].
Equation (2.5) turns out to be only a part of a bigger story.On the one hand, the power series Φ(h) is only a special case at α = 0 of the more general asymptotic series Φ α (h) (α ∈ Q) occurring in the modularity conjecture for J 4 1 (q) made by the second author in [54] and play a central role in our prior paper [32].These asymptotic series appear in the asymptotics of G 0 (q) for q = e 2πi(α+τ ) as τ → 0 in a cone in the upper half-plane.This will be discussed in Section 3.3 below.On the other hand, the q-series G 0 (q) and the asymptotic formula (2.5) are related to the Dimofte-Gaiotto-Gukov index and to the Hikami-Kashaev state integral.We explain this next.

2.3
The index, the state integral and a second q-series G 1 (q) After describing the radial asymptotics of G 0 (q) at roots of unity, our next step was to look for a connection between the power series G 0 (q) and the index of 4 1 .The index is an invariant of suitable ideal triangulation introduced in [11,12].Necessary and sufficient conditions for its convergence were established in [20] and its topological invariance was proven in [25], leading in particular to an invariant Ind K (q) for any knot K in equation ( 2) of [25], this invariant was denoted by I tot K (q) .The index is defined as a sum over a lattice of products of the tetrahedron index function (q; q) n (q; q) n+e .
For the 4 1 knot, the rotated index at (0, 0) (abbreviated simply by the index below) is given by It seems quite natural to expect a relation between the Ind 4 1 (q) and G 0 (q).This is encouraged by the illegitimate rewriting of Ind 4 1 (q) as a 4-dimensional sum over the integers (which is divergent), but after some rearrangement it decouples into the product of two two-dimensional sums each of which is equal to G 0 (q).Nonetheless, when we performed experiments no relation between the series Ind 4 1 (q) and G 0 (q) 2 was observed.
The key to finding the missing relation between Ind 4 1 (q) and G 0 (q) turned out to involve the Andersen-Kashaev state integral associated to the 4 1 knot [4] and its factorization [27] as a sum of products of q-series and q-series.
State integrals appear in quantum hyperbolic geometry and in Chern-Simons theory with complex gauge group pioneered by the work of Kashaev [4,40], Dimofte [9,10] and many other researchers [15,38].Their building block is the Faddeev quantum dilogarithm, and a suitable combinatorial ideal triangulation of a cusped hyperbolic 3-manifold M and the result is a holomorphic function which is often independent of the ideal triangulation, thus a topological invariant.Below, we will use the state integral of the Andersen-Kashaev invariant of a hyperbolic knot complement [4].In the normalization that we will use this invariant is a holomorphic function Z M (τ ) on the cut plane C ′ , and for the 4 1 knot is given by (see [4,Section 11.4]) for convenience we write Z K in place of Z S 3 \K , with small positive ε, where Φ b (x) is Faddeev's quantum dilogarithm [17] Φ b (x) = −q 1/2 e 2πbx ; q ∞ −q 1/2 e 2πb −1 x ; q ∞ , q = e 2πiτ , q = e −2πi/τ , τ = b 2 .
As is well known (see for instance [5,27]), the structure of the set of poles of the quantum dilogarithm permits one to factorize this integral as a finite sum of a product of functions of q and q as above.The answer here is given by the following theorem.Let G 1 (q) be the q-hypergeometric series defined by and given explicitly by where E 1 (q)("the non-modular Eisenstein series of weight 1") is the power series (2.10) Theorem ( [27]).When Im(τ ) > 0, we have where q = e 2πiτ and q = e −2πi/τ .
The coefficients of G 0 (q) and G 1 (q) can be computed easily using that where T m (q) and R m (q) are given by the recursion with initial conditions T 0 (1) = 1 and R 0 (q) = E 1 (q).For instance, we find Quite by accident, when we compared the power series expansions of G 0 (q), G 1 (q), and the index, we discovered the following.
Observation 2.3.The three q-series G 0 (q), G 1 (q) and Ind 4 1 (q) are related by Ind 4 1 (q) = G 0 (q)G 1 (q).(2.13) A proof of equation (2.13) was communicated to us by T. Dimofte and an additional proof follows from the results of [23,Section 5.3].This observation suggests that the q-series G 0 (q) and G 1 (q) are intimately related.Since we had already discovered a relationship between the asymptotics of G 0 (q) as q → 1 and the power series occurring in (2.1) (Observation 2.1), it was natural to make a similar numerical study of the asymptotics of G 1 (q) as q → 1.The result of this experiment, stated in the following observation, was surprisingly simple.
Observation 2.4.We have to all orders in τ as τ tends to 0 in a cone in the interior of the upper half-plane.
The right hand side of equation (2.8) defines a sequence of power series (one for every power of ε) the first two of which are G 0 (q) and G 1 (q)/2.This is analogous to the ε-deformations of linear differential equations studied for instance by Golyshev and the second author [34,55], and also analogous to the theory of Jacobi forms, where ε plays the role of a Jacobi variable.The connection between ε-deformation and factorization of state integrals is discussed further in Appendix A.5 below.One may wonder whether the q-series given by the coefficient of ε 2 or ε k for k ≥ 2 in (2.8) has radial asymptotics given by a variation of Observations 2.1 and 2.4.A relation was recently found by Wheeler [51].
We discovered empirically the following alternative q-series representation for G 1 , which is just a slight modification of the second formula for G 0 given in (2.6).

Holomorphic functions in C \ R
The relation of the q-series G 0 and G 1 with the state integral given in equation (2.11) brings out one more aspect to the q-series G 0 and G 1 , namely their extension outside the unit disk |q| > 1.This happens because on the one hand the state integral satisfies the symmetry (which in turn follows from the corresponding symmetry of Faddeev's quantum dilogarithm), and on the other hand the state integral is factorized in terms of explicit q-hypergeometric series, which are guaranteed to be convergent when |q| ̸ = 1.Indeed, the summand in last part of equation (2.6) is invariant under the replacement of q by q −1 , and hence the formula of the equation defines an extension of G 0 for |q| > 1 which satisfies the property G 0 (q) = G 0 q −1 .Likewise, equation (2.9), together with the convention that E 1 q −1 = −E 1 (q) for |q| > 1, defines an extension of G 1 which satisfies the property G 1 (q) = −G 1 q −1 .Summarizing, we have and equation (2.11) holds for τ ∈ C \ R.
3 q-series and perturbative series In this section, we discuss three further aspects of our pair (G 0 (q), G 1 (q)) of q-series.One is that their asymptotic expansions depend on a sector.This seems to be a property of general q-hypergeometric series not observed before, which is not only theoretically interesting, but also practically so, since to numerically compute asymptotic expansions, we can choose rays with a single dominant asymptotics, making the numerical computation much easier.From that point of view, the numerical asymptotics when q ∈ [0, 1) tends to 1 is a very resonant situation.
A second aspect is that bilinear combinations of factorially divergent series give convergent power series.These bilinear combinations are motivated by the factorization of state-integrals, combined by the asymptotic expansions of our q-series, and lead to explicit formulas for the Taylor series expansions of state-integrals at rational numbers, which subsequently have been proven in [26].
The third aspect is that the asymptotic analysis of our q-series can be extended to any complex root of unity.This is hardly a surprise, and relates the asymptotic expansions of the pair (G 0 (q), G 1 (q)) as q approaches a root of unity to the asymptotic expansions of the Kashaev invariant in the quantum modularity conjecture of the second author [54].

Asymptotics of holomorphic functions in sectors
Since we will be considering functions of q on |q| ̸ = 1 as well as functions of τ ∈ C \ R with q = e 2πiτ , we will use capital letters for functions F (q) of q with |q| ̸ = 1 and small letters for the corresponding functions f (τ ) := F e 2πiτ of τ ∈ C \ R. For instance, we have and Observations 2.1 and 2.4 can be written in the form as τ ∈ C \ R goes to 0 in a cone in the interior of the upper half-plane.We emphasize here that we are not only considering limits as q → 1 radially, which would correspond to taking τ = iϵ with a positive real number ϵ tending to zero, but are also allowing τ to tend to 0 at an fixed angle.This is important when actually doing the numerical experiments since often (and also here) the limit when one moves along the imaginary axis only is hard to recognize because the two terms in (2.14) are both oscillatory and have the same order of magnitude, so that they interfere with one another, and it is only possible to see the numerical structure clearly when one allows oneself more freedom.The two asymptotic series Φ(2πiτ ) and i Φ(−2πiτ ) partition the upper half plane into two sectors In the interior of S 1 , Φ(2πiτ ) dominates exponentially, and the reverse happens in S 2 , while on the common ray arg(τ ) = π/2 both functions have oscillatory growth.On a fixed ray, the asymptotic statements of equation (3.1) involves combinations of series with different growth rates, and it would appear at first sight that the coefficient in front of the dominated series in (3.1) is meaningless.However, the refined optimal truncation of [32,33] allows us to make numerical sense of the both divergent series Φ(±2πiτ ) with a relative error that is exponentially rather than merely polynomially small compared to the leading term, and then we can "see" both terms in (3.1).
We can also try to take a linear combination of the two equations in (3.1) to get new holomorphic functions w (σ 1 ) (τ ) and w (σ 2 ) (τ ) whose asymptotic behavior near the origin gives each of the individual completed series Φ(±2πiτ ) separately.Specifically, if we define a holomorphic vector-valued function w(τ ) = by then equation (3.1) might seem to imply the asymptotic statements to all orders in both quarter-planes S 1 and S 2 .In any case, the passage from g to w has several other nice consequences.The first is a very simple formula for the index, namely (combine equations (2.13) and (3.2)), which when combined with Observation 3.1 gives the asymptotics of the 3D index when τ tends to zero on the vertical axis.The second, obtained by combining equation (2.11) with Observation 2.3 as τ → 0, and using the fact that In other words, the state integral as τ → 0 exponentially decays with the fastest possible rate and with an asymptotic expansion matching to all orders that of the Kashaev invariant at q = 1.This is a version of the Volume Conjecture for the state integral which has recently been established for knot complements with suitable ideal triangulations in [2].However, equation (3.3) is not quite true.Instead, we find that it is true in a wide neighborhood of the imaginary axis, but fails when τ approaches 0 from very near the positive or negative real axis.More precisely, what we find numerically is the following Observation 3.1.The first asymptotic equation in (3.3) holds to all orders in τ as τ tends to 0 along a ray with argument between 0 and π − 0.11, but fails when the argument is larger, while the second equation holds to all orders if τ tends to 0 along a ray with argument between 0.11 and π, but fails for small arguments.
As an illustration, for τ = −10+i 100000 we find so that w (σ 2 ) (τ ) is indeed asymptotically close to −i Φ(−2πiτ ) (and in fact their ratio equals 1 numerically to over 200 digits), but w (σ 1 ) (τ ) is not at all close to Φ(2πiτ ).On the other hand, the ratio of w (σ 1 ) (τ ) to w (σ 2 ) (τ ) is extremely close to 3 q, where q := e −2πi/τ , and the corrected value w (σ 1 ) (τ ) − 3qw (σ 2 ) (τ ) now coincides with Φ(2πiτ ) with a relative accuracy of more than 200 digits.In other words, in this region w (σ 1 ) (τ ) is always asymptotically very close to Φ(2πiτ ) + 3i q Φ(−2πiτ ), but there is a phase transition on the line arg(τ ) = arctan V /2π 2 = 0.10247 . . ., where the two terms in this new approximation have the same order of magnitude as τ → 0. If we continue further to the left, then there is a new phase transition at arg(τ ) = arctan V /4π 2 = 0.05137 . . ., where we need a further correction term 18 q2 w (σ 2 ) (τ ) and similarly if we go further we find phase transitions whenever arg(τ ) = arctan V /2π 2 m , where qm Φ(−2πiτ ) and Φ(−2πiτ ) are of the same order of magnitude, the correction needed at τ = −40+i 100000 for instance being 3q + 18q 2 + 99q 3 + 555q 4 w (σ 2 ) (τ ), which makes w (σ 1 ) agree with Φ(2πiτ ) with a relative error of 10 −148 as opposed to the huge 10 +531 that we obtain without any correction.Note that we cannot find these higher-order corrections in q by looking for a q-power series linear combination of Φ(−2πiτ ) and Φ(−2πiτ ) that is very close to w (σ 1 ) (τ ), because even with improved optimal truncation we cannot evaluate qm Φ(−2πiτ ) to the required degree of precision, but since w (σ 1 ) (τ ) and w (σ 2 ) (τ ) are given in terms of convergent power series that can be computed to any desired precision, we can find successive terms of a power series a = a ± (q) making w (σ 1 ) − aw (σ 2 ) agree with Φ(−2πiτ ) to all orders τ approaches the real line with any argument between 0 and π, and similarly (by studying the power series near the positive real axis) another Z[[q]]-power series linear combination of w (σ 1 ) and w (σ 2 ) that agrees to all orders with Φ(2πiτ ) in the entire upper half-plane.Both linear combinations are determined by these requirements only up to multiplication of the whole expression by a power series in q starting with 1.We will see later in Section 4 why this happens and how to find canonical Z[[q]]-linear combinations of τ −1/2 g 0 and τ 1/2 g 1 -see equation ( 4.3) below.

From divergent to convergent power series
The third interesting corollary of Observations 2.1 and 2.4 is obtained by combining them with equation (2.11) and the fact that Z 4 1 (τ ) is holomorphic in the cut plane C ′ , since this leads to startling predictions regarding the factorially divergent formal power series Φ(h Specifically, using the factorization of the state integral given in (2.11), the fact that each w (σ j ) (τ ) is a linear combination of the functions τ −1/2 g 0 (τ ) and τ 1/2 g 1 , and the fact that g 0 and g 1 are 1-periodic, we can re-express the state integral in terms of w as follows: The fact that the state integral is holomorphic in C ′ implies that the right-hand side of (3.4) has a Taylor expansion around τ = 1 with radius of convergence 1.However, this is wasteful because it uses only the holomorphy of Z 4 1 in the disk |τ − 1| < 1.If we use its holomorphy, first in {Re(τ ) > 0} and then in all of C ′ , then by making the changes of variables which give biholomorphic maps between the unit u-, v-and w-disks and the sets {|τ − 1| < 1}, {Re(τ ) > 0} and C ′ , respectively, we find: ] be given by (2.3).Each of the three formal power series has radius of convergence 1.
Note that the original formulas obtained from (3.4) would have had Φ's instead of Φ's and would not have had the scalar factors e ±C , which arise from a cancellation of an exponentially large and an exponentially small prefactor.This also means that each of the three power series Q, R and S has coefficients in the ring Q π, √ −3, e C .What the corollary says is that, although the original power series Φ(x) occurring in the asymptotic expansion of the Kashaev invariant ⟨4 1 ⟩ N was factorially divergent, each of the combinations Q, R and S defined by (3.6) are convergent power series with radius of convergence 1.This can be seen dramatically in following table showing the growth of the coefficients (rounded), part of which was already given in [32, equations (35) and ( 83)]: Note that the fact that the coefficients of S, although very much smaller than those of Φ, are much larger than those of Q and R, does not mean that S is the worst of these three series, but actually the best one, since the larger growth reflects the fact that the unit w-disk corresponds to the entire domain of holomorphy C ′ of the state integral rather than a subset like the two other series, and that consequently this power series has essential singularities on the entire unit circle rather than at only one or two points.(This observation was already made in [32].)

3.3
The asymptotics of G 0 (q) and G 1 (q) at roots of unity Observations 2.1 and 2.4 express the asymptotics of the functions G 0 (q) and G 1 (q) at q = 1 in terms of the series Φ 4 1 (h) which appears in the asymptotics of the Kashaev invariant at q = 1.We now extend the above observation to all roots of unity using the series Φ 4 1 α (h) that appear in the quantum modularity theorem of the Kashaev invariant of the 4 1 knot [32].Let us briefly recall the latter.Let denote the extension of the Kashaev invariant of 4 1 [41] to Q where J(−1/N ) = ⟨K⟩ N .The quantum modularity theorem for the 4 1 knot asserts that for every matrix γ = a b c d ∈ SL 2 (Z) we have to all orders in 1/X as X → ∞ in Q with bounded denominator where α = a/c, and Φ α (h) is a power series with algebraic coefficients.Various refinements of the quantum modularity conjecture were discussed in detail in [32].Since J is 1-periodic (i.e., defined for α ∈ Q/Z), it follows that the series Φ α (h) depends on α ∈ Q/Z.The reflection of the quantum modularity statement (3.7) for the power series g 0 and g 1 is the following extension of equation (3.1), in which we have set τ = α + ε/c: Observation 3.3.For a rational number α = a/c, we have ) to all orders in ε as ε ∈ C \ R tends to 0 in a cone in the interior of the upper half-plane.
Finally, we reformulate the asymptotic expansions given in equations (3.8) in a way that resembles the quantum modularity conjecture.Consider the vector-valued holomorphic function g = g 0 g 1 on C \ R, where g 0 and g 1 are declared to have weights −1/2 and 1/2, and define the corresponding vector-valued "slash operator" by Notice that Observation 3.4 has a corollary generalizing the one given in Section 3.2, giving linear combinations of two products of a Φ a -series and a Φ −1/α -series with radius of convergence 1 for any rational number α, and not just for α = 1 as before.We leave the details to the reader.

The quadratic relation
We now describe some new phenomena that we observed using other knots.The knot 4 1 was amphicheiral and hence special: in general one should expect an r-tuple of pairs of q-series, one on each half-plane, hence a total of 2r q-series.(We will see in a later Section 5.4 the topological meaning of this number r).However, in the case of the 4 1 knot, the four q-series are actually two, each appearing twice, due to the amphicheirality of the 4 1 knot.On the other hand, the factorization integral for the 5 2 knot and for the (−2, 3, 7) pretzel knot gives a total of 6 and 12 q-series.For each knot, the collection of these q-series satisfies one quadratic relation, which is trivial for the case of the 4 1 knot.
Let us illustrate the quadratic relation using the 5 2 knot as an example.The Andersen-Kashaev state integral of the 5 2 knot is given by [4, equation (39)] In [27], by the same type of residue calculation as in the 4 1 case, it is shown that Z 5 2 has the decomposition for τ ∈ C \ R, where are holomorphic functions in a half-plane and H ± j (q) ∈ Z[[q]] are q-series with coefficients in 1/6Z defined by whose first few terms are given by and whose further properties are given in Appendix A.4.Here, E 2 (q) = 1 − 24 n≥1 q n (1−q n ) 2 is the weight 2 Eisenstein series and (x; q) ∞ = ∞ k=0 1 − q k x .The index of the 5 2 knot is given by the following expression: The next observation (a proof follows from results of [23, Section 5.3]) was expected given what we knew from the case of the 4 1 knot.
Observation 3.5.The q-series H j are related to the index by The next observation, a quadratic relation among the 3 pairs of q-series was unexpected and found by accident.This relation could not be seen in the case of the 4 1 knot, since it reduces to the empty equation G 0 (q)G 1 (q) − G 1 (q)G 0 (q) = 0, as a consequence of the fact that the 4 1 knot is amphicheiral.
Observation 3.6.The q-series H j satisfy the quadratic relation We now discuss the asymptotics of the six q-series of the 5 2 knot.Just as in the case of the 4 1 knot, the asymptotics of h j (τ ) as τ ∈ C \ R tends to zero in a ray are given by a rational linear combination of three asymptotic series Φ (σ) (h) that appear in the quantum modularity conjecture of the 5 2 knot [32], where σ denotes one of the three embeddings of the trace field of the 5 2 knot (the cubic field of discriminant −23 generated by ξ with ξ 3 − ξ 2 + 1 = 0).Each embedding corresponds to a boundary parabolic SL 2 (C) representations of the fundamental group of the complement of the knot, with the convention that σ 1 , σ 2 and σ 3 denotes the geometric embedding, (corresponding to Im(ξ) < 0, its complex conjugate, and the real embedding of the trace field).When τ approaches zero in a fixed generic ray, the three asymptotic series Φ (σ j ) (h) have different growth rates and this divides each of the upper and lower half-plane into four sectors shown in Figure 2. Just as in the case of the 4 1 knot, the refined optimal truncation of [32] finds in each sector R a unique matrix M R such that h(τ ) ∼ M R Φ(2πiτ ) as τ ∈ R and τ → 0, where Using 108 exact coefficients of the power series Φ and refined optimal truncation, we found the following.
Observation 3.7.We have where Inverting the matrices N ± we obtain a vector w = that express equation (3.12) in the equivalent form when arg(τ ) ∈ (−π/2, 0.19) \ {0} and j = 1, 2, 3. Since the functions h and w are related by a linear transformation, it follows that the state integral, the index and the quadratic identity can be expressed in terms of the function w as follows: 4Ind In terms of the Φ (σ j ) series, equation (3.14) and (3.13) implies the quadratic identity (where we are summing over σ ∈ {σ 1 , σ 2 , σ 3 }) whereas equation (3.15) and (3.13) implies that the expansion of Z 5 2 (τ ) around τ = 1 when τ is given by (3.5) is a power series where Vol C (ρ) is the complexified volume of the corresponding boundary parabolic SL 2 (C)-representation ρ of the fundamental group of the complement of the 5 2 knot.

Higher level and weight spaces
In this section, we describe a new phenomenon, the level of a knot, and examples where the weight spaces have higher multiplicity.For the (−2, 3, 7) pretzel knot, there are 6 pairs of q-series, and the weight spaces are not one-dimensional; there are weights 0, 1 and 2 with dimensions 1, 4 and 1, respectively.The 6 pairs of q-series involve power series in integer powers of q 1/2 , meaning level N = 2, and so we should introduce the level of a knot, presumably the same as the one coming from the periodicity of the degree of the colored Jones polynomial [18,19].This q 1/2 will be upgraded to a whole SL 2 (Z) and Γ(2) story in Section 4. As an added complexity for the (−2, 3, 7) knot, the 6 asymptotic series come in two Galois orbits of size 3 defined over the cubic field of discriminant −23 (the trace field) and over the abelian field Q(cos(2π/7)) of discriminant 49.Moreover, the 3 complex volumes of the latter Galois orbit are rational multiples of π 2 .
To illustrate the new phenomenon, we begin by introducing the 6 pairs of q-series for the (−2, 3, 7) pretzel knot.The state integral of the (−2, 3, 7) pretzel knot was given in [26,Appendix B].Using the functional equation for Faddeev's quantum dilogarithm [26, equation (78)], and ignoring some prefactors, the state integral is given by with small positive ε, where b = √ τ and Using the method of [27], we can express the above state integral in terms of 6 q-series as follows.
The vector space ⟨H⟩ spanned by (H 0 , . . ., H 5 ) has the (ε-deformation) weight decomposition There is a representation ρ of SL 2 (Z) on ⟨H⟩ which is the identity on W 1 and W 2 and has kernel Γ(2) on W 0 .Thus, the action of ρ on W 0 comes from a representation ρ ′ of the quotient group S 3 = Γ/Γ(2).The latter decomposes as the direct sum of the 2-dimensional irreducible representation of S 3 and two copies of the trivial representation of S 3 .The index of the (−2, 3, 7) pretzel knot is given by the following expression: Observation 3.9.The relation with the index is given by Ind (−2,3,7) (q) = H + 1 (q)H − 1 (q) and the following quadratic relation holds: Just in the case of the 4 1 knot and the 5 2 knots, the asymptotics of h j (τ ) as τ ∈ C \ R tends to zero in a ray are given by a rational linear combination of the asymptotic series Φ (σ) (h) that appear in the quantum modularity conjecture of the (−2, 3, 7) knot [32].However, this knot has 6 boundary parabolic SL 2 (C) representations, arranged in two Galois orbits of size 3, one defined over the trace field of the (−2, 3, 7) pretzel knot the cubic field of discriminant −23 generated by ξ with ξ 3 − ξ 2 + 1 = 0 and another defined over the real abelian field Q(2 cos(2π/7)).Let {σ 1 , σ 2 , σ 3 } denote the three embeddings of the trace field corresponding to Im(ξ) < 0, Im(ξ) > 0 and Im(ξ) = 0, and let {σ 4 , σ 5 , σ 6 } denote the three embeddings of Q(η) with η 3 + η 2 − 2η − 1 = 0 (the abelian cubic field with discriminant 49) into C given by sending η to 2 cos(2π/7), 2 cos(4π/7) and 2 cos(6π/7), respectively.When τ approaches zero in a fixed generic ray, the six asymptotic series Φ (σ j ) (h) have different growth rates, and the ordering of the growth rates in each ray is dictated by Figure 3.
Let Φ α (h) = Φ (σ j ) (h) 6 j=1 denote the vector of asymptotic series, and let h(τ ) = (h j (τ )) 5 j=0 denote the vector of holomorphic functions on C \ R with weight (−1, 0, 1, −1, −1, −1).As before, if we let X → ∞ in a fixed sector and γ ∈ SL 2 (Z), we can fit the asymptotic expansion of the vector h| γ (X) with the asymptotic series Φ α (2πi/(cX+d)) after multiplication by a matrix.There is an additional subtlety which is absent in the case of the 4 1 and 5 2 knots, namely the fact that some of the q-series H ± j (q) are power series in q 1/2 , which implies that the functions h j (τ ) are 2-periodic, but not 1-periodic.This implies that the matrices that determine the linear combinations depend on the cosets of Γ(2) in SL 2 (Z).Observation 3.10.As X ∈ C \ R in a sector near the positive real axis and X → ∞, we have to all orders in 1/X.
Inverting the matrix in equation (3.18), allows one to define holomorphic lifts w (σ) in C \ R of the asymptotic series Φ (σ) (h).This gives a practical method for computing the coefficients of the 6 asymptotic series Φ (σ) (h).Indeed, a numerical computation of the series w (σ) at cusps and the Galois invariant of the series Φ (σ) (h) reduces the computation of their coefficient to the recognition of rational numbers with prescribed denominators.We used this method to compute 37 terms of the six Φ (σ) (h), and to compare the results with the asymptotics of the Kashaev invariant in [32].
4 From vector-valued to matrix-valued q-series So far, we used the state integral of a knot to define a vector of q-series for |q| ̸ = 1 whose asymptotics were found to be related to the r-vector of asymptotic series of the knot from our earlier paper [32].In this section, we report a recent discovery, descendants, which places the vector as the first column of an invertible r by r matrix of q-series for |q| ̸ = 1.It turns out that asymptotic series [32], q-series and state integrals [22,23] all have descendants.We will explain the notion of descendants in Section 4.1 for the 4 1 knot, where there will be infinitely many descendants G (m) 0 (q) and G (m) 1 (q) (Laurent series in q with integer coefficients) with m ranging over Z, and then we will construct the matrix Q(q) whose second column is 1  2 qG (1) for j = 0, 1. (We will explain in Section 5.3 below why we choose this particular linear combination.)In Section 4.2 we discuss the asymptotic properties of these descendants, and in Section 4.3 we state the analogous results for the 5 2 knot.
Theorem ( [23]).The matrix w m (q) is a fundamental solution of the linear q-difference equation It has constant determinant and satisfies the symmetry and orthogonality properties for all integers m and for |q| ̸ = 1.
The descendant series G (m) j (q) arise from a factorization of the "descendant state integral" . This is a holomorphic function of τ ∈ C ′ that coincides with Z 4 1 (τ ) when m = m ′ = 0 and can be expressed bilinearly in terms of G (m) j (q) and G (m ′ ) j (q) as follows [22, equation (69)]: (Here q = e(−1/τ ) as usual.)This implies that the matrix-valued function which is originally defined only for τ ∈ C\R, extends holomorphically to τ ∈ C ′ for all integers m and m ′ .A similar story of descendants for the 5 2 knot was given in [23, Section 4.1k], and will be reproduced in Section 4.3 below.

The asymptotics of the descendants
In [32], studying the refined quantum modularity conjecture for the 4 1 knot, we found a 2 by 2 matrix of asymptotic series , where Ψ(x) = e C/h Ψ(x) where Ψ(x) is the series Naturally, we looked into the asymptotics of its descendant holomorphic blocks.Since any three consecutive are related by the recursion (4.1), so are their asymptotics.For consistency, and for symmetry, we looked into the asymptotics of the descendant holomorphic blocks for m = −1, 0, 1. Naturally, we expected that the series Ψ as well as the series Φ would show up, and indeed we found the following asymptotics for the matrix of q-series defined by (q) , q = e(τ ).(4.4) Observation 4.1.As τ → 0 in the upper half-plane, we have Note that equation (4.2) implies that det(Q(τ )) = 2 for all τ , and combined with the above, it follows that the function Φ(x) satisfies det( Φ(x)) = 1 as well as the orthogonality property Φ(−x) Φ(x) t = 0 i i 0 .

The case of the 5 2 knot
Consider the linear q-difference equation y m (q) − 3y m+1 (q) + 3 − q 2+m y m+2 (q) − y m+3 (q) = 0, m ∈ Z, (4.5) In [23,Section 3.2], it was shown that it has a fundamental solution sets given by the columns of the following matrix where for |q| < 1 q n(n+1)+nm (q; q) k (q) defined in equation (A.16) below.Note that when m = 0, H j (q ±1 ) = H ± j (q) where H ± j (q) are the six q-series of the 5 2 knot (3.11) that appear in the factorization of its state-integral.
Theorem ( [23]).The function w m (q) defined by (4.6) is a fundamental solution of the linear q-difference equation (4.5) that has constant determinant det(w m (q)) = 2, satisfies the orthogonality property as well as for all integers m, ℓ and for |q| ̸ = 1.
The series H (m) (q) for |q| ̸ = 1 appear in the factorization of the descendant state integral of the 5 2 knot of [22].It is a holomorphic function of τ ∈ C ′ that coincides with Z 5 2 (τ ) when m = m ′ = 0 and can be expressed bilinearly in terms of H (m) (q) as follows: where for j = 0, 1, 2 and m ∈ Z.It follows that the matrix-valued function defined for τ = C \ R, has entries given by the descendant state integrals (up to multiplication by a prefactor of (4.8)) and hence extends to a holomorphic function of τ ∈ C ′ for all integers m and m ′ .Using this for m = −1 and m ′ = 0 and the orthogonality relation (4.7), it follows that we can express the Borel sums of Φ(τ ) in a region R in terms of descendant state integrals and hence, as holomorphic functions of τ ∈ C ′ as follows.

The matrix-valued cocycle of a knot
In this section, we extend the observations of the previous sections to matrix-valued analytic functions which naturally give rise to a cocycle on on the set of matrix-valued piece-wise analytic functions on P 1 (R).What's more, we conjecture (and in the case of the 4 1 , prove) that this cocycle, restricted to the rational numbers, exactly agrees with the cocycle of our previous work [32], which naturally binds the two works together and naturally leads to the concept of a matrix-valued holomorphic quantum modular form.

An equivariant state integral
We return to the 4 1 knot.The factorization of the state-integral (2.7) given in equation (2.11) in terms of the pair (g 0 (τ ), g 1 (τ )) motivates us to consider the following function: for an element γ of SL 2 (Z) and for τ ∈ C \ R, where now q denotes e(γτ ).A priori, this function is not defined for any real value of the argument.However, experimentally (by looking at the asymptotics of the function as we approach real points vertically) we found the following.To explain and prove this observation, we introduced an SL 2 (Z)-version of the state-integral using an SL 2 (Z)-version of Faddeev's quantum dilogarithm where the latter function corresponds to γ = 0 −1 1 0 that satisfies a pentagon identity.The functional properties of this quantum dilogarithm implies that the corresponding state-integral extends on C γ , and its factorization coincides, up to elementary factors, with the function Z 4 1 (γ; τ ) for the case of the 4 1 knot.This is discussed in current joint work with Kashaev [28], where in particular a proof of the above observation is given.

A matrix-valued cocycle
The state integral Z 4 1 (τ ) is just one component of a 2 × 2 matrix closely related to the matrix W 0,0 (τ ) defined in equation ( 4.3), and similarly the equivariant state integral (5.1), up to elementary factors, becomes just one component of a 2 × 2 matrix-valued function (5.2) Observation 5.1 now generalizes to the statement that the function W γ extends holomorphically from the upper and lower half-planes to C γ .Its restriction to C\R is a matrix-valued holomorphic cocycle there, meaning that it satisfies because the diagonal matrix appearing as the middle factor in (5.2) is a cocycle, so that the function γ → W γ is a "twisted coboundary".If W γ extended to the whole plane, then this cocycle property would automatically extend to the real line by continuity.This doesn't quite work since W γ does not extend to the whole real line, but only to a subset of it, namely the set of x with cx + d > 0, depending on γ.To solve this problem, we pass from SL 2 (Z) to its quotient PSL 2 (Z) = SL 2 (Z)/{±1} and define a PSL 2 (Z)-cocycle γ → W R γ with values in the group of piecewise-analytic invertible matrix-valued functions on P 1 (R) by setting observing that for any element γ of PSL 2 (Z) and x ∈ R\{−d/c} we can lift γ to a unique element γ ∈ SL 2 (Z) with cx + d positive.Of course the new cocycle on P 1 (R) is no longer a coboundary in any sense.But this is a bonus rather than a defect, since non-trivial cohomology classes are more interesting than trivial ones.In the paper [32] we had also found a cocycle on piecewise analytic functions on R with a completely different definition, in terms of the asymptotics near rational numbers of generalized Habiro-like functions.The two cocycles turn out to agree, provably for the 4 1 knot and conjecturally in general.We discuss this next.

The two cocycles agree
We now show that the cocycle (5.4) and the one from our prior paper [32] agree for the case of the 4 1 knot.
We first recall from [32, Section 7.1] the periodic function J = J (4 1 ) on Q defined by where with q = e(x) and c = denom(x) being the denominator of x. (Actually, the periodic function defined in [32], and denoted there by J = J (4 1 ) , was a 3 × 3 matrix with first column (100) T and bottom 2 × 2 piece J, but we will only need this part of it.)The matrix J defines a cocycle [32, Section 5] where C is 1/2π times the volume of the figure 8 knot and γ → λ γ is the Q-valued cocycle defined in equation ( 24) of [32] .
One of the main discoveries of [32], conjectural in general but proved for the 4 1 knot, is that this coboundary extends smoothly from Q\{−d/c} to R\{−d/c}.(Actually, in [32] only a somewhat weaker statement was discussed, namely, that the function on Q has a power series to all orders in x − x 0 as the argument x tends to a fixed rational number x 0 , with the stronger statement with smoothness, or even real-analyticity, being mentioned there as an consequence of the results in the current paper.) The next theorem links the cocycle of our paper [32] with the one of the current paper and explains the bond between our two papers.
Theorem 5.2.The cocycles W R and W Hab coincide.
Because SL 2 (Z) is generated by S = 0 −1 1 0 and T = 1 1 0 1 , and both of the functions under consideration are cocycles and are trivial on T , and because both are continuous on R \ {0}, it is enough to prove the equality The proof of this identity, given in Appendix A.3, uses a "factorization" of state integrals at positive rational points (i.e., a bilinear expression of a vector of functions of τ ∈ Q and −1/τ ) established by Kashaev and the first author [26], similar to the "factorization" of state integrals when τ ∈ C \ R of the first author and Kashaev [27].These two "factorization" properties of state integrals, one in the upper-half plane and another in the positive rational numbers, are separate (in the sense that we do not know how to deduce one from the other) but closely-related facts.

Matrix-valued holomorphic quantum modular forms
We believe that the results we have been describing for the 4 1 knot will apply to all hyperbolic knots (possibly with the disclaimers given in the introduction to [32] about the behavior of character varieties of general knots).Some part of the story, the matrix of "descendant" functions and the factorization formula (4.8), was carried out for the 5 2 knot in [22] and described in Section 4.3, and another part, the asymptotics (analogue of Observation 4.1) was carried out for the same knot in [30].For the (−2, 3, 7)-pretzel knot, only a part of the story, concerning what should be the upper left-hand of the matrix W S (τ ) for this knot, was given in Section 3.5.
We have not done the corresponding calculations for any other knots, but the expected pattern is clear and will be told here.These examples will also lead to a new notion of "matrix-valued holomorphic quantum modular forms" which we expect will be of interest also in areas that are unrelated to quantum topology.
To each hyperbolic knot we are going to assign various r×r matrices, where r is the number of non-trivial boundary parabolic SL 2 (C)-representations. (Some of them, and perhaps all, extend to square matrices of size r + 1 including also the trivial representation, as discussed in [32] and [51], but we will not go into this here.These larger matrices were denoted by boldface letters there and we will use non-boldface names here to distinguish them.)Some of these will be periodic functions (on either Q or C \ R), but with the property that the corresponding coboundaries lead to the same cocycle W γ with values in the group of invertible matrices of piecewise analytic functions on P 1 (R).The periodic functions on Q are either the generalized Habiro functions J (K) (α) or the related matrices of power series Φ(α) of the previous paper [32], whereas the matrix-valued functions in C \ R are the functions Q = Q K (τ ) studied here.They have the following properties and interrelations: (i) The matrix Q = Q K is a holomorphic and periodic in C \ R and meromorphic at infinity, meaning that each of its entries is a power series in some rational power of q = e(τ ) in the upper half-plane and in q −1 in the lower half-plane.We also have "weight" k = (k 1 , . . ., k r ) ∈ Z r and a representation ρ : SL 2 (Z) → GL r (C) which factors through Γ(N ) for some integer N (called the level of the knot) which are compatible in the sense that the map is a cocycle on SL 2 (Z).(The representation ρ is a minor technical point that arose in [32] for the (−2, 3, 7)-pretzel knot but was trivial for both the 4 1 and 5 2 knots and can be ignored.)The key property, which is the one that says that Q is a holomorphic quantum modular form, is that the matrix-valued function extends holomorphically from C\R to C γ for each γ ∈ SL 2 (Z), just as we saw above for the 4 1 knot.This map automatically satisfies equation (5.3), and therefore leads to a PSL 2 (Z)cocycle w R , with values in the ring of invertible piecewise analytic matrix-valued functions on P 1 (R), by the same formula (5.4) as before.
(ii) Secondly, we associate to the knot K a collection α → Φ α (h) of matrices, indexed by numbers α ∈ Q/Z) (or equivalently, by roots of unity), which are the generalized Habiro invariants whose existence was conjectured, and in some cases extensively checked numerically, in [32].The entries of these matrices are completed power series in an formal variable h, where "completed" means that they belong to e v/h C[[h]] for some v, which in fact will depend only the column of the matrix in which the entry lies and will be the appropriate complexified hyperbolic volume.We think of Φ a (h) as the value of some formal function Φ at x = α + iℏ, defined in infinitesimal neighborhoods of all rational points α.The group PSL 2 (Z) acts on the space of such formal functions, so that we again get a coboundary Φ(γx) −1 Φ γ (x), and this turns out to become a smooth function W Hab γ (x) of γ and of a real variable x ∈ R \ γ −1 (∞)) .(For a more precise statement, see [32, equation (78)].)This new function is then of course a cocycle, and the conjectural general statement is that it simply coincides with W R .The relation with what we said for the 4 1 knot in Section 5.3 is that, if we write the completed power series-valued matrix Φ a (h) as the product on the left of a true power series-valued matrix Φ a (h) by the diagonal matrix with entries e V j /c 2 h (j = 1, . . ., r, c =denom(α)), and then define J(α) to be the constant term Φ α (0) of this matrix, then we have yet another coboundary defined by the obvious analogue of equation (5.7).The latter is now a GL r (C)-valued function on rational numbers, that again extends continuously to the same smooth cocycle W γ as before.It is this latter statement that directly generalizes Theorem 5.2 above, but the statement that we want to emphasize is that the same cocycle γ → W γ trivializes (i.e., becomes a coboundary) in each of three larger spaces than the space of piecewise realanalytic functions on P 1 (R) in which it is originally defined.We can think of each of these trivializations given by Q, Φ and J as realizations of the same object in different spaces, similar to the various realizations of motives in differently defined cohomology groups.
(iii) Finally, and in some sense quite amazingly, the cocycle W is not only determined by the completed power series-valued matrix-valued function α → Φ α as its coboundary, but conversely determines this function uniquely by the asymptotic property. .
The matrices we have been discussing have a number of further interesting properties, some of which we list in no particular order.
Orthogonality.There exists a matrix B ∈ GL r (C) such that q-holonomicity.This property was discussed for the Habiro-like matrix invariants in [32], while its q-series analogue, of which equation (4.1) is a special case, was the starting point of [29].
Unimodularity.In the cases that we have looked at, all of the matrices we have been discussing were unimodular.We do not know whether to expect this property in general.
Bilinearity.Property (5.8) implies that W can be expressed bilinearly in terms of the entries of Q by W γ (τ ) = (Q| εγε ) t (ετ )BQ(τ ), where ε = −1 0 0 1 .Taylor series.The cocycle property of W γ allows one to compute the Taylor series expansion of the smooth function W γ at every rational point and express them bilinearly in terms of the matrix Φ as was done in [32, Proposition 5.2].

Final remarks
In this paper, we discussed the properties of a 2 by 2 matrix Q of periodic functions on C \ R associated to the 4 1 knot (see equation (4.4)).On the other hand, in our companion paper [32], we constructed a 3 by 3 matrix Q + of periodic functions on Q (see equation (5.5)).Wheeler [51] has found an extension of our 2 by 2 matrix Q (with one boring column (1, 0, 0) t and one interesting row) using the ε-deformation series (2.8).
Another aspect of the matrix Q of q-series associated to a knot appears to be in connection to the resurgence, i.e., analytic continuation, of the the factorially divergent series Φ(h) in the complex Borel plane.In fact the matrix Q appears to completely describe this problem of analytic continuation as found by the first author and Gu and Mariño [22,23].The so-called Stokes constants of the analytic continuation problem are integers, multiplied by integer powers of q = e −2πi/τ that assemble into power series with integer coefficients which are none other than the matrix Q(−1/τ ).This approach to resurgence of asymptotic series is similar to the one proposed abstractly by Kontsevich-Soibelman [43,44,45,46,47].
It is clear from the data that is used to define a state integral that the proposed holomorphic quantum modular forms are not only associated to knots, but more generally to suitable halfsymplectic matrices introduced in [32], or alternatively to combinatorial gadgets often called K 2 Lagrangians.
The proposed quantum holomorphic modular forms that appear here presumably correspond to the partition functions Z(h) and Z(q) predicted by the ongoing program of Gukov and collaborators [16,35,36,37] for general 3-manifolds.
In the present paper we do not study the dependence of the invariants on Jacobi variables, but postpone this for a later study.An example of such invariants with the Jacobi variable corresponding to the holonomy of the meridian of a knot complement was given in [23].

A Complements and proofs
In this appendix, we provide proofs of some of the observations, in particular regarding the 4 1 knot, that were made in Sections 2 and 3.

A.1 q-series identities
We begin by giving the proof of the two identities of equation (2.6), as communicated to us by Sander Zwegers.We will use the identity (A.17) and 1 (q) m (q) n = r,s,t≥0 r+s=m,s+t=n q rt (q) r (q) s (q) t , (A.1) which may be found for instance in [53], where we abbreviate (q) n = (q; q) n .If we sum over m using (A.17) we find m,n≥0 Equation (A.1) with m = n gives 1 (q) 2 n = r,s,t≥0 r+s=n,s+t=n q rt (q) r (q) s (q) t = r,s≥0 r+s=n q r 2 (q) 2 r (q) s , and so m,n≥0 r,s≥0 r+s=n q r 2 (q) 2 r (q) s which we can also write as (q) 2 r (q) s .
Summing over s and using (A.17) with x = q r , we get that this equals to This concludes the proof of (2.6).■

A.2 Asymptotics at roots of unity
For the comparison of the results of this paper and those of [32], we need to understand the asymptotics of our q-series near roots of unity.This is not the main theme of the paper and we will not go into detail, but as an indication of the method we prove Observation 2.1 giving the asymptotics (to all orders) of the two q-series G 0 (q) and G 1 (q) associated to the 4 1 knot at q = 1.
For this purpose we will use the formula for G 0 (q) given in the second part of equation (2.6).
To find the asymptotics of G 0 (q), we use the "Meinardus trick" as explained in [53, pp. 54-55].This would work using either identity in equation (2.6), but since the first would lead to a double rather than a single integral, we use only the second one.From the second representation of G 0 (q) in equation (2.6) and the standard expansion we get the integral representation where ε > 0 is a small and positive, "c.t." means "constant term" with respect to x, and Θ q (x) is defined by From the transformation law θ(τ, u) = i/τ e −u 2 /iτ θ(−1/τ, u/τ ) of the Jacobi theta function θ(τ, u) = e(τ /8 + u/2)Θ q (e(u)) we get Inserting this into the integral representations of G 0 (q) and unfolding in the usual way gives (e(u); q) 2 ∞ du.
We now apply the method of stationary phase to this integral, deforming the path of integration to pass through a point where the derivative of the integrand vanishes and then expanding as a Gaussian integral around this point to get the desired asymptotic expansion.We use the standard (and easy) expansion where Li 2 (x) is the dilogarithm function, to find that the logarithm of the integrand has an asymptotic expansion of the form ∞ n=−1 A n (u)h n , where The function A −1 (u) has two local maxima at u = 1 2 ± 1 3 .A careful analysis of each of the local maxima, whose details we omit, reproduces each of the two terms in the asymptotic expansion (2.5).A similar analysis can be done for the asymptotics of the series G 1 (q) at q = 1 using equation (2.15).All of this was sketched for q = 1 (q = e −h , h ↘ 0), however it can be extended to the case of q = ζe −h following ideas similar to those discussed in [31].Finally, we mention that in principle the formulas we have given for 5 2 would allow us to compute the asymptotics for this case too, but we have not done this.

A.3 The two matrix-valued cocycles for the 4 1 knot agree
In this section, we give the proof of Theorem 5.2.Let us begin by explaining the choice of matrix Q(q) of q-series for the 4 1 knot given in equation (4.4), using the matrix-valued function J on the rational numbers from [32, equation (95)] whose first row is 1, J 0 (x) and 1 2 (qJ 1 (q) − q −1 J −1 (q)) when q = e(x), where J m (q) = ∞ n=0 (q; q) n q −1 ; q −1 n q mn is a sequence of elements of the Habiro ring for integers m that satisfies the linear q-difference equation It follows that the first row of J is a basis for the Q[q ± ]-module spanned by {J m (q)|m ∈ Z}.The recursion (A.2) is an inhomogeneous analogue of (4.1) and the first row of J above explains the choice for the second column of the matrix (4.4).
Observe next that the elements of the matrix J given in (5.6) can be written in the form  , c) is the Dedekind sum [49] and where the logarithm is the principal one away from the cut at the negative real axis and equals to the average one on the cut.The cyclic quantum dilogarithm appears in the expansion of Faddeev's quantum dilogarithm at roots of unity (see for example [26,42]) and plays a key role in the definition of the near units associated to elements of the Bloch group [8].
With the notation of Section 5.3, the 2 × 2 matrix J from (5.6) has determinant 1, hence its inverse is given by J [32,Section 3.1] (where num(α) and den(α) > 0 denote the numerator and the denominator of a rational number), it follows that when γ = S, the cocycle (5.7) is given by This and the factorization (2.11) of the state-integral implies that W R S (τ ) σ 2 ,σ 1 equals to the state-integral Z 4 1 (τ ), up to multiplication by elementary factors that involve a (q/q) 1/24 , a root of unity, a rational number and a square root of τ .
To identify the two cocycles (A.4) and (A.5), we use a "factorization" property of state integrals at positive rational points (i.e., a bilinear expression of a vector of functions of τ ∈ Q and −1/τ ) of the first author and Kashaev [26], similar to the "factorization" of state integrals when τ ∈ C \ R of the first author and Kashaev [27].These two factorization properties of the state-integral are related, but we not know how to deduce one from the other.Note also that Theorem 1.1 of [26] proves the needed factorization for all 1-dimensional state integrals at positive rational numbers, and this covers the case of all three knots (namely, the 4 1 , 5 2 and (−2, 3, 7) pretzel knots) and all of their descendant state-integrals of interest to us.
We need to show that for all positive rational numbers α, we have We will focus on the equality of the (σ 2 , σ 1 ) entries in the above equality, in which case W S (α) , where • = means equality up to elementary factors.The proof also matches and which was unfortunately not stated explicitly in [26].The key observation, using the notation of [26, Lemma 2.2], is that in the context of [26, Theorem 1.1], we have g + N (x; q + ) = g − N (y; q − ) = (−x) A (1 − x) B = 1, which implies that g + k+N (x + ; q + ) = g + k (x + ; q + ) and g − k+N (x − ; q − ) = g − k (x − ; q − ).This, together with equation (A.7) and the fact that the tweaking function λ satisfies λ(x) − λ(−1/x) = 1/(den(x)num(x)) (where num(x) and den(x) > 0 denotes the numerator and denominator of a rational number) concludes the proof of the lemma.■ On the other hand, equation (A.4) implies that This and the previous lemma completes the proof of the (σ 2 , σ 1 )-entry of (A.6).■ We may say that equations (A.9) and (A.8) syntactically agree.More generally, in [26] the evaluation of the 1-dimensional state integrals where λ is a generic real number such that Note that if w ∈ S, then e 2πsw is an algebraic number with a fixed choice of N and M -th roots.
A.5 ε-deformation and the factorization of the state integral In this section, we comment further between a connection of the factorization proof of state integrals taken from [27] and the ε-deformations of difference/differential equations.Whereas only finitely many q-series appear in the factorization of a state integral (via the residue theorem), their ε-deformation leads to a sequence of q-series that contains further information, as Wheeler has recently found out [51].Consider the one-dimensional state integral Ψ A,A+ A (τ ) = R+iε Φ √ τ (x) A+ A e −Aπix 2 dx, z ∈ C ′ from [27] (which was denoted I A,A+ A ( √ z) in ibid) for positive integers A, Ã > 0. Let us briefly recall its factorization following [27] and their notation.Since A, A > 0, it follows that the integral is absolutely convergent.The idea when τ = b 1/2 is in the upper half-plane is to move the contour of integration upwards, and collect the residues from the poles of the integrand.The quantum dilogarithm is a meromorphic function of x with poles given by The quasi-periodicity of Φ b (x) where q = e 2πib 2 , q = e −2πib −2 , ε = 2πbx and ε = −2πb −1 x.Moreover, the formula Φ b (x) = e 2πb(x+c b ) ; q ∞ / e 2πb −1 (x−c b ) ; q ∞ implies that Combining, we find a product that decouples Φ b (x + x m,n ) = (qe ε ; q) ∞ (qe −ε ; q) ∞ 1 e ε/2 − e −ε/2 (−1) n q n(n+1) 2 e (n+ 1 2 )ε (qe ε ; q) m (qe ε; q) n (A.14) and an exponential that also decouples e −πi(x+xm,n) 2 = e πi 2 q q 1 8 q m(m+1) 2 q− n(n+1)
), where γτ = aτ +b cτ +d as usual.Then equations (3.8a) and (3.8b) can be written in the equivalent form Observation 3.4.For any γ = a b c d in SL 2 (Z), we have
b j ∈ Q, the first values being given by

m
can be obtained from its predecessor in just O(1) operations, we can use the formulas (A.10) to compute a several thousand coefficients of H ± j efficiently.Remark A.2.Our notation p (0) m , p