Given the following model for a particle on a lattice: $$ \hat{H} = -t \sum_j[\left|\ j-2\right\rangle \left\langle j \right|+ \left|j+2\right\rangle \left\langle j \right|]$$
We introduce vectors $\vec{e_j} = (0,0,\dots,1, \dots, 0) \equiv \left|\vec{e_j}\right\rangle$ where 1 is the $j$-th column. Similarly introduce the vectors $\vec{k_n} = (0,0,\dots,1,\dots,0)$ which is equivalent to: $$\left|k_n\right\rangle = \frac{1}{\sqrt{N}} \sum_j \exp(i k_nja)\left|e_j\right\rangle$$ with $k_n = \frac{2\pi n }{aN}$
Now, as part of an assignment, I would like to construct a matrix $Q$ such that $H_e = Q^{-1}H_kQ$ which has the property that $Q^{\dagger} = Q^{-1}$ where $H_e$ is the $N \times N $ matrix with elements $[H_e]_{jj'} = \left\langle j|\hat{H}|j'\right\rangle$ and $H_k$ is the $N \times N $ matrix with elements $[H_k]_{kk'} = \left\langle k|\hat{H}|k'\right\rangle$
I suppose that the method is to first find matrices $H_e$ and $H_k$ but I'm not quite sure how to do this, since I don't fully understand the way the different elements are calculated?