Trace of AB = Trace of BA We can define trace if $A =\sum_{i} \langle e_i, Ae_i\rangle$ where $e_i$'s are standard column vectors, and $\langle x, y\rangle =x^t y$ for suitable column vectors $x, y$. With this set up, I want to prove trace of AB and BA are same, so it's enough to prove that $$\sum_{i} \langle e_i, ABe_i\rangle =\sum_{i} \langle e_i, BAe_i\rangle$$ but how to conclude that?

Let's write the trace in a more convenient way. We have: $$Ae_i = \begin{bmatrix}a_{11}&\cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{n1} & \cdots & a_{nn} \end{bmatrix} \begin{bmatrix} 0 \\ \vdots \\ 1 \\ \vdots \\ 0\end{bmatrix} = \begin{bmatrix} a_{i1} \\ \vdots \\ a_{in}\end{bmatrix},$$ where the $1$ is in the $i$-th entry. This way: $$ \langle e_i, Ae_i \rangle = e_i^tAe_i = a_{ii}.$$
So ${\rm tr}(A) = \sum_ia_{ii}$. Now: $(AB)_{ij} = \sum_k a_{ik}b_{kj}$, and: $${\rm tr}(AB) = \sum_i \sum_k a_{ik}b_{ki}.$$On the other hand, $(BA)_{ij} = \sum_k b_{ik}a_{kj}$. So: $${\rm tr}(BA) = \sum_i \sum_kb_{ik}a_{ki}.$$They are the same quantity, up to renaming indices ($i \leftrightarrow k$)
