A first square matrix is similar to a second square matrix if there exists a nonsingular matrix such that the first matrix is identical to the product of the inverse of the nonsingular matrix the second square matrix and the nonsingular matrix.
Let $A, B \in \R ^{n \times n}$.
$B$ is similar to $A$ if there exists a
nonsingular matrix $S \in \R ^{n \times n}$
such that
\[
B = S^{-1}AS.
\]