The l.h.s. of the previous equation reads

$$ \mathcal{L}[L_{2,2}(\lambda, \hbar)] = \mathcal{L}[P_1](\lambda, \hbar) + \frac{\hbar \mathcal{L}[q]}{(\lambda - q)^2}, \qquad (8-25) $$

while the r.h.s. reads

$$ \hbar \partial_{\lambda} \mathrm{Tr} A(\lambda, \hbar) = \frac{\hbar P_1(q) - 2p}{(\lambda - q)^2} - \hbar P_{\infty,2}^{(1)} + 2\hbar P_{\infty,2}^{(1)}. \qquad (8-26) $$

Thus, we end up with

$$ \begin{aligned} \mathcal{L}[P_{\infty,2}^{(1)}] = \mathcal{L}[P_{\infty,1}^{(1)}] = 0, \quad \mathcal{L}[P_{\infty,0}^{(1)}] &= -\hbar P_{\infty,2}^{(1)} + 2\hbar P_{\infty,2}^{(1)} = -\hbar(t_{1,3} + t_{2,3}) \\ &\Leftrightarrow \mathcal{L}[P_1](\lambda) = -\hbar(t_{1,3} + t_{2,3}) \end{aligned} \qquad (8-27) $$

and

$$ \mathcal{L}[q] = P_1(q) - 2\frac{p}{\hbar}. \qquad (8-28) $$

The same computation may be applied to the entry (2, 1) of the compatibility equation (8-22), and it is equivalent to

$$ \begin{aligned} \mathcal{L}[P_{\infty,4}^{(2)}] &= 0 \\ \mathcal{L}[P_{\infty,3}^{(2)}] &= 0 \\ \mathcal{L}[P_{\infty,2}^{(2)}] &= -2\hbar P_{\infty,4}^{(2)} + \hbar [P_{\infty,2}^{(1)}]^2 \\ \mathcal{L}[P_{\infty,1}^{(2)}] &= -\hbar P_{\infty,3}^{(2)} + \hbar P_{\infty,1}^{(1)} P_{\infty,2}^{(1)} \\ \mathcal{L}[P_{\infty,0}^{(2)}] - \mathcal{L}[H] &= 2\hbar P_{\infty,4}^{(2)} q^2 + \hbar P_{\infty,3}^{(2)} q - P_{\infty,2}^{(1)} p + \hbar P_{\infty,0}^{(1)} P_{\infty,2}^{(1)} \\ \mathcal{L}[p] &= -P_1'(q)p + \hbar P_2'(q) + \hbar^2 t_{2,3} \\ H &= \frac{p^2}{\hbar^2} - P_1(q)\frac{p}{\hbar} + P_2(q) - \hbar P_1'(q) + \hbar(P_{\infty,2}^{(1)} - t_{2,3})q. \end{aligned} \qquad (8-29) $$

In particular, combining (8-28) and (8-29) we get that the evolution of $(q, p)$ satisfies the Hamiltonian system

$$ \mathcal{L}[q] = -\hbar \frac{\partial H_0}{\partial p}, \quad \mathcal{L}[p] = \hbar \frac{\partial H_0}{\partial q}, \qquad (8-30) $$

with the Hamiltonian

$$ \begin{aligned} H_0(p, q, \hbar) &= \frac{p^2}{\hbar^2} - P_1(q)\frac{p}{\hbar} + P_2(q) - \hbar P_1'(q) + \hbar q(2P_{\infty,2}^{(1)} - t_{2,3}) \\ &= \frac{p^2}{\hbar^2} - \left(P_{\infty,2}^{(1)}q^2 + P_{\infty,1}^{(1)}q + P_{\infty,0}^{(1)}\right)\frac{p}{\hbar} \\ &\quad + \left(P_{\infty,4}^{(2)}q^4 + P_{\infty,3}^{(2)}q^3 + P_{\infty,2}^{(2)}q^2 + P_{\infty,1}^{(2)}q + P_{\infty,0}^{(2)} + 2\hbar P_{\infty,2}^{(1)}q\right), \end{aligned} \qquad (8-31) $$

so that

$$ H = H_0(p, q, \hbar) + \hbar(t_{1,3} + t_{2,3})q. \qquad (8-32) $$

We may use the connection between coefficients $(P_{\infty,i}^{(j)})_{1 \le i \le 4, 1 \le j \le 2}$ and the spectral times $(t_{i,j})$'s given by (8-5), (8-6), (8-7) to obtain

$$ \mathcal{L}[t_{1,3}] = \mathcal{L}[t_{2,3}] = \mathcal{L}[t_{1,2}] = \mathcal{L}[t_{1,0}] = \mathcal{L}[t_{2,0}] = 0, \quad \mathcal{L}[t_{1,1}] = \hbar t_{2,3}, \quad \mathcal{L}[t_{2,1}] = \hbar t_{1,3}, \qquad (8-33) $$
indicating that the operator $\mathcal{L}$ corresponds to the following differential operator

$$ \mathcal{L} = \hbar t_{2,3} \partial_{t_{1,1}} + \hbar t_{1,3} \partial_{t_{2,1}}. \qquad (8-34) $$

In particular, since $\alpha = t_{1,3} + 2t_{2,3}$, we obtain that $\mathcal{L}[\alpha] = 0$. We may also rewrite the action of $\mathcal{L}$ in terms of the spectral times

$$ \begin{aligned} \mathcal{L}[P_{\infty,4}^{(2)}] &= \mathcal{L}[P_{\infty,3}^{(2)}] = 0 \\ \mathcal{L}[P_{\infty,2}^{(2)}] &= \hbar(t_{1,3}^2 + t_{2,3}^2), \quad \mathcal{L}[P_{\infty,1}^{(2)}] = \hbar(t_{2,3}t_{2,2} + t_{1,3}t_{1,2}) \\ \mathcal{L}[P_{\infty,2}^{(1)}] &= \mathcal{L}[P_{\infty,1}^{(1)}] = 0, \quad \mathcal{L}[P_{\infty,0}^{(1)}] = -\hbar(t_{1,3} + t_{2,3}) \\ \mathcal{L}[P_{\infty,0}^{(2)}] - \mathcal{L}[H] &= 2\hbar t_{1,3}t_{2,3}q^2 + \hbar(t_{1,2}t_{2,3} + t_{2,2}t_{1,3})q + (t_{1,3} + t_{2,3})p + \hbar(t_{1,1} + t_{2,1})(t_{1,3} + t_{2,3}) \\ \mathcal{L}[q] &= -2\frac{p}{\hbar} - (t_{1,3} + t_{2,3})q^2 - (t_{1,2} + t_{2,2})q - t_{1,1} - t_{2,1} \\ \mathcal{L}[p] &= (2(t_{1,3} + t_{2,3})q + t_{1,2} + t_{2,2})p + 4\hbar t_{1,3}t_{2,3}q^3 + 3\hbar(t_{1,3}t_{2,2} + t_{2,3}t_{1,2})q^2 \\ & \quad +2\hbar(t_{1,3}t_{2,1} + t_{2,3}t_{1,1} + t_{1,2}t_{2,2})q \\ & \quad +\hbar(t_{1,2}t_{2,1} + t_{1,1}t_{2,2} - (t_{1,3} - t_{2,3})t_{1,0}) - \hbar^2 t_{2,3}. \end{aligned} \qquad (8-35) $$

Combining the last two equations, we may obtain the following equation for $q$,

$$ \begin{aligned} \mathcal{L}^2[q] = & \ 2(t_{1,3} - t_{2,3})^2 q^3 + 3(t_{1,3} - t_{2,3})(t_{1,2} - t_{2,2})q^2 \\ & + ((t_{1,2} - t_{2,2})^2 + 2(t_{1,3} - t_{2,3})(t_{1,1} - t_{2,1}))q \\ & + (t_{1,2} - t_{2,2})(t_{1,1} - t_{2,1}) + (2t_{1,0} - \hbar)(t_{1,3} - t_{2,3}). \end{aligned} \qquad (8-36) $$

**Remark 8.1** (Normalization of the non-perturbative wave functions and coefficient $\alpha$). The value of the coefficient $\alpha = t_{1,3} + 2t_{2,3}$ comes from the choice of normalization of the wave functions. Indeed, the Lax pair (8-16) and (8-21) is consistent for any value of $\alpha$. However, this value is imposed by the choice of normalization of the wave functions at infinity,

$$ \begin{aligned} \ln \Psi_{1,1} &= -\frac{t_{1,3}}{3\hbar}\lambda^3 - \frac{t_{1,2}}{2\hbar}\lambda^2 - \frac{t_{1,1}}{\hbar}\lambda - \frac{t_{1,0}}{\hbar}\ln\lambda + S_{1,0} + \sum_{k=2}^{\infty} \frac{S_{1,k}}{(k-1)\lambda^{k-1}}, \\ \ln \Psi_{1,2} &= -\frac{t_{2,3}}{3\hbar}\lambda^3 - \frac{t_{2,2}}{2\hbar}\lambda^2 - \frac{t_{2,1}}{\hbar}\lambda - \frac{t_{2,0}}{\hbar}\ln\lambda - \ln\lambda + S_{2,0} + \sum_{k=2}^{\infty} \frac{S_{2,k}}{(k-1)\lambda^{k-1}}. \end{aligned} \qquad (8-37) $$

Indeed, this formal expansion and the fact that $t_{2,0} = -t_{1,0}$ and $t_{1,3} - t_{2,3} \neq 0$ imply that $L_{2,1}(\lambda, \hbar) = \frac{\hbar^2}{W(\lambda, \hbar)} \left( \frac{\partial^2 \Psi_{1,1}}{\partial \lambda^2} \frac{\partial \Psi_{1,2}}{\partial \lambda} - \frac{\partial \Psi_{1,1}}{\partial \lambda} \frac{\partial^2 \Psi_{1,2}}{\partial \lambda^2} \right)$ has a formal expansion at infinity,

$$ L_{2,1}(\lambda, \hbar) = -t_{1,3}t_{2,3}\lambda^4 - (t_{1,3}t_{2,2} + t_{2,3}t_{1,2})\lambda^3 - (t_{2,1}t_{1,3} + t_{1,1}t_{2,3} + t_{2,2}t_{1,2})\lambda^2 \\ -(t_{1,3}t_{2,0} + t_{1,0}t_{2,3} + t_{1,2}t_{2,1} + t_{1,1}t_{2,2} + \hbar t_{1,3})\lambda + O(1), \qquad (8-38) $$

where the Wronskian $W(\lambda, \hbar)$ is given by (8-12) with $\kappa = (t_{1,3} - t_{2,3})e^{S_{1,0}+S_{2,0}}$. Thus $L_{2,1}(\lambda, \hbar)$ only matches the formula given by (8-16),

$$ L_{2,1}(\lambda, \hbar) = -P_{\infty,4}^{(2)}\lambda^4 - P_{\infty,3}^{(2)}\lambda^3 - P_{\infty,2}^{(2)}\lambda^2 - (P_{\infty,1}^{(2)} - 2\hbar P_{\infty,2}^{(1)} - \hbar\alpha)\lambda + O(1), \qquad (8-39) $$

for $t_{1,3} = -2P_{\infty,2}^{(1)} - \alpha$, i.e. $\alpha = t_{1,3} + 2t_{2,3}$.

Note also that $S_{1,0} = \ln Z_{NP}(\hbar, \rho)$ because of (6-39).

**Remark 8.2.** In agreement with the general theory developed in this article, the formal expansion of the wave functions (8-37) as well as the condition on the Wronskian (8-12) completely determine the Lax pair matrices using $L = \hbar(\partial_{\lambda}\Psi)\Psi^{-1}$ and $A = \mathcal{L}[\Psi]\Psi^{-1}$.
Using Remark 8.1, we may look at the terms $O(\frac{1}{\lambda^2})$ in entry $A_{1,2}(\lambda, \hbar)$ as $\lambda \to \infty$. The coefficient is given by $-q$ in the Lax pair formulation while it corresponds to $\frac{\mathcal{L}[S_{2,0}] - \mathcal{L}[S_{1,0}] + t_{1,2} - t_{2,2}}{t_{1,3} - t_{2,3}}$ using (8-37). Similarly, we may look at coefficient $O(1)$ when $\lambda \to \infty$ of the entry $A_{1,1}(\lambda, \hbar)$. We get $\frac{t_{1,3}\mathcal{L}[S_{2,0}] - t_{2,3}\mathcal{L}[S_{1,0}] + t_{2,3}t_{1,2} - t_{1,3}t_{2,2}}{t_{1,3} - t_{2,3}} = -\frac{H}{\hbar} + t_{2,2}$. The last two equations are equivalent to

$$ \mathcal{L}[S_{1,0}] = t_{1,3}q - \frac{H}{\hbar} + t_{1,2} + t_{2,2}, \quad \mathcal{L}[S_{2,0}] = t_{2,3}q - \frac{H}{\hbar} + 2t_{2,2}. \qquad (8-40) $$

In particular, since $S_{1,0} = \ln Z_{\text{NP}}(\hbar, \rho)$, we end up with

$$ \begin{aligned} \mathcal{L}[\ln Z_{\text{NP}}] &= t_{1,3}q - \frac{H}{\hbar} + t_{1,2} + t_{2,2} = -\frac{H_0}{\hbar} - t_{2,3}q + t_{1,2} + t_{2,2} \\ &= -\frac{1}{\hbar} \left[ \frac{p^2}{\hbar^2} - P_1(q)\frac{p}{\hbar} + P_2(q) - \hbar P_1'(q) \right] - 2P_{\infty,2}^{(1)}q + t_{1,2} + t_{2,2}. \end{aligned} \qquad (8-41) $$

This relation connects the non-perturbative partition function with the Hamiltonian of the system. This relation shall be useful to relate the non-perturbative partition function with the isomonodromic tau-function associated to the Lax system. We let this perspective for future works where we hope to prove that such relations hold for all cases presented in this article.

### 8.1.5 Gauge transformation to remove the apparent singularity

We may also perform a gauge transformation to remove the apparent singularity of the Lax system (8-16) and (8-21). The general theory indicates that we should define

$$ \tilde{\Psi}(\lambda, \hbar) = J(\lambda, \hbar)\Psi(\lambda, \hbar) \quad \text{with} \quad J(\lambda, \hbar) = \begin{pmatrix} 1 & 0 \\ -\frac{p}{\hbar(\lambda-q)} & \frac{1}{\lambda-q} \end{pmatrix}, \qquad (8-42) $$

so that we obtain a new Lax system for $\tilde{\Psi}(\lambda, \hbar)$ given by

$$ \hbar \partial_{\lambda} \tilde{\Psi}(\lambda, \hbar) = \tilde{L}(\lambda, \hbar) \tilde{\Psi}(\lambda, \hbar), \quad \mathcal{L}[\tilde{\Psi}(\lambda, \hbar)] = \tilde{A}(\lambda, \hbar) \tilde{\Psi}(\lambda, \hbar), \qquad (8-43) $$

with

$$ \begin{aligned} \tilde{L}(\lambda, \hbar) &= \begin{pmatrix} \frac{p}{\hbar} & \lambda - q \\ -((\lambda + q)(t_{1,3} + t_{2,3}) + t_{2,2} + t_{1,2})\frac{p}{\hbar} + Q_3(\lambda, \hbar) & -\frac{p}{\hbar} + P_1(\lambda) \end{pmatrix} \\ \tilde{A}(\lambda, \hbar) &= \begin{pmatrix} -(t_{1,3} + t_{2,3})\lambda - \frac{H}{\hbar} + t_{2,2} & -1 \\ (t_{1,3} + t_{2,3})\frac{p}{\hbar} + Q_2(\lambda, \hbar) & (t_{1,3} + t_{2,3})q + t_{1,2} + 2t_{2,2} - \frac{H}{\hbar} \end{pmatrix}, \end{aligned} \qquad (8-44) $$

where

$$ \begin{aligned} Q_3(\lambda, \hbar) &= -P_{\infty,4}^{(2)}\lambda^3 - (P_{\infty,4}^{(2)}q + P_{\infty,3}^{(2)})\lambda^2 - (P_{\infty,4}^{(2)}q^2 + P_{\infty,3}^{(2)}q + P_{\infty,2}^{(2)}\lambda \\ &\quad + (P_{\infty,4}^{(2)}q^3 + P_{\infty,3}^{(2)}q^2 + P_{\infty,2}^{(2)}q + P_{\infty,1}^{(2)} + \hbar t_{1,3}), \\ Q_2(\lambda, \hbar) &= P_{\infty,4}^{(2)}\lambda^2 + 2P_{\infty,4}^{(2)}q\lambda + P_{\infty,3}^{(2)}\lambda + (3P_{\infty,4}^{(2)}q^2 + 2P_{\infty,3}^{(2)}q + P_{\infty,2}^{(2)}). \end{aligned} \qquad (8-45) $$

The deformed classical spectral curve is given by $\det(yI_2 - \tilde{L}(\lambda, \hbar)) = 0$. It reads

$$ P_{\text{defo}}(\lambda, y) = y^2 - P_1(\lambda)y + P_2(\lambda) - \hbar P_1'(\lambda) - \hbar(t_{1,3} + 2t_{2,3})\lambda - H = 0. \qquad (8-46) $$

In particular, we observe that

$$ P_{\text{defo}}\left(q, \frac{p}{\hbar}\right) = 0. \qquad (8-47) $$
### 8.1.6 Recovering the Painlevé 2 equation

From the previous section, we know that the operator $\mathcal{L}$ corresponds to $\mathcal{L} = \hbar(t_{2,3}\partial_{t_{1,1}}+t_{1,3}\partial_{t_{2,1}})$. This suggests that there exists a natural change of variables from $(t_{1,1}, t_{2,1})$ to $(\tau, \tilde{\tau})$ such that $\mathcal{L}$ corresponds to $\hbar\partial_{\tau}$ while $\tilde{\tau}$ should satisfy $\partial_{\tau}\tilde{\tau} = 0$. We define

$$ \begin{aligned} \tau &= \frac{1}{t_{1,3} - t_{2,3}} (t_{2,1} - t_{1,1}), \quad \tilde{\tau} = \frac{1}{t_{1,3} - t_{2,3}} (t_{1,3}t_{1,1} - t_{2,3}t_{2,1}) \\ \Leftrightarrow t_{1,1} &= t_{2,3}\tau + \tilde{\tau}, \quad t_{2,1} = t_{1,3}\tau + \tilde{\tau}. \end{aligned} \quad (8-48) $$

This gives

$$ \partial_{t_{1,1}} = -\frac{1}{t_{1,3} - t_{2,3}} \partial_{\tau} + \frac{t_{1,3}}{t_{1,3} - t_{2,3}} \partial_{\tilde{\tau}} \quad \text{and} \quad \partial_{t_{2,1}} = \frac{1}{t_{1,3} - t_{2,3}} \partial_{\tau} - \frac{t_{2,3}}{t_{1,3} - t_{2,3}} \partial_{\tilde{\tau}}. \quad (8-49) $$

In particular $\mathcal{L} = \hbar\partial_{\tau}$, $\hbar\partial_{\tau}\tilde{\tau} = 0$, $\partial_{\tilde{\tau}}\tau = 0$ and $\mathcal{L}[\tilde{\tau}] = 0$. Observe also that $t_{1,1} - t_{2,1} = -(t_{1,3} - t_{2,3})\tau$. Equation (8-36) reads

$$ \begin{aligned} \hbar^2 \partial_{\tilde{\tau}^2}^2 q &= 2(t_{1,3} - t_{2,3})^2 q^3 + 3(t_{1,3} - t_{2,3})(t_{1,2} - t_{2,2})q^2 \\ & \quad + ((t_{1,2} - t_{2,2})^2 + 2(t_{1,3} - t_{2,3})(t_{1,1} - t_{2,1}))q \\ & \quad + (t_{1,2} - t_{2,2})(t_{1,1} - t_{2,1}) + (2t_{1,0} - \hbar)(t_{1,3} - t_{2,3}) \\ &= 2(t_{1,3} - t_{2,3})^2 q^3 + 3(t_{1,3} - t_{2,3})(t_{1,2} - t_{2,2})q^2 \\ & \quad + ((t_{1,2} - t_{2,2})^2 - 2(t_{1,3} - t_{2,3})^2\tau)q \\ & \quad - (t_{1,2} - t_{2,2})(t_{1,3} - t_{2,3})\tau + (2t_{1,0} - \hbar)(t_{1,3} - t_{2,3}). \end{aligned} \quad (8-50) $$

In particular it does not depend on $\tilde{\tau}$. The last differential equation is equivalent to the Painlevé 2 equation after a proper rescaling $(q, \tau) \leftrightarrow (\tilde{q}, t)$. Indeed, let us define

$$ \begin{aligned} \tau &= \left( \frac{-1}{2(t_{1,3} - t_{2,3})^2} \right)^{\frac{1}{3}} t - \frac{(t_{1,2} - t_{2,2})^2}{4(t_{1,3} - t_{2,3})^2} \quad \text{and} \quad q = \left( \frac{-2}{t_{1,3} - t_{2,3}} \right)^{\frac{1}{3}} \tilde{q} - \frac{t_{1,2} - t_{2,2}}{2(t_{1,3} - t_{2,3})} \\ t &= (-2(t_{1,3} - t_{2,3})^2)^{\frac{1}{3}} \left( \tau + \frac{(t_{1,2} - t_{2,2})^2}{4(t_{1,3} - t_{2,3})^2} \right) \quad \text{and} \quad \tilde{q} = \left( \frac{-(t_{1,3} - t_{2,3})}{2} \right)^{\frac{1}{3}} \left( q + \frac{t_{1,2} - t_{2,2}}{2(t_{1,3} - t_{2,3})} \right). \end{aligned} \quad (8-51) $$

Then we obtain that $\tilde{q}$ satisfies the following Painlevé 2 equation

$$ \hbar^2 \partial_{t^2}^2 \tilde{q} = 2\tilde{q}^3 + t\tilde{q} - \left(t_{1,0} - \frac{\hbar}{2}\right). \quad (8-52) $$

Note that the final rescaling (8-51) greatly simplifies when $t_{1,2} = t_{2,2}$ and $t_{1,3} - t_{2,3} = -1$.

## 8.2 A $\mathrm{Gl}_3$ example

In this section, we consider a degree 3 example where the classical spectral curve has genus 1 and a single singularity at infinity. In particular, we show how to derive the quantum curve in this context using the general results obtained above. For this purpose, let us consider a classical spectral curve defined by an algebraic equation of the form

$$ y^3 - (P_{\infty,1}^{(1)}\lambda + P_{\infty,0}^{(1)})y^2 + (P_{\infty,2}^{(2)}\lambda^2 + P_{\infty,1}^{(2)}\lambda + P_{\infty,0}^{(2)})y - P_{\infty,3}^{(3)}\lambda^3 - P_{\infty,2}^{(3)}\lambda^2 - P_{\infty,1}^{(3)}\lambda - P_{\infty,0}^{(3)} = 0, $$
where the coefficients $(P_{\infty,i}^{(j)})_{0\le i\le 2,1\le j\le 3}$ are generic in such a way that the curve has genus 1 and that there are three distinct points $(\infty^{(1)}, \infty^{(2)}, \infty^{(3)})$ in the fiber $x^{-1}(\infty)$ above infinity. This corresponds to the case $N=0$ and $r_{\infty(j)} = 3$ for $j \in [1,3]$. We define

$$
\begin{align}
P_1(\lambda) &= P_{\infty,1}^{(1)}\lambda + P_{\infty,0}^{(1)}, \nonumber \\
P_2(\lambda) &= P_{\infty,2}^{(2)}\lambda^2 + P_{\infty,1}^{(2)}\lambda + P_{\infty,0}^{(2)}, \nonumber \\
P_3(\lambda) &= P_{\infty,3}^{(3)}\lambda^3 + P_{\infty,2}^{(3)}\lambda^2 + P_{\infty,1}^{(3)}\lambda + P_{\infty,0}^{(3)}. \tag{8-53}
\end{align}
$$

The coefficients $(P_{\infty,i}^{(j)})_{0\le i\le 3,1\le j\le 3}$ are connected to the spectral times $(t_{i,j})_{1\le i\le 3,0\le j\le 2}$ by the relations

$$
P_{\infty,1}^{(1)} = -\sum_{i=1}^{3} t_{i,2}, \quad P_{\infty,0}^{(1)} = -\sum_{i=1}^{3} t_{i,1}, \quad 0 = \sum_{i=1}^{3} t_{i,0}, \qquad (8-54)
$$

as well as

$$
\begin{align}
P_{\infty,2}^{(2)} &= \sum_{1 \le i < j \le 3} t_{i,2} t_{j,2} = t_{1,2} t_{2,2} + t_{1,2} t_{3,2} + t_{2,2} t_{3,2}, \notag \\
P_{\infty,1}^{(2)} &= \sum_{i=1}^{3} \sum_{j \ne i} t_{i,1} t_{j,2} = t_{1,1} t_{2,2} + t_{1,1} t_{3,2} + t_{2,1} t_{1,2} + t_{2,1} t_{3,2} + t_{3,1} t_{1,2} + t_{3,1} t_{2,2}, \notag \\
P_{\infty,0}^{(2)} &= \sum_{i=1}^{3} \sum_{j \ne i} t_{i,0} t_{j,2} + \sum_{1 \le i < j \le 3} t_{i,1} t_{j,1} \notag \\
&= t_{1,0} t_{2,2} + t_{1,0} t_{3,2} + t_{2,0} t_{1,2} + t_{2,0} t_{3,2} + t_{3,0} t_{1,2} + t_{3,0} t_{2,2} + t_{1,1} t_{2,1} + t_{1,1} t_{3,1} + t_{2,1} t_{3,1} \tag{8-55}
\end{align}
$$

and

$$
\begin{align}
P_{\infty,3}^{(3)} &= -t_{1,2}t_{2,2}t_{3,2}, \notag \\
P_{\infty,2}^{(3)} &= -t_{1,1}t_{2,2}t_{3,2} - t_{1,2}t_{2,1}t_{3,2} - t_{1,2}t_{2,2}t_{3,1}, \notag \\
P_{\infty,1}^{(3)} &= - \sum_{k_1+k_2+k_3=4} t_{1,k_1}t_{2,k_2}t_{3,k_3} \notag \\
&= -t_{1,0}t_{2,2}t_{3,2} - t_{1,1}t_{2,1}t_{3,2} - t_{1,1}t_{2,2}t_{3,1} - t_{1,2}t_{2,2}t_{3,0} - t_{1,2}t_{2,1}t_{3,1} - t_{1,2}t_{2,0}t_{3,2}, \notag \\
P_{\infty,0}^{(3)} &= - \sum_{k_1+k_2+k_3=3} t_{1,k_1}t_{2,k_2}t_{3,k_3} \notag \\
&= -t_{1,0}t_{2,1}t_{3,2} - t_{1,0}t_{2,2}t_{3,1} - t_{1,1}t_{2,1}t_{3,1} - t_{1,1}t_{2,2}t_{3,0} \notag \\
&\phantom{= -t_{1,0}t_{2,1}t_{3,2} - } -t_{1,1}t_{2,0}t_{3,2} - t_{1,2}t_{2,1}t_{3,0} - t_{1,2}t_{2,0}t_{3,1}. \tag{8-56}
\end{align}
$$

The computations being rather long, we provide the detailed example in Appendix D and we shall only present the important result there.

The quantum curve corresponds to the Lax pair $L(\lambda, \hbar) =$

$$
\begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
P_3(\lambda) - \hbar P_2'(\lambda) + \hbar (P_{\infty,2}^{(2)} + t_{2,2}t_{3,2})\lambda - H + \frac{p_1}{\lambda-q} & -P_2(\lambda) - \hbar t_{1,2} + \frac{p_2}{\lambda-q} & P_1(\lambda) + \frac{\hbar}{\lambda-q}
\end{pmatrix},
\quad (8-57)
$$
with the associated auxiliary matrix $\mathcal{L}[\Psi(\lambda, \hbar)] = A(\lambda, \hbar)\Psi(\lambda, \hbar)$ of the form

$$A(\lambda, \hbar) = \begin{pmatrix} P_{\infty,2}^{(2)}\lambda - \frac{H}{\hbar} + \frac{p_1}{\hbar(\lambda-q)} & \frac{p_2}{\hbar(\lambda-q)} + t_{1,2} & \frac{1}{\lambda-q} \\ A_{2,1} & A_{2,2} & A_{2,3} \\ A_{3,1} & A_{3,2} & A_{3,3} \end{pmatrix}. \qquad (8-58)$$

Compatibility of this system provides the following equations

$$\mathcal{L}[t_{1,0}] = \mathcal{L}[t_{2,0}] = \mathcal{L}[t_{3,0}] = \mathcal{L}[t_{3,2}] = \mathcal{L}[t_{2,2}] = \mathcal{L}[t_{1,2}] = 0$$

$$\mathcal{L}[t_{1,1}] = -\hbar(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2})$$

$$\mathcal{L}[t_{2,1}] = -\hbar(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2)$$

$$\mathcal{L}[t_{3,1}] = -\hbar(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2)$$

$$p_1 = \frac{p_2^2}{\hbar} + P_1(q_2)p_2 + \hbar P_2(q) + \hbar^2 t_{1,2}$$

$$H = -H_0(q, p_2, \hbar) + (t_{1,2} + P_{\infty,1}^{(1)})p_2 - \hbar P_{\infty,2}^{(2)}q - \hbar P_{\infty,1}^{(2)} - \hbar P_{\infty,0}^{(1)}t_{1,2}$$

$$\mathcal{L}[q] = -3\frac{p_2^2}{\hbar^2} - 4P_1(q)\frac{p_2}{\hbar} - P_2(q) - P_1(q)^2 - \hbar(P_{\infty,1}^{(1)} + 2t_{1,2})$$

$$\mathcal{L}[p_2] = 2P_{\infty,1}^{(1)} \frac{p_2^2}{\hbar} + (P_2'(q) + 2P_1'(q)P_1(q))p_2 - \hbar P_3'(q) + \hbar P_2(q)P_1'(q) + \hbar P_2'(q)P_1(q) \\ + \hbar^2(P_{\infty,1}^{(1)}t_{1,2} - t_{2,2}t_{3,2})q, \qquad (8-59)$$

In particular, the system is Hamiltonian with $H_0(q, p_2, \hbar)$ given by

$$H_0(q, p_2, \hbar) = \frac{p_2^3}{\hbar^3} + 2P_1(q)\frac{p_2^2}{\hbar^2} + (P_2(q) + P_1(q)^2 + \hbar(P_{\infty,1}^{(1)} + 2t_{1,2}))\frac{p_2}{\hbar} - P_3(q) + P_1(q)P_2(q) \\ + \hbar(P_{\infty,1}^{(1)}t_{1,2} - t_{2,2}t_{3,2})q, \qquad (8-60)$$

satisfying

$$\hbar \partial_{p_2} H_0(q, p_2, \hbar) = -\mathcal{L}[q] \text{ and } \hbar \partial_q H_0(q, p_2, \hbar) = \mathcal{L}[p_2]. \qquad (8-61)$$

Combining these relations, we show that $q$ satisfies a PDE of the form

$$\alpha_0(q; \hbar)\mathcal{L}^3[q] + \alpha_1(q; \hbar)\mathcal{L}^2[q]\mathcal{L}[q] + \alpha_2(q; \hbar)(\mathcal{L}[q])^2 + \alpha_3(q; \hbar)\mathcal{L}^2[q] + \alpha_4(q; \hbar)\mathcal{L}[q] + \alpha_5(q; \hbar) = 0, \qquad (8-62)$$

with polynomial coefficients $(\alpha_i(q; \hbar))_{1 \le i \le 5}$ in $q$ and $\hbar$ whose expressions are given in (D-36) (quantities involved in (D-36) are defined in (D-30)).

Finally, we get that

$$\mathcal{L} = -\hbar(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2})\partial_{t_{1,1}} - \hbar(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2)\partial_{t_{2,1}} - \\ \hbar(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2)\partial_{t_{3,1}}, \qquad (8-63)$$

