Naive questions about "matrices" representing endomorphisms of Hilbert spaces. This is a very basic question and might be way too easy for MO. I am learning analysis in a very backwards way. This is a question about complex Hilbert spaces but here's how I came to it: I have in the past written a paper about (amongst other things) compact endomorphisms of $p$-adic Banach spaces (and indeed of Banach modules over a $p$-adic Banach algebra), and in this paper I continually used the notion of a "matrix" of an endomorphism as an essential crutch when doing calculations and proofs. I wondered at the time where more "conceptual" proofs existed, and probably they do, but I was too lazy to find them.
Now I find myself learning the basic theory of certain endomorphisms of complex separable Hilbert spaces (continuous, compact, Hilbert-Schmidt and trace class operators) and my instinct, probably wrong, is to learn the theory in precisely the same way. So this is the sort of question I find myself asking.
Say $H$ is a separable Hilbert space with orthonomal basis $(e_i)_{i\in\mathbf{Z}_{\geq1}}$. Say $T$ is a continuous linear map $H\to H$. Then $T$ is completely determined by its "matrix" $(a_{ij})$ with $Te_i=\sum_ja_{ji}e_j$. But are there completely "elementary" conditions  which completely classify which collections of complex numbers $(a_{ij})$ arise as "matrices" of continuous operators?
I will ask a more precise question at the end, but let me, for the sake of exposition, tell you what the the answer is in the $p$-adic world.
In the $p$-adic world, $\sum_na_n$ converges iff $a_n\to 0$, and life is easy: the answer to the question in the $p$-adic world is that $(a_{ij})$ represents a continuous operator iff 
(1) For all $i$, $\sum_j|a_{ji}|^2<\infty$ (equivalently, $a_{ji}\to 0$ as $j\to\infty$), and 
(2) there's a universal bound $B$ such that $|a_{ij}|\leq B$ for all $i,j$.
[there is no inner product in the $p$-adic case, so no adjoint, and the conditions come out being asymmetric in $i$ and $j$].
See for example pages 8--9 of this paper of mine, although of course this isn't due to me---it's in Serre's paper on compact operators on $p$-adic Banach spaces from the 60s---see Proposition 3 of Serre's paper. In particular, in the $p$-adic world, one can identify the continuous maps $H\to H$ (here $H$ is a $p$-adic Banach space with countable ON basis $(e_i)$) with the collection of bounded sequences in $H$, the identification sending $T$ to $(Te_i)$.
In the real/complex world though, the analogue of this result fails: the sequence $(e_1,e_1,e_1,\ldots)$ is a perfectly good bounded sequence, but there is no continuous linear map $H\to H$ sending $e_i$ to $e_1$ for all $i$ (where would $\sum_n(1/n)e_n$ go?). 
Let's consider the finite rank case, so $T$ is a continuous linear map $H\to H$ with image landing in $\mathbf{C}e_1$. Then by Riesz's theorem, $T$ is just "inner product with an element of $H$ and then multiply by $e_1$". Hence we have an additional condition on the $a_{ij}$, namely that $\sum_j|a_{ij}|^2<\infty$. Furthermore a continuous linear map is bounded, as is its adjoint.
This makes me wonder whether the following is true, or whether this is still too naive:
Q) Say $(a_{ij})$ $(i,j\in\mathbf{Z}_{\geq1})$ is a collection of complex numbers satisfying the following:
There is a real number $B$ such that
1) For all $i$, $\sum_j|a_{ij}|^2\leq B$
2) For all $j$, $\sum_j|a_{ij}|^2\leq B$
Then is there a unique continuous linear map $T:H\to H$ with $Te_i=\sum_ja_{ji}e_i$?
My guess is that this is still too naive. Can someone give me an explicit counterexample? Or, even better, a correct "elementary" list of conditions characterising the continuous endomorphisms of a Hilbert space?
On the other hand, it clearly isn't a complete waste of time to think about matrix coefficients. For example there's a bijection between Hilbert-Schmidt operators $T:H\to H$ and collections $(a_{ij})$ of complexes with $\sum_{i,j}|a_{ij}|^2<\infty$, something which perhaps the experts don't use but which I find incredibly psychologically useful.
 A: So maybe the following is a counterexample to Kevin's original post. (It was created by computer scientist and friend Erik Vee as a "counterexample" to that exercise 3.14 in Zimmer (which says that a bounded operator is compact iff $a_{ij}$ goes to 0 as i and j go to $\infty$); and it was Robert Pollack who figured out that the reason it's not a counterexample is that it doesn't represent a continuous operator. So my role here is transcriber only.)
Define the matrix as follows. The first column is (1, 0, 0, ...), the second is (1/2, 1/2, 1/2, 1/2, 0, 0, ...), the nth has $\frac 1 n$ appearing $n^2$ times, followed by all zeros. Then $\ell_2$-norm of each column is exactly 1, and the $\ell_2$-norm of each row is bounded by $\sqrt{\frac{\pi^2}{6}}$. So this matrix has bounded $\ell_2$ rows and columns as necessary. 
But this matrix cannot represent a continuous operator. If it did, then, since it satisfies Kevin's/Zimmer's criterion, this operator -- call it $A$ -- would be compact, and hence a uniform limit of the operators $A_n$ given by the first n rows of $A$. But the operator $A - A_n$ has, in its nth column, $\frac 1 n$ appearing $n^2 - n$ times, which means that that column's $\ell_2$ norm is $1 - \frac 1 n$, which is bounded away from zero.
It's still unclear to me if this matrix represents an unbounded linear map, or if it doesn't represent a well-defined map at all.  
A: Not an answer, only a side question to Kevin Buzzard. Properly a comment. 
Kevin, you mention in a comment to gowers' answer above that you have easy criteria for an infinite matrix representing a continuous operator on a Hilbert space to be be representing a compact or trace-class operator. What are these criteria?
A: Chapter V of Halmos' "A Hilbert space problem book" is called "Infinite matrices".
It contains lots of nice results and problems, and also the statement that "there are no elegant and usable necessary and sufficient conditions [for a matrix to be the matrix of an operator]".
A: Consider the n-by-n matrix that has $n^{-1/2}$ as every entry. That satisfies your condition with B=1. The image of the unit vector that has $n^{-1/2}$ as every coordinate is a vector that has 1 as every coordinate, and therefore norm $n^{1/2}$. 
If you now put a whole lot of these as blocks down the diagonal, you can create an unbounded operator that satisfies your condition with B=1.
I'd say that the main general problem with the condition you suggested is that it is too tied to one particular basis. I'm not sure it's all that easy to come up with nice conditions of the kind you are looking for.
Additional remark: if you take spaces like ell_1 and ell_infinity, where the definition of the norm is much more closely tied to a particular basis, then it tends to be easier to find nice matrix conditions for boundedness.
