# 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?

## closed as unclear what you're asking by PlatoManiac, Dr. belisarius, Mark McClure, Sjoerd C. de Vries, m_goldbergDec 19 '14 at 15:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• 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

The code below works for matrices representing ordinary complex numbers.

matrixToComplexNumber[{{a_, b_}, {c_, d_}}] := Module[{p, q, x},
p = (a - d)^2/4 + b c;
If[p >= 0, Return["N is not an ordinary complex number"]];
x = (a + d)/2;
Return[{x, Sqrt[-p]}];
]

• Thanks! But why it returns for {{0,-1,1,0}} and {{0,1,-1,0}} the same result? It should be i and -i. – Anixx Dec 18 '14 at 13:55
• I am also interested in how to adapt it for dual numbers. – Anixx Dec 18 '14 at 13:56