Given two real and irreducible matrices $A$ and $B$ of size $n \times n$. A matrix $A$ is irreducible if there is no permutation matrix $Q$ so that
$$
Q^{-1} A Q = \begin{bmatrix} E & G \\ 0 & F \end{bmatrix}
$$
where $E$ and $F$ are square.


Also, $A$ and $B$ have equal principal minors, i.e,
$$
det A(\alpha) = det B(\alpha) \textrm{ for non-empty } \alpha \subset \{1, \dots, n\},
$$
where $A(\alpha)$ is the submatrix with columns and rows indices in $\alpha$.


There is also symmetric $P$ such that
$$
P A P^{-1} = B.
$$
Are then $A$ and $B$ necessarily diagonally similar?
The opposite direction is clear, i.e., for $A$ and $B$ being diagonally similar, $A$ and $B$ have equal principal minors.



Principal minors and similarity
$$A=\begin{bmatrix} 1& 0& 1\\1&1&1\\1&1&1 
\end{bmatrix} \quad
B=\begin{bmatrix} 1& 1& 1\\0&1&1\\1&1&1 
\end{bmatrix} \quad
P=\begin{bmatrix} 0& 1& 0\\1&0&0\\0&0&1 
\end{bmatrix}$$


$P^{-1}=P$ and $B=PAP^{-1}$. $A$ is irreducible since conjugation by a
permutation matrix simply moves around the single zero in $A$ (all of
the entries of $A^2$ are positive). The principle minors of $A$ and
$B$ are equal. However, if $D=\begin{bmatrix} a& 0& 0\\0&b&0\\0&0&c
\end{bmatrix}$ is any invertible diagonal matrix,
$$DAD^{-1}=\begin{bmatrix} 1& 0& a/c\\b/a&1&b/c\\c/a&c/b&1 
\end{bmatrix}\neq B$$.


