The Hamiltonian for an electron in a magnetic field $\vec{B}$ is $H=-\mu\_B \vec{\sigma}\cdot \vec{B}$, where $\vec{\sigma}$ is the Pauli matrices

ie:
$\vec{\sigma\_x}$=
$\begin{pmatrix}
0 & 1 \\
1 & 0 
\end{pmatrix}$
$\vec{\sigma\_y}$ =
$\begin{pmatrix}
0 & -i \\
i & 0 
\end{pmatrix}$
$\vec{\sigma\_z}$=
$\begin{pmatrix}
1 & 0 \\
0 & -1 
\end{pmatrix}$
respectively.

In the calculation of quantum canonical ensemble, the evaluation of the density matrix along for the direction $\hat{n}$ is given by: $\frac{e^{-\beta H}}{tr{e^{-\beta H}}}$

It's clear that the trace of $\vec{\sigma\_x}$ and $\vec{\sigma\_y}$ vanish, thus diagonlization is required for calculation.

The diagonlization of hermitian matrices can be evaluated by:

1. Compute of eigenvalue of the matrix
2. Obtain the eigenvectors
3. Construct the unitary matrix from the eigenvectors
4. Apply unitary transformation $A'$=$UAU^{\dagger}$, however,

From my calculation, diagonlization of $\vec{\sigma\_x}$ gives $\vec{\sigma\_z}$, and diagonlization of $\vec{\sigma\_y}$ gives $\vec{\sigma\_x}$, however $\vec{\sigma\_x}$ trace is zero, which makes the density matrix calculation not feasible.

Here are some question arise from this problems.

1. What is the significance of the diagonlization of Pauli matrices yield another Pauli matrices?
2. How to do a calculation if the magnetic field is pointing in y direction?
3. In this case, $\vec{\sigma\_y}$ seems special as trace of $\vec{\sigma\_z}$ and diagonlise $\vec{\sigma\_x}$ is non-zero, how to account for that?

For the second question, I just realised I can diagonlise the matrix again, so in practical sense, the calculation is valid, that might have also solve the third question.