when q=12289, n=512, we obtain overflow errors for when computing omega(q^2, n). this is likely due to the line if g_lifted.pow((p - 1) as u32) % p.pow(e) == 1 in primitive_root. it should probably be a mod_exp.