How to calculate Spectrum function in condensed matter physics? Now I known the spectrum function can be measured directly in certain experiments. Suppose Hamiltonian for a system is $H = \epsilon(k)\sigma_x+M(k)\sigma_y$,spectrum function can be calculated as:$A(k,\omega)=\sum_{n,\sigma}\frac{|u_{n,\sigma}(k)|^2}{\omega-E(k) + i*\Gamma}$,where $E(k)$ and $u_{n,\sigma}(k)$ are eigenvalues and eigenvectors through diagonalizing the Hamiltonian matrix.In here $\sigma_i$ is Pauli matrices act in spin or orbit space.$n$ is eigenvalues index.
If a Hamiltonian can be expressed 4*4 matrice,it has spin and orbit freedom.In this condition summation of spectrum freedom should include spin and orbit at the same time?
$$A(k,\omega)=\sum_{n,\sigma,s}\frac{|u_{n,\sigma,s}(k)|^2}{\omega-E(k) + i*\Gamma}$$
where $\sigma$ and s are orbit and spin indecs,respectively. Is this formula correct?
And also,what if superconductivity be added in Hamiltonian? I realized particle-hole space will appear in this situation,just add the particle-hole index $\tau$ within formula?
 A: What you suspect is basically correct, each new d.o.f. leads to an additional index to be summed over. The spectral function is related to the trace of the imaginary part of the (retarded) Green function. That is
\begin{equation}
A(k,\omega) = - \frac{1}{\pi} \textrm{Im}\left(\textrm{tr}\left[ \hat{G}^R (k,\omega)\right] \right),
\end{equation}
where
\begin{equation}
\hat{G}^R (k,\omega) = \left( \omega - \hat{H}(k) + i\eta \right)^{-1} = \sum_n \frac{\vert k, n \rangle \langle k, n \vert}{\omega - \varepsilon_{k,n} + i \eta}.
\end{equation}
Here, $\eta$ is infinitesimal but positive and $\vert k,n \rangle$ are eigenstates of the Bloch Hamiltonian $\hat{H}(k)$ with energies $\varepsilon_{k,n}$. So the sum goes over all quantum numbers labeling the eigenstates of $\hat{H}(k)$. In your case that would be over the bands formed from your spin and orbit degrees of freedom. We can then evaluate the spectral function as
\begin{equation}
A(k,\omega) = - \frac{1}{\pi} \textrm{Im}\left(  \sum_n \frac{ \textrm{tr} \vert k, n \rangle \langle k, n \vert  }{\omega - \varepsilon_{k,n} + i \eta}  \right) =  - \frac{1}{\pi} \textrm{Im}\left(  \sum_{n,\sigma,s,\tau ... } \frac{ \langle\sigma,s,\tau ... \vert k, n \rangle \langle k, n \vert \sigma,s,\tau ...\rangle  }{\omega - \varepsilon_{k,n} + i \eta}  \right),
\end{equation}
where we have written the trace as a sum over orbit $\sigma$, spin $s$, particle hole $\tau$ etc. ..., i.e. $\textrm{tr}\left[ X \right] = \sum_{\sigma,s,\tau ... }  \langle\sigma,s,\tau \vert X \vert \sigma,s,\tau ...\rangle$. The matrix elements $\langle\sigma,s,\tau ... \vert k, n \rangle$ are just your $u(k)_{n;\sigma,s,\tau, ...}$. 
