How does the Hamiltonian changes after rotating the coordinate frame A basic question in rotation. Initially I have a Hamiltonian 
$$
H = \frac{-1}{2}(4E_c(1-n_g)\sigma_z + E_J\sigma_x) \, .
$$
It's said that, if I rotate the coordinate system by mixing angle,
$$
\theta = \arctan \left(\frac{E_J}{4E_c(1-n_g)} \right)
$$
then in the new coordinate system, $\sigma_z$ becomes the quantization angle and the Hamiltonian would be
$$
H'= \hbar \omega_a \sigma_z
$$
where $\hbar \omega_a$ will be
$$
\hbar \omega_a = \sqrt{E_J^2+(4E_c(1-n_g))^2}
$$
Could you please tell how the Hamiltonian changes?
 A: For convenience in order to simplify the equations let ignore the constant $\:-\frac12\:$ so that we have the Hamiltonian 
\begin{equation}
H=\mathrm A\sigma_{x}+\mathrm C\sigma_{z}\,,\quad \mathrm A=E_J\,, \:\: \mathrm C=\left[4E_c\left(1-n_g\right)\right] 
\tag{01}\label{eq1}
\end{equation}
We must find a rotation in real space $\:\mathbb{R}^{3}\:$ so that for the new Hamiltonian
\begin{equation}
H'=\mathrm B\sigma_{z}
\tag{02}
\end{equation} 
The rotation must be(1) around the $\:y-$axis through an angle $\:-\theta\:$ represented by the following special unitary matrix
\begin{equation}
\!\!\!\!\!\!U=\cos\frac{\theta}{2}I+i\sin\frac{\theta}{2}\sigma_{y}  \,,\quad \theta =\arctan\left(\dfrac{\mathrm A}{\mathrm C}\right)= \arctan \left[\frac{E_J}{4E_c\left(1-n_g\right)} \right]\,,\quad \theta \in [0,\pi]
\tag{03}\label{eq3}
\end{equation}
In the following $\:\omega=\frac{\theta}{2}:$ 
\begin{align}
\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!H'&\!\!\!\!\!\!\!\!\!= UHU^{*} =\left(\cos\omega I+i\sin\omega\sigma_{y}\right)\left(\mathrm A\sigma_{x}+\mathrm C\sigma_{z}\right)\left(\cos\omega  I-i\sin\omega\sigma_{y}\right)
\nonumber\\
& \!\!\!\!\!\!\!\!\!= \left(\mathrm A\cos\omega \sigma_{x}+i\mathrm A\sin\omega\sigma_{y}\sigma_{x}+\mathrm C\cos\omega \sigma_{z}+i\mathrm C\sin\omega\sigma_{y}\sigma_{z}\right)\left(\cos\omega I-i\sin\omega\sigma_{y}\right)
\nonumber\\
&\!\!\!\!\!\!\!\!\! = \mathrm A\cos^{2}\omega \sigma_{x}-i\mathrm A\cos\omega\sin\omega\sigma_{x}\sigma_{y}+i\mathrm A\cos\omega\sin\omega\sigma_{y}\sigma_{x}+\mathrm A\sin^{2}\omega\sigma_{y} \sigma_{x}\sigma_{y}
\nonumber\\
&\:\!\!\!\!\!\!\!\!\!+\mathrm C\cos^{2}\omega \sigma_{z}-i\mathrm C\cos\omega\sin\omega\sigma_{z}\sigma_{y}+i\mathrm C\cos\omega\sin\omega\sigma_{y}\sigma_{z}+\mathrm C\sin^{2}\omega\sigma_{y} \sigma_{z}\sigma_{y}
\nonumber\\
&\!\!\!\!\!\!\!\!\! \!=\!\mathrm A \left(\cos^{2}\omega\!-\!\sin^{2}\omega\right)\sigma_{x}\!+\!2 \mathrm A\cos\omega\sin\omega\sigma_{z}\!-\!2 \mathrm C\cos\omega\sin\omega\sigma_{x}\!+\!\mathrm C \left(\cos^{2}\omega\!-\!\sin^{2}\omega\right)\sigma_{z}
\nonumber\\
&\!\!\!\!\!\!\!\!\!\! =\left(\mathrm A\sin\theta+\mathrm C \cos\theta\right)\sigma_{z}+\left(\mathrm A\cos\theta-\mathrm C \sin\theta\right)\sigma_{x}=\left(\mathrm A\sin\theta+\mathrm C \cos\theta\right)\sigma_{z} 
\tag{04}\label{eq4}
\end{align}
that is, see equation \eqref{eq11}(2) 
\begin{equation}
H'=\sqrt{\mathrm A^{2}+\mathrm C^{2}}\:\sigma_{z}= \sqrt{E_J^{2}+\left[4E_c\left(1-n_g\right)\right]^{2}}\:\sigma_{z}
\tag{05}
\end{equation}
In \eqref{eq4} we make use of Pauli matrices properties, see equations \eqref{eq12a} and \eqref{eq12b}.(3) 