and prove that the change of variables

$$\begin{pmatrix} \tau_1 \\ \tau_2 \\ \tau_3 \end{pmatrix} = B \begin{pmatrix} t_{1,1} \\ t_{2,1} \\ t_{3,1} \end{pmatrix} \Leftrightarrow \begin{pmatrix} t_{1,1} \\ t_{2,1} \\ t_{3,1} \end{pmatrix} = B^{-1} \begin{pmatrix} \tau_1 \\ \tau_2 \\ \tau_3 \end{pmatrix} = \begin{pmatrix} -(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2}) & 1 & t_{1,2} \\ -(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2) & 1 & t_{2,2} \\ -(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2) & 1 & t_{3,2} \end{pmatrix} \begin{pmatrix} \tau_1 \\ \tau_2 \\ \tau_3 \end{pmatrix} \qquad (8-64)$$

is such that $\mathcal{L} = \hbar \partial_{\tau_1}$.
# 9 Conclusion and outlooks

In this paper, we have been able to quantize any admissible spectral curve by building a formal solution to the associated quantum curve using the topological recursion. A first natural question which should be addressed is the generalization of this procedure to other classical spectral curves. First of all, we expect that it is possible to drop the admissibility conditions we introduced without changing the structure of the proof. It should also be possible to consider any classical spectral curve given by a Higgs field on a higher genus base curve and allow for more complicated singularities such as logarithmic ones. This step would in particular give access to curves over $\mathbb{C}^*$ appearing in the study of Gromov-Witten invariants of Toric Calabi-Yau three-folds by mirror symmetry. Considering the structure of the proofs presented in this article we expect that such a large generalization is possible.

We have observed in the first example of Section 8 that the non-perturbative partition function plays the role of isomonodromic tau function of the system. We expect this observation to be a general phenomenon. Namely, we conjecture that the non-perturbative partition function is an isomonodromic tau function for the Lax system built by topological recursion. In order to prove it, we plan to express the coefficients of the deformed spectral curve in terms of variations of the logarithm of the partition function with respect to the spectral times. At the same time, this would allow to describe the $\hbar$ evolution of the connection built in this paper as a flow in the associated moduli space of connections, making the link with Hitchin systems.

In this paper we have considered formal $\hbar$ trans-series solutions to the quantum curve. However, these trans-series are in no way convergent when $\hbar$ is a small parameter. One important question thus remains: how is it related to asymptotics of actual convergent solutions of the quantum curve equation when $\hbar \to 0$? In order to answer this question, we would like to be able to trade off the formal Fourier transform considered in this paper against a proper Fourier transform. However, it is not clear in which context this can be safely performed since the two orderings of the infinite sums involved lead to different ordering of trans-monomials considered for defining the formal trans-series. This issue already appeared in the context of trans-asymptotics developed by Costin [8, 9, 10], who proved that, in a particular setting, formal trans-series of the form considered in this paper give good asymptotics to proper solutions of a differential equation. We hope to be able to adapt this procedure to the present set-up and make the link with the result on resurgence analysis encountered in a similar context [2, 48]. Very recently, N. Nikolaev [44, 45] obtained tremendous results promoting formal WKB expansion in $\hbar$ to some analytic objects defined in some Stokes sectors in the $gl_2$ case. It would be very interesting to see how these results help in the understanding of the formal setup developed in this article. Upgrading formal quantities to analytic objects would in particular allow to study the asymptotics of bi-orthogonal polynomials arising in hermitian random matrix models and make rigorous some saddle-point approximations in that context. Since our partition functions and wave functions have $2g$ parameters $(\epsilon, \rho)$, we expect to get a general isomonodromic tau function in this way and should be able to study the Riemann-Hilbert problems they solve. We wish to map these free parameters to coordinates in the associated moduli space and study their map to Stokes data.

Finally, our results can be interpreted from a geometric quantization perspective. Indeed, the initial data considered is an algebraic curve on the one hand and a choice of Torelli marking on the other hand. This second ingredient is similar to a choice of real polarization for the quantization of our algebraic curve. It would be very interesting to translate our procedure into the language of geometric quantization and study the effect of a choice of polarization. In
particular, it would be important to derive Hitchin’s equations governing a change in the choice of polarization.

Acknowledgements

This paper is partly a result of the ERC-SyG project, Recursive and Exact New Quantum Theory (ReNewQuantum) which received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program under grant agreement No 810573. The second author was supported by the public grant “Jacques Hadamard” as part of the Investissement d’avenir project, reference ANR-11-LABX-0056-LMH, LabEx LMH and currently receives funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreement No. ERC-2016-STG 716083 “CombiTop”). The work of N. O. is supported in part by the NCCR SwissMAP of the Swiss National Science Foundation.

A Proof of the loop equations and ramification points at poles

In this section, we prove Theorem 4.1 and Lemma 3.1.

A.1 Case (h, n) = (0, 0)

This follows directly from the expression (4-4).

A.2 Case (h, n) = (0, 1)

From the definition, an elementary computation gives

$$
\frac{Q_{0,2}^{(l)}(\lambda, z_1)}{(d\lambda)^l} = (-1)^l \sum_{z \in x^{-1}(\lambda)} \frac{\omega_{0,2}(z, z_1)}{d\lambda} \left[ \sum_{k=0}^{l-1} P_{l-1-k}(\lambda) y(z)^k \right]. \quad (A-1)
$$

It is a meromorphic function of $\lambda$ on the base, i.e. a rational fraction of $\lambda$. Since there is the denominator $d\lambda$ it seems that it could have a pole at $a$, a zero of $d\lambda$, i.e. a ramification point. Let $\zeta_a = \sqrt{\lambda - x(a)}$ be a local coordinate near $a$, then $d\lambda$ vanishes to the first order (from our assumption of simple ramification points), and all the other terms are finite at the ramification points. Therefore

$$
\frac{Q_{0,2}^{(l)}(\lambda, z_1)}{(d\lambda)^l} = O\left(\frac{1}{\sqrt{\lambda - x(a)}}\right).
$$

Since a rational fraction can have poles only with integer powers, this implies that

$$
\frac{Q_{0,2}^{(l)}(\lambda, z_1)}{(d\lambda)^l} = O(1),
$$

i.e. there is no pole at $a$.
### A.3 Stable cases

In this section, we deal with the stable cases corresponding to $(h, n) \notin \{(0, 0), (0, 1)\}$.

#### Step 1: Rewriting the topological recursion

The proof is more easily obtained by using the general formalism of global topological recursion developed in [5] where authors prove that recursion (3-1) defining the forms $\omega_{h,n}$ can be traded for a more global formulation which reads

$$ \omega_{h,n+1}(z_0, \mathbf{z}) = \sum_{a \in \mathcal{R}} \mathrm{Res}_{z \to a} \left[ \sum_{k=1}^{d-1} \sum_{\beta \subset x^{-1}(x(z)) \setminus \{z\}} (-1)^{k+1} \frac{\int_{\alpha}^{z} \omega_{0,2}(z_0, \cdot)}{\prod_{i=1}^{k} [\omega_{0,1}(z) - \omega_{0,1}(\beta_i)]} U_{h,n+1}^{(k+1)}(z, \beta; \mathbf{z}) \right], \quad (A-2) $$

with

$$ U_{h,n+1}^{(k)}(\beta; \mathbf{z}) := \sum_{\mu \in \mathcal{S}(\beta)} \sum_{\bigcup_{i=1}^{l(\mu)} J_i = \mathbf{z}} \sum_{\sum_{i=1}^{l(\mu)} g_i = h+l(\mu)-k}^{\text{no } (0,1)} \left[ \prod_{i=1}^{l(\mu)} \omega_{g_i, |\mu_i|+|J_i|}(\mu_i, J_i) \right], \quad (A-3) $$

where the symbol $\sum_{\alpha \in \Sigma}$ means that one considers only terms with $(g_i, |\mu_i| + |J_i|) \notin \{(0, 1)\}$ and $\alpha \in \Sigma$ is an arbitrary reference point.

In [6], Cauchy formula on $\Sigma$ allowed to prove that this version of the topological recursion can be equivalently written as

$$ 0 = \sum_{a \in \mathcal{R}} \mathrm{Res}_{z \to a} \left[ \int_{\alpha}^{z} \omega_{0,2}(z_0, \cdot) \right] \frac{dx(z)}{\partial P(x(z), y(z))} Q_{h,n+1}(x(z), y(z); \mathbf{z}), \quad (A-4) $$

where we abusively use the notation

$$ \frac{\partial P(x(z), y(z'))}{\partial y} := \left. \frac{\partial P(\lambda, y)}{\partial y} \right|_{\substack{\lambda=x(z) \\ y=y(z')}} \quad (A-5) $$

and $Q_{h,n+1}(x(z), y(z); \mathbf{z})$ is given by Definition 4.3.

#### Step 2: Proving that $\frac{dx(z)}{\partial y(x(z), y(z))} Q_{h,n+1}(x(z), y(z); \mathbf{z})$ is holomorphic at the ramification points

To prove this second step, let us assume that $\frac{dx(z)}{\partial y(x(z), y(z))} Q_{h,n+1}(x(z), y(z); \mathbf{z})$ has a pole at $z = a \in \mathcal{R}$. Hence, in any local coordinate, it reads

$$ \frac{dx(z)}{\partial y(x(z), y(z))} Q_{h,n+1}(x(z), y(z); \mathbf{z}) = \frac{S_{h,n+1}(\mathbf{z})}{(z-a)^{m+1}} (1 + O(z-a)), \quad (A-6) $$

for some $m \ge 1$ and $S_{h,n+1}(\mathbf{z}) \ne 0$. On the other hand, the expansion of $\omega_{0,2}$ in the same local coordinate takes the form

$$ \int_{\alpha}^{z} \omega_{0,2}(z_0, \cdot) = \sum_{k=0}^{\infty} (z-a)^k f_{a,k}(z_0), \quad (A-7) $$

where $f_{a,k}(z_0)$ is a 1-form behaving as

$$ f_{a,k}(z_0) = \frac{dz_0}{(z_0 - a)^{k+1}} (1 + O(z_0 - a)), \quad (A-8) $$
as $z_0 \to a$. The evaluation above shows that the leading order of (A-4) in $(z_0 - a)$ implies that $S_{h,n+1}(\mathbf{z}) = 0$, leading to a contradiction.

**Step 3: Proving that** $\frac{Q_{h,n+1}^{(k)}(\lambda;\mathbf{z})}{dx(z)^k}$ is holomorphic at the ramification points.

Let us recall that

$$Q_{h,n+1}(\lambda, y; \mathbf{z}) = \sum_{k=1}^{d} (-1)^k y^{r-k} \frac{Q_{h,n+1}^{(k)}(\lambda; \mathbf{z})}{d\lambda^k}, \qquad (A-9)$$

so that

$$Q_{h,n+1}(x(z), y(z); \mathbf{z}) = \sum_{k=1}^{d} (-1)^k y(z)^{r-k} \frac{Q_{h,n+1}^{(k)}(x(z); \mathbf{z})}{dx(z)^k}. \qquad (A-10)$$

We shall now use an interpolation formula to extract the coefficients $\frac{Q_{h,n+1}^{(k)}(x(z);\mathbf{z})}{dx(z)^k}$ out of $Q_{h,n+1}(x(z), y(z);\mathbf{z})$.

For this purpose, let us write

$$\frac{P(x(z), y)}{y - y(z)} = \sum_{l=0}^{d-1} (-1)^l y^{d-1-l} U^{(l)}(z), \qquad (A-11)$$

where

$$U^{(l)}(z) := \sum_{\substack{\beta \subseteq x^{-1}(x(z)) \setminus \{z\} \\ l \\ i=1}} \prod_{\beta}^{l} y(\beta_i). \qquad (A-12)$$

The evaluation at $y = y(z)$ gives

$$\frac{\partial P}{\partial y}(x(z), y(z)) = \sum_{l=0}^{d-1} (-1)^l y(z)^{d-1-l} U^{(l)}(z), \qquad (A-13)$$

while the evaluation at $y = y(z')$ with $x(z) = x(z')$ but $z \neq z'$ implies that

$$\forall z' \in x^{-1}(x(z)) \setminus \{z\}, \quad 0 = \sum_{l=0}^{d-1} (-1)^l y(z')^{d-1-l} U^{(l)}(z). \qquad (A-14)$$

One can use these two relations to compute

$$\begin{aligned} Q_{h,n+1}(x(z), y(z); \mathbf{z}) &= \sum_{z' \in x^{-1}(x(z))} \frac{Q_{h,n+1}(x(z), y(z'); \mathbf{z})}{\frac{\partial P}{\partial y}(x(z), y(z'))} \frac{\partial P}{\partial y}(x(z), y(z)) \delta_{z,z'} \\ &= \sum_{z' \in x^{-1}(x(z))} \frac{Q_{h,n+1}(x(z), y(z'); \mathbf{z})}{\frac{\partial P}{\partial y}(x(z), y(z'))} \sum_{l=0}^{d-1} (-1)^l y(z)^{d-1-l} U^{(l)}(z'). \end{aligned} \qquad (A-15)$$

Exchanging the summations and shifting the index $l$ by 1, one gets

$$Q_{h,n+1}(x(z), y(z); \mathbf{z}) = - \sum_{l=1}^{d} (-1)^l y(z)^{d-l} \sum_{z' \in x^{-1}(x(z))} \frac{Q_{h,n+1}(x(z), y(z'); \mathbf{z})}{\frac{\partial P}{\partial y}(x(z), y(z'))} U^{(l-1)}(z'). \qquad (A-16)$$
Comparing with (A-10), one obtains

$$ \frac{Q_{h,n+1}^{(k)}(x(z); \mathbf{z})}{dx(z)^k} = - \sum_{z' \in x^{-1}(x(z))} \frac{Q_{h,n+1}(x(z), y(z'); \mathbf{z})}{\frac{\partial P}{\partial y}(x(z), y(z'))} U^{(l-1)}(z'). \quad (A-17) $$

Since we have proved that $\frac{Q_{h,n+1}(x(z),y(z');\mathbf{z})}{\frac{\partial P}{\partial y}(x(z),y(z'))}$ is holomorphic at the ramification points and $U^{(l-1)}(z')$ obviously is, one can conclude that $\frac{Q_{h,n+1}^{(k)}(x(z);\mathbf{z})}{dx(z)^k}$ does not have any pole at $z = a \in \mathbb{R}$.

## A.4 Ramification points at poles

The points of $x^{-1}(\mathcal{P})$ play an important role in this article. A large part of our derivations rely on the fact that $\omega_{h,n}(z_1, \dots, z_n)$ for $(h, n) \neq (0, 1)$ have no poles at any $z_i \in x^{-1}(\mathcal{P})$. Let us consider some subclass of spectral curves for which this holds.

Let us write the ramification profile over $P \in \mathcal{P}$ as

$$ x^{-1}(P) = \{P^{(1)}, \dots, P^{(l_P)}\}, \quad (A-18) $$

$$ d_{P(\alpha)} = \deg_{P(\alpha)} x. \quad (A-19) $$

Let us denote $\zeta_\alpha$ the canonical local coordinate near $P^{(\alpha)}$, and let us denote

$$ \rho_{P(\alpha)} = e^{\frac{2\pi i}{d_{P(\alpha)}}} \quad (A-20) $$

the root of unity.

The meromorphic function $y$ has a Taylor-Laurent expansion given by the spectral times

$$ ydx = \sum_{k=0}^{r_{P(\alpha)}-1} t_{P(\alpha),k} \zeta_{\alpha}^{-k-1} d\zeta_{\alpha} + \text{analytic at } P^{(\alpha)}. \quad (A-21) $$

**Lemma A.1.** If for all $p \in x^{-1}(\mathcal{P})$ we have $r_p \ge 3$ and $t_{p,r_p-2} \ne 0$, then $\omega_{h,n}$ for $(h, n) \ne (0, 1)$ are analytic at $x^{-1}(\mathcal{P})$.

*Proof.* The proof proceeds by recursion on $2h - 2 + n$. It is clearly true for $2h - 2 + n = 0$, i.e. for $\omega_{0,2}$.

Let us assume that it holds up to $2h - 2 + n$ and prove it for $\omega_{h,n+1}$ using eq (A-2). Let $p \in x^{-1}(\mathcal{P})$.

By recursion hypothesis, the factor $U_{h,n+1}^{(k+1)}(z, \beta; z)$ has no pole at $z = p$ nor $\beta_i = p$, but it may have poles at $z = \beta_i$ or $\beta_j$ if they appear in $\omega_{0,2}$. Remark that

$$ \omega_{0,2}(\beta_i, \beta_j) = \frac{\rho_p^{\beta_j}}{(\rho_p^{\beta_i} - \rho_p^{\beta_j})^2} \zeta_p^{-2} d\zeta_p^2, \quad (A-22) $$

i.e. it has a double pole (notice that $\rho_p^{\beta_i} - \rho_p^{\beta_j} \ne 0$ because $\beta_i$ and $\beta_j$ are in $[0, d_p]$).

The maximum number of factors $\omega_{0,2}$ is $\frac{k+1}{2}$, which means that the degree of the pole is at most $k+1$.

Let us now study the behavior of the denominator with $ydx$. We have

$$ ydx(z) - ydx(\beta_j) = t_{p,r_p-1}(1 - \rho_p^{r_p\beta_j})\zeta_p^{-r_p}d\zeta_p + t_{p,r_p-2}(1 - \rho_p^{(r_p-1)\beta_j})\zeta_p^{1-r_p}d\zeta_p + O(\zeta_p^{2-r_p})d\zeta_p. \quad (A-23) $$
If $r_p\beta_j$ is not multiple of $d_p$, this quantity is of order $O(\zeta_p^{-r_p})$, and if $r_p\beta_j$ is multiple of $d_p$, then $(r_p-1)\beta_j$ can't be multiple of $d_p$, and thus in both cases this quantity has a pole of degree at least $(r_p-1)$.

In (A-2), there are $k$ factors $\frac{1}{ydx(z)-ydx(\beta_j)}$, therefore the integrand is of order at least $O(\zeta_p^{-(k+1)+k(r_p-1)})$.

If $r_p \ge 3$, the integrand behaves as $O(\zeta_p^{k-1})$, which has no pole because $k \ge 1$. Therefore, the residue vanishes.

This proves that residues coming from $a = p$ vanish, and hence $\omega_{h,n}$ is the same as if we had taken residues only at $a \in \mathcal{R}$, which have no pole at $z \in x^{-1}(\mathcal{P})$. $\square$

**Remark A.1.** This condition is sufficient, but it might not be necessary.

# B Proof of the KZ equations

In this section we prove the KZ equations for a generic divisor $D$, then we regularize them for a particular divisor $D = [z] - [\infty^{(\alpha)}]$ and finally, we re-write them making use of cycles.

## B.1 Proof for a generic divisor

In this section we give the proof of Theorem 5.1. Let us compute the differential $\hbar d_{p_i}\psi_{l,i}(D, \hbar)$. It reads

$$ \begin{aligned} \hbar d_{p_i} \psi_{l,i}(D, \hbar) &= \hbar d_{p_i} \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n}}{n!} \int_D \cdots \int_D \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right] \psi(D, \hbar) \\ &\quad + \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n}}{n!} \int_D \cdots \int_D \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right] \hbar d_{p_i} (\psi(D, \hbar)) \\ &= \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n+1}}{n!} \int_D \cdots \int_D d_{p_i} \left( \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right) \right] \psi(D, \hbar) \\ &\quad + \alpha_i \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n+1}}{(n-1)!} \int_D \cdots \int_D \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; p_i, \cdot)}{(dx(p_i))^l} \right] \psi(D, \hbar) \\ &\quad + \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n}}{n!} \int_D \cdots \int_D \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right] \hbar d_{p_i} (\psi(D, \hbar)). \quad (B-1) \end{aligned} $$

The first of the last three terms is obtained by action of the differential operator inside the integrals while the second one comes from the action on any of the $n$ integrals themselves.

Let us now compute the different terms. One has

