Solution (source code)

= Solution

Cut one nonseparating circle on each handle of the closed <orientable surface> $\Sigma_g$ of <genus> $g$. The cut surface is a <sphere> with $2g$ boundary circles. Gluing a pair back together requires an <anyon> label $a_i$ on one boundary and the <antianyon> label $\bar a_i$ on the oppositely oriented boundary. Sum over these labels independently for the $g$ handles.

For a fixed labeling, the <dimension> of the resulting <anyon fusion space> on the <sphere>, with total <vacuum anyon> charge, is
$$
\left[N_{a_1}N_{\bar a_1}\cdots N_{a_g}N_{\bar a_g}\right]_{11}.
$$
The gluing rule of the <topological quantum field theory> therefore gives the <handle-cut formula for anyon ground-state degeneracy>:
$$
\boxed{\operatorname{GSD}(\Sigma_g)=\sum_{a_1,\ldots,a_g}\left[N_{a_1}N_{\bar a_1}\cdots N_{a_g}N_{\bar a_g}\right]_{11}=\left[\left(\sum_aN_aN_{\bar a}\right)^g\right]_{11}.}
$$
Here $1$ denotes the <vacuum anyon>, and the <anyon fusion matrices> have entries $(N_b)_{ac}=N^c_{ab}$, as in the source. At $g=0$, the empty product is the identity <matrix>, giving one <ground state>. At $g=1$, $(N_aN_{\bar a})_{11}=1$ for each simple charge, so the <ground-state degeneracy> of the <torus> is the number of <anyon> types.