# How to prove two matrices unitary equivalent?

A= $$\left[ \begin{array}{ccc} 2&1&4\\ 0&1&2\\ 0&0&1 \end{array} \right]$$ and B=$$\left[ \begin{array}{ccc} 2&0&3\sqrt2\\ 1&1&\sqrt2\\ 0&0&1 \end{array} \right]$$ Is there any method to find if they are matrix equivalent? Or we need to find a matrix S by trial and error such that $$S^*AS=B$$

• First off, apply a permutation similarity to bring $B$ to the form $$\pmatrix{1&1&\sqrt{2}\\0&2& 3 \sqrt{2}\\ 0&0&1}$$ – Ben Grossmann Feb 24 '17 at 6:13
• It seems like the answer will be yes, which I find surprising – Ben Grossmann Feb 24 '17 at 6:19
• A common trick is to compare $tr(w(A,A^*))$ and $tr(w(B,B^*))$ where $w$ denotes a word on two letters. So far, $tr(A^nA^{*n}) = tr(B^nB^{*n})$ up to $n=3$. – Ben Grossmann Feb 24 '17 at 6:21

Guess: try calculating $S^*BS$ with $$S = \frac 1{\sqrt{2}}\pmatrix{1&1&0\\1&-1&0\\0&0&\sqrt{2}}$$ The idea is that I begin by upper triangularizing $B$ to match the form of $A$, with $2$ as the first eigenvector.