$$ \hbar d_{p_i}(\psi(D, \hbar)) = \alpha_i \left[ \sum_{h \ge 0} \sum_{n \ge 1} \frac{\hbar^{2h-1+n}}{(n-1)!} \int_D \cdots \int_D \left[ \omega_{h,n}(p_i, \cdot) - \delta_{h,0}\delta_{n,2} \frac{dx(p_i)dx(\cdot)}{(x(p_i) - x(\cdot))^2} \right] \right] \psi(D, \hbar), \quad (B-2) $$
so that the sum of the second and third terms reads

$$
\begin{equation}
\begin{aligned}
& \alpha_i \sum_{h \ge 0} \sum_{n \ge 1} \frac{\hbar^{2h+n+1}}{(n-1)!} \overbrace{\int_D \cdots \int_D}^{n-1} \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; p_i, \cdot)}{(dx(p_i))^l} \psi(D, \hbar) \\
& + \alpha_i \sum_{h_1, h_2 \ge 0} \sum_{n_1, n_2 \ge 0} \frac{\hbar^{2h_1+2h_2+n_1+n_2}}{n_1! n_2!} \overbrace{\int_D \cdots \int_D}^{n_1} \frac{\hat{Q}_{h_1, n_1+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \\
& \qquad \overbrace{\int_D \cdots \int_D}^{n_2} \left[ \omega_{h_2, n_2+1}(p_i, \cdot) - \delta_{h_2, 0} \delta_{n_2, 1} \frac{dx(p_i) dx(\cdot)}{(x(p_i)-x(\cdot))^2} \right] \psi(D, \hbar),
\end{aligned}
\tag{B-3}
\end{equation}
$$

which can be re-organized as

$$
\begin{equation}
\begin{aligned}
& \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \hbar^{2h+n} \left[ \frac{1}{n!} \overbrace{\int_D \cdots \int_D}^{n} \frac{\hat{Q}_{h-1,n+2}^{(l)}(p_i; p_i, \cdot)}{(dx(p_i))^l} \right. \\
& \qquad \left. + \sum_{h_1+h_2=h} \sum_{n_1+n_2=n} \frac{1}{n_1! n_2!} \overbrace{\int_D \cdots \int_D}^{n_1} \frac{\hat{Q}_{h_1,n_1+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right. \\
& \qquad \left. \overbrace{\int_D \cdots \int_D}^{n_2} \left[ \omega_{h_2,n_2+1}(p_i, \cdot) - \delta_{h_2,0} \delta_{n_2,1} \frac{dx(p_i)dx(\cdot)}{(x(p_i)-x(\cdot))^2} \right] \right] \psi(D, \hbar).
\end{aligned}
\tag{B-4}
\end{equation}
$$

Using Lemma 5.1 and Definition 5.4, this reads

$$
\begin{equation}
\begin{aligned}
& - \alpha_i \psi_{l+1,i}(D, \hbar) dx(p_i) + \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \\
& \qquad \int_{z_1 \in D} \cdots \int_{z_n \in D} \left[ \frac{Q_{h,n+1}^{(l+1)}(x(p_i); \mathbf{z})}{(dx(p_i))^l} - \sum_{j=1}^{n} \frac{\hat{Q}_{h,n}^{(l)}(p_i; \mathbf{z} \setminus \{z_j\})}{(dx(p_i))^l} \frac{dx(p_i)dx(z_j)}{(x(p_i) - x(z_j))^2} \right] \psi(D, \hbar).
\end{aligned}
\tag{B-5}
\end{equation}
$$

Plugging the definition given by (4-8), this reads

$$
\begin{equation}
\begin{aligned}
& - \alpha_i \psi_{l+1,i}(D, \hbar) dx(p_i) + \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(p_i); \mathbf{z}) \psi(D, \hbar) \\
& + \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \sum_{j=1}^{n} d_{z_j} \left[ \frac{dx(p_i) \left( \frac{\hat{Q}_{h,n}^{(l)}(z_j; \mathbf{z} \setminus \{z_j\})}{dx(z_j)^l} - \frac{\hat{Q}_{h,n}^{(l)}(p_i; \mathbf{z} \setminus \{z_j\})}{dx(p_i)^l} \right)}{x(p_i) - x(z_j)} \right] \psi(D, \hbar).
\end{aligned}
\tag{B-6}
\end{equation}
$$

One can evaluate the last term by integration along the divisor D and, taking into account that
it has degree 0, one gets

$$
\begin{align}
& - \alpha_i \psi_{l+1,i}(D, \hbar) dx(p_i) - \hbar \alpha_i dx(p_i) \sum_{j \in [1,s] \setminus \{i\}} \alpha_j \frac{\psi_{l,i}(D, \hbar) - \psi_{l,j}(D, \hbar)}{x(p_i) - x(p_j)} \nonumber \\
& - \alpha_i^2 \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n+1}}{n!} \int_D \cdots \int_D d_{p_i} \left( \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right) \right] \psi(D, \hbar) \nonumber \\
& + \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n} dx(p_i)}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(p_i); \mathbf{z}) \psi(D, \hbar). \tag{B-7}
\end{align}
$$

Plugging this into (B-1), this gives

$$
\begin{align}
\hbar d_{p_i} \psi_{l,i}(D, \hbar) = & -\alpha_i \psi_{l+1,i}(D, \hbar) dx(p_i) - \hbar \alpha_i dx(p_i) \sum_{j \in [1,s] \setminus \{i\}} \alpha_j \frac{\psi_{l,i}(D, \hbar) - \psi_{l,j}(D, \hbar)}{x(p_i) - x(p_j)} \nonumber \\
& + (1 - \alpha_i^2) \left[ \sum_{(h,n) \in \mathbb{N}^2} \frac{\hbar^{2h+n+1}}{n!} \int_D \cdots \int_D d_{p_i} \left( \frac{\hat{Q}_{h,n+1}^{(l)}(p_i; \cdot)}{(dx(p_i))^l} \right) \right] \psi(D, \hbar) \nonumber \\
& + \alpha_i \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n} dx(p_i)}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(p_i); \mathbf{z}) \psi(D, \hbar). \tag{B-8}
\end{align}
$$

B.2 Proof for the special divisor

In this section we prove Theorem 5.2 corresponding to the special choice of divisor: D = [z] − [∞(α)], with z / ∈ x − $^{1}$( P ) ∪ x − $^{1}$( x ( R )) a generic point in a small neighborhood of ∞ (α).

For a two point divisor $D = [z] - [p_2]$, the first KZ equation of Theorem 5.1 reads

$$
\begin{align*}
\hbar \frac{d\psi_{l,1}(D=[z]-[p_2],\hbar)}{dx(z)} ={}& -\psi_{l+1,1}(D=[z]-[p_2],\hbar) + \hbar \frac{\psi_{l,1}(D=[z]-[p_2],\hbar) - \psi_{l,2}(D=[z]-[p_2],\hbar)}{x(z)-x(p_2)} \\
& + \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(z); \mathbf{z}) \right] \psi(D=[z]-[p_2], \hbar).
\end{align*}
$$

Multiplying this equation by e h − $^{1}$V ∞ ( α $^{)}$( p$_{2}$ ) 1 x ( p$_{2}$ ) √ dx ( p$_{2}$ ) dζ ∞ ( α $^{)}$( p$_{2}$ ) , one gets

$$
\hbar \frac{d\psi_{l,1}^{(p_2)}}{dx(z)} = -\psi_{l+1,1}^{(p_2)} + \hbar \frac{\psi_{l,1}^{(p_2)} - \psi_{l,2}^{(p_2)}}{x(z) - x(p_2)} + \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(z); \mathbf{z}) \right] \psi_{0,1}^{(p_2)}
$$

where we denote for simplicity:

$$
\psi_{l,i}^{(p_2)} := e^{\hbar^{-1} V_{\infty(\alpha)}(p_2)} \frac{1}{x(p_2)} \sqrt{\frac{dx(p_2)}{d\zeta_{\infty(\alpha)}(p_2)}} \psi_{l,i}(D = [z] - [p_2], \hbar),
$$

for i ∈ { 1 , 2 } and l ∈ [0 , d − 1] . They are defined in such a way that

$$
\psi_l^{\text{reg}}(D = [z] - [\infty^{(\alpha)}], \hbar) := \lim_{p_2 \to \infty^{(\alpha)}} \psi_{l,1}^{(p_2)}, \text{ for all } l \in [0, d-1].
$$
By definition, $\psi_{l,1}^{(p_2)}$ is holomorphic as $p_2 \to \infty^{(\alpha)}$, so that one can separate the singular and regular terms in this limit by writing

$$ \begin{aligned} & \hbar \frac{d\psi_{l,1}^{(p_2)}}{dx(z)} + \psi_{l+1,1}^{(p_2)} - \hbar \frac{\psi_{l,1}^{(p_2)}}{x(z) - x(p_2)} \\ & = -\hbar \frac{\psi_{l,2}^{(p_2)}}{x(z) - x(p_2)} + \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(x(z); \mathbf{z}) \right] \psi_{0,1}^{(p_2)}. \end{aligned} $$

The LHS admits a limit as $p_2 \to \infty^{(\alpha)}$ and reads

$$ \hbar \frac{d\psi_l^{\text{reg}}(D = [z] - [\infty^{(\alpha)}], \hbar)}{dx(z)} + \psi_{l+1}^{\text{reg}}(D = [z] - [\infty^{(\alpha)}], \hbar). $$

This implies that the RHS admits a limit as $p_2 \to \infty^{(\alpha)}$ as well. In order to study this limit, let us write this RHS as

$$ \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \left( \tilde{Q}_{h,n+1}^{(l+1)}(x(z); \mathbf{z}) - \hbar \frac{\hat{Q}_{h,n+1}^{(l)}(p_2; \mathbf{z})}{(x(z) - x(p_2))(dx(p_2))^l} \right) \right] \psi_{0,1}^{(p_2)}, \quad (B-9) $$

where we have used that $\psi_{0,2}^{(p_2)} = \psi_{0,1}^{(p_2)}$ because $\psi_{0,2}(D, \hbar) = \psi_{0,1}(D, \hbar) = \psi(D, \hbar)$ for any divisor $D$. The factor $\psi_{0,1}^{(p_2)}$ satisfies

$$ \psi_{0,1}^{(p_2)} \to \psi^{\text{reg}}(D = [z] - [\infty^{(\alpha)}], \hbar), \quad \text{as } p_2 \to \infty^{(\alpha)}, $$

so that the RHS tends to

$$ \psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar) \cdot \lim_{p_2 \to \infty^{(\alpha)}} \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in D} \cdots \int_{z_n \in D} \left( \tilde{Q}_{h,n+1}^{(l+1)}(x(z); \mathbf{z}) - \hbar \frac{\hat{Q}_{h,n+1}^{(l)}(p_2; \mathbf{z})}{(x(z) - x(p_2))(dx(p_2))^l} \right) \right]. $$

Let $\lambda \in \mathbb{P}^1 \setminus \mathcal{P}$, and $\lambda \neq x(z)$, we have

$$ \int_{z_1 \in D} \cdots \int_{z_n \in D} \tilde{Q}_{h,n+1}^{(l+1)}(\lambda; \mathbf{z}) = \int_{z_1 \in D} \cdots \int_{z_n \in D} Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z}) / d\lambda^{l+1} \\ - \frac{n}{\lambda - x(z)} \int_{z_1 \in D} \cdots \int_{z_{n-1} \in D} \hat{Q}_{h,n}^{(l)}(z; \mathbf{z}) / dx(z)^l \\ + \frac{n}{\lambda - x(p_2)} \int_{z_1 \in D} \cdots \int_{z_{n-1} \in D} \hat{Q}_{h,n}^{(l)}(p_2; \mathbf{z}) / dx(p_2)^l. \qquad (B-10) $$

The third term exactly cancels when we sum over $n$, and the first 2 terms do have a limit as $p_2 \to \infty^{(\alpha)}$. Indeed if $l \ge 1$, in the definition of $Q_{h,n+1}^{(l+1)}(\lambda; z_1, \dots, z_n)$, there is no $\omega_{0,1}(z_i)$ for any $i \in [1, n]$, and there is no $\omega_{0,2}(z_i, z_j)$. Thus the integrals $z_i \in D$ are convergent in the limit $p_2 \to \infty^{(\alpha)}$.
This implies that the RHS tends to

$$ \psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar) \cdot \lim_{\lambda \to x(z)} \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in [z] - [\infty^{(\alpha)}]} \cdots \int_{z_n \in [z] - [\infty^{(\alpha)}]} \left( Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z}) / d\lambda^{l+1} - \hbar \frac{\hat{Q}_{h,n+1}^{(l)}(z; \mathbf{z})}{(\lambda - x(z)) (dx(z))^l} \right) \right]. $$

Let us write the limit as a residue at $\lambda \to x(z)$ as

$$ \operatorname{Res}_{\lambda \to x(z)} \frac{d\lambda}{\lambda - x(z)} \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in [z] - [\infty^{(\alpha)}]} \cdots \int_{z_n \in [z] - [\infty^{(\alpha)}]} \left( \frac{Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z})}{d\lambda^{l+1}} - \hbar \frac{\hat{Q}_{h,n+1}^{(l)}(z; \mathbf{z})}{(\lambda - x(z)) (dx(z))^l} \right) \right]. $$

The integrand is a rational fraction of $\lambda$, with singularities at $x(z)$ and at $\lambda \in \mathcal{P}$, therefore, moving the integration contour we get

$$ - \sum_{P \in \mathcal{P}} \operatorname{Res}_{\lambda \to P} \frac{d\lambda}{\lambda - x(z)} \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in [z] - [\infty^{(\alpha)}]} \cdots \int_{z_n \in [z] - [\infty^{(\alpha)}]} \left( \frac{Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z})}{d\lambda^{l+1}} - \hbar \frac{\hat{Q}_{h,n+1}^{(l)}(z; \mathbf{z})}{(\lambda - x(z)) (dx(z))^l} \right) \right]. $$

The last term in $\frac{1}{(\lambda - x(z))^2}$ yields no residues at $\mathcal{P}$. For the other term, let us Taylor expand the $\frac{1}{\lambda - x(z)}$ at $\lambda \to P$ as

$$ \frac{d\lambda}{\lambda - x(z)} = - \sum_{k=0}^{\infty} \xi_P(x(z))^{-k} \xi_P(\lambda)^{k-1} d\xi_P(\lambda). \qquad (B-11) $$

This gives

$$ \sum_{P \in \mathcal{P}} \sum_{k=0}^{\infty} \xi_P(x(z))^{-k} \operatorname{Res}_{\lambda \to P} \xi_P(\lambda)^{k-1} d\xi_P(\lambda) \\ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \int_{z_1 \in [z] - [\infty^{(\alpha)}]} \cdots \int_{z_n \in [z] - [\infty^{(\alpha)}]} Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z}) / d\lambda^{l+1}. \qquad (B-12) $$

This leads to the KZ equation

$$ \hbar \frac{d\psi_l^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar)}{dx(z)} + \psi_{l+1}^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar) \\ = \left[ \sum_{h \ge 0} \sum_{n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{P \in \mathcal{P}} \sum_{k \in S_P^{(l+1)}} \xi_P(x(z))^{-k} \operatorname{Res}_{\lambda \to P} \xi_P(\lambda)^{k-1} d\xi_P(\lambda) \right. \\ \left. \int_{z_1=\infty^{(\alpha)}}^z \cdots \int_{z_n=\infty^{(\alpha)}}^z \frac{Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z})}{(d\lambda)^{l+1}} \right] \psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar). \qquad (B-13) $$
## B.3 Rewriting the KZ equations with cycles

For every pole $P \in \mathcal{P}$, let us write its preimages $x^{-1}(P) = \{p^{(1)}, \dots, p^{(\ell_P)}\}$ keeping track of their multiplicities as follows

$$P = (P^{(1)}, \dots, P^{(d)}) = \overbrace{(p^{(1)}, \dots, p^{(1)}, \dots, p^{(2)}, \dots, p^{(2)}, \dots, p^{(\ell_P)}, \dots, p^{(\ell_P)})}^{d_{p^{(1)}}} \quad (B-14)$$

For $j \in [1, d]$, we will say that $P^{(j)}$ corresponds to $p^{(k)}$ if $1 + \sum_{r=1}^{k-1} d_{p^{(r)}} \le j \le \sum_{r=1}^{k} d_{p^{(r)}}$. We also denote $d_{p^{(k)}}$ by $d_{P^{(j)}}$, for every $P^{(j)}$ that corresponds to $p^{(k)}$. Note that there are $d_{p^{(k)}}$ different $j$'s that give $P^{(j)}$'s corresponding to the same $p^{(k)}$.

Let us introduce roots of unity

$$\rho_{P^{(j)}} = e^{\frac{2\pi i}{d_{P^{(j)}}}} \quad (B-15)$$

In a neighborhood of $\lambda \to P$, we denote the preimages

$$x^{-1}(\lambda) = \{q_1, \dots, q_d\},$$

labeled in such a way that when $\lambda \to P$, we have $q_j \to P^{(j)}$, and the local coordinates are

$$\zeta_{P^{(j)}}(q_j) = (\rho_{P^{(j)}})^j (\xi_P(\lambda))^{\frac{1}{d_{P^{(j)}}}} \quad (B-16)$$

In particular, if $P^{(j)} = P^{(j')}$, the local coordinates are proportional by a root of unity

$$\zeta_{P^{(j)}} = (\rho_{P^{(j)}})^{j-j'} \zeta_{P^{(j')}} \quad (B-17)$$

Then let us Taylor expand $Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z})$ in its first variable in the limit $\lambda \to P$. For $(h, n+l+1) \ne (0, 2)$, the Taylor series of $\omega_{h,n+l+1}(q_{i_1}, \dots, q_{i_{l+1}}, z_1, \dots, z_n)$, has its coefficients obtained by residues, i.e. by generalized cycle integrals

$$\omega_{h,n+l+1}(q_{i_1}, \dots, q_{i_{l+1}}, z_1, \dots, z_n) = \sum_{k_1, \dots, k_{l+1} = -r_P}^{\infty} \prod_{j=1}^{l+1} \zeta_{P^{(i_j)}}(q_{i_j})^{k_j-1} d\zeta_{P^{(i_j)}}(q_{i_j}) \int_{C_{P^{(i_1)}, k_1}} \dots \int_{C_{P^{(i_{l+1})}, k_{l+1}}} \omega_{h,n+l+1}(\cdot, \dots, \cdot, \mathbf{z}) \quad (B-18)$$

Non strictly positive values of $k_i$ can occur only for $\omega_{0,1}$. We denote the lower bound $r_P = \max_{j=1, \dots, d} (r_{P^{(j)}} - 1)$.

We can also write the Taylor expansion for the integrals with $z_1, \dots, z_n$ on $D$:

$$\int_{z_1 \in D} \dots \int_{z_n \in D} \omega_{h,n+l+1}(q_{i_1}, \dots, q_{i_{l+1}}, z_1, \dots, z_n) = \sum_{k_1, \dots, k_{l+1} = -r_P}^{\infty} \prod_{j=1}^{l+1} \zeta_{P^{(i_j)}}(q_{i_j})^{k_j-1} d\zeta_{P^{(i_j)}}(q_{i_j}) \int_{C_{P^{(i_1)}, k_1}} \dots \int_{C_{P^{(i_{l+1})}, k_{l+1}}} \omega_{h,n+l+1} \quad (B-19)$$

As in the last expression, for simplicity, we omit the variables that we integrate over when there is no possible confusion. Notice that the $\int_D$ integrals are rightmost, they are performed before
the $C_{p,k}$ integrals, i.e. before taking the Taylor expansion coefficients, and (B-19) is not the integral of (B-18) in general. However the only case where the order of integration does not commute is for $\omega_{0,2}$, as we saw in Proposition 5.1, and in that case

$$ \int_{z_1 \in D} \omega_{0,2}(q_{i_1}, z_1) = \sum_{k_1=0}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \int_{C_{P^{(i_1)},k_1}} \int_D \omega_{0,2} \\ = -\delta_{P^{(i_1)},\infty(\alpha)} \zeta_{P^{(i_1)}}(q_{i_1})^{-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \\ + \sum_{k_1=1}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \int_D \int_{C_{P^{(i_1)},k_1}} \omega_{0,2}. \quad (B-20) $$

From the definition of $Q_{h,n+1}^{(l+1)}(\lambda; z)$, the $\omega_{0,2}(q_{i_1}, q_{i_2})$ that can appear there will always be evaluated at $q_{i_1} \neq q_{i_2}$. However, we can expand them around $q_{i_j} \to P^{(i_j)}$, $j \in \{1, 2\}$, with $P^{(i_1)} = P^{(i_2)}$. The Taylor expansion of $\omega_{0,2}$ is

$$ \begin{aligned} & \frac{\omega_{0,2}(q_{i_1}, q_{i_2}) - \delta_{P^{(i_1)}, P^{(i_2)}} \frac{d\zeta_{P^{(i_1)}}(q_{i_1}) d\zeta_{P^{(i_2)}}(q_{i_2})}{(\zeta_{P^{(i_1)}}(q_{i_1}) - \zeta_{P^{(i_2)}}(q_{i_2}))^2}}{\omega_{0,2}(q_{i_1}, q_{i_2})} \\ &= \sum_{k_1, k_2=1}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{k_2-1} d\zeta_{P^{(i_2)}}(q_{i_2}) \\ & \oint_{z_1' \in C_{P^{(i_1)},k_1}} \oint_{z_2' \in C_{P^{(i_2)},k_2}} \left( \omega_{0,2}(z_1', z_2') - \delta_{P^{(i_1)}, P^{(i_2)}} \frac{d\zeta_{P^{(i_1)}}(z_1') d\zeta_{P^{(i_2)}}(z_2')}{(\zeta_{P^{(i_1)}}(z_1') - \zeta_{P^{(i_2)}}(z_2'))^2} \right) \\ &= \sum_{k_1, k_2=1}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{k_2-1} d\zeta_{P^{(i_2)}}(q_{i_2}) \\ & \oint_{z_1' \in C_{P^{(i_1)},k_1}} \left( -\delta_{P^{(i_1)}, P^{(i_2)}} k_2 \zeta_{P^{(i_1)}}(z_1')^{-k_2-1} d\zeta_{P^{(i_1)}}(z_1') + \oint_{z_2' \in C_{P^{(i_2)},k_2}} \omega_{0,2}(z_1', z_2') \right) \\ &= \sum_{k_1, k_2=1}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{k_2-1} d\zeta_{P^{(i_2)}}(q_{i_2}) \\ & \oint_{z_1' \in C_{P^{(i_1)},k_1}} \oint_{z_2' \in C_{P^{(i_2)},k_2}} \omega_{0,2}(z_1', z_2'). \end{aligned} \quad (B-21) $$

Then, notice that if $P^{(i_1)} = P^{(i_2)}$, $\frac{\zeta_{P^{(i_1)}}}{\zeta_{P^{(i_2)}}} = \rho_{P^{(i_1)}}^{i_1-i_2}$ is a root of unity. This implies

$$ \frac{d\zeta_{P^{(i_1)}}(q_{i_1}) d\zeta_{P^{(i_2)}}(q_{i_2})}{(\zeta_{P^{(i_1)}}(q_{i_1}) - \zeta_{P^{(i_2)}}(q_{i_2}))^2} = \frac{\rho_{P^{(i_1)}}^{i_1-i_2}}{(1 - \rho_{P^{(i_1)}}^{i_1-i_2})^2} \zeta_{P^{(i_1)}}(q_{i_1})^{-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{-1} d\zeta_{P^{(i_2)}}(q_{i_2}). \quad (B-22) $$

In other words

$$ \begin{aligned} \omega_{0,2}(q_{i_1}, q_{i_2}) = & \delta_{P^{(i_1)}, P^{(i_2)}} \frac{\rho_{P^{(i_1)}}^{i_1-i_2}}{(1 - \rho_{P^{(i_1)}}^{i_1-i_2})^2} \zeta_{P^{(i_1)}}(q_{i_1})^{-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{-1} d\zeta_{P^{(i_2)}}(q_{i_2}) \\ & + \sum_{k_1, k_2=1}^{\infty} \zeta_{P^{(i_1)}}(q_{i_1})^{k_1-1} d\zeta_{P^{(i_1)}}(q_{i_1}) \zeta_{P^{(i_2)}}(q_{i_2})^{k_2-1} d\zeta_{P^{(i_2)}}(q_{i_2}) \\ & \oint_{C_{P^{(i_1)},k_1}} \oint_{C_{P^{(i_2)},k_2}} \omega_{0,2}. \end{aligned} \quad (B-23) $$
In some sense this is as if we extended the sum in the second line to include the cases $k_1 = 0$ and $k_2 = 0$ by defining:

$$ \oint_{C_{P(i_1),0}} \oint_{C_{P(i_2),0}} \omega_{0,2} := R(P)_{i_1,i_2}, \qquad (B-24) $$

where we defined the $d \times d$ matrix $R(P)$ to be

$$ \forall i \in [1, d] \quad R(P)_{i,i} := 0, \quad \forall i_1 \neq i_2 \quad R(P)_{i_1,i_2} := \delta_{P(i_1),P(i_2)} \frac{\rho_{P(i_1)}^{i_1-i_2}}{(1-\rho_{P(i_1)}^{i_1-i_2})^2}. \qquad (B-25) $$

With this definition at hand, we can now write the RHS of the KZ equation (B-13), after expanding the $Q_{h,n+1}^{(l+1)}(\lambda; \mathbf{z})$ around $\lambda \to P$, as

$$ \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{P \in \mathcal{P}} \sum_{k \in S_P^{(l+1)}} \xi_P(x(z))^{-k} \sum_{\substack{\beta \subseteq x^{-1}(\lambda) \\ \nu \in S(\beta)}} \sum_{J_1 \sqcup \cdots \sqcup J_{l(\nu)} = \mathbf{z}} \sum_{\substack{l(\nu) \\ \sum_{i=1}^{l(\nu)} h_i = h+l(\nu)-l-1}} \sum_{k_{i,j} = 1-r_P(\nu_{i,j})}^{\infty} \mathrm{Res}_{\lambda=P} \xi_P(\lambda)^{k-1} \frac{d\xi_P(\lambda)}{d\lambda} \prod_{i=1}^{l(\nu)} \prod_{j=1}^{|\nu_i|} \zeta_{P(\nu_{i,j})}^{k_{i,j}-1} d\zeta_{P(\nu_{i,j})}/d\lambda \prod_{i=1}^{l(\nu)} \left( \left( \prod_{j=1}^{|\nu_i|} \int_{C_{P(\nu_{i,j}),k_{i,j}}} \prod_{j=1}^{|J_i|} \int_{[z]-[-\infty^{(\alpha)}]} \omega_{h_i,|\nu_i|+|J_i|} \right) \right) \psi^{\mathrm{reg}}([z] - [\infty^{(\alpha)}], \hbar). \qquad (B-26) $$

Notice that only the elements of $J_i$ are integrated from $\infty^{(\alpha)}$ to $z$, and since $|\nu_i| > 0$, it can never be an integral of $\omega_{0,1}$, i.e. the integrand never has poles at $\infty^{(\alpha)}$ and thus these integrals are well defined.

Note that only $\omega_{0,1}$ factors can bring some $k_{i,j} < 0$ and only $\omega_{0,1}$ and $\omega_{0,2}$ factors can bring some $k_{i,j} = 0$.

Let us now compute the residues at $\lambda \to P$. We have,

* If $P = \Lambda_i$ is a finite pole, we denote $\epsilon_P = 1$, and its multiplicity $d_{P(j)} = \mathrm{order}_{P(j)}x > 0$. The canonical base local coordinate is $\xi_P = \lambda - \Lambda_i$, $d\xi_P = d\lambda$, and writing the preimages of $P$ with multiplicities as $\{P^{(1)}, \dots, P^{(d)}\}$, we have

$$ \zeta_{P(j)} = \xi_P^{\frac{1}{d_{P(j)}}} \quad \text{and} \quad d\zeta_{P(j)} = \frac{1}{d_{P(j)}} \xi_P^{\frac{1}{d_{P(j)}}-1} d\xi_P. \qquad (B-27) $$

The residue at $\lambda = P$ thus selects

$$ -k = -l - 1 + \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P(\nu_{i,j})}}. \qquad (B-28) $$

