$\newcommand{\bra}[1]{\left\langle #1 \right|} \newcommand{\ket}[1]{\left| #1 \right\rangle}$I have a simple 4-state Hamiltonian and am trying to find the matrix representation (in order to determine the eigenvalues of energy for the system); however, I keep ending up with the wrong matrix, so I'd appreciate some help with spotting what concept I'm misunderstanding.
We have that the Hamiltonian is given by:
\begin{equation} \hat{\mathbf{H}}=\sum_{n=1}^{4}E_{0}\left|n\right\rangle\left\langle n \right|+\sum_{n=1}^{4}W\{\left| n \right\rangle\left\langle n+1 \right| + \left|n+1\right\rangle\left\langle n \right|-\left|2\right\rangle\left\langle 3\right|-\left|3\right\rangle\left\langle 2 \right| \} \end{equation}
Using the distributivity of the sum over the space formed by the tensor product $\mathbb{C}^{4} \otimes \mathbb{C}^{4}$, we have that this can be written by:
$$\hat{\mathbf{H}}=E_{0}\sum_{n=1}^{4}\ket{n}\bra{n}+W\left\{\sum_{n=1}^{4}\ket{n}\bra{n+1}+\sum_{n=1}^{4}\ket{n+1}\bra{n}-\sum_{n=1}^{4}\ket{2}\bra{3}-\sum_{n=1}^{4}\ket{3}\bra{2}\right\}$$
We further can reduce this by noting that: $\sum_{n=1}^{4}k = 4k$, $\forall k \in \mathbb{C}^{4}\otimes \mathbb{C}^{4}$, and thus:
$$\hat{\mathbf{H}}=E_{0}\sum_{n=1}^{4}\ket{n}\bra{n}+W\sum_{n=1}^{4}\ket{n}\bra{n+1}+W\sum_{n=1}^{4}\ket{n+1}\bra{n}-4W\ket{2}\bra{3}-4W\ket{3}\bra{2}$$ If we work in the space where: $$\ket{n}=\begin{cases}\hat{\mathbf{e}}_{n} & n \in \{1,2,3,4\} \\ \mathbf{0} & n \not\in \{1,2,3,4\}\end{cases}$$
Then we have:
$$\sum_{n=1}^{4}\ket{n}\bra{n}=\mathbf{I}_{4\times 4} \quad\land\quad \ket{2}\bra{3} = \begin{pmatrix}0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0\end{pmatrix} \quad\land\quad \ket{3}\bra{2}=\begin{pmatrix}0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0\end{pmatrix}$$
And:
$$\sum_{n=1}^{4}\ket{n}\bra{n+1}=\begin{pmatrix}0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0\end{pmatrix} \quad\land\quad \sum_{n=1}^{4}\ket{n+1}\bra{n}=\begin{pmatrix}0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}$$
Thus we have:
$$\hat{\mathbf{H}}=E_{0}\mathbf{I}_{4\times 4}+\begin{pmatrix}0 & W & 0 & 0 \\ 0 & 0 & W & 0 \\ 0 & 0 & 0 & W \\ 0 & 0 & 0 & 0\end{pmatrix}+\begin{pmatrix}0 & 0 & 0 & 0 \\ W & 0 & 0 & 0 \\ 0 & W & 0 & 0 \\ 0 & 0 & W & 0\end{pmatrix}-\begin{pmatrix}0 & 0 & 0 & 0 \\ 0 & 0 & 4W & 0 \\ 0 & 4W & 0 & 0 \\ 0 & 0 & 0 & 0\end{pmatrix}$$
Expanding, we have:
$$\hat{\mathbf{H}} = \begin{pmatrix}E_{0} & W & 0 & 0 \\ W & E_{0} & -3W & 0 \\ 0 & -3W & E_{0} & W \\ 0 & 0 & W & E_{0}\end{pmatrix}$$
Which is incorrect, as I know that the eigenvalues are $\{E_{0}\pm W\}$, and the Hamiltonian can be written in matrix form as:
$$\hat{\mathbf{H}} = \begin{pmatrix}E_{0} & W & 0 & 0 \\ W & E_{0} & 0 & 0 \\ 0 & 0 & E_{0} & W \\ 0 & 0 & W & E_{0}\end{pmatrix}$$
However, I'm not sure where I've made my error, each step seems valid to me?