What matrix functionals are invariant under change of basis? Fix some integer $n$, and consider the linear space $M(n,\mathbb F)$ of square $n\times n$ matrices in some field $\mathbb F$. Let $f:M(n,\mathbb F)\to\mathbb F$ be a functional that is invariant under change of basis, that is, such that $f(PAP^{-1})=f(A)$ for any $A,P\in M(n,\mathbb F)$ with $P$ invertible.
Standard examples are $f(A)=\det(A)$ and $f(A)=\operatorname{tr}(A)$. More generally, any function defined via the eigenvalues of $A$ is another example of this.
Are these the only possible such examples?
In other words, can we characterise the set of possible functionals $M(n,\mathbb F)\to\mathbb F$ that are invariant under change of basis as being all and only those functions that can be defined from the eigenvalues of the matrix? I'm mostly interested to the cases $\mathbb F=\mathbb R,\mathbb C$, but I'm leaving this question general because I don't know if this assumption is relevant to the discussion.
 A: Here is an observation that you might find interesting.

Claim: Let $\Bbb F \in \{\Bbb R, \Bbb C\}$. If $f:M(n,\Bbb F) \to \Bbb F$ is invariant under change of basis and continuous, then there exists a (symmetric) function $g$ such that $f(A) = g(\lambda_1(A),\dots,\lambda_n(A))$.

Proof of claim: I will prove this for $\Bbb F = \Bbb C$, but the proof for $\Bbb F = \Bbb R$ is similar. Define $g:\Bbb C^n \to \Bbb C$ by
$$
g(\lambda_1,\dots,\lambda_n) = f (\operatorname{diag}(\lambda_1,\dots,\lambda_n)),
$$
where $\operatorname{diag}(\lambda_1,\dots,\lambda_n)$ is the diagonal matrix with diagonal entries $\lambda_1,\dots,\lambda_n$. It is clear that if $A$ is diagonlizable, then $f(A) = g(\lambda_1(A),\dots,\lambda_n(A))$. Suppose that $A$ is not diagonalizable. Let $J = PAP^{-1}$ be the Jordan form of $A$. Define
$$
D_k = \operatorname{diag}(1,k,\dots,k^n).
$$
Note that because $J$ is upper-triangular, $\lim_{k \to \infty}D_kJD_k^{-1} = \Lambda$, where $\Lambda$ denotes the diagonal matrix whose diagonal is equal to that of $J$.  Conclude that
$$
g(\lambda_1(A),\dots,\lambda_n(A)) = 
f(\Lambda) = f\left(\lim_{k \to \infty} D_kJD_k^{-1}\right)
\\
= \lim_{k \to \infty} f(D_kJD_k^{-1}) = \lim_{k \to \infty} f(J) = 
f(J) = f(A).
$$
A: A function $f:\mathcal M_n(\mathbb F) \to \mathbb F$ is invariant under $A\to P^{-1}AP$ if it is constant on the equivalence classes of similar matrices. A complete set of invariant for matrix similarity is given by the so-called invariants de similitude (I don't know how they are called in english). So $f$ is invariant if, and only if, it factorizes as a function of those invariants.
This includes the determinant, the trace, as well as any function of the characteristic polynomial, but also many others.