(1)
The reasoning :
The Pauli matrices 
\begin{equation}
\sigma_{x}=
\begin{bmatrix}
0 &  \!\!\hphantom{\boldsymbol{-}}1 \vphantom{\tfrac{a}{b}}\\
1 &  \!\!\hphantom{\boldsymbol{-}}0\vphantom{\tfrac{a}{b}}
\end{bmatrix}
\: , \:\:\:
\sigma_{y}=
\begin{bmatrix}
0 & \!\!\boldsymbol{-} i \vphantom{\tfrac{a}{b}}\\
i & \!\!\hphantom{\boldsymbol{-}} 0\vphantom{\tfrac{a}{b}}
\end{bmatrix}
\: , \:\:\:
\sigma_{z}=
\begin{bmatrix}
1 & \!\!\hphantom{\boldsymbol{-}} 0 \vphantom{\frac{a}{b}}\\
0 & \!\!\boldsymbol{-} 1\vphantom{\frac{a}{b}}
\end{bmatrix}
\tag{06}
\end{equation}
are the hermitian traceless matrix representations of the unit vectors
\begin{equation}
\mathbf{i}=
\begin{bmatrix}
1  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}
\end{bmatrix}
\: , \:\:\:
\mathbf{j}=
\begin{bmatrix}
0  \vphantom{\tfrac{a}{b}}\\
1  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}
\end{bmatrix}
\: , \:\:\:
\mathbf{k}=
\begin{bmatrix}
0  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
1  \vphantom{\tfrac{a}{b}}
\end{bmatrix}
\tag{07}
\end{equation}
along the $\:x,y, z\:$ axis respectively according to the following  bijection (one-to-one and onto correspondence) between $\mathbb{R}^3$ and the space of  $2\times2$  hermitian traceless matrices, let it be $\mathbb{H}$ :
\begin{equation}
   \mathbf{w}=(x,y,z)\in \mathbb{R}^3\;\longleftarrow\!\longrightarrow \; W= 
   \begin{bmatrix}         
         z        &   x-iy  \\
         x+iy   &    -z 
   \end{bmatrix}
       \in \mathbb{H}      
 \tag{08}
\end{equation}
Under this interpretation the Hamiltonian $\:H\:$ of equation \eqref{eq1} is the hermitian traceless matrix representation of the vector
\begin{equation}
\!\!\!\!\!\!\mathbf{h}\!=\!\mathrm A \mathbf{i}+\mathrm C \mathbf{k}\!=\!
\begin{bmatrix}
\mathrm A  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
\mathrm C  \vphantom{\tfrac{a}{b}}
\end{bmatrix}
\!=\!
\begin{bmatrix}
E_J  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
4E_c\left(1-n_g\right) \vphantom{\tfrac{a}{b}}
\end{bmatrix}
\, , \:
\Vert \mathbf{h}\Vert^{2}=\mathrm A^{2}+\mathrm C^{2}=E_J^{2}+\left[4E_c\left(1-n_g\right)\right]^{2}
\tag{09}\label{eq9}
\end{equation}
But if we want under a rotation the new Hamiltonian to be $\:H'=\mathrm B\sigma_{z}\:$ then this Hamiltonian will be the hermitian traceless matrix representation of the vector
\begin{equation}
\mathbf{h'}\!=\!\Vert \mathbf{h}\Vert\:\mathbf{k}\!=\!\sqrt{\mathrm A^{2}+\mathrm C^{2}}\:\mathbf{k}\!=\!
\begin{bmatrix}
0 \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
\sqrt{\mathrm A^{2}+\mathrm C^{2}}
\end{bmatrix}
=
\begin{bmatrix}
0  \vphantom{\tfrac{a}{b}}\\
0  \vphantom{\tfrac{a}{b}}\\
\sqrt{E_J^{2}+\left[4E_c\left(1-n_g\right)\right]^{2}}
\end{bmatrix}
\tag{10}\label{eq10}
\end{equation}
So, the  rotation we try to find must rotate the vector $\:\mathbf{h}\:$ of \eqref{eq9} to the vector $\:\mathbf{h'}\:$ of \eqref{eq10}. The  most simple rotation we have to do it is that given by \eqref{eq3}.
In the Figure below we see the vectorial in $\:\mathbb{R}^{3}\:$ representation of the  $2\times2$  hermitian traceless matrices
$\:\sigma_{x},\sigma_{y},\sigma_{z},H,H'$.


(2)
\begin{equation}
\dfrac{\sin\theta}{\cos\theta}=\tan\theta \stackrel{defin. (03)}{=\!=\!=\!=\!=\!=}\dfrac{\mathrm A }{\mathrm C }\Longrightarrow
\left.
\begin{cases}
\sin\theta=\dfrac{\mathrm A}{\sqrt{\mathrm A^{2}+\mathrm C^{2}}}\\
\cos\theta=\dfrac{\mathrm C}{\sqrt{\mathrm A^{2}+\mathrm C^{2}}}
\end{cases}
\right\}
\Longrightarrow
\left.
\begin{cases}
\mathrm A\sin\theta+\mathrm C \cos\theta=\sqrt{\mathrm A^{2}+\mathrm C^{2}}\vphantom{\dfrac{\mathrm A}{\sqrt{\mathrm A^{2}+\mathrm C^{2}}}}\\
\mathrm A \cos\theta-\mathrm C\sin\theta=0\vphantom{\dfrac{\mathrm A}{\sqrt{\mathrm A^{2}+\mathrm C^{2}}}}
\end{cases}
\right\}
\tag{11}\label{eq11}
\end{equation}


(3)
Pauli matrices properties used :
\begin{align}
\sigma_{x}\sigma_{y} & = \boldsymbol{-}\sigma_{y}\sigma_{x}=i\sigma_{z}\,, \quad  \sigma_{y} \sigma_{x}\sigma_{y} =\boldsymbol{-}\sigma_{x}
\tag{12a}\label{eq12a}\\
\sigma_{y}\sigma_{z} & = \boldsymbol{-}\sigma_{z}\sigma_{y}=i\sigma_{x}\,, \quad  \sigma_{y} \sigma_{z}\sigma_{y} =\boldsymbol{-}\sigma_{z}
\tag{12b}\label{eq12b}
\end{align}

