Let $H$ be a $\mathbb R$-Hilbert space, $A\in\mathfrak L(H)$ be self-adjoint and $\sigma(A)$ denote the spectrum of $A$. We know that$^1$ $$\sup_{\left\|x\right\|_H=1}\langle Ax,x\rangle_H=\sup\sigma(A)\tag1$$ and $$\left\|A\right\|_{\mathfrak L(H)}=\sup_{\left\|x\right\|_H=1}|\langle Ax,x\rangle|\tag2.$$
Now assume that $A$ is compact and nonnegative. Then, $$A=\sum_{i\in I}\lambda_ie_i\otimes e_i\tag3$$ for some orthonormal basis $(e_i)_{i\in I}$ of $\overline{\mathcal R(A)}$, nonincreasing $(\lambda_i)_{i\in I}\subseteq(0,\infty)$ and $I:=\mathbb N\cap[0,\operatorname{rank}A]$. In light of $(1)$, can we show that $$\left\|A\right\|_{\mathfrak L(H)}=\lambda_1\tag4$$ using $(3)$?
Clearly, to exclude the trivial case, we may supplement $(e_i)_{i\in I}$ to an orthonormal basis $(e_i)_{i\in\tilde I}$ of $H$, $\tilde I:=\mathbb N\cap[0,\dim H]$, and set $\lambda_i:=0$ for $i\in\tilde I\setminus I$.
$^1$ I'm lacking a reference for that at the moment. So, if anyone has a good reference for this result, I would really appreciate a comment.