The Berry phase accumulated on a path can be described by a matrix when we look at adiabatic time evolution with a Hamiltonian with degenerate energy levels. The Berry phase matrix is given by $$ \gamma_{mn}= \int_\mathcal{C} \left\langle m(R) \right | \nabla_R \left| n(R) \right \rangle . d R. $$
here $R$ parametrizes the said path and $ A_{mn}= \left\langle m(R) \right | \nabla_R \left| n(R) \right \rangle$. Now what I want to do is calculate the Berry Curvature, something that, if I assume my path above is closed and has three determining coordinates$R_1$, $R_2$ , $R_3$ is $\vec{F}$ such that
$$ \mathbf{\gamma}=\int_\mathcal{S} \vec{F}.d\vec{s} $$ note that the $\gamma$ and $F$ here are matrices and we're integrating over the surface $\mathcal{S}$ enclosed by curve $\mathcal{C}$
What is stopping me from applying the stokes theorem to $\gamma_{mn}$ and getting $\vec{F}_{mn}=\nabla_R\times A_{mn} $?
It is said that the answer contains a matrix commutator $[A_i,A_j]_{mn}$ c because this berry phase is non abelian. but I seem to be missing something fundamental.
Edit: Note: this also corresponds to problem 2 Chapter 2 of Topological insulators and superconductors by Bernevig and Hughes