An example of an operator whose spectrum is the unit square Is there an example of an operator, the spectrum of which is a unit square $[0, 1] \times [0, 1] \subset \mathbb{C}$?
 A: Take any $K\subset\mathbb C$, compact. Let $\{q_j\}_{j\in\mathbb N}\subset K$ be dense. Now for $T\in B(\ell^2(\mathbb N))$ by $$Te_j=q_je_j,$$ where $\{e_j\}$ is the canonical basis. 
Then all $q_j$ are eigenvalues of $T$. The spectrum is closed, so $K\subset \sigma(T)$. If $\lambda\in \mathbb C\setminus K$, the compactness of $ K$ guarantees that there exists $\delta>0$ with $|\lambda-t|\geq\delta$ for all $t\in \sigma(T)$. Then the operator $S$ given by 
$$
Se_j=\frac1{q_j-\lambda}\,e_j
$$
is bounded with $\|S\|\leq\frac1\delta$, and $S(T-\lambda I)=(T-\lambda I)S=I$. So $\mathbb C\setminus K\subset\mathbb C\setminus\sigma(T)$, which implies $\sigma(T)\subset K$. 
Thus $\sigma(T)=K$. 
A: This answer gives an affirmative response to your question (and more general variants of it), assuming that we're free to choose the domain of the operator.
If we're not, the answer depends on the domain of the operator, but I'm not sure if a 'characterization' is known/has been developed.
A: Let $Mf = zf(z)$ be the multiplication operator on $L_{\mu}^2(S)$ where $S$ is the square $S=\{ z \in \mathbb{C} : 0 \le \Im z \le 1, 0 \le \Re z \le 1 \}$,
and where $\mu$ is Lebesgue measure on $S$. Then the spectrum of $M$ is $S$. Using various measures on $\mathbb{C}$ and the operator $M$, you can design $M$ to have any closed compact set as its spectrum.
