# Diagonalizing quadratic Hamiltonian in second quantization

I have a Hamiltonian of the form $$H = \Sigma_{ij} H_{ij}a^\dagger_ia_j$$, and I want to diagonlize it:

Let $$H_{ij} = \Sigma_{\alpha}U_{i\alpha}\epsilon_\alpha U^*_{j\alpha}$$, where U is a unitary matrix. Then I proceed by inserting this in the first equation:

$$H = \Sigma_{ij\alpha}U_{i\alpha}\epsilon_\alpha U^*_{j\alpha}a^\dagger_ia_j = \Sigma_\alpha \epsilon_\alpha \Big(\Sigma_i U_{i\alpha}a^\dagger_i\Big)\Big(\Sigma_jU^\dagger_{j\alpha}a_j\Big)$$

Defining $$b^\dagger_\alpha = \Sigma_i U_{i\alpha}a^\dagger_i$$ my Hamiltonian can be writen as:

$$H = \Sigma_\alpha \epsilon_\alpha b^\dagger_\alpha b_\alpha$$ which is diagonal. My first question is: why is this a diagonal hamiltonian? How can I be so sure?

The second question is: how to effectvely use this diagonalization procedure?

I have now a Hamiltonian of the form: $$H = \epsilon_\alpha a^\dagger a + \epsilon_b b^\dagger b - J(a^\dagger b + b^\dagger a)$$ where a and b are two modes, that can be either bosonic or fermionic.

To diagonalize this I have to use the procedure described only in the part that is multiplied by -J?

Basically what we mean is that we can write our Hilbert space as a product of $$n$$ smaller spaces such that our Hamiltonian has the form of $$\hat H = \hat h_1 \otimes I \otimes \dots \otimes I ~+~ I \otimes h_2 \otimes \dots \otimes I ~+~ \dots ~+~ I \otimes I \otimes \dots \otimes \hat h_n,$$ where $$I$$ is the identity operator.
In your case, to “be sure” you will want to confirm that your $$b_i$$ are commuting or anticommuting annihilators, so that they satisfy either $$b_m b_n^\dagger \mp b_n^\dagger b_m = \delta_{mn}$$with the $$-$$ sign for the bosonic case and the $$+$$ sign for the fermionic case. If you have this, then you have a Fock space in the form of the occupation numbers for the states that the $$b_n$$ annihilate, and your Hamiltonian is diagonal with regard to that Fock space.
(2) Yes, you essentially want to imagine that you have a matrix looking something like $$\begin{bmatrix}\epsilon_a & -J\\-J & \epsilon_b\end{bmatrix}.$$