Quantum Algorithms, Quantum Computing, Physics, Mathematics, Education.
simplifications here were thanks to the fact that trace is a linear mapping. Also note that the same can be done for the other two Pauli matrices, the derivation goes exactly the same way. Thus, this shows that the expectation values of the Pauli matrices have a direct relation with the density