TITLE: Show that any compact set in $\mathbb{C}$ is the spectrum of an operator.
QUESTION [6 upvotes]: I have been looking around for an example of a general continuous (bounded) linear operator, who's spectrum is any compact set $K\subset\mathbb{C}$.
I have seen an example, where we take the set $\{\alpha_n\}$ to be a countable dense subset of $K$. Let $H$ be a hilbert space with orthonormal basis $\{e_n\}$, define the operator $T:H\to H$ such that:
$T(u)=\sum_n\alpha_n\langle u,e_n\rangle e_n.$ I can see that any eigenvalue of $T$ is some $\alpha_j\in\{\alpha_n\}$ since:
$Tu-\lambda u=0\Rightarrow \sum_n\alpha_n\langle u ,e_n \rangle e_n-\sum_n\lambda\langle u,e_n\rangle e_n=0$ Now each $i$-th term gives us:
$\alpha_iu_i-\lambda u_i=0\Rightarrow \lambda = \alpha_i$ so we know that every value in $\{\alpha_n\}$ is in the spectrum of $T$ so we see that the spectrum is at least a dense subset of $K$. 
But this is where I am stuck and would appreciate help/ explaining what comes next.
Thanks!

REPLY [3 votes]: Suppose that a non-empty set $K$ in $\mathbb{C}$ is given and choose a dense sequence $(\lambda_n)$ in $K$. If $T$ is the corresponding diagonal operator, $T(e_n)=\lambda_n e_n$, then 
${\rm sp}(T)=\overline{\{\lambda_n: n\in\mathbb{N}\}}=K$.
 Thus, the spectrum is an arbitrary non-empty compact set in general.