* If $P = \infty$ is an infinite pole, we denote $\epsilon_P = -1$, and its multiplicity $d_{P(j)} = -\mathrm{order}_{P(j)}x > 0$. We have $\xi_P = \frac{1}{\lambda}$, $d\lambda = -\xi_P^{-2}d\xi_P$, and writing the preimages of $P$ with multiplicities as $\{P^{(1)}, \dots, P^{(d)}\}$, we have

$$ \zeta_{P(j)} = \xi_P^{\frac{1}{d_{P(j)}}} \quad \text{and} \quad d\zeta_{P(j)} = \frac{1}{d_{P(j)}} \xi_P^{\frac{1}{d_{P(j)}}-1} d\xi_P. \qquad (B-29) $$
The residue at $\lambda = P$ thus selects

$$-k = l + 1 + \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P^{(\nu_{i,j})}}} \qquad (B-30)$$

In both cases

$$\sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P^{(\nu_{i,j})}}} = (l+1)\epsilon_P - k. \qquad (B-31)$$

Some of the $k_{i,j}$s can be negative and with lower bound $k_{i,j} > -r_{P^{(\nu_{i,j})}}$. This implies that the sum over the $k_{i,j}$ must in fact be a finite sum, with an upper bound.

We have that the RHS of (B-13) reads

$$\left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{P \in \mathcal{P}} \sum_{k \in S_P^{(l+1)}} \xi_P(x(z))^{-k} \sum_{\substack{\beta \subseteq x^{-1}(\lambda) \\ l=1}} \sum_{\nu \in S(\beta)} \sum_{J_1 \sqcup \cdots \sqcup J_{l(\nu)} = \mathbf{z}} \sum_{\substack{l(\nu) \\ \sum_{i=1}^{l(\nu)} h_i = h+l(\nu)-l-1}} \sum_{k_{i,j}=1-r_{P^{(\nu_{i,j})}}}^{\infty} \delta \left( \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P^{(\nu_{i,j})}}} = (l+1)\epsilon_P - k \right) \prod_{i=1}^{l(\nu)} \prod_{j=1}^{\nu_i} \frac{\epsilon_P}{d_{P^{(\nu_{i,j})}}} \prod_{i=1}^{l(\nu)} \left( \left( \prod_{j=1}^{|\nu_i|} \int_{C_{P^{(\nu_{i,j})}, k_{i,j}}} \prod_{j=1}^{|J_i|} \int_{[z]-[\infty^{(\alpha)}]} \omega_{h_i, |\nu_i|+|J_i|} \right) \psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar) \right) \right] \psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar), \qquad (B-32)$$

where we use the Krönecker $\delta$ to encode the constraint on the $k_{i,j}$s. In this sum there are terms with $k_{i,j} < 0$ that may only come from $\omega_{0,1}$, there are terms with $k_{i,j} = 0$ that may only come from $\omega_{0,1}$ and $\omega_{0,2}$, and there are the strictly positive $k_{i,j} > 0$.

Let us separate the negative and vanishing $k_{i,j}$s from the strictly positive.

We shall decompose the partition $\nu$ into 3 pieces:

* A piece that we re-call $\nu$ for the strictly positive $k_{i,j}$s:

$$\nu = \bigsqcup_{i \in [1, \ell]} \{\nu_{i,1}, \dots, \nu_{i,|\nu_i|}\}, \qquad (B-33)$$

with all indices $(i, j)$, $j \in [1, |\nu_i|]$, distinct, corresponding to elements in $[1, d]$, and giving an order to the sets. To it we associate the sequence of exponents

$$((k_{1,1}, \dots, k_{1,|\nu_1|}), (k_{2,1}, \dots, k_{2,|\nu_2|}), \dots, (k_{\ell,1}, \dots, k_{\ell,|\nu_\ell|})), \qquad (B-34)$$

with all $k_{i,j} > 0$.

* A piece that we call $\nu'$ for the negative or vanishing $k_{i,j}$s corresponding to integrals of $\omega_{0,1}$. All its parts must be of size 1, and instead of encoding it as a set partition, we can just denote it as a set of indices $\nu' = \{\nu'_1, \dots, \nu'_{\ell'}\}$, with $\nu'_j \in [1, d] \setminus \nu$. To it we associate the exponents

$$k'_1, \dots, k'_{\ell'}, \quad \text{with } k'_i \in [0, r_{P^{(\nu'_i)}} - 1]. \qquad (B-35)$$
The integrals associated to it give the spectral times

$$ \oint_{C_P(\nu_i'), -k_i'} \omega_{0,1} = t_{P(\nu_i'), k_i'}. \qquad (B-36) $$

• A piece that we call $\nu''$ for the zero values corresponding to the pseudo-integrals of $\omega_{0,2}$ which are worth $R(p)_{i_1,i_2}$. All its parts must be of size 2 and its indices are taken $\nu_{i,\pm}'' \in [1, d] \setminus (\nu \cup \nu')$:

$$ \nu'' = \{\{\nu_{1,+}'' , \nu_{1,-}''\}, \{\nu_{2,+}'' , \nu_{2,-}''\}, \dots, \{\nu_{\ell'',+}'' , \nu_{\ell'',-}''\}\} \in S^{(2)}([1, d] \setminus (\nu \cup \nu')) $$

where we denoted $S^{(2)}([1, d] \setminus (\nu \cup \nu'))$ the set of set partitions where all the parts have size 2. To it we shall associate zero exponents $k_{i,\pm}'' = 0$, and the factor

$$ C_{\nu_i''} := \oint_{C_P(\nu_{i,+}', 0)} \oint_{C_P(\nu_{i,-}', 0)} \omega_{0,2} = R(p)_{\nu_{i,+}', \nu_{i,-}''} = R(p)_{\nu_i''}. \qquad (B-37) $$

Finally, one could have a factor of the form

$$ \int_{C_P(\nu_{i,j}, k_{i,j})} \int_{[z]-[\infty(\alpha)]} \omega_{0,2}, $$

with $P^{(\nu_{i,j})} = \infty^{(\alpha)}$ and $k_{i,j} = 0$ giving a contribution equal to -1. In this case, one has the same contributions as above for $\nu \cup \nu' \cup \nu''$ not containing $\alpha$ and $|\nu \cup \nu' \cup \nu''| = l$.

In the end we get the RHS of the KZ equation divided by $\psi^{\text{reg}}([z] - [\infty^{(\alpha)}], \hbar)$ as

$$ \begin{aligned} & \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{P \in \mathcal{P}} \sum_{k \in S_P^{(l+1)}} \xi_P(x(z))^{-k} \sum_{\ell'=0}^{l+1} \sum_{\nu' \subset \ell'} \sum_{[1,d]} \sum_{k_i'=0}^{r_P(\nu_i')-1} \sum_{0 \le \ell'' \le \frac{l+1-\ell'}{2}} \sum_{\substack{l(\nu'')=\ell'' \\ l(\nu'') \in S^{(2)}([1,d] \setminus \nu')}} \\ & \qquad \sum_{\beta \subseteq [1,d] \setminus (\nu' \cup \nu'')} \sum_{\nu \in S(\beta)} \sum_{\substack{l(\nu) \\ \sum_{i=1}^{l(\nu)} h_i = h+l(\nu) - |\nu| - \ell''}} \sum_{k_{i,j}=1}^{\infty} \sum_{\substack{n_1+\dots+n_{l(\nu)}=n \\ j=1,\dots,|\nu_i|}} \frac{n!}{n_1! \dots n_{l(\nu)!}} \\ & \qquad \delta \left( \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P(\nu_{i,j})}} = (l+1)\epsilon_P - k + \sum_{i=1}^{\ell'} \frac{k_i'}{d_{P(\nu_i')}^2} \right) \prod_{i=1}^{\ell'} \frac{\epsilon_P}{d_{P(\nu_i')}^2} \prod_{i=1}^{\ell''} \frac{1}{d_{P(\nu_{i,+}')^2} d_{P(\nu_{i,-}')^2}} \\ & \qquad \prod_{i=1}^{l(\nu)} \prod_{j=1}^{\ell'} \frac{\epsilon_P}{d_{P(\nu_{i,j})}} \prod_{i=1}^{\ell''} t_{P(\nu_i'), k_i'} \prod_{i=1}^{l(\nu)} R(P)_{\nu_i''} \prod_{i=1}^{l(\nu)} \left( \left( \prod_{j=1}^{|\nu_i|} \int_{C_P(\nu_{i,j}, k_{i,j})} \prod_{j=1}^{n_i} \int_{[z]-[\infty(\alpha)]} \omega_{h_i, |\nu_i|+n_i} \right) \omega_{h_i, |\nu_i|+n_i} \right) \\ & \qquad - \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{k \in S_{\infty}^{(l+1)}} \xi_{\infty}(x(z))^{-k} \sum_{\ell'=0}^{l} \sum_{\nu' \subset \ell'} \sum_{[1,d] \setminus \{\alpha\}} \sum_{k_i'=0}^{\infty} \sum_{0 \le \ell'' \le \frac{l-\ell'}{2}} \sum_{\substack{l(\nu'')=\ell'' \\ l(\nu'') \in S^{(2)}([1,d] \setminus \nu' \cup \{\alpha\})}} \\ & \qquad \sum_{\beta \subseteq [1,d] \setminus (\nu' \cup \nu'' \cup \{\alpha\})} \sum_{\nu \in S(\beta)} \sum_{\substack{l(\nu) \\ \sum_{i=1}^{l(\nu)} h_i = h+l(\nu) - |\nu| - \ell''}} \sum_{k_{i,j}=1}^{\infty} \sum_{\substack{i=1,\dots,l(\nu) \\ j=1,\dots,|\nu_i|}} \end{aligned} $$
$$
\begin{equation}
\begin{split}
& \sum_{n_1+\cdots+n_{l(\nu)}+1=n} \frac{n!}{n_1! \cdots n_{l(\nu)!}} \delta \left( \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{\infty}^{(\nu_i,j)}} \right) \\
& \qquad \times \frac{\epsilon_{\infty}}{d_{\infty}^{(\alpha)}} \prod_{i=1}^{l(\nu)} \prod_{j=1}^{|\nu_i|} \frac{\epsilon_{\infty}}{d_{\infty}^{(\nu_i,j)}} \prod_{i=1}^{\ell'} \frac{\epsilon_{\infty}}{d_{\infty}^{(\nu'_i)}} \prod_{i=1}^{\ell''} \frac{1}{d_{\infty}^{(\nu''_{i,+})} d_{\infty}^{(\nu''_{i,-})}} \\
& \qquad \times \prod_{i=1}^{\ell'} t_{P^{(\nu'_i), k'_i}} \prod_{i=1}^{\ell''} R(\infty)_{\nu''_i} \prod_{i=1}^{l(\nu)} \left( \left( \prod_{j=1}^{|\nu_i|} \int_{C_{\infty}^{(\nu_i,j), k_{i,j}}} \prod_{j=1}^{n_i} \int_{[z]-[\infty^{(\alpha)}]} \omega_{h_i, |\nu_i|+n_i} \right) \right) .
\end{split}
\tag{B-38}
\end{equation}
$$

Now all cycle integrals are with generalized cycles with $k_{i,j} > 0$, and these commute with all other integrals present in this expression; in particular with integrals $\int_{[z]-[\infty^{(\alpha)}]}$, so the order of integrations doesn't matter anymore. Moreover, we have a formal power series of $\hbar$, whose coefficients are rational fractions of $x(z)$ with poles at $\mathcal{P}$, and whose coefficients are algebraic combinations of generalized cycle integrals of the $\omega_{h_i, n_i + |\nu_i|}$, therefore it can be written as the evaluation of an element of our symbolic algebra $\mathcal{W}$.

So let us rewrite the last expression in $\mathcal{W}$ as

$$
\begin{align*}
& \hbar^{l+1} \sum_{P \in \mathcal{P}} \epsilon_P^{l+1} \sum_{k \in S_P^{(l+1)}} \xi_P(x(z))^{-k} \sum_{\ell'=0}^{l+1} \sum_{\nu' \subset \ell'} \sum_{l \le \ell'' \le \frac{l+1-\ell'}{2}} \sum_{\nu'' \in S^{(2)}([1,d]\setminus\nu')} \sum_{l(\nu'')=\ell''} \\
& \qquad \sum_{\substack{\beta \\ l+1-\ell'-2\ell''}} \sum_{\substack{\nu \\ [1,d]\setminus(\nu' \cup \nu'')}} \sum_{\nu \in S(\beta)} \frac{1}{\prod_{i=1}^{l(\nu)} \prod_{j=1}^{\nu_i} d_{P^{(\nu_i,j)}} \prod_{i=1}^{\ell'} d_{P^{(\nu'_i)}} \prod_{i=1}^{\ell''} d_{P^{(\nu''_{i,+})}} d_{P^{(\nu''_{i,-})}}} \\
& \qquad \sum_{\substack{k_{i,j}=1 \\ i=1, \dots, l(\nu) \\ j=1, \dots, |\nu_i|}}^{\infty} \delta \left( \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{P^{(\nu_i,j)}}} \right) = (l+1)\epsilon_P - k + \sum_{i=1}^{\ell'} \frac{k'_i}{d_{P^{(\nu'_i)}}} \prod_{i=1}^{\ell'} \hbar^{-1} t_{P^{(\nu'_i), k'_i}} \prod_{i=1}^{\ell''} R(P)_{\nu''_i} \\
& \qquad \sum_{h_1, \dots, h_{l(\nu)}} \sum_{n_1+\dots+n_{l(\nu)}=n} \prod_{i=1}^{l(\nu)} \left( \frac{\hbar^{2h_i-2+n_i+|\nu_i|}}{n_i!} \prod_{j=1}^{n_i} \int_{[z]-[\infty^{(\alpha)}]} \prod_{j=1}^{|\nu_i|} \int_{C_{P^{(\nu_i,j), k_{i,j}}}} \omega_{h_i, |\nu_i|+n_i} \right) \\
& \qquad - \hbar^{l+1} \epsilon_{\infty}^{l+1} \sum_{k \in S_{\infty}^{(l+1)}} \xi_{\infty}(x(z))^{-k} \sum_{\ell'=0}^{l} \sum_{\nu' \subset \ell'} \sum_{\substack{\beta \\ [1,d]\setminus\{\alpha\}}} \sum_{\substack{k'_i=0 \\ \sum_{i=1}^{\infty} (\nu'_i)^{-1}}} \sum_{\substack{0 \le \ell'' \le \frac{l-\ell'}{2} \\ \nu'' \in S^{(2)}([1,d]\setminus\nu' \cup \{\alpha\}) \\ l(\nu'')=\ell''}} \sum_{l(\nu'')=\ell''} \\
& \qquad \sum_{\substack{\beta \\ l-\ell'-2\ell''}} \sum_{\substack{\nu \\ [1,d]\setminus(\nu' \cup \nu'') \cup \{\alpha\}}} \sum_{\nu \in S(\beta)} \frac{1}{d_{\infty^{(\alpha)}} \prod_{i=1}^{l(\nu)} \prod_{j=1}^{\nu_i} d_{\infty^{(\nu_i,j)}} \prod_{i=1}^{\ell'} d_{\infty^{(\nu'_i)}} \prod_{i=1}^{\ell''} d_{\infty^{(\nu''_{i,+})}} d_{\infty^{(\nu''_{i,-})}}} \\
& \qquad \sum_{\substack{k_{i,j}=1 \\ i=1, \dots, l(\nu) \\ j=1, \dots, |\nu_i|}}^{\infty} \delta \left( \sum_{i=1}^{l(\nu)} \sum_{j=1}^{|\nu_i|} \frac{k_{i,j}}{d_{\infty^{(\nu_i,j)}}} \right) = (l+1)\epsilon_{\infty} - k + \sum_{i=1}^{\ell'} \frac{k'_i}{d_{\infty^{(\nu'_i)}}} \prod_{i=1}^{\ell'} \hbar^{-1} t_{\infty^{(\nu'_i), k'_i}} \prod_{i=1}^{\ell''} R(\infty)_{\nu''_i} \\
& \qquad \sum_{h_1, \dots, h_{l(\nu)}} \sum_{n_1+\dots+n_{l(\nu)}+1=n} \prod_{i=1}^{l(\nu)} \left( \frac{\hbar^{2h_i-2+n_i+|\nu_i|}}{n_i!} \prod_{j=1}^{n_i} \int_{[z]-[\infty^{(\alpha)}]} \prod_{j=1}^{|\nu_i|} \int_{C_{\infty^{(\nu_i,j), k_{i,j}}}} \omega_{h_i, |\nu_i|+n_i} \right) . \tag{B-39}
\end{align*}
$$

The following lemma will help recognize this expression as an operator acting on $\psi$.
**Lemma B.1.** Let $l > 0$ and let $C_1, \dots, C_l \in \mathcal{E}$ be some generalized cycles of strictly positive type (i.e. $C_i = C_{p_i, k_i}$ with $k_i > 0$). Let $D$ be a divisor of degree $0$. We have

$$ \hbar^{2l} \mathcal{I}_{C_1} \dots \mathcal{I}_{C_l} \psi^{\text{reg symbol}}(D, \hbar) = \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{\nu \in S([1,l])} \sum_{n_1 + \dots + n_{l(\nu)} = n} \sum_{h_1 + \dots + h_{l(\nu)} = h-l+l(\nu)} \frac{n!}{\prod_{i=1}^{l(\nu)} n_i!} \prod_{i=1}^{l(\nu)} \left( \prod_{j=1}^{n_i} \int_D \prod_{j \in \nu_i} \int_{C_j} \omega_{h_i, |\nu_i|+n_i} \right) \right] \psi^{\text{reg symbol}}(D, \hbar) \quad (B-40) $$

and

$$ \operatorname{ev.} \mathcal{I}_{C_1} \dots \mathcal{I}_{C_l} \psi^{\text{reg symbol}}(D, \hbar) = \left[ \sum_{h,n \ge 0} \sum_{\beta \subseteq x^{-1}(\lambda)} \sum_{\nu \in S(\beta)} \frac{\hbar^{2h+n-2l}}{n!} \int_{z_1 \in D} \dots \int_{z_n \in D} \sum_{J_1 \sqcup \dots \sqcup J_{l(\nu)} = \{z_1, \dots, z_n\}} \sum_{h_1 + \dots + h_{l(\nu)} = h-l+l(\nu)} \prod_{i=1}^{l(\nu)} \left( \prod_{j \in \nu_i} \int_{C_j} \omega_{h_i, |\nu_i|+|J_i|} (\nu_i, J_i) \right) \right] \psi^{\text{reg}}(D, \hbar). \quad (B-41) $$

*Proof.* Let us start by proving (B-40) by recursion on $l$. It is true for $l = 1$ by our definition of applying $\mathcal{I}_{C_1}$ to an exponential (5-62):

$$ \hbar^{2l} \mathcal{I}_{C_1} \psi^{\text{reg symbol}}(D, \hbar) = \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \left( \int_D \dots \int_D \int_{C_1} \omega_{h,1+n} \right) \right] \psi^{\text{symbol}}(D, \hbar). \quad (B-42) $$

Then, assuming it is true up to $l-1$, let us prove it for $l$. We have by induction hypothesis

$$ \hbar^{2l} \mathcal{I}_{C_1} \dots \mathcal{I}_{C_l} \psi^{\text{reg symbol}}(D, \hbar) = \hbar^2 \mathcal{I}_{C_l} \left( \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{\nu \in S([1,l-1])} \sum_{n_1 + \dots + n_{l(\nu)} = n} \sum_{\substack{h_1 + \dots + h_{l(\nu)} = h-l+1+l(\nu) \\ =h-l+1+l(\nu)}} \frac{n!}{\prod_{i=1}^{l(\nu)} n_i!} \prod_{i=1}^{l(\nu)} \left( \prod_{j=1}^{n_i} \int_D \prod_{j \in \nu_i} \int_{C_j} \omega_{h_i, |\nu_i|+n_i} \right) \right] \psi^{\text{reg symbol}}(D, \hbar) \right). \quad (B-43) $$
Then we apply Leibniz rule

$$
\begin{equation}
\begin{aligned}
\hbar^{2l} \mathcal{I}_{C_1} \dots \mathcal{I}_{C_l} \psi^{\text{reg symbol}}(D, \hbar) = & \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+n}}{n!} \sum_{\nu \in S([1,l-1])} \sum_{n_1+\dots+n_{l(\nu)}=n} \sum_{h_1+\dots+h_{l(\nu)}=h-l+1+l(\nu)} \right. \\
& \left. \frac{n!}{\prod_{i=1}^{l(\nu)} n_i!} \prod_{i=1}^{l(\nu)} \left( \prod_{j=1}^{n_i} \int_D \prod_{j \in \nu_i} \int_{C_j} \omega_{h_i, |\nu_i|+n_i} \right) \right] \hbar^2 \mathcal{I}_{C_l} \psi^{\text{reg symbol}}(D, \hbar) \\
& + \left[ \sum_{h,n \ge 0} \frac{\hbar^{2h+2+n}}{n!} \sum_{\nu \in S([1,l-1])} \sum_{n_1+\dots+n_{l(\nu)}=n} \sum_{h_1+\dots+h_{l(\nu)}=h-l+l(\nu)} \right. \\
& \left. \frac{n!}{\prod_{i=1}^{l(\nu)} n_i!} \mathcal{I}_{C_l} \left( \prod_{i=1}^{l(\nu)} \left( \prod_{j=1}^{n_i} \int_D \prod_{j \in \nu_i} \int_{C_j} \omega_{h_i, |\nu_i|+n_i} \right) \right) \right] \psi^{\text{reg symbol}}(D, \hbar).
\end{aligned}
\tag{B-44}
\end{equation}
$$

The first term can be written using (B-42) as sum over partitions of ⌊1, l⌋ the form ˜ν = (ν₁, ..., νₗ(ν), 1), i.e. a partition obtained from ν by adding one more block of size 1, hence l(˜ν) = l(ν) + 1 and |˜ν| = |ν| + 1. Then we have that the new genus is ˜h = h + hₗ(˜ν), giving h₁ + ... + hₗ(˜ν) = ˜h − l + 1 + l(ν) = ˜h − l + l(˜ν). We also have ˜n = n + nₗ(˜ν). In the second term, I_C_l acts by Leibniz rule on the product, by acting on one of the factors, which amounts to adding the index l to a block of ν in all possible ways. This gives ℏ²h+2+n, with a new ˜h = h + 1 and ˜ν ∈ S([1, l]), so h₁ + ... + hₗ(˜ν) = ˜h − l + l(˜ν), with l(˜ν) = l(ν) and ˜h − l = h − l + 1, as before. Eventually these two terms together give the sum over all partitions of the set ⌊1, l⌋, i.e. the formula (B-40) at rank l.

To prove (B-41), we just recognize that the factor

$$
\frac{n!}{\prod_{i=1}^{l(\nu)} n_i!} \tag{B-45}
$$

is the number of ways of writing

$$
\{z_1, \dots, z_n\} = J_1 \sqcup J_2 \sqcup \dots \sqcup J_{l(\nu)}. \tag{B-46}
$$

This ends the proof of the lemma.

<figure><img src="image_3.png" /></figure>

We define the operator

$$
\begin{align*}
\tilde{\mathcal{L}}_l(x(z)) &:= \sum_{P \in \mathcal{P}} \epsilon_P^{l+1} \left[ \xi_P(x(z))^{-(l+1)\epsilon_P} \sum_{\ell'=0}^{l+1} \sum_{\nu' \subset \ell' \, \llbracket \! \llbracket 1, d \rrbracket \rrbracket} \prod_{j \in \nu'} \left( \sum_{k=0}^{r_{P(j)}-1} \frac{t_{P(j),k}}{d_{P(j)}} \xi_P^{-k/d_{P(j)}} \right) \right. \\
& \qquad \left. \sum_{0 \le \ell' \le \frac{l+1-\ell'}{2}} \sum_{\nu'' \in S^{(2)}(\llbracket 1, d \rrbracket \setminus \nu') \atop l(\nu'') = \ell''} \prod_{i=1}^{\ell''} \frac{\hbar^2 R(P)_{\nu''_i}}{d_{P(\nu'',i)} d_{P(\nu'',-i)}} \right. \\
& \qquad \left. \sum_{\nu \subset \llbracket 1, d \rrbracket \setminus (\nu' \cup \nu'')} \prod_{j \in \nu} \left( \hbar^2 \sum_{k=1}^{\infty} \frac{\xi_P^{k/d_{P(j)}}}{d_{P(j)}} \mathcal{I}_{C_{P(j),k}} \right) \right]_{\le 0} \\
&\quad - \hbar \frac{\epsilon_{\infty}^{l+1}}{d_{\infty(\alpha)}} \left[ \xi_{\infty}(x(z))^{-(l+1)\epsilon_{\infty}} \sum_{\ell'=0}^{l} \sum_{\nu' \subset \ell' \, \llbracket \! \llbracket 1, d \rrbracket \rrbracket \setminus \{\alpha\}} \prod_{j \in \nu'} \left( \sum_{k=0}^{r_{\infty(j)}-1} \frac{t_{\infty(j),k}}{d_{\infty(j)}} \xi_{\infty}^{-k/d_{\infty(j)}} \right) \right]
\end{align*}
$$
$$
\sum_{0 \le l'' \le \frac{l+1-l'}{2}} \sum_{\nu'' \in S^{(2)}([1,d] \setminus (\nu' \cup \{\alpha\}))} \prod_{l(\nu'') = l''}^{l''} \frac{\hbar^2 R(\infty) \nu_i''}{d_{\infty^{(\nu''_i,+)}} d_{\infty^{(\nu''_{i,-})}}} \\
\sum_{\nu \subseteq [1,d] \setminus (\nu' \cup \nu'' \cup \{\alpha\})} \prod_{j \in \nu} \left( \hbar^2 \sum_{k=1}^{\infty} \frac{\xi_{\infty}^{k/d_{\infty(j)}}}{d_{\infty(j)}} \mathcal{I}_{\infty(j),k} \right]_{\le 0}, \qquad (B-47)
$$

where the notation $[\cdot]_{\le 0}$ means we keep only the terms that give $\xi_P(x(z))^{-m}$, with $m \in S_P^{(l)}$.
Then (B-40) implies that the RHS of the KZ equation is

$$
\hbar \frac{d}{dx(z)} \psi_l^{\text{reg}}([z] - [\infty^{(\alpha)}]) + \psi_{l+1}^{\text{reg}}([z] - [\infty^{(\alpha)}]) = \text{ev.} \tilde{\mathcal{L}}_l(x(z)) [\psi^{\text{reg symbol}}([z] - [\infty^{(\alpha)}])] . \quad (B-48)
$$

This ends the proof of Theorem 5.3.

C Proof of Theorem 6.4: No pole at ramification points

C.1 General idea of the proof

For any triple $J = (P, k, l)_{P \in \mathcal{P}, k \in \mathbb{N}, l \in [0, d-1]}$, $\mathcal{L}_{P,k,l}$ is a linear combination of operators of the
form $\prod_{j=1}^{m} (\hbar^2 \mathcal{I}_{C_j})$ with generalized cycles of the form $C_j = C_{p_j, k_j}$ with $x(p_j) = P$, $k_j \ge 1$ and
$m \le l$. Let us note that the coefficients of this linear combination are independent of $\lambda$.

For any set of generalized cycles $(C_j)_{j=1}^m$ of this form, one can define the symbolic matrix

$$
\tilde{A}_{C_1, \dots, C_m}^{\text{symbol}} := \hbar^{-1} \left( \prod_{j=1}^{m} (\hbar^2 \mathcal{I}_{C_j}) \tilde{\Psi}^{\text{symbol}} \right) (\tilde{\Psi}^{\text{symbol}})^{-1} \quad (C-1)
$$

and its evaluation

$$
\tilde{A}_{C_1, \dots, C_m} := \text{ev.} \tilde{A}_{C_1, \dots, C_m}^{\text{symbol}}. \qquad (C-2)
$$

It is defined in such a way that the systems

$$
\left\{
\begin{array}{l}
\displaystyle \frac{\hbar \frac{d \tilde{\Psi}^{\text{symbol}}(\lambda)}{d\lambda}}{\hbar^{-1} \left( \prod_{j=1}^{m} (\hbar^2 \mathcal{I}_{C_j}) \right)} = \tilde{L}^{\text{symbol}}(\lambda) \tilde{\Psi}^{\text{symbol}}(\lambda), \\[1em]
\displaystyle \hbar^{-1} \left( \prod_{j=1}^{m} (\hbar^2 \mathcal{I}_{C_j}) \right) \tilde{\Psi}^{\text{symbol}}(\lambda) = \tilde{A}_{C_1, \dots, C_m}^{\text{symbol}}(\lambda) \tilde{\Psi}^{\text{symbol}}(\lambda)
\end{array}
\right.
\qquad (C-3)
$$

and

$$
\left\{
\begin{array}{l}
\displaystyle \hbar \frac{d \tilde{\Psi}(\lambda)}{d \lambda} = \tilde{L}(\lambda) \tilde{\Psi}(\lambda), \\[2ex]
\text{ev.} \left[ \hbar^{-1} \left( \prod_{j=1}^{m} (\hbar^2 \mathcal{I}_{C_j}) \right) \tilde{\Psi}^{\text{symbol}}(\lambda) \right] = \tilde{A}_{C_1, \dots, C_m}(\lambda) \tilde{\Psi}(\lambda)
\end{array}
\right.
\qquad (C-4)
$$

are compatible. All these matrices are trans-series of the form

$$
\tilde{L}(\lambda) = \sum_{p \ge 0} \hbar^p L^{(p)}(\lambda, \hbar), \quad \tilde{L}^{\text{symbol}}(\lambda) = \sum_{p \ge 0} \hbar^p L^{(p), \text{symbol}}(\lambda, \hbar) \quad (C-5)
$$
and

$$ \tilde{A}_{C_1, \dots, C_m}(\lambda) = \sum_{p \ge 0} \hbar^p \tilde{A}_{C_1, \dots, C_m}^{(p)}(\lambda, \hbar), \qquad \tilde{A}_{C_1, \dots, C_m}^{\text{symbol}}(\lambda) = \sum_{p \ge 0} \hbar^p \tilde{A}_{C_1, \dots, C_m}^{(p), \text{symbol}}(\lambda, \hbar). \qquad (C-6) $$

The proof is done by induction on $h \ge 0$ regarding the following proposition.

$$ \mathcal{P}_h: \quad \text{``} \forall m \ge 1, \forall P \in \mathcal{P}, \forall (p_1, \dots, p_m) \in (x^{-1}(P))^m, \forall (k_1, \dots, k_m) \in (\mathbb{N}^*)^m : \quad \tilde{A}_{C_{p_1,k_1}, \dots, C_{p_m,k_m}}^{(h)}(\lambda) = O(1), \text{ when } \lambda \to u \text{ for all } u \in x(\mathcal{R}). \text{''} \qquad (C-7) $$

For every $h \ge 0$, we thus assume by induction that for all $a \in [0, h-1]$, $\mathcal{P}_a$ is satisfied. Note that this assumption is empty for the initialization case $h=0$. We now want to prove that $\mathcal{P}_h$ holds.

First of all, by the definition (6-81) of $\tilde{L}(\lambda, \hbar)$, the possible poles of $L^{(a)}(\lambda)$ at $\lambda = u$ come from the poles of some $\tilde{A}_{P,K,l}^{(m)}$ with $m < a$. Hence, the previous assumption implies that

$$ \forall a \in [0, h], L^{(a)}(\lambda) = O(1), \text{ when } \lambda \to u, \text{ for all } u \in x(\mathcal{R}). \qquad (C-8) $$

Hence proving $\mathcal{P}_h$ for any $h \in \mathbb{N}$ proves the theorem.

For proving $\mathcal{P}_h$, we shall begin by proving it for $m \ge 2$ by using an induction formula for $\tilde{A}_{C_{p_1,k_1}, \dots, C_{p_m,k_m}}^{(h)}(\lambda)$.

We then prove it for $m=1$ by using the compatibility of the system (C-3).

## C.2 Proof of $\mathcal{P}_h$ for $m \ge 2$

One can compute the matrices $\tilde{A}_{C_1, \dots, C_m}(\lambda)$ by induction on $m$ through the formula

$$ \forall m \ge 2, \quad \tilde{A}_{C_1, \dots, C_m}^{\text{symbol}}(\lambda) = \hbar^2 \mathcal{I}_{C_m} \tilde{A}_{C_1, \dots, C_{m-1}}^{\text{symbol}}(\lambda) + \hbar \tilde{A}_{C_1, \dots, C_{m-1}}^{\text{symbol}}(\lambda) \tilde{A}_{C_m}^{\text{symbol}}(\lambda). \qquad (C-9) $$

After evaluation, this reads

$$ \forall m \ge 2, \quad \tilde{A}_{C_1, \dots, C_m}(\lambda) = \hbar^2 \text{ev.} \mathcal{I}_{C_m} \tilde{A}_{C_1, \dots, C_{m-1}}^{\text{symbol}}(\lambda) + \hbar \tilde{A}_{C_1, \dots, C_{m-1}}(\lambda) \tilde{A}_{C_m}(\lambda). \qquad (C-10) $$

To order $h$ in the $\hbar$ expansion as trans-series, the RHS involves only terms of the form $\tilde{A}_{C_1, \dots, C_n}^{(a)}$ with $a<h$ which do not have any pole as $\lambda \to u \in \mathbb{R}$ thanks to the induction property $\mathcal{P}_a, a \le h-1$. Hence it is regular and one has

$$ \forall m \ge 2, \quad \tilde{A}_{C_1, \dots, C_m}^{(h)}(\lambda) = O(1) \qquad (C-11) $$

when $\lambda \to u$.

## C.3 Preparation of the proof of $\mathcal{P}_h$ for $m=1$

In this section, we collect a few properties which will prove to be useful for the proof in the case $m=1$.
### C.3.1 Leading order of the Lax matrix $\tilde{L}(\lambda)$

One of the main ingredients of our proof is the form of the leading order $L^{(0)}(\lambda)$ of the Lax matrix $\tilde{L}(\lambda)$.

For $\lambda \notin x(\mathcal{R}) \cup \mathcal{P}$, since $L^{(0)}(\lambda)$ is a companion matrix with distinct eigenvalues,

$$L^{(0)}(\lambda) = \begin{bmatrix} 0 & 1 & 0 & \dots & 0 \\ 0 & 0 & 1 & \dots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \dots & 1 \\ (-1)^{d-1} P_d(\lambda) & (-1)^{d-2} P_{d-1}(\lambda) & (-1)^{d-3} P_{d-2}(\lambda) & \dots & P_1(\lambda) \end{bmatrix}. \quad (C-12)$$

It is diagonalized by a Vandermonde matrix $V(\lambda)$,

$$V^{-1}(\lambda)L^{(0)}(\lambda)V(\lambda) = Y(\lambda), \quad (C-13)$$

where

$$Y(\lambda) = \operatorname{diag}(y_1(\lambda), y_2(\lambda), \dots, y_d(\lambda)), \quad (C-14)$$

with $y_i(\lambda)$ being the value of $y(z^{(i)}(\lambda))$, with $\{z^{(i)}(\lambda)\}_{i=1}^d = x^{-1}(\lambda)$ chosen such that

$$y_1(u) = y_2(u) \quad (C-15)$$

and $V(\lambda)$ is the Vandermonde matrix with entries $[V(\lambda)]_{k,l} = y_l(\lambda)^{k-1}$, for all $(k,l) \in [1, d]^2$.

**Remark C.1.** Since the spectral curve is admissible, we have that $\forall (k,l) \in [3, d]^2: y_k(u) \neq y_l(u)$ and $y_k(u) \neq y_l(u)$. Moreover, $y'_2(u) = -y'_1(u)$, with $y'_1(u) \neq y'_2(u)$. In particular, we also have $y'_1(u) \neq 0$ and $y'_2(u) \neq 0$.

### C.3.2 Action of $\mathcal{I}_C$ on trans-series

Let us remind the reader how our linear operators act on the trans-series considered. From (6-50), which we recall here for convenience,

$$\begin{aligned} \hbar \mathcal{I}_C \left[ \sum_{m=1}^{\infty} \hbar^m \Xi_m^{(\infty_\alpha)}(z, \hbar, \epsilon, \rho) \right] = & \sum_{m=1}^{\infty} \hbar^{m+1} \mathcal{I}_C \cdot \Xi_m^{(\infty_\alpha)}(z, \hbar, \epsilon, \rho) \Big|_{\phi \text{ fixed}} \\ & + \sum_{j=1}^{g} \mathcal{I}_C[\phi_j] \sum_{m=1}^{\infty} \hbar^m \frac{\partial \Xi_m^{(\infty_\alpha)}(z, \hbar, \epsilon, \rho)}{\partial \phi_j} \Bigg|_{\phi_j = \frac{1}{2\pi i} \oint_{\partial B_j} \omega_{0,1}}, \quad (C-16) \end{aligned}$$

$\hbar \mathcal{I}_C$ raises the $\hbar$ order by one except when acting on the $(\phi_i)_{i=1}^g$ dependence of our trans-series. In particular, when acting on the Vandermonde matrix $V(\lambda)$, its inverse or the rational functions $\xi_P(\lambda)$, $\hbar \mathcal{I}_C$ raises the order of $\hbar$ by one.

### C.3.3 Relation between the Lax and auxiliary matrices

Let $k \in \mathbb{N}$ and $P \in \mathcal{P}$. The entries of $\tilde{\Delta}_{P,k}(\lambda)$ defined from (6-80) and (6-82) are expressed in terms of the entries of the auxiliary matrices $\hat{A}_{P,k,l}(\lambda)$. For later use, let us remind it here. From the definition, one has

$$\tilde{\Delta}_{P,k}(\lambda) = -\hbar(G(\lambda))^{-1} \frac{\partial G(\lambda)}{\partial \lambda} + (G(\lambda))^{-1} \hat{\Delta}_{P,k}(\lambda) G(\lambda), \quad (C-17)$$
$$[\hat{\Delta}_{P,k}(\lambda)]_{r,s} = [\hat{A}_{P,k,r-1}]_{1,s}, \qquad (C-18)$$

and

$$\tilde{A}_{P,k,l}(\lambda, \hbar) := (G(\lambda))^{-1} \operatorname{ev.} \left( \left[ G^{\operatorname{symbol}}(\lambda), \hbar^{-1} \mathcal{L}_{P,k,l} \right] \tilde{\Psi}^{\operatorname{symbol}}(\lambda, \hbar) \right) \tilde{\Psi}(\lambda, \hbar)^{-1} \\ + (G(\lambda))^{-1} \hat{A}_{P,k,l}(\lambda, \hbar) G(\lambda). \qquad (C-19)$$

One can combine these two equations in order to get an expression of $\tilde{\Delta}_{P,k}(\lambda)$ in terms of the $\tilde{A}_{P',k',l'}$. At the end of the proof, we shall use only the leading order expansion of this equation around the branch points.

### C.4 Proof of $\mathcal{P}_h$ for $m = 1$

In order to prove that $\mathcal{P}_h$ is true for $m = 1$, let us consider an arbitrary generalized cycle $C := C_{p,k}$ for $p \in x^{-1}(\mathcal{P})$ and $k \ge 1$. We shall prove that $\tilde{A}_C^{(h)}(\lambda) = O(1)$ as $\lambda \to u \in \mathcal{R}$.

The compatibility of the system (C-3) reads

$$\hbar \frac{\partial \tilde{A}_C^{\text{symbol}}(\lambda)}{\partial \lambda} = \hbar \mathcal{I}_C \tilde{L}^{\text{symbol}}(\lambda) + [\tilde{L}^{\text{symbol}}(\lambda), \tilde{A}_C^{\text{symbol}}(\lambda)]. \qquad (C-20)$$

Let us now consider a given $u \in x(\mathcal{R})$ for the rest of the proof. We shall denote $s_C \in \mathbb{N}$ the order of the pole of $\tilde{A}_C^{(h)}(\lambda)$ at $\lambda \to u$. Note that we may have $s_C = 0$ if $\tilde{A}_C^{(h)}(\lambda)$ is regular at $\lambda \to u$. We then define $s = \max_{(p,k) \in x^{-1}(\mathcal{P}) \times \mathbb{N}^*} (s_{C_{p,k}})$. If $s = 0$, then $\mathcal{P}_h$ holds. Let us thus assume by reductio ad absurdum that $s > 0$ and consider $\mathcal{T} = \{(p,k) \in x^{-1}(\mathcal{P}) \times \mathbb{N}^* \text{ such that } s_{C_{p,k}} = s\}$ the subset of indices for which the poles are of maximum order. By assumption $\mathcal{T} \ne \emptyset$.

For any $C_0 = C_{p,k}$ with $(p,k) \in \mathcal{T}$, the expansion of $\tilde{A}_{C_0}^{(h)}(\lambda)$ around $\lambda = u$ reads

$$\tilde{A}_{C_0}^{(h)}(\lambda) = \frac{a_{C_0}}{(\lambda - u)^s} + \frac{b_{C_0}}{(\lambda - u)^{s-1}} + O((\lambda - u)^{-s+2}), \quad \text{with } a_{C_0} \neq 0, \qquad (C-21)$$

for some $d \times d$ matrices $a_{C_0}$ and $b_{C_0}$.

At order $\hbar^h$ and $\hbar^{h+1}$, the compatibility condition takes the form, for any $C_0 \in \mathcal{T}$,

$$\left\{ \begin{array}{l} [\tilde{A}_{C_0}^{(h)}(\lambda), L^{(0)}(\lambda)] = - \sum_{0 \le m \le h-1} [\tilde{A}_{C_0}^{(m)}(\lambda), L^{(h-m)}(\lambda)] + \frac{\partial \tilde{A}_{C_0}^{(h-1)}(\lambda)}{\partial \lambda} - (\hbar \operatorname{ev.} \mathcal{I}_{C_0} \tilde{L}^{\operatorname{symbol}}(\lambda))^{(h)}, \\ \\ \sum_{0 \le m \le h+1} [\tilde{A}_{C_0}^{(m)}(\lambda), L^{(h-m+1)}(\lambda)] = \frac{\partial \tilde{A}_{C_0}^{(h)}}{\partial \lambda} - (\hbar \operatorname{ev.} \mathcal{I}_{C_0} \tilde{L}^{\operatorname{symbol}}(\lambda))^{(h+1)}, \end{array} \right. \qquad (C-22)$$

where we remind the reader that the notation $(F(\lambda))^{(p)}$ means extracting the coefficient of order $\hbar^p$ in the trans-series $F(\lambda)$.

#### C.4.1 Expansion of the Vandermonde matrix and its inverse when $\lambda \to u$

The expansions of the Vandermonde matrix $V(\lambda)$ and its inverse $V^{-1}(\lambda)$ at $\lambda \to u$ read

$$\begin{align} V(\lambda) &= V_0 + V_1(\lambda - u)^{\frac{1}{2}} + V_2(\lambda - u) + O((\lambda - u)^{\frac{3}{2}}), \notag \\ V^{-1}(\lambda) &= \frac{B_0}{(\lambda - u)^{\frac{1}{2}}} + B_1 + B_2(\lambda - u)^{\frac{1}{2}} + O((\lambda - u)). \tag{C-23} \end{align}$$
It is straightforward computations from the identity $V^{-1}(\lambda)V(\lambda) = I_d$ around $\lambda = u$ (providing $B_0V_0 = 0$, $B_1V_0 + B_0V_1 = I_d$, $B_2V_0 + B_1V_1 + B_0V_2 = 0$ and $B_3V_0 + B_2V_1 + B_1V_2 + B_0V_3 = 0$ and so on) and our knowledge of $V(\lambda)$ to show that the matrices $(B_k)_{k \ge 0}$ are given by

$$ M(B_k)^t = F_k \Leftrightarrow B_k = (F_k)^t (M^{-1})^t, \forall k \ge 0, \qquad (C-24) $$

where the matrix $M$ does not depend on $k$ and is given by

$$ M := \begin{pmatrix} 1 & y_2(u) & \cdots & y_2(u)^{d-1} \\ 1 & y_3(u) & \cdots & y_3(u)^{d-1} \\ \vdots & \vdots & & \vdots \\ 1 & y_d(u) & \cdots & y_d(u)^{d-1} \\ 0 & (y'_1(u) - y'_2(u)) & \cdots & (y'_1(u) - y'_2(u))(d-1)y_2(u)^{d-2} \end{pmatrix}, \qquad (C-25) $$

while matrices $(F_k)_{k \ge 0}$ are given by

$$ F_0 = \begin{pmatrix} 0 & 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & & \vdots \\ 0 & 0 & 0 & \cdots & 0 \\ 1 & -1 & 0 & \cdots & 0 \end{pmatrix}, \qquad (C-26) $$

$$ \forall (i,j) \in [1,d]^2, (F_1)_{i,j} = \begin{cases} \delta_{i+1,j} - (B_0V_1)_{j,i+1}, & \text{if } i \le d-1, \\ (B_0V_2)_{j,2} - (B_0V_2)_{j,1}, & \text{if } i=d, \end{cases} \qquad (C-27) $$

and for all $k \ge 2$,

$$ \forall (i,j) \in [1,d]^2, (F_k)_{i,j} = \begin{cases} -\sum_{m=0}^{k-1} (B_m V_{k-m})_{j,i+1}, & \text{if } i \le d-1, \\ \left(\sum_{m=0}^{k-1} B_m V_{k+1-m}\right)_{j,2} - \left(\sum_{m=0}^{k-1} B_m V_{k+1-m}\right)_{j,1}, & \text{if } i=d. \end{cases} \qquad (C-28) $$

Note that $M$ is invertible since its determinant is

$$ \det M = (-1)^d (y'_1(u) - y'_2(u)) \left( \prod_{j=3}^{d} (y_2(u) - y_j(u))^2 \right) \prod_{3 \le i < j \le d} (y_i(u) - y_j(u)), \qquad (C-29) $$

which is non-vanishing due to Remark C.1.

Remark also that $B_0$ and $V_0$ have a peculiar form and read

$$ \begin{align} B_0 &= \begin{pmatrix} (B_0)_{1,1} & \cdots & (B_0)_{1,d} \\ -(B_0)_{1,1} & \cdots & -(B_0)_{1,d} \\ 0 & \cdots & 0 \\ \vdots & & \vdots \\ 0 & \cdots & 0 \end{pmatrix}, \notag \\ V_0 &= \begin{pmatrix} 1 & 1 & 1 & \cdots & 1 \\ y_2(u) & y_2(u) & y_3(u) & \cdots & y_d(u) \\ \vdots & \vdots & \vdots & & \vdots \\ y_2(u)^{d-1} & y_2(u)^{d-1} & y_3(u)^{d-1} & \cdots & y_d(u)^{d-1} \end{pmatrix}. \tag{C-30} \end{align} $$

In particular, we get that, for any $d \times d$ matrix $K$, we always have

$$ \begin{align} 0 &= (B_0KV_0)_{i,j}, \quad \forall i \ge 3 \text{ and } j \ge 1, \notag \\ 0 &= (B_0KV_0)_{1,j} + (B_0KV_0)_{2,j}, \quad \forall j \ge 1, \notag \\ 0 &= (B_0KV_0)_{i,1} - (B_0KV_0)_{i,2}, \quad \forall i \ge 1. \tag{C-31} \end{align} $$
### C.4.2 Expansion of the compatibility conditions

For any $C_0 = C_{p,k}$ with $(p, k) \in \mathcal{T}$, let us now write down the expansion of the compatibility conditions around $\lambda = u$. Remark that, by the induction hypothesis, the RHS of (C-22) behave at worst as $(\lambda - u)^{-s}$ while the LHS behaves as $(\lambda - u)^{-s-1}$. Hence, after conjugation for diagonalizing the leading order of $\tilde{L}(\lambda)$, the coefficients of $(\lambda - u)^{-s-1/2}$, $(\lambda - u)^{-s}$ and $(\lambda - u)^{-s+1/2}$ of the first line of (C-22) respectively read, for any $(k, l) \in [1, d]^2$,

$$ \left\{ \begin{array}{l} [B_0 a_{C_0} V_0]_{k,l} (y_k(u) - y_l(u)) = 0, \\ [B_0 a_{C_0} V_0]_{k,l} [y'_k(u) - y'_l(u)] + [B_0 a_{C_0} V_1 + B_1 a_{C_0} V_0]_{k,l} (y_k(u) - y_l(u)) = 0, \\ [B_0 a_{C_0} V_0]_{k,l} \frac{y''_k(u) - y''_l(u)}{2} + [B_0 a_{C_0} V_1 + B_1 a_{C_0} V_0]_{k,l} (y'_k(u) - y'_l(u)) + \\ \qquad + [B_0 a_{C_0} V_2 + B_1 a_{C_0} V_1 + B_2 a_{C_0} V_0 + B_0 b_{C_0} V_0]_{k,l} (y_k(u) - y_l(u)) = [B_0 R_{C_0} V_0]_{k,l} \delta_{s,1}, \end{array} \right. \qquad (C-32) $$

where

$$ R_{C_0} := \lim_{\lambda \to u} (\lambda - u)^{\frac{1}{2}} \left[ \sum_{0 \le m \le h-1} \left[ -\tilde{A}_{C_0}^{(h)}(\lambda), L^{(h-m)}(\lambda) \right] + \frac{\partial \tilde{A}_{C_0}^{(h-1)}(\lambda)}{\partial \lambda} - \left( \hbar \text{ev.} \mathcal{I}_{C_0} \tilde{L}^{\text{symbol}}(\lambda) \right)^{(h)} \right]. \qquad (C-33) $$

Remark that the RHS of the last line of (C-32) is vanishing except if we have a simple pole (i.e. if $s = 1$) since we have proved that the induction hypothesis implies that $L^{(h)}(\lambda) = O(1)$ as $\lambda \to u$.

Let us now write the second line of (C-22) as

$$ \frac{\partial \tilde{A}_{C_0}^{(h)}(\lambda)}{\partial \lambda} = \left( \hbar \text{ev.} \mathcal{I}_{C_0} \tilde{L}^{\text{symbol}}(\lambda) \right)^{(h+1)} + \sum_{0 \le m \le h-1} \left[ \tilde{A}_{C_0}^{(m)}(\lambda), L^{(h-m+1)}(\lambda) \right] \\ + [\tilde{A}_{C_0}^{(h)}(\lambda), L^{(1)}(\lambda)] + [\tilde{A}_{C_0}^{(h+1)}(\lambda), L^{(0)}(\lambda)]. \qquad (C-34) $$

After conjugation with the Vandermonde matrix, $L^{(0)}(\lambda)$ is diagonalized and the commutator involving $\tilde{A}_{C_0}^{(h+1)}$ has a vanishing diagonal. The LHS behaves as $(\lambda - u)^{-s-3/2}$, while the RHS behaves at most as $(\lambda - u)^{-s-1/2}$ on the diagonal. Thus, on the diagonal, the expansion around $\lambda = u$ reads, for any $k \in [1, d]$,

$$ \left\{ \begin{array}{l} [B_0 a_{C_0} V_0]_{k,k} = 0, \\ [B_0 a_{C_0} V_1 + B_1 a_{C_0} V_0]_{k,k} = 0, \\ -s [B_0 a_{C_0} V_2 + B_2 a_{C_0} V_0 + B_1 a_{C_0} V_1]_{k,k} - (s-1) [B_0 b_{C_0} V_0]_{k,k} = [B_0 K_{C_0} V_0]_{k,k}, \end{array} \right. \qquad (C-35) $$

where

$$ K_{C_0} = \lim_{\lambda \to u} (\lambda - u)^s \left( \left( \hbar \text{ev.} \mathcal{I}_{C_0} \tilde{L}^{\text{symbol}}(\lambda) \right)^{(h+1)} + [\tilde{A}_{C_0}^{(h)}(\lambda), L^{(1)}(\lambda)] \right). \qquad (C-36) $$

We shall come back to a more precise expression for this quantity later in the proof.

### C.4.3 Computation of $a_{C_0}$ in terms of its $(1, d)$ entry

Let $C_0 = C_{p,k}$ with $(p, k) \in \mathcal{T}$. The first line of (C-32), together with the first line of (C-35), implies that $[B_0 a_{C_0} V_0]_{k,l}$ is vanishing for any $(k, l) \notin \{(1, 2), (2, 1)\}$. The evaluation of the second line of (C-32) for $(k, l) \in \{(1, 2), (2, 1)\}$ implies that $[B_0 a_{C_0} V_0]_{1,2} = [B_0 a_{C_0} V_0]_{2,1} = 0$. One thus has

$$ B_0 a_{C_0} V_0 = 0. \qquad (C-37) $$
Using the second equation of (C-31), the same considerations applied to the second and third line of (C-32) and the second line of (C-35) lead to

$$B_0 a_{C_0} V_1 + B_1 a_{C_0} V_0 = 0. \qquad (C-38)$$

Equations (C-37) and (C-38) imply the following lemma.

**Lemma C.1.** For any $C_0 = C_{p,k}$ with $(p, k) \in \mathcal{T}$, the matrix $a_{C_0}$ satisfies

$$B_0 a_{C_0} = 0 \quad \text{and} \quad a_{C_0} V_0 = 0. \qquad (C-39)$$

*Proof.* Let us recall the non-overdetermined linear system determining $B_0$ in terms of $V_0$ and $V_1$. It reads

$$\left\{ \begin{array}{ll} (B_0 V_0)_{1,l} & = 0, \quad \forall l \ge 1, \\ (B_0 V_0)_{k,l} & = 0, \quad \forall k \ge 3 \text{ and } l \ge 1, \\ (B_0 V_1)_{k,1} - (B_0 V_1)_{k,2} & = \delta_{k,1} - \delta_{k,2}, \quad \forall k \ge 1. \end{array} \right. \qquad (C-40)$$

Equations (C-37) and (C-38) show that the matrix $C := B_0 a_{C_0}$ satisfies the system $CV_0 = 0$ and $(CV_1)_{k,1} - (CV_1)_{k,2} = 0$, for all $k \ge 1$. This corresponds to the same linear system as the one determining $B_0$, except that the RHS is null. Hence, we get that $C = 0(M^{-1})^t = 0$. Therefore, we get $C = 0$, i.e. $B_0 a_{C_0} = 0$.

In the same way, let us define $\tilde{C} := a_{C_0} V_0$. It satisfies from (C-37) and (C-38)

$$B_0 \tilde{C} = 0 \quad \text{and} \quad B_1 \tilde{C} = 0. \qquad (C-41)$$

Let us introduce $\hat{C} = \tilde{C}^t(M^{-1})$. Since $B_0 = F_0^t(M^{-1})^t$ and $B_1 = F_1^t(M^{-1})^t$, we get that the previous equations are equivalent to

$$\hat{C} F_0 = 0 \quad \text{and} \quad \hat{C} F_1 = 0. \qquad (C-42)$$

Since

$$F_0 = \begin{pmatrix} 0 & 0 & 0 & \dots & 0 \\ \vdots & \vdots & \vdots & & \vdots \\ 0 & 0 & 0 & \dots & 0 \\ 1 & -1 & 0 & \dots & 0 \end{pmatrix}, \quad F_1 = \begin{pmatrix} (F_1)_{1,1} & 1 - (F_1)_{1,1} & 0 & \dots & 0 \\ (F_1)_{2,1} & -(F_1)_{2,1} & 1 & 0 & 0 \\ \vdots & \vdots & 0 & \ddots & \vdots \\ 0 & 0 & \vdots & \ddots & 1 \\ (F_1)_{d,1} & -(F_1)_{d,1} & 0 & \dots & 0 \end{pmatrix}, \qquad (C-43)$$

we get that $\hat{C}F_1 = 0$ implies that, for all $(i, j) \in [1, d] \times [1, d-1]$, $\hat{C}_{i,j} = 0$. Indeed,

$$\begin{align} \forall i \in [1, d], j \in [3, d] : 0 &= (\hat{C}F_1)_{i,j} = \sum_{k=1}^{d} \hat{C}_{i,k} (F_1)_{k,j} = \hat{C}_{i,j-1}, \nonumber \\ \forall i \in [1, d] : 0 &= (\hat{C}F_1)_{i,1} + (\hat{C}F_1)_{i,2} = \sum_{k=1}^{d} \hat{C}_{i,k} ((F_1)_{k,1} + (F_1)_{k,2}) = \hat{C}_{i,1}. \tag{C-44} \end{align}$$

Eventually, $\hat{C}F_0 = 0$ leads to

$$\forall i \in [1, d] : 0 = (\hat{C}F_0)_{i,1} = \sum_{k=1}^{d} \hat{C}_{i,k} (F_0)_{k,1} = \hat{C}_{i,d}, \qquad (C-45)$$

so that $\hat{C} = 0$, i.e. $a_{C_0} V_0 = 0$. $\square$
Lemma C.1 gives us the first two equations for $a_{C_0}$. The coefficient of $(\lambda - u)^{-s+1}$ of the first line of (C-22) (which would be the fourth line of (C-32), but we did not write it down), together with the last equation of (C-31), gives the third equation for $a_{C_0}$.

$$ \left\{ \begin{array}{lcl} B_0 a_{C_0} & = & 0, \\ a_{C_0} V_0 & = & 0, \\ (B_1 a_{C_0} V_1)_{i,1} - (B_1 a_{C_0} V_1)_{i,2} & = & 0, \quad \forall i \ge 3. \end{array} \right. \qquad (C-46) $$

We define $\tilde{a}_{C_0} := (a_{C_0})^t M^{-1}$ (i.e. $a_{C_0} = M^t(\tilde{a}_{C_0})^t$). The last set of equations is equivalent to

$$ \left\{ \begin{array}{lcl} \tilde{a}_{C_0} F_0 & = & 0, \\ (\tilde{a}_{C_0})^t V_0 & = & 0, \\ ((V_1)^t \tilde{a}_{C_0} F_1)_{1,i} - ((V_1)^t \tilde{a}_{C_0} F_1)_{2,i} & = & 0, \quad \forall i \ge 3. \end{array} \right. \qquad (C-47) $$

Since $(F_0)_{i,j} = \delta_{(i,j)=(d,1)} - \delta_{(i,j)=(d,2)}$, equation $\tilde{a}_{C_0} F_0 = 0$ is equivalent to (only entries $(\tilde{a}_{C_0} F_0)_{i,1}$, with $i \ge 1$, are sufficient)

$$ (\tilde{a}_{C_0})_{i,d} = 0, \quad \forall i \in [1, d], \qquad (C-48) $$

i.e. the last column of $\tilde{a}_{C_0}$ is vanishing. For $j \in [1, d]$, let us define the vector $\tilde{a}_{C_0,j} := ((\tilde{a}_{C_0})_{1,j}, \dots, (\tilde{a}_{C_0})_{d,j})^t$ corresponding to the $j$th column of $\tilde{a}_{C_0}$. For $j, k \ge 2$, equations $((\tilde{a}_{C_0})^t V_0)_{j,k} = 0$ and $((V_1)^t \tilde{a}_{C_0} F_1)_{1,j+1} - ((V_1)^t \tilde{a}_{C_0} F_1)_{2,j+1} = 0$ are equivalent to

$$ \left\{ \begin{array}{l} 0 = \sum_{r=1}^{d} y_k(u)^{r-1} (\tilde{a}_{C_0,j})_r, \quad \forall j, k \in [2, d], \\ 0 = (y'_1(u) - y'_2(u)) \sum_{r=2}^{d} (r-1)y_2^{r-2}(u) (\tilde{a}_{C_0,j})_r, \quad \forall j \in [2, d]. \end{array} \right. \qquad (C-49) $$

These equations are equivalent to saying that, for all $j \ge 2$, $M \tilde{a}_{C_0,j} = 0$, i.e. $\tilde{a}_{C_0,j} = 0$, since $M$ is invertible. Note that in order to obtain the last equation of (C-49), we have used $(F_1)_{s,j+1} = \delta_{s,j}$ for $j \ge 2$ and $s \le d-1$, and the fact that $(\tilde{a}_{C_0})_{r,d} = 0$, for all $r \ge 1$, so that $(F_1)_{d,j+1}$ does not contribute.

In terms of the initial matrix $a_{C_0} = M^t(\tilde{a}_{C_0})^t$, this is equivalent to saying that, for all $(k,l) \in [1, d]^2$,

$$ (a_{C_0})_{k,l} = \sum_{n=1}^{d} M_{n,k}(\tilde{a}_{C_0})_{l,n} = M_{1,k}(\tilde{a}_{C_0})_{l,1} = y_2(u)^{k-1}(\tilde{a}_{C_0})_{l,1}. \qquad (C-50) $$

In other words, it means that the $l$th column of $a_{C_0}$ is $(\tilde{a}_{C_0})_{l,1} (1, y_2(u), \dots, y_2(u)^{d-1})^t$.

So far, only the first column of $\tilde{a}_{C_0}$ remains. Using $((\tilde{a}_{C_0})^t V_0)_{1,k} = 0$ for all $k \ge 2$, we get that

$$ \left( \begin{array}{c} 1 \quad y_2(u) \quad \dots \quad y_2(u)^{d-1} \\ \vdots \quad \vdots \quad \dots \quad \vdots \\ 1 \quad y_d(u) \quad \dots \quad y_d(u)^{d-1} \end{array} \right) \left( \begin{array}{c} (\tilde{a}_{C_0})_{1,1} \\ \vdots \\ (\tilde{a}_{C_0})_{d,1} \end{array} \right) = 0. \qquad (C-51) $$

We may eventually use (C-51) to get the following proposition.
**Proposition C.1** (Expression of $a_{C_0}$ in terms of its $(1, d)$ entry). For any $C_0 := C_{p,k}$ with $(p, k) \in \mathcal{T}$, the matrix $a_{C_0}$ is equal to

$$ (a_{C_0})_{1,d} = \begin{pmatrix} (-1)^{d-1} E_{d-1}(y_2(u), \dots, y_d(u)) & \cdots & -E_1(y_2(u), \dots, y_d(u)) & 1 \\ y_2(u)(-1)^{d-1} E_{d-1}(y_2(u), \dots, y_d(u)) & \cdots & -y_2(u)E_1(y_2(u), \dots, y_d(u)) & y_2(u) \\ \vdots & & \vdots & \vdots \\ y_2(u)^{d-1}(-1)^{d-1} E_{d-1}(y_2(u), \dots, y_d(u)) & \cdots & -y_2(u)^{d-1}E_1(y_2(u), \dots, y_d(u)) & y_2(u)^{d-1} \end{pmatrix}, $$

where $\forall j \in [1, d] : E_j(\lambda_2, \dots, \lambda_d) = \sum_{2 \le i_1 < \dots < i_j \le d} \lambda_{i_1} \dots \lambda_{i_j}$. (In particular, $E_1(\lambda_2, \dots, \lambda_d) = \lambda_2 + \dots + \lambda_d$ and $E_{d-1}(\lambda_2, \dots, \lambda_d) = \lambda_2 \dots \lambda_d$).

Note that Proposition C.1 implies that, for any $C_0 := C_{p,k}$ with $(p, k) \in \mathcal{T}$,

$$ [a_{C_0}, L^{(0)}(\lambda)] = 0 \qquad (C-52) $$

and that we only need one remaining independent equation to get the complete expression of $a_{C_0}$. Moreover, we have, for all $(k, l) \in [1, d]^2$,

$$ \begin{aligned} [B_1 a_{C_0} V_1]_{k,l} &= ((F_1)^t (M^{-1})^t a_{C_0} V_1)_{k,l} = ((F_1)^t (\tilde{a}_{C_0})^t V_1)_{k,l} \\ &= \sum_{1 \le m,n \le d} (F_1)_{m,k} (\tilde{a}_{C_0})_{n,m} (V_1)_{n,l} \\ &= \sum_{n=1}^{d} (F_1)_{1,k} (\tilde{a}_{C_0})_{n,1} (V_1)_{n,l} \\ &= \left( -\frac{y_2'(u)}{y_1'(u) - y_2'(u)} \delta_{k,1} + \frac{y_1'(u)}{y_1'(u) - y_2'(u)} \delta_{k,2} \right) \left( \sum_{n=1}^{d} (\tilde{a}_{C_0})_{n,1} (V_1)_{n,l} \right) \\ &= \left( -\frac{y_2'(u)}{y_1'(u) - y_2'(u)} \delta_{k,1} + \frac{y_1'(u)}{y_1'(u) - y_2'(u)} \delta_{k,2} \right) \left( \sum_{n=2}^{d} (n-1)y_1'(u) y_l(u)^{n-2} (\tilde{a}_{C_0})_{n,1} \right). \end{aligned} \qquad (C-53) $$

### C.4.4 Proving that $(a_{C_0})_{1,d} = 0$.

Let us finally prove that the last remaining unknown coefficient of $a_{C_0}$ is vanishing for any $C_0 \in \mathcal{T}$. For this purpose, we shall consider two different cases depending on the degree $s$ of the pole at $\lambda \to u$ of $\tilde{A}_{C_0}^{(h)}(\lambda)$.

#### Higher order pole: $s \ge 2$

If $s \ge 2$, the RHS of the last line of (C-32), as well as the RHS of the following order in the expansion around $\lambda = u$, vanish. This allows to conclude that,

$$ \forall k \in [2, d], \forall l \in [1, d] : [B_1 a_{C_0} V_1 + B_0 b_{C_0} V_0]_{k,l} = 0. \qquad (C-54) $$

Using the last line of (C-31) and subtracting cases $l = 1$ and $l = 2$ in the previous equation we get that

$$ \forall k \in [2, d] : [B_1 a_{C_0} V_1]_{k,1} - [B_1 a_{C_0} V_1]_{k,2} = 0. \qquad (C-55) $$

In particular for $k = 2$, we end up with

$$ [B_1 a_{C_0} V_1]_{2,1} - [B_1 a_{C_0} V_1]_{2,2} = 0, \qquad (C-56) $$
which, using (C-53), and the fact that $y_1(u) = y_2(u)$ implies

$$ y_1'(u) \left( \sum_{n=2}^{d} (n-1) y_2(u)^{n-2} (\tilde{a}_{C_0})_{n,1} \right) = 0. \qquad (C-57) $$

Together with (C-51), we get the linear system

$$ \begin{pmatrix} 1 & y_2(u) & y_2(u)^2 & \dots & y_2(u)^{d-1} \\ \vdots & \vdots & \vdots & \dots & \vdots \\ 1 & y_d(u) & y_d(u)^2 & \dots & y_d(u)^{d-1} \\ 0 & y_1'(u) & 2y_1'(u)y_2(u) & \dots & (d-1)y_1'(u)y_2(u)^{d-2} \end{pmatrix} \begin{pmatrix} (\tilde{a}_{C_0})_{1,1} \\ \vdots \\ \vdots \\ (\tilde{a}_{C_0})_{d,1} \end{pmatrix} = 0, \qquad (C-58) $$

whose determinant is similar to the one of $M$ and reads

$$ (-1)^{d-1} y_1'(u) \left( \prod_{j=3}^{d} (y_2(u) - y_j(u))^2 \right) \prod_{3 \le i < j \le d} (y_i(u) - y_j(u)). \qquad (C-59) $$

From Remark C.1, this determinant is not vanishing so that the linear system has a unique trivial solution

$$ \forall k \in [1, d] : (\tilde{a}_{C_0})_{k,1} = 0. \qquad (C-60) $$

Thus, from Proposition C.1, we end up with $\tilde{a}_{C_0} = 0$, i.e. $a_{C_0} = 0$ for all $C_0 = C_{p,k}$ with $(p, k) \in \mathcal{T}$, which is a contradiction with (C-21).

### Simple pole $s=1$

The derivation of the same result of $s=1$ requires to be more precise since the RHS of the last line of (C-32) does not vanish.

The last line of (C-35) reads

$$ -[B_1 a_{C_0} V_1]_{k,k} = [B_0 K_{C_0} V_0]_{k,k}, \quad \forall k \in [1, d]. \qquad (C-61) $$

Let us now prove that the RHS is vanishing using our knowledge on $K_{C_0}$. We remind the reader of its definition from (C-36):

$$ K_{C_0} = \lim_{\lambda \to u} (\lambda - u) \left[ (\hbar \text{ev.} \mathcal{I}_{C_0} \tilde{L}^{\text{symbol}}(\lambda))^{(h+1)} + [\tilde{A}_{C_0}^{(h)}(\lambda), L^{(1)}(\lambda)] \right]. \qquad (C-62) $$

Since, for any $C_0$, $B_0 a_{C_0} = a_{C_0} V_0 = 0$, the commutator $[\tilde{A}_{C_0}^{(h)}, L^{(1)}]$ satisfies

$$ V^{-1}(\lambda) [\tilde{A}_{C_0}^{(h)}, L^{(1)}] V(\lambda) = \frac{B_0 a_{C_0} R_1 V_0 - B_0 R_1 a_{C_0} V_0}{(\lambda - u)^{\frac{3}{2}}} + O((\lambda - u)^{-1}) = O((\lambda - u)^{-1}), \quad (C-63) $$

where we have denoted $L^{(1)}(\lambda) \stackrel{\lambda \to u}{=} R_1 + o(1)$.

Thus, for any $C_0 := C_{p,k}$ with $(p,k) \in \mathcal{T}$, $[\tilde{A}_{C_0}^{(h)}, L^{(1)}]$ does not provide any contribution to $K_{C_0}$.

Following the discussion of Section C.3.2, the only contribution from $[\hbar \text{ev.} \mathcal{I}_{C_0} \tilde{L}^{\text{symbol}}(\lambda)]_{l,m}$ at order $\hbar^{h+1}$ in the trans-series expansion is

$$ \sum_{P \in \mathcal{P}} \sum_{K \in \mathbb{N}} \xi_P^{-K}(\lambda) \sum_{j=1}^{g} \text{ev.} \mathcal{I}_{C_0}[\phi_j] \left. \frac{\partial [\tilde{\Delta}_{P,K}^{(h+1)}(\lambda)]_{l,m}}{\partial \phi_j} \right|_{\phi_j = \frac{1}{2\pi i} \oint_{B_j} \omega_{0,1}}. \qquad (C-64) $$
Note that the sum over $K \in \mathbb{N}$ is finite since $\{\tilde{\Delta}_{P,K}(\lambda)\}_{K \ge 0}$ contains only a finite number of non-zero elements.

Using (C-17), the leading order of $[\hbar\text{ev.}\mathcal{I}_{C_0}\tilde{L}^{\text{symbol}}(\lambda)]_{i,m}^{(h+1)}$ in the expansion around $\lambda = u$ reads

$$[\hbar\text{ev.}\mathcal{I}_{C_0}\tilde{L}^{\text{symbol}}(\lambda)]_{i,m}^{(h+1)} = \sum_{P \in \mathcal{P}} \sum_{K \in \mathbb{N}} \xi_P^{-K}(u) \sum_{j=1}^{g} \mathcal{I}_{C_0}^{(0)}[\phi_j] \sum_{r=1}^{d} [G^{-1}(u)]_{i,r} \sum_{l=1}^{d} \frac{[G]_{1,l}}{(\lambda - u)} \frac{\partial [a_{P,K,r-1}]_{l,m}}{\partial \phi_j} \Bigg|_{\phi_j = \frac{1}{2\pi i} \oint_{B_j} \omega_{0,1}} + O(1), \quad (C-65)$$

where $a_{P,k,l}$ is defined as the leading order of $\tilde{A}_{P,K,l}^{(h)}(\lambda)$ when $\lambda \to u$, i.e.

$$\tilde{A}_{P,K,l}^{(h)}(\lambda) = \frac{a_{P,K,l}}{\lambda - u} + O(1), \quad (C-66)$$

as $\lambda \to u$. Since we proved the part of the proposition $\mathcal{P}_h$ corresponding to $m \ge 2$, the matrices $a_{P,K,l}$ are linear combinations of matrices $a_C$ with coefficients independent of $\phi_j$,

$$\forall (P, K, l) \in \mathcal{P} \times \mathbb{N} \times [1, d], \quad a_{P,K,l} = \sum_{(p_0, k_0) \in \mathcal{T}} \alpha_{P,K,l}^{p_0, k_0} a_{C_{p_0, k_0}}, \quad (C-67)$$

where $\alpha_{P,K,l}^{p_0,k_0} \in \mathbb{C}$ is independent of $\phi_j$.

Hence, for any $C_0 := C_{p_0,k_0}$ with $(p_0, k_0) \in \mathcal{T}$ and $k \in [1, d]$, the RHS of equation (C-61) reduces to

$$\begin{aligned} [B_0 K_{C_0} V_0]_{k,k} &= \sum_{P \in \mathcal{P}} \sum_{K \in \mathbb{N}} \xi_P^{-K}(u) \sum_{j=1}^{g} \mathcal{I}_{C_0}^{(0)}[\phi_j] \sum_{r=1}^{d} [B_0 G^{-1}(u)]_{k,r} \\ &\qquad \left. \sum_{l=1}^{d} \frac{[G]_{1,l}}{(\lambda - u)} \frac{\partial [a_{P,K,r-1}]_{l,m} [V_0]_{m,k}}{\partial \phi_j} \right|_{\phi_j = \frac{1}{2\pi i} \oint_{B_j} \omega_{0,1}} \\ &= \sum_{P \in \mathcal{P}} \sum_{K \in \mathbb{N}} \xi_P^{-K}(u) \sum_{j=1}^{g} \mathcal{I}_{C_0}^{(0)}[\phi_j] \sum_{r=1}^{d} [B_0 G^{-1}(u)]_{k,r} \\ &\qquad \left. \sum_{l=1}^{d} \frac{[G]_{1,l}}{(\lambda - u)} \frac{\partial ([a_{P,K,r-1}]_{l,m} y_k(u)^{m-1})}{\partial \phi_j} \right|_{\phi_j = \frac{1}{2\pi i} \oint_{B_j} \omega_{0,1}} . \end{aligned} \quad (C-68)$$

Since $a_{P,K,l}$ is a linear combination of matrices $a_{C_{p_0,k_0}}$ for $(P, K, l) \in \mathcal{P} \times \mathbb{N} \times [1, d]$ the expression of $[a_{P,K,l}]_{1 \le l,m \le d}$ in terms of $[a_{P,K,l}]_{1,d}$ is the same as the expression of $((a_{C_0})_{l,m})_{1 \le l,m \le d}$ in terms of $(a_{C_0})_{1,d}$ given by Proposition C.1 and one has

$$\forall (P, K, r) \in \mathcal{P} \times \mathbb{N} \times [1, d], \forall (m, n) \in [1, d]^2 : \sum_{m=1}^{d} (a_{P,K,r-1})_{l,m} y_k(u)^{m-1} = 0. \quad (C-69)$$

Thus, equation (C-68) simplifies into

$$\forall k \in [1, d] : [B_0 K_{C_0} V_0]_{k,k} = 0, \quad (C-70)$$

implying from (C-61) the following lemma.
**Lemma C.2.** For all $C_0 = C_{p_0, k_0}$ with $(p_0, k_0) \in \mathcal{T}$, the matrix $a_{C_0}$ satisfies

$$ \forall k \in [1, d] : [B_1 a_{C_0} V_1]_{k,k} = 0. \qquad (C-71) $$

Plugging (C-53) into (C-71) and using the fact (see Remark C.1) that $y'_1(u) \neq y'_2(u)$ and $y'_1(u)y'_2(u) \neq 0$, one gets, for $k=2$,

$$ \left( \sum_{n=2}^{d} (n-1)y'_2(u) y_2(u)^{n-2} (\tilde{a}_{C_0})_{n,1} \right) = 0. \qquad (C-72) $$

As in the previous case, together with (C-51), this leads to the linear system

$$ \begin{pmatrix} 1 & y_2(u) & y_2(u)^2 & \dots & y_2(u)^{d-1} \\ \vdots & \vdots & \vdots & & \vdots \\ 1 & y_d(u) & y_d(u)^2 & \dots & y_d(u)^{d-1} \\ 0 & y'_2(u) & 2y'_2(u)y_2(u) & \dots & (d-1)y'_2(u)y_2(u)^{d-2} \end{pmatrix} \begin{pmatrix} (\tilde{a}_{C_0})_{1,1} \\ \vdots \\ \vdots \\ (\tilde{a}_{C_0})_{d,1} \end{pmatrix} = 0, \qquad (C-73) $$

whose determinant reads

$$ (-1)^{d-1} y'_2(u) \left( \prod_{j=3}^{d} (y_2(u) - y_j(u))^2 \right) \prod_{3 \le i < j \le d} (y_i(u) - y_j(u)). \qquad (C-74) $$

From Remark C.1, this determinant is not vanishing so that the linear system has a unique trivial solution

$$ \forall k \in [1, d] : (\tilde{a}_{C_0})_{k,1} = 0. \qquad (C-75) $$

Thus, from Proposition C.1, we end up with $\tilde{a}_{C_0} = 0$, i.e. $a_{C_0} = 0$ for any $C_0 = C_{p_0, k_0}$ with $(p_0, k_0) \in \mathcal{T}$, which is a contradiction with (C-21).

# D Detailed computations for the $G_3$ example

In this appendix, we present the detailed computation of the example presented in Section 8.2.

## D.1 Classical spectral curve

Let us consider a three-sheeted cover of the sphere defined by an equation of the form

$$ y^3 - (P_{\infty,1}^{(1)}\lambda + P_{\infty,0}^{(1)})y^2 + (P_{\infty,2}^{(2)}\lambda^2 + P_{\infty,1}^{(2)}\lambda + P_{\infty,0}^{(2)})y - P_{\infty,3}^{(3)}\lambda^3 - P_{\infty,2}^{(3)}\lambda^2 - P_{\infty,1}^{(3)}\lambda - P_{\infty,0}^{(3)} = 0. \qquad (D-1) $$

where the coefficients $P_{\infty,i}^{(j)}$ are generic in such a way that the curve has genus 1 and that there are three distinct points $(\infty^{(1)}, \infty^{(2)}, \infty^{(3)})$ in the fiber $x^{-1}(\infty)$ above infinity. This corresponds to the case $N=0$ and $r_{\infty(j)} = 3$ for $j=1,2,3$. We recall that the general notations of the article correspond to:

$$ \begin{aligned} P_1(\lambda) &= P_{\infty,1}^{(1)}\lambda + P_{\infty,0}^{(1)}, \\ P_2(\lambda) &= P_{\infty,2}^{(2)}\lambda^2 + P_{\infty,1}^{(2)}\lambda + P_{\infty,0}^{(2)}, \\ P_3(\lambda) &= P_{\infty,3}^{(3)}\lambda^3 + P_{\infty,2}^{(3)}\lambda^2 + P_{\infty,1}^{(3)}\lambda + P_{\infty,0}^{(3)}. \end{aligned} \qquad (D-2) $$
Around the three points $(\infty^{(1)}, \infty^{(2)}, \infty^{(3)})$, the function $y(z)$ admits the expansion

$$ \forall i \in \{1, 2, 3\}, \quad y(z) = -t_{i,2}x(z) - t_{i,1} - t_{i,0}x(z)^{-1} + O(x(z)^{-2}), \quad \text{as } z \to \infty^{(i)}, \quad (D-3) $$

where we used the notation $t_{i,j} := t_{\infty^{(i)},j}$ in order to simplify the reading. These coefficients satisfy

$$ P_{\infty,1}^{(1)} = -\sum_{i=1}^{3} t_{i,2}, \quad P_{\infty,0}^{(1)} = -\sum_{i=1}^{3} t_{i,1}, \quad 0 = \sum_{i=1}^{3} t_{i,0}, \quad (D-4) $$

as well as

$$ \begin{aligned} P_{\infty,2}^{(2)} &= \sum_{1 \le i < j \le 3} t_{i,2}t_{j,2} = t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2} \\ P_{\infty,1}^{(2)} &= \sum_{i=1}^{3} \sum_{j \ne i} t_{i,1}t_{j,2} = t_{1,1}t_{2,2} + t_{1,1}t_{3,2} + t_{2,1}t_{1,2} + t_{2,1}t_{3,2} + t_{3,1}t_{1,2} + t_{3,1}t_{2,2} \\ P_{\infty,0}^{(2)} &= \sum_{i=1}^{3} \sum_{j \ne i} t_{i,0}t_{j,2} + \sum_{1 \le i < j \le 3} t_{i,1}t_{j,1} \\ &= t_{1,0}t_{2,2} + t_{1,0}t_{3,2} + t_{2,0}t_{1,2} + t_{2,0}t_{3,2} + t_{3,0}t_{1,2} + t_{3,0}t_{2,2} + t_{1,1}t_{2,1} + t_{1,1}t_{3,1} + t_{2,1}t_{3,1} \end{aligned} \quad (D-5) $$

$$ \begin{aligned} P_{\infty,3}^{(3)} &= -t_{1,2}t_{2,2}t_{3,2} \\ P_{\infty,2}^{(3)} &= -t_{1,1}t_{2,2}t_{3,2} - t_{1,2}t_{2,1}t_{3,2} - t_{1,2}t_{2,2}t_{3,1} \\ P_{\infty,1}^{(3)} &= - \sum_{k_1+k_2+k_3=4} t_{1,k_1}t_{2,k_2}t_{3,k_3} \\ &= -t_{1,0}t_{2,2}t_{3,2} - t_{1,1}t_{2,1}t_{3,2} - t_{1,1}t_{2,2}t_{3,1} - t_{1,2}t_{2,2}t_{3,0} - t_{1,2}t_{2,1}t_{3,1} - t_{1,2}t_{2,0}t_{3,2} \\ P_{\infty,0}^{(3)} &= - \sum_{k_1+k_2+k_3=3} t_{1,k_1}t_{2,k_2}t_{3,k_3} \\ &= -t_{1,0}t_{2,1}t_{3,2} - t_{1,0}t_{2,2}t_{3,1} - t_{1,1}t_{2,1}t_{3,1} - t_{1,1}t_{2,2}t_{3,0} \\ &\quad - t_{1,1}t_{2,0}t_{3,2} - t_{1,2}t_{2,1}t_{3,0} - t_{1,2}t_{2,0}t_{3,1}. \end{aligned} \quad (D-6) $$

## D.2 KZ equations

Let us now write the KZ equations satisfied by the wave functions. They read

$$ \left\{ \begin{aligned} \hbar \frac{\partial \psi(z)}{\partial x(z)} + \psi_1(z) &= x(z) \mathcal{L}_{\infty,1}^{(0)} \psi(z) + \mathcal{L}_{\infty,0}^{(0)} \psi(z) \\ \hbar \frac{\partial \psi_1(z)}{\partial x(z)} + \psi_2(z) &= x(z)^2 \mathcal{L}_{\infty,2}^{(1)} \psi(z) + x(z) \mathcal{L}_{\infty,1}^{(1)} \psi(z) + \mathcal{L}_{\infty,0}^{(1)} \psi(z) \\ \hbar \frac{\partial \psi_2(z)}{\partial x(z)} &= x(z)^3 \mathcal{L}_{\infty,3}^{(2)} \psi(z) + x(z)^2 \mathcal{L}_{\infty,2}^{(2)} \psi(z) + x(z) \mathcal{L}_{\infty,1}^{(2)} \psi(z) + \mathcal{L}_{\infty,0}^{(2)} \psi(z). \end{aligned} \right. \quad (D-7) $$

Hence, the KZ equations read

$$ \left\{ \begin{aligned} \hbar \frac{\partial \psi(z)}{\partial x(z)} + \psi_1(z) &= P_1(\lambda)\psi(z) \\ \hbar \frac{\partial \psi_1(z)}{\partial x(z)} + \psi_2(z) &= [P_2(\lambda) - \hbar t_{2,2} - \hbar t_{3,2}] \psi(z) \\ \hbar \frac{\partial \psi_2(z)}{\partial x(z)} &= P_3(\lambda)\psi(z) + \hbar \mathcal{L}_{KZ}\psi(z), \end{aligned} \right. \quad (D-8) $$

where

$$ \mathcal{L}_{KZ}(\lambda) := \hbar \left[ t_{1,2}t_{2,2}\mathcal{I}_{\infty^{(3)},2} + t_{1,2}t_{3,2}\mathcal{I}_{\infty^{(2)},2} + t_{3,2}t_{2,2}\mathcal{I}_{\infty^{(1)},2} \right] + \hbar t_{2,2}t_{3,2}\lambda + t_{2,1}t_{3,2} + t_{2,2}t_{3,1}. \quad (D-9) $$
### D.3 Expansion around $\infty$ and apparent singularities

In this example, we consider the divisor $D = [z] - [\infty^{(1)}]$. The perturbative wave functions have the following asymptotics as $\lambda \to \infty$.

$$ \psi^{reg}([z^{(i)}(\lambda)] - [\infty^{(1)}], \hbar) = \begin{cases} \exp[\hbar^{-1}(V_{\infty^{(1)}}(z^{(1)}(\lambda) + O(1)))](C_1 + O(\lambda^{-1})), & \text{if } i = 1, \\ \lambda^{-1} \exp[\hbar^{-1}(V_{\infty^{(i)}}(z^{(i)}(\lambda) + O(1)))](C_i + O(\lambda^{-1})), & \text{if } i \neq 1. \end{cases} \qquad (\text{D-10}) $$

This allows to compute the Wronskian of the system

$$ W(\lambda, \hbar) := \psi_{\text{NP}}(z^{(1)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(2)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(3)}(\lambda))}{\partial \lambda^2} \\ + \psi_{\text{NP}}(z^{(2)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(3)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(1)}(\lambda))}{\partial \lambda^2} \\ + \psi_{\text{NP}}(z^{(3)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(1)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(2)}(\lambda))}{\partial \lambda^2} \\ - \psi_{\text{NP}}(z^{(1)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(3)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(2)}(\lambda))}{\partial \lambda^2} \\ - \psi_{\text{NP}}(z^{(2)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(1)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(3)}(\lambda))}{\partial \lambda^2} \\ - \psi_{\text{NP}}(z^{(3)}(\lambda))\hbar \frac{\partial^2 \psi_{\text{NP}}(z^{(2)}(\lambda))}{\partial \lambda} \hbar^2 \frac{\partial^2 \psi_{\text{NP}}(z^{(1)}(\lambda))}{\partial \lambda^2}, \qquad (\text{D-11}) $$

which takes the form

$$ W(\lambda, \hbar) = \kappa \exp \left( \hbar^{-1} \int_{0}^{\lambda} P_{1}(\lambda) d\lambda \right) (\lambda - q(\hbar)). \qquad (\text{D-12}) $$

### D.4 Quantum curve

Let us now compute the quantum curve of this system. For this purpose, we should compute the entries $[C_{\infty}(\lambda, \hbar)]_{2,i}$ with $i \in \{1, 2, 3\}$, of the matrix

$$ C_{\infty}(\lambda, \hbar) := \frac{1}{\hbar} \begin{bmatrix} \psi_{\text{NP}}(z^{(1)}(\lambda), \hbar) & \psi_{\text{NP}}(z^{(2)}(\lambda), \hbar) & \psi_{\text{NP}}(z^{(3)}(\lambda), \hbar) \\ \text{ev.} \left[ \mathcal{L}_{\text{KZ}} \psi_{\text{NP}}^{\text{symbol}}(z^{(1)}(\lambda), \hbar) \right] & \text{ev.} \left[ \mathcal{L}_{\text{KZ}} \left[ \psi_{\text{NP}}(z^{(2)}(\lambda), \hbar) \right] \right] & \text{ev.} \left[ \mathcal{L}_{\text{KZ}} \psi_{\text{NP}}(z^{(3)}(\lambda), \hbar) \right] \\ \text{ev.} \left[ \mathcal{L}^2 \psi_{\text{NP}}^{\text{symbol}}(z^{(1)}(\lambda), \hbar) \right] & \text{ev.} \left[ \mathcal{L}^2 \psi_{\text{NP}}^{\text{symbol}}(z^{(2)}(\lambda), \hbar) \right] & \text{ev.} \left[ \mathcal{L}^2 \psi_{\text{NP}}^{\text{symbol}}(z^{(3)}(\lambda), \hbar) \right] \end{bmatrix} \cdot (\Psi_{\text{NP}}(\lambda, \hbar))^{-1} \qquad (\text{D-13}) $$

as a rational function of $\lambda$ with poles at $\infty$ and at the zero $q(\hbar)$ of $W(\lambda, \hbar)$. Since it is a rational function in $\lambda$, one only needs its expansion around its poles and it takes the form of $\frac{\text{Pol}(\lambda)}{(\lambda-q)}$ where $\text{Pol}(\lambda)$ is a polynomial which we can compute through the asymptotic expansion of $C_{\infty}(\lambda, \hbar)$ around infinity. To compute these polynomials, we shall use the expression of $(\Psi_{\text{NP}}(\lambda, \hbar))^{-1}$ in terms of the matrix of $\Psi_{\text{NP}}(\lambda, \hbar)$ and its determinant $W(\lambda, \hbar)$.

One obtains expressions of the form

$$ [C_{\infty}(\lambda, \hbar)]_{2,1} = \hbar \left( P_{\infty,2}^{(2)} + t_{2,2} t_{3,2} \right) \lambda - H + \frac{p_1}{\lambda - q}, \qquad (\text{D-14}) $$

$$ [C_{\infty}(\lambda, \hbar)]_{2,2} = \hbar \left( P_{\infty,1}^{(1)} + t_{2,2} + t_{3,2} \right) + \frac{p_2}{\lambda - q} \qquad (\text{D-15}) $$
and

$$[C_{\infty}(\lambda, \hbar)]_{2,3} = \frac{\hbar}{\lambda - q}. \qquad (D-16)$$

This leads to a Lax matrix of the form given in the next section.

## D.5 Lax pair and Hamiltonian system

From the previous results, the Lax pair corresponding to this example is given by $L(\lambda, \hbar) =$

$$\begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ P_3(\lambda) - \hbar P'_2(\lambda) + \hbar(P_{\infty,2}^{(2)} + t_{2,2}t_{3,2})\lambda - H + \frac{p_1}{\lambda-q} & -P_2(\lambda) - \hbar t_{1,2} + \frac{p_2}{\lambda-q} & P_1(\lambda) + \frac{\hbar}{\lambda-q} \end{pmatrix}, \qquad (D-17)$$

with the associated auxiliary matrix

$$A_{KZ}(\lambda, \hbar) = \begin{pmatrix} (P_{\infty,2}^{(2)} + t_{2,2}t_{3,2})\lambda - \frac{H}{\hbar} + \frac{p_1}{\hbar(\lambda-q)} & \frac{p_2}{\hbar(\lambda-q)} + t_{1,2} & \frac{1}{\lambda-q} \\ A_{2,1} & A_{2,2} & A_{2,3} \\ A_{3,1} & A_{3,2} & A_{3,3} \end{pmatrix}. \qquad (D-18)$$

The coefficients of the Lax pair correspond to the normalization of the non-perturbative wave functions at $\lambda = \infty$,

$$\begin{align} \Psi_{1,1}(\lambda, \hbar) &= \exp \left( -\frac{t_{1,2}}{2\hbar} \lambda^2 - \frac{t_{1,1}}{\hbar} \lambda - \frac{t_{1,0}}{\hbar} \ln \lambda + S_{1,0} + \sum_{k=2}^{\infty} \frac{S_{1,k}}{(k-1)\lambda^{k-1}} \right), \notag \\ \Psi_{1,2}(\lambda, \hbar) &= \exp \left( -\frac{t_{2,2}}{2\hbar} \lambda^2 - \frac{t_{2,1}}{\hbar} \lambda - \frac{t_{2,0}}{\hbar} \ln \lambda - \ln \lambda + S_{2,0} + \sum_{k=2}^{\infty} \frac{S_{2,k}}{(k-1)\lambda^{k-1}} \right), \notag \\ \Psi_{1,3}(\lambda, \hbar) &= \exp \left( -\frac{t_{3,2}}{2\hbar} \lambda^2 - \frac{t_{3,1}}{\hbar} \lambda - \frac{t_{3,0}}{\hbar} \ln \lambda - \ln \lambda + S_{3,0} + \sum_{k=2}^{\infty} \frac{S_{3,k}}{(k-1)\lambda^{k-1}} \right), \tag{D-19} \end{align}$$

from which one may recover the general form of $L(\lambda, \hbar)$ and $A(\lambda, \hbar)$ at infinity using $L(\lambda, \hbar) = \hbar(\partial_{\lambda}\Psi)\Psi^{-1}$, $A(\lambda, \hbar) = (\mathcal{L}[\Psi])\Psi^{-1}$ and the form of the Wronskian (D-12) with $\kappa = -(t_{3,2} - t_{1,2})(t_{3,2} - t_{2,2})(t_{2,2} - t_{1,2})e^{S_{1,0}+S_{2,0}+S_{3,0}}$. Note in particular that the first entry does not have the $-\ln \lambda$ term in its formal expansion around $\lambda = \infty$ contrary to all other entries.

In order to obtain an operator commuting with $\partial_{\lambda}$ we shall define $\mathcal{L}$ acting directly on $\Psi(\lambda, \hbar)$ out of the operator $\mathcal{L}_{KZ} - t_{2,2}t_{3,2}$ as in the degree 2 example so that $\mathcal{L}\Psi(\lambda, \hbar) = \text{ev. } [\mathcal{L}_{KZ}\Psi^{\text{symbol}}(\lambda, \hbar)]$. Hence, the compatible system is

$$\mathcal{L}\Psi(\lambda, \hbar) = A(\lambda, \hbar)\Psi(\lambda, \hbar), \qquad (D-20)$$

with

$$A(\lambda, \hbar) = \begin{pmatrix} P_{\infty,2}^{(2)}\lambda - \frac{H}{\hbar} + \frac{p_1}{\hbar(\lambda-q)} & \frac{p_2}{\hbar(\lambda-q)} + t_{1,2} & \frac{1}{\lambda-q} \\ A_{2,1} & A_{2,2} & A_{2,3} \\ A_{3,1} & A_{3,2} & A_{3,3} \end{pmatrix}. \qquad (D-21)$$

We may now use the compatibility relation

$$\mathcal{L}[L(\lambda, \hbar)] = \hbar \partial_{\lambda} A(\lambda, \hbar) + [A(\lambda, \hbar), L(\lambda, \hbar)]. \qquad (D-22)$$
The l.h.s. of the first two lines is null so that we obtain the expression of the last two lines of $A(\lambda, \hbar)$. The expressions being rather long, we omit them here. Eventually, the third line of the compatibility relation provides the following equations by identification of the singular parts at $\lambda = q$ and at $\lambda = \infty$,

$$
\begin{align*}
\mathcal{L}[P_{\infty,1}^{(1)}] &= 0 \\
\mathcal{L}[P_{\infty,0}^{(1)}] &= \hbar \left( (P_{\infty,1}^{(1)})^2 + P_{\infty,2}^{(2)} + t_{1,2} P_{\infty,1}^{(1)} \right) \\
\mathcal{L}[P_{\infty,2}^{(2)}] &= 0 \\
\mathcal{L}[P_{\infty,1}^{(2)}] &= \hbar(-3P_{\infty,3}^{(3)} + 3P_{\infty,1}^{(1)}P_{\infty,2}^{(2)} + 2t_{1,2}P_{\infty,2}^{(2)}) \\
\mathcal{L}[P_{\infty,0}^{(2)}] &= \hbar(P_{\infty,1}^{(2)}P_{\infty,1}^{(1)} - P_{\infty,2}^{(3)} + P_{\infty,0}^{(1)}P_{\infty,2}^{(2)} + P_{\infty,1}^{(2)}t_{1,2} - \mathcal{L}[t_{1,2}]) \\
\mathcal{L}[P_{\infty,3}^{(3)}] &= 0 \\
\mathcal{L}[P_{\infty,2}^{(3)}] &= \hbar(P_{\infty,1}^{(1)}P_{\infty,3}^{(3)} + (P_{\infty,2}^{(2)})^2 + 3t_{1,2}P_{\infty,3}^{(3)}) \\
\mathcal{L}[P_{\infty,1}^{(3)}] &= \hbar(-P_{\infty,0}^{(1)}P_{\infty,3}^{(3)} + P_{\infty,1}^{(1)}P_{\infty,2}^{(3)} + P_{\infty,2}^{(2)}P_{\infty,1}^{(2)} + 2t_{1,2}P_{\infty,2}^{(3)} \\
&\quad -t_{3,2}\mathcal{L}[t_{2,2}] - t_{2,2}\mathcal{L}[t_{3,2}]) \\
p_1 &= \frac{p_2^2}{\hbar} + P_1(q)p_2 + \hbar P_2(q) + \hbar^2 t_{1,2} \\
\mathcal{L}[q] &= -3\frac{p_2^2}{\hbar^2} - 4P_1(q)\frac{p_2}{\hbar} - P_2(q) - P_1(q)^2 - \hbar(P_{\infty,1}^{(1)} + 2t_{1,2}) \\
\mathcal{L}[p_2] &= 2P_{\infty,1}^{(1)}\frac{p_2^2}{\hbar} + (P_2'(q) + 2P_1'(q)P_1(q))p_2 - \hbar P_3'(q) + \hbar P_2(q)P_1'(q) + \hbar P_2'(q)P_1(q) \\
&\quad + \hbar^2(P_{\infty,1}^{(1)}t_{1,2} - t_{2,2}t_{3,2}) \\
H &= -H_0(q, p_2, \hbar) + (t_{1,2} + P_{\infty,1}^{(1)})p_2 - \hbar P_{\infty,2}^{(2)}q - \hbar P_{\infty,1}^{(2)} - \hbar P_{\infty,0}^{(1)}t_{1,2}, \tag{D-23}
\end{align*}
$$

where the Hamiltonian $H_0(q, p_2, \hbar)$ is given by

$$
H_0(q, p_2, \hbar) = \frac{p_2^3}{\hbar^3} + 2P_1(q)\frac{p_2^2}{\hbar^2} + (P_2(q) + P_1(q)^2 + \hbar(P_{\infty,1}^{(1)} + 2t_{1,2}))\frac{p_2}{\hbar} - P_3(q) + P_1(q)P_2(q) \\
+ \hbar(P_{\infty,1}^{(1)}t_{1,2} - t_{2,2}t_{3,2})q \tag{D-24}
$$

and satisfies

$$
\hbar \partial_{p_2} H_0(q, p_2, \hbar) = -\mathcal{L}[q] \text{ and } \hbar \partial_q H_0(q, p_2, \hbar) = \mathcal{L}[p_2]. \qquad (\text{D-25})
$$

One may use the relations between spectral times and coefficients $(P_{\infty,i}^{(j)})_{i \le 2, j \le 3}$ given by (D-4), (D-5) and (D-6) to rewrite (D-23) as

$$
\begin{align*}
\mathcal{L}[t_{1,0}] &= \mathcal{L}[t_{2,0}] = \mathcal{L}[t_{3,0}] = \mathcal{L}[t_{3,2}] = \mathcal{L}[t_{2,2}] = \mathcal{L}[t_{1,2}] = 0 \\
\mathcal{L}[t_{1,1}] &= -\hbar(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2}) \\
\mathcal{L}[t_{2,1}] &= -\hbar(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2) \\
\mathcal{L}[t_{3,1}] &= -\hbar(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2). \tag{D-26}
\end{align*}
$$

Thus, we get that

$$
\mathcal{L} = -\hbar(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2})\partial_{t_{1,1}} - \hbar(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2)\partial_{t_{2,1}} \\
-\hbar(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2)\partial_{t_{3,1}}. \tag{D-27}
$$

Note that we may now obtain $\mathcal{L}[P_{\infty,i}^{(j)}]$ for $(i, j) \in [0, 2] \times [1, 3]$ in terms of the spectral times $(t_{i,j})_{i \le 2, j \le 3}$ using (D-4), (D-5), (D-6) and (D-26). The results being long and not particularly enlightening, we omit them here.
We may now write the evolution equation for $q$. We first observe that

$$ \mathcal{L}^2[q] = (2P_1'(q)P_1(q) - 3P_2'(q))\frac{p_2^2}{\hbar^2} \\ + (6P_3'(q) - 2P_1'(q)P_2(q) - 6P_2'(q)P_1(q) + 4P_1'(q)P_1(q)^2 - \hbar(4P_{\infty,2}^{(2)} \\ + 2P_{\infty,1}^{(1)}t_{1,2} - 6t_{2,2}t_{3,2}))\frac{p_2}{\hbar} + (P_2(q) + P_1(q)^2)(P_2'(q) + 2P_1'(q)P_1(q)) \\ + 4P_1(q)(P_3'(q) - P_1'(q)P_2(q) - P_1(q)P_2'(q)) - \hbar((t_{1,2} \\ - t_{3,2})(t_{1,2} - t_{2,2})(2t_{1,2} + t_{3,2} + t_{2,2})q \\ + (t_{1,2} - t_{3,2})(t_{1,2} - t_{2,2})(t_{3,1} + 2t_{1,1} + t_{2,1})). \quad (\text{D-28}) $$

In particular, we get that

$$ \mathcal{L}^2[q] + \frac{1}{3}(2P_1'(q)P_1(q) - 3P_2'(q))\mathcal{L}[q] = R_0(q; \hbar)\frac{p_2}{\hbar} + R_3(q) + \hbar R_1(q), \quad (\text{D-29}) $$

where

$$ \begin{aligned} R_0(\lambda; \hbar) &= 6P_3'(\lambda) - 2P_2(\lambda)P_1'(\lambda) - 2P_2'(\lambda)P_1(\lambda) + \frac{4}{3}P_1(\lambda)^2 P_1'(\lambda) \\ &\quad + 2\hbar(t_{1,2} - t_{2,2})(t_{1,2} - t_{3,2}), \\ R_3(\lambda) &= (P_2(\lambda) + P_1(\lambda)^2)(P_2'(\lambda) + 2P_1'(\lambda)P_1(\lambda)) \\ &\quad + 4P_1(\lambda)(P_3'(\lambda) - P_1'(\lambda)P_2(\lambda) - P_1(\lambda)P_2'(\lambda)) \\ &\quad - \frac{1}{3}(2P_1'(\lambda)P_1(\lambda) + 3P_2'(\lambda))(P_2(\lambda) + P_1(\lambda)^2) \\ &= \left(2P_2'(\lambda) + \frac{4}{3}P_1'(\lambda)P_1(\lambda)\right)(P_2(\lambda) + P_1(\lambda)^2) \\ &\quad + 4P_1(\lambda)(P_3'(\lambda) - P_1'(\lambda)P_2(\lambda) - P_1(\lambda)P_2'(\lambda)), \\ R_1(\lambda) &= -(t_{1,2} - t_{3,2})(t_{1,2} - t_{2,2})(2t_{1,2} + t_{3,2} + t_{2,2})\lambda \\ &\quad + (t_{1,2} - t_{3,2})(t_{1,2} - t_{2,2})(t_{3,1} + 2t_{1,1} + t_{2,1}) \\ &\quad - \frac{1}{3}(2P_1'(\lambda)P_1(\lambda) - 3P_2'(\lambda))(P_{\infty,1}^{(1)} + 2t_{1,2}). \end{aligned} \quad (\text{D-30}) $$

We also have

$$ 3\frac{\mathcal{L}[p_2]}{\hbar} + 2P_1'(q)\mathcal{L}[q] = -(2P_1'(q)P_1(q) - 3P_2'(q))\frac{p_2}{\hbar} - 3P_3'(q) + P_2(q)P_1'(q) + 3P_2'(q)P_1(q) \\ - 2P_1'(q)P_1(q)^2 - \hbar(2(P_{\infty,1}^{(1)})^2 + P_{\infty,1}^{(1)}t_{1,2} + 3t_{2,2}t_{3,2}). \quad (\text{D-31}) $$

Applying $\mathcal{L}$ to (D-29) leads to

$$ \begin{aligned} & \mathcal{L}^3[q] + \frac{1}{3}(2P_1'(q)P_1(q) - 3P_2'(q))\mathcal{L}^2[q] \\ & + \frac{1}{3}(2P_1'(q)^2 - 3P_2''(q))(\mathcal{L}[q])^2 + \frac{1}{3}(\mathcal{L}[2P_1P_1' - 3P_2')(q))\mathcal{L}[q] \\ &= (R_0'(q; \hbar)\mathcal{L}[q] + \mathcal{L}[R_0](q; \hbar))\frac{p_2}{\hbar} + R_0(q; \hbar)\frac{\mathcal{L}[p_2]}{\hbar} \\ & + (R_3'(q) + \hbar R_1'(q))\mathcal{L}[q] + (\mathcal{L}[R_3](q) + \hbar\mathcal{L}[R_1](q)). \end{aligned} \quad (\text{D-32}) $$
We now use (D-31) to remove $\mathcal{L}[p_2]$,

$$
\begin{align}
& 3\mathcal{L}^3[q] + (2P_1'(q)P_1(q) - 3P_2'(q))\mathcal{L}^2[q] + (2P_1'(q)^2 - 3P_2''(q))(\mathcal{L}[q])^2 + (\mathcal{L}[2P_1P_1' - 3P_2'](q))\mathcal{L}[q] \nonumber \\
& = (3R_0'(q;\hbar)\mathcal{L}[q] + 3\mathcal{L}[R_0](q;\hbar) - R_0(q;\hbar)(2P_1'(q)P_1(q) - 3P_2'(q)))\frac{p_2}{\hbar} \nonumber \\
& \quad - 2R_0(q;\hbar)P_1'(q)\mathcal{L}[q] - R_0(q;\hbar)(3P_3'(q) - P_2(q)P_1'(q) - 3P_2'(q)P_1(q) + 2P_1'(q)P_1(q)^2) \nonumber \\
& \quad - \hbar R_0(q;\hbar)(2(P_{\infty,1}^{(1)})^2 + P_{\infty,1}^{(1)}t_{1,2} + 3t_{2,2}t_{3,2}) \nonumber \\
& \quad + 3(R_3'(q) + \hbar R_1'(q))\mathcal{L}[q] + 3(\mathcal{L}[R_3](q) + \hbar\mathcal{L}[R_1](q)). \tag{D-33}
\end{align}
$$

Then we use Equation (D-29) to remove $p_2$. Thus we get

$$
\begin{align}
& 3R_0(q; \hbar)\mathcal{L}^3[q] + R_0(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q))\mathcal{L}^2[q] + R_0(q; \hbar)(2P_1'(q)^2 - 3P_2''(q))(\mathcal{L}[q])^2 \nonumber \\
& \quad + R_0(q; \hbar)(\mathcal{L}[2P_1P_1' - 3P_2](q))\mathcal{L}[q] \nonumber \\
& = (3R_0'(q; \hbar)\mathcal{L}[q] + 3\mathcal{L}[R_0](q; \hbar) - R_0(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q))) \nonumber \\
& \quad \left( \mathcal{L}^2[q] + \frac{1}{3}(2P_1'(q)P_1(q) - 3P_2'(q))\mathcal{L}[q] - R_3(q) - \hbar R_1(q) \right) \nonumber \\
& \quad - 2R_0(q; \hbar)^2 P_1'(q)\mathcal{L}[q] - R_0(q; \hbar)^2(3P_3'(q) - P_2(q)P_1'(q) - 3P_2'(q)P_1(q) + 2P_1'(q)P_1(q)^2) \nonumber \\
& \quad - \hbar R_0(q; \hbar)^2(2(P_{\infty,1}^{(1)})^2 + P_{\infty,1}^{(1)}t_{1,2} + 3t_{2,2}t_{3,2}) \nonumber \\
& \quad + 3R_0(q; \hbar)(R_3'(q) + \hbar R_1'(q))\mathcal{L}[q] + 3R_0(q; \hbar)(\mathcal{L}[R_3](q) + \hbar\mathcal{L}[R_1](q)). \tag{D-34}
\end{align}
$$

It corresponds to an evolution equation of the form

$$
\alpha_0(q; \hbar)\mathcal{L}^3[q] + \alpha_1(q; \hbar)\mathcal{L}^2[q]\mathcal{L}[q] + \alpha_2(q; \hbar)(\mathcal{L}[q])^2 + \alpha_3(q; \hbar)\mathcal{L}^2[q] + \alpha_4(q; \hbar)\mathcal{L}[q] + \alpha_5(q; \hbar) = 0, \quad (D-35)
$$

with

$$
\begin{align}
\alpha_0(q; \hbar) &= 3R_0(q; \hbar) \nonumber \\
\alpha_1(q; \hbar) &= -3R_0'(q; \hbar) \nonumber \\
\alpha_2(q; \hbar) &= 2R_0(q; \hbar)((P_{\infty,1}^{(1)})^2 - 3P_{\infty,0}^{(2)}) - R_0'(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q)) \nonumber \\
\alpha_3(q; \hbar) &= 2R_0(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q)) - 3\mathcal{L}[R_0](q; \hbar) \nonumber \\
\alpha_4(q; \hbar) &= R_0(q; \hbar)(\mathcal{L}[2P_1P_1' - 3P_2](q)) + 3R_0'(q; \hbar)(R_3(q) + \hbar R_1(q)) \nonumber \\
&\quad -\frac{1}{3}(2P_1'(q)P_1(q) - 3P_2'(q))(3\mathcal{L}[R_0](q; \hbar) - R_0(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q))) \nonumber \\
&\quad +2R_0(q; \hbar)^2 P_1'(q) - 3R_0(q; \hbar)(R_3'(q) + \hbar R_1'(q)) \nonumber \\
\alpha_5(q; \hbar) &= (3\mathcal{L}[R_0](q; \hbar) - R_0(q; \hbar)(2P_1'(q)P_1(q) - 3P_2'(q)))(R_3(q) + \hbar R_1(q)) \nonumber \\
&\quad +R_0(q; \hbar)^2(3P_3'(q) - P_2(q)P_1'(q) - 3P_2'(q)P_1(q) + 2P_1'(q)P_1(q)^2) \nonumber \\
&\quad +\hbar R_0(q; \hbar)^2(2(P_{\infty,1}^{(1)})^2 + P_{\infty,1}^{(1)}t_{1,2} + 3t_{2,2}t_{3,2}) \nonumber \\
&\quad -3R_0(q; \hbar)(\mathcal{L}[R_3](q) + \hbar\mathcal{L}[R_1](q)). \tag{D-36}
\end{align}
$$

One may easily obtain $\mathcal{L}[R_0]$, $\mathcal{L}[R_1]$, $\mathcal{L}[R_3]$ and $\mathcal{L}[2P_1P_1' - 3P_2]$ from (D-23) and (D-26).

The Lax pair is compatible with formal series expansion given by (D-19). In particular, we have $S_{1,0} = \ln Z_{\text{NP}}$. Inserting these expansions into the last line of $L(\lambda, \hbar)$ and the first line of $A(\lambda, \hbar)$ provides

$$
\mathcal{L}[S_{1,0}] = t_{1,2}^2 q - t_{1,2} \frac{p_2}{\hbar} - \frac{H}{\hbar} + t_{1,1} t_{1,2}
$$
$$
\begin{align}
\mathcal{L}[S_{2,0}] &= t_{2,2}^2 q - t_{2,2} \frac{p_2}{\hbar} - \frac{H}{\hbar} + t_{2,1}(2t_{2,2} - t_{1,2}) \nonumber \\
\mathcal{L}[S_{3,0}] &= t_{3,2}^2 q - t_{3,2} \frac{p_2}{\hbar} - \frac{H}{\hbar} + t_{3,1}(2t_{3,2} - t_{1,2}). \tag{D-37}
\end{align}
$$

Thus we get

$$
\mathcal{L}[\ln Z_{\text{NP}}] = t_{1,2}^2 q - t_{1,2} \frac{p_2}{\hbar} - \frac{H}{\hbar} + t_{1,1} t_{1,2}, \quad (\text{D-38})
$$

giving an explicit relation between the partition function and the Darboux coordinates.

Finally, we may perform a linear change of variables $(t_{1,1}, t_{2,1}, t_{3,1}) \leftrightarrow (\tau_1, \tau_2, \tau_3)$ so that $\mathcal{L}$ identifies to $\hbar\partial_{\tau_1}$. Let us define

$$
\begin{pmatrix} \tau_1 \\ \tau_2 \\ \tau_3 \end{pmatrix} = B \begin{pmatrix} t_{1,1} \\ t_{2,1} \\ t_{3,1} \end{pmatrix} \Leftrightarrow \begin{pmatrix} t_{1,1} \\ t_{2,1} \\ t_{3,1} \end{pmatrix} = B^{-1} \begin{pmatrix} \tau_1 \\ \tau_2 \\ \tau_3 \end{pmatrix}, \qquad (\text{D-39})
$$

where $B$ is a $3 \times 3$ matrix with coefficients expressed in terms of spectral times different from $(t_{i,1})_{1 \le i \le 3}$. The chain rule implies that

$$
\forall i \in [1, 3] : \partial_{t_{i,1}} = \frac{\partial \tau_1}{\partial t_{i,1}} \partial_{\tau_1} + \frac{\partial \tau_2}{\partial t_{i,1}} \partial_{\tau_2} + \frac{\partial \tau_3}{\partial t_{i,1}} \partial_{\tau_3} = b_{1,i} \partial_{\tau_1} + b_{2,i} \partial_{\tau_2} + b_{3,i} \partial_{\tau_3}. \quad (\text{D-40})
$$

In other words,

$$
\begin{pmatrix} \partial_{t_{1,1}} \\ \partial_{t_{2,1}} \\ \partial_{t_{3,1}} \end{pmatrix} = B^t \begin{pmatrix} \partial_{\tau_1} \\ \partial_{\tau_2} \\ \partial_{\tau_3} \end{pmatrix}. \qquad (\text{D-41})
$$

Since

$$
\mathcal{L} = (\mathcal{L}[t_{1,1}], \mathcal{L}[t_{2,1}], \mathcal{L}[t_{3,1}]) \begin{pmatrix} \partial_{t_{1,1}} \\ \partial_{t_{2,1}} \\ \partial_{t_{3,1}} \end{pmatrix} = (\mathcal{L}[t_{1,1}], \mathcal{L}[t_{2,1}], \mathcal{L}[t_{3,1}]) B^t \begin{pmatrix} \partial_{\tau_1} \\ \partial_{\tau_2} \\ \partial_{\tau_3} \end{pmatrix}, \quad (\text{D-42})
$$

$\mathcal{L} = \hbar \partial_{\tau_1}$ if and only if

$$
(\mathcal{L}[t_{1,1}], \mathcal{L}[t_{2,1}], \mathcal{L}[t_{3,1}]) B^t = (\hbar, 0, 0) \Leftrightarrow B \begin{pmatrix} \mathcal{L}[t_{1,1}] \\ \mathcal{L}[t_{2,1}] \\ \mathcal{L}[t_{3,1}] \end{pmatrix} = \begin{pmatrix} \hbar \\ 0 \\ 0 \end{pmatrix} \Leftrightarrow \begin{pmatrix} \mathcal{L}[t_{1,1}] \\ \mathcal{L}[t_{2,1}] \\ \mathcal{L}[t_{3,1}] \end{pmatrix} = B^{-1} \begin{pmatrix} \hbar \\ 0 \\ 0 \end{pmatrix}. \tag{D-43}
$$

In other words

$$
B^{-1} = \begin{pmatrix} \frac{\mathcal{L}[t_{1,1}]}{\hbar} & c_{1,2} & c_{1,3} \\ \frac{\mathcal{L}[t_{2,1}]}{\hbar} & c_{2,2} & c_{2,3} \\ \frac{\mathcal{L}[t_{3,1}]}{\hbar} & c_{3,2} & c_{3,3} \end{pmatrix}. \qquad (\text{D-44})
$$

We choose coefficients $(c_{i,j})_{1 \le i, \le 3, 2 \le j \le 3}$ so that $\det(B^{-1}) = -(t_{3,2} - t_{1,2})(t_{3,2} - t_{2,2})(t_{2,2} - t_{1,2})$
which corresponds to the prefactor of the Wronskian. Indeed, we want the change of variables
to remain invertible except when the Wronskian vanishes. We find that

$$
B^{-1} = \begin{pmatrix} -(t_{1,2}t_{2,2} + t_{1,2}t_{3,2} + t_{2,2}t_{3,2}) & 1 & t_{1,2} \\ -(t_{1,2}t_{3,2} + t_{2,2}t_{3,2} + t_{2,2}^2) & 1 & t_{2,2} \\ -(t_{1,2}t_{2,2} + t_{2,2}t_{3,2} + t_{3,2}^2) & 1 & t_{3,2} \end{pmatrix} \quad (\text{D-45})
$$
is such that $det(B^{-1}) = -(t_{3,2} - t_{1,2})(t_{3,2} - t_{2,2})(t_{2,2} - t_{1,2})$. It is equivalent to

$$ -(t_{3,2} - t_{1,2})(t_{3,2} - t_{2,2})(t_{2,2} - t_{1,2})B = \begin{pmatrix} t_{3,2} - t_{2,2} & -(t_{3,2} - t_{1,2}) & t_{2,2} - t_{1,2} \\ t_{1,2}(t_{3,2}^2 - t_{2,2}^2) & -t_{2,2}(t_{3,2}^2 - t_{1,2}^2) & t_{3,2}(t_{2,2}^2 - t_{1,2}^2) \\ (t_{3,2} - t_{2,2})(t_{3,2} + t_{2,2} - t_{1,2}) & -t_{3,2}(t_{3,2} - t_{1,2}) & t_{2,2}(t_{2,2} - t_{1,2}) \end{pmatrix}, \quad (D-46) $$

which provides a suitable change of variables for which $\mathcal{L} = \hbar \partial_{\tau_1}$.

## References

[1] M. R. Adams, J. Harnad, and J. Hurtubise. Darboux coordinates and Liouville-Arnold integration in loop algebras. Commun. Math. Phys., 155(2):385-413, 1993. arXiv:hep-th/9210089.

[2] I. Aniceto, R. Schiappa, and M. Vonk. The resurgence of instantons in string theory. Commun. Number Theory Phys., 6(2):339-496, 2012. arXiv:1106.5922.

[3] S. Bergman and M. Schiffer. Kernel functions and conformal mapping. Compositio Math., 8:205-249, 1951.

[4] G. Borot and B. Eynard. Geometry of spectral curves and all order dispersive integrable system. SIGMA, 8(100), 2012. arXiv:1110.4936.

[5] V. Bouchard and B. Eynard. Think globally, compute locally. JHEP, 2013(2):143, front matter + 34, 2013. arXiv:1211.2302.

[6] V. Bouchard and B. Eynard. Reconstructing WKB from topological recursion. J. Éc. polytech. Math., 4:845-908, 2017. math-ph/1606.04498.

[7] L. Chekhov, B. Eynard, and N. Orantin. Free energy topological expansion for the 2-matrix model. JHEP, 2006(12):053, 31, 2006. arXiv:math-ph/0603003.

[8] O. Costin. Correlation between pole location and asymptotic behavior for Painlevé I solutions. Comm. Pure Appl. Math., 52(4):461-478, 1999. arXiv:math/9709223.

[9] O. Costin and R. D. Costin. On the formation of singularities of solutions of nonlinear differential systems in antistokes directions. Invent. Math., 145(3):425-485, 2001. arXiv:math/0202234.

[10] O. Costin, R. D. Costin, and M. Huang. Tronquée solutions of the Painlevé equation PI. Constr. Approx., 41(3):467-494, 2015. arXiv:1310.5330.

[11] R. Dijkgraaf and H. Fuji. The volume conjecture and topological strings. Fortschr. Phys., 57(9):825-856, 2009. arXiv:0903.2084.

[12] R. Dijkgraaf, H. Fuji, and M. Manabe. The volume conjecture, perturbative knot invariants, and recursion relations for topological strings. Nuclear Phys. B, 849(1):166-211, 2011. arXiv:1010.4542.

[13] N. Do, A. Dyer, and D.V. Mathews. Topological recursion and a quantum curve for monotone Hurwitz numbers. J. Geom. Phys., 120:19-36, 2017. arXiv:1408.3992.
[14] N. Do and D. Manescu. Quantum curves for the enumeration of ribbon graphs and hyper-maps. *Commun. Number Theory Phys.*, 8(4):677-701, 2014. arXiv:1312.6869.

[15] N. Do and P. Norbury. Topological recursion for irregular spectral curves. *J. Lond. Math. Soc. (2)*, 97(3):398-426, 2018. arXiv:1412.8334.

[16] B. Dubrovin. Geometry of 2D topological field theories. In *Integrable systems and quantum groups (Montecatini Terme, 1993)*, volume 1620 of *Lecture Notes in Math.*, pages 120-348. Springer, Berlin, 1996. arXiv:hep-th/9407018.

[17] B. Dubrovin and M. Mazzocco. Canonical structure and symmetries of the Schlesinger equations. *Commun. Math. Phys*, 271:289-373, 2007. arXiv:math/0311261.

[18] O. Dumitrescu and M. Mulase. Quantum curves for Hitchin fibrations and the Eynard-Orantin theory. *Lett. Math. Phys.*, 104(6):635-671, 2014. arXiv:1310.6022.

[19] O. Dumitrescu and M. Mulase. Lectures on the topological recursion for Higgs Bundles and Quantum Curves. *Lecture Notes Series, Institute for Mathematical Sciences, National University of Singapore, The Geometry, Topology and Physics of Moduli Spaces of Higgs Bundles*, pages 103-198, 2018. arXiv:1509.09007.

[20] O. Dumitrescu and M. Mulase. Quantization of spectral curves for meromorphic Higgs bundles through topological recursion. In *Topological recursion and its influence in analysis, geometry, and topology*, volume 100 of *Proc. Sympos. Pure Math.*, pages 179-229. Amer. Math. Soc., Providence, RI, 2018. arXiv:1411.1023.

[21] P. Dunin-Barkowski, M. Mulase, P. Norbury, A. Popolitov, and S. Shadrin. Quantum spectral curve for the Gromov-Witten theory of the complex projective line. *J. Reine Angew. Math.*, 726:267-289, 2017. arXiv:1312.5336.

[22] P. Dunin-Barkowski, P. Norbury, N. Orantin, A. Popolitov, and S. Shadrin. Primary invariants of Hurwitz Frobenius manifolds. In *Topological recursion and its influence in analysis, geometry, and topology*, volume 100 of *Proc. Sympos. Pure Math.*, pages 297-331. Amer. Math. Soc., Providence, RI, 2018. arXiv:1605.07644.

[23] P. Dunin-Barkowski, N. Orantin, S. Shadrin, and L. Spitz. Identification of the Givental formula with the spectral curve topological recursion procedure. *Commun. Math. Phys.*, 328(2):669-700, 2014. arXiv:1211.4021.

[24] B. Eynard. Large *N* expansion of convergent matrix integrals, holomorphic anomalies, and background independence. *JHEP*, 2009(3):003, 20, 2009. arXiv:0802.1788.

[25] B. Eynard. *Counting surfaces*, volume 70 of *Progress in Mathematics*. Birkhäuser, Basel, 2016.

[26] B. Eynard. The Geometry of integrable systems. Tau functions and homology of Spectral curves. Perturbative definition., 2018. arXiv:1706.04938.

[27] B. Eynard and E. Garcia-Failde. From topological recursion to wave functions and PDEs quantizing hyperelliptic curves. *Forum Math. Sigma*, 11, 2023. arXiv:1911.07795.

[28] B. Eynard and M. Mariño. A holomorphic and background independent partition function for matrix models and topological strings. *J. Geom. Phys.*, 61(7):1181-1202, 2011. arXiv:0810.4273.
[29] B. Eynard and N. Orantin. Invariants of algebraic curves and topological expansion. *Commun. Number Theory Phys.*, 1(2), 2007. arXiv:0702045.

[30] B. Eynard and N. Orantin. Topological recursion in random matrices and enumerative geometry. *J. Phys. A: Mathematical and Theoretical*, 42(29), 2009. arXiv:0811.3531.

[31] S. Gukov. Three-dimensional quantum gravity, Chern-Simons theory, and the A-polynomial. *Commun. Math. Phys.*, 255(3):577-627, 2005. arXiv:hep-th/0306165.

[32] S. Gukov and P. Sulkowski. A-polynomial, B-model, and quantization. *JHEP*, 2012(2):070, front matter+56, 2012. arXiv:1108.0002.

[33] K. Iwaki. 2-parameter $\tau$-function for the first Painlevé equation: topological recursion and direct monodromy problem via exact WKB analysis. *Commun. Math. Phys.*, 377(2):1047-1098, 2020. arXiv:1902.06439.

[34] K. Iwaki and A. Saenz. Quantum curve and the first Painlevé equation. *SIGMA Symmetry Integrability Geom. Methods Appl.*, 12:Paper No. 011, 24, 2016. arXiv:1507.06557.

[35] M. Jimbo and T. Miwa. Monodromy preserving deformation of linear ordinary differential equations with rational coefficients. II. *Phys. D*, 2(3):407-448, 1981.

[36] A. Kokotov and D. Korotkin. Tau-functions on Hurwitz spaces. *Math. Phys. Anal. Geom.*, 7(1):47-96, 2004. arXiv:math-ph/0202034.

[37] M. Kontsevich. Intersection theory on the moduli space of curves and the matrix Airy function. *Commun. Math. Phys.*, 147:1-23, 1992.

[38] I. Kostov and N. Orantin. CFT and topological recursion. *JHEP*, 2010(11):056, 30, 2010. arXiv:1006.2028.

[39] O. Marchal and N. Orantin. Isomonodromic deformations of a rational differential system and reconstruction with the topological recursion: the $sl_2$ case. *J. Math. Phys.*, 61(6):061506, 33, 2020. arXiv:1901.04344.

[40] O. Marchal and N. Orantin. Quantization of hyper-elliptic curves from isomonodromic systems and topological recursion. *J. Geom. Phys*, 2021. arXiv:1911.07739.

[41] M. Mulase and P. Sulkowski. Spectral curves and the Schrödinger equations for the Eynard-Orantin recursion. *Adv. Theor. Math. Phys.*, 19(5):955-1015, 2015. arXiv:1210.3006.

[42] H. Murakami and J. Murakami. The colored Jones polynomials and the simplicial volume of a knot. *Acta Math.*, 186(1):85-104, 2001. arXiv:math/9905075.

[43] W.D. Neumann and D. Zagier. Volumes of hyperbolic three-manifolds. *Topology*, 24(3):307-332, 1985.

[44] N. Nikolaev. Exact solutions for the singularly perturbed Riccati equation and exact WKB analysis. *Nagoya Math. J.*, pages 1-36, 2022. arXiv:2008.06492.

[45] N. Nikolaev. Existence and uniqueness of exact WKB solutions for second-order singularly perturbed linear ODEs. *Commun. Math. Phys.*, 2022. arXiv:2106.10248.
[46] P. Norbury. Quantum curves and topological recursion. In *String-Math 2014*, volume 93 of Proc. Sympos. Pure Math., pages 41–65. Amer. Math. Soc., Providence, RI, 2016. arXiv:1502.04394.

[47] B. Safnuk. Topological recursion for open intersection numbers. Commun. Number Theory Phys., 10(4):833–857, 2016. arXiv:1601.04049.

[48] R. Schiappa and R. Vaz. The resurgence of instantons: multi-cut Stokes phases and the Painlevé II equation. Commun. Math. Phys., 330(2):655–721, 2014. arXiv:1302.5138.

[49] E. Witten. Two dimensional gravity and intersection theory on moduli space. *Surveys in Diff. Geom.*, 1:243–310, 1991.

[50] J. Zhou. Intersection numbers on Deligne–Mumford moduli spaces and quantum Airy curve, 2012. arXiv:1206.5896.