# Matrix form of complex numbers [closed]

Complex numbers have matrix form. But some 2x2 matrices while differ, represent the same complex number. To compare complex numbers one has to transform the matrices to the form

\begin{pmatrix} a & -b \\ b & \;\; a \end{pmatrix}.

How I transform an arbitrary 2x2 matrix representing a complex number to this form without changing its complex number value?

• c = a + I b; Refine[{{Re[c], -Im[c]}, {Im[c], Re[c]}}, Assumptions -> {a, b} [Element] Reals]? – Algohi Dec 18 '14 at 13:30
• @Algohi how to transform a matrix to this form? You show how to produce a matrix given a complex number, I am looking for the opposite. – Anixx Dec 18 '14 at 13:36
• Do you mean MatrixForm? – Algohi Dec 18 '14 at 13:38
• @Algohi it only changes appearance, it does not change the matrix. – Anixx Dec 18 '14 at 13:39
• What would be an example of two different matrices that represent the same complex number? – Daniel Lichtblau Dec 18 '14 at 19:23

matrixToComplexNumber[{{a_, b_}, {c_, d_}}] := Module[{p, q, x},