Solution (source code)

= Solution

The <trace> is unchanged by <similarity>, so in the same <eigenbasis>
$$
\boxed{\operatorname{tr}H=\lambda_1+\lambda_2.}
$$