# Decomposition of a matrix in the Pauli basis

I read in this article (Apendix III p.8) that for $$A\in \mathcal{M}_2$$, since the normalized Pauli matrices $$\{I,X,Y,Z\}/\sqrt{2}$$ form an orthogonal matrix basis. $$A=\frac{Tr(AI)I+Tr(AX)X+Tr(AY)Y+Tr(AZ)Z}{2}$$

I don't understand, where does the Trace coefficient come from ?

The Pauli matrices form an orthogonal basis of $$\mathcal{M}_2$$, this vector space can be endowed with a scalar product called the Hilbert-Schmidt inner product
$$\langle A,B\rangle=\mathrm{Tr}(A^\dagger B)$$ since the Pauli matrices anticommute, their product is traceless, and since they are Hermitian this implies that they are orthogonal with respect to that scalar product, hence the decomposition noticing they have norm $$2$$ since their square is the identity.
More explicitely, if $$A=\alpha X +\beta Y +\gamma Z+ \delta I$$
$$\mathrm{Tr}(AX)=\alpha \mathrm{Tr}(X^2)+\beta\mathrm{Tr}(XY)+\gamma\mathrm{Tr}(XZ)+\delta\mathrm{Tr}(X)=2\alpha$$