Let us first recall Specht's Theorem. Denote by $\text{Mat}_{\mathbb{C}}(n)$ the set of all $n\times n$ matrices over the complex field $\mathbb{C}$. Let $A$ be a matrix in $\text{Mat}_{\mathbb{C}}(n)$ and denote by $A^*$ its conjugate transpose. A word $w(A,A^*)$ of $A$ and $A^*$ is an expression of the form $$ A^{n_1}\cdot (A^*)^{m_1}\cdot\cdots\cdot A^{n_k}\cdot (A^*)^{m_k} $$ where ``$\cdot$'' represent matrix multiplication, $A^i$ is the $i$th power of $A$ (similarly for $(A^*)^i$) and $n_1,m_1,\ldots,n_k,m_k$ are non-negative integers. The length of a word is given by $n_1+n_2+\cdots+n_k+m_1+\cdots+m_k$.
Spechts's Theorem: Given two matrices $A$ and $B$ in $\text{Mat}_{\mathbb{C}}(n)$. Then, $A=U\cdot B\cdot U^*$ for some unitary matrix $U$ if and only if $$ \text{tr}(w(A,A^*))=\text{tr}(w(B,B^*)) $$ for all words $w$. Here, $\text{tr}(\cdot)$ is the standard trace function on matrices.
Let us now replace the trace function by the ``sum of all entries'' function $\sigma$ defined as $$ \sigma:\text{Mat}_{\mathbb{C}}(n) \to \mathbb{C}: A=(a_{ij})\mapsto \sigma(A)=\sum_{i=1}^n\sum_{j=1}^n a_{ij}.$$ It is known that the functions $s(\cdot)$ and $\text{tr}(\cdot)$ share certain properties, see e.g., Merikoski: On the trace and the sum of elements of a matrix, Linear Algebra and its applications, Volume 60, August 1984, pp. 177-185.
But what is known for two matrices $A$ and $B$ such that $$ \sigma(w(A,A^*))=\sigma(w(B,B^*))\tag{1} $$ for all words $w$?
Question: Is a Specht-like characterisation of matrices satisfying the conditions (1) known? Moreover,
- Is the equivalence relation $A\equiv_s B$ iff $\sigma(w(A,A^*))=\sigma(w(B,B^*)) $ for all words $w$ studied before?
- What about $A\equiv_s^K B$ iff $\sigma(w(A,A^*))=\sigma(w(B,B^*)) $ for all words of length less than $K$?
- Can it be that $A\equiv_s^K B$ but $A\not\equiv_s^{K+1} B$?
- What if we restrict $A$ and $B$ to (non-negative) real matrices?
Any pointers to related work or insights are welcome.