Let $X$ be compact separable Hausdorff space with a positive Borel measure $\mu$. Assume $L^2(X)$ is separable.
Consider a function $K: X \times X \to \mathbb{C}$ with $K \in L^2(X \times X , \mu \otimes \mu)$. We denote the integral operator $\tilde{K}$ on $L^2(X)$ whose kernel is $K$, that is, for every $f \in L^2(X)$ we define \begin{align} \tilde{K}f(x) = \int_X K(x,y)f(y)\mu(dy). \end{align}
Then is the operator $\tilde{K}$ in Hilbert Schmidt class, that is, for every orthonormal basis $\{e_n\}$ on $L^2(X)$, \begin{align} \sum_{n}(\tilde{K}^{\ast}\tilde{K}e_n,e_n) = \int_{X \times X}|K(x,y)|^2\mu \otimes \mu(dx,dy)< \infty? \end{align}
I know this holds when $X = \mathbb{R}$ and $\mu$ is the Lebesgue measure. But I couldn't find the assertion for general settings. I would appreciate it if you give me counter examples or conditions for $X$ and $\mu$ under which the assertion holds.
This is true and , in fact, the converse is also true. Every H-S operator on $L^{2}(\mu)$ is of this type for some $K$. Reference: Theorem VI.23, p. 210, Functional Analysis, Vol 1 by Reed and Simon.