# Conditions to make unitary a given matrix

Suppose I have some symmetric matrix W = {{c[1, 1], c[1, 2], c[1, 3]}, {c[1, 2], c[2, 2],c[2, 3]}, {c[1, 3], c[2, 3], c[3, 3]}}; where the c's are complex and I want conditions on them such that W is unitary.
I tried using with Solve[ConjugateTranspose[W].W-IdentityMatrix[3]==0] but seems like the equations are to heavy to solve. Is there another way to do this? I just want conditions on the c's.

• The conditions are, quite literally, $WW^\dagger=1$, component-wise. It's not likely this can be simplified any further. You could try something like Reduce@And@@Flatten@ ..., but don't expect any considerable simplification. – AccidentalFourierTransform Jun 23 at 0:47

This is a very complex problem in general. I'll do the $$n=2$$ case only.

Define the matrix $$W$$ with explicit real and imaginary parts: $$c_{i,j}=a_{i,j}+i b_{i,j}$$,

n = 2;
W = Table[c[Min[i, j], Max[i, j]], {i, n}, {j, n}] /. c[i_, j_] -> a[i, j] + I*b[i, j]
Wd = ConjugateTranspose[W] // ComplexExpand


The variables of $$W$$:

vars = Flatten[Table[{a[i, j], b[i, j]}, {i, n}, {j, i, n}]]
(*    {a[1, 1], b[1, 1], a[1, 2], b[1, 2], a[2, 2], b[2, 2]}    *)


Set the real and imaginary parts of $$W\cdot W^{\dagger}-1$$ to zero and reduce over the reals:

Reduce[Thread[Flatten[ComplexExpand[ReIm[W.Wd - IdentityMatrix[n]]]] == 0],
vars, Reals]


(a[1, 1] == -1 && b[1, 1] == 0 && a[1, 2] == 0 && b[1, 2] == 0 && ((a[2, 2] == -1 && b[2, 2] == 0) || (-1 < a[2, 2] < 1 && (b[2, 2] == -Sqrt[1 - a[2, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2])) || (a[2, 2] == 1 && b[2, 2] == 0))) || (-1 < a[1, 1] < -(1/Sqrt[ 2]) && ((b[1, 1] == -Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (-Sqrt[ 1 - a[1, 1]^2] < b[1, 1] <= 0 && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (0 < b[1, 1] < Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (b[1, 1] == Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))))) || (a[1, 1] == -(1/Sqrt[ 2]) && ((b[1, 1] == -Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (-Sqrt[ 1 - a[1, 1]^2] < b[1, 1] <= Root[-1 + 6 a[1, 1]^2 - 12 a[1, 1]^4 + 8 a[1, 1]^6 + (-2 - 12 a[1, 1]^2 + 18 a[1, 1]^4 + a[1, 1]^6) #1^2 + (12 a[1, 1]^2 + 3 a[1, 1]^4) #1^4 + (2 + 3 a[1, 1]^2) #1^6 + #1^8 &, 3] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]))) || (Root[-1 + 6 a[1, 1]^2 - 12 a[1, 1]^4 + 8 a[1, 1]^6 + (-2 - 12 a[1, 1]^2 + 18 a[1, 1]^4 + a[1, 1]^6) #1^2 + (12 a[1, 1]^2 + 3 a[1, 1]^4) #1^4 + (2 + 3 a[1, 1]^2) #1^6 + #1^8 &, 3] < b[1, 1] < Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (b[1, 1] == Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))))) || (-(1/ Sqrt2) < a[1, 1] < 1/Sqrt[ 2] && ((b[1, 1] == -Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (-Sqrt[ 1 - a[1, 1]^2] < b[1, 1] <= 0 && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (0 < b[1, 1] < Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (b[1, 1] == Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))))) || (a[1, 1] == 1/Sqrt[ 2] && ((b[1, 1] == -Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (-Sqrt[ 1 - a[1, 1]^2] < b[1, 1] <= Root[-1 + 6 a[1, 1]^2 - 12 a[1, 1]^4 + 8 a[1, 1]^6 + (-2 - 12 a[1, 1]^2 + 18 a[1, 1]^4 + a[1, 1]^6) #1^2 + (12 a[1, 1]^2 + 3 a[1, 1]^4) #1^4 + (2 + 3 a[1, 1]^2) #1^6 + #1^8 &, 3] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]))) || (Root[-1 + 6 a[1, 1]^2 - 12 a[1, 1]^4 + 8 a[1, 1]^6 + (-2 - 12 a[1, 1]^2 + 18 a[1, 1]^4 + a[1, 1]^6) #1^2 + (12 a[1, 1]^2 + 3 a[1, 1]^4) #1^4 + (2 + 3 a[1, 1]^2) #1^6 + #1^8 &, 3] < b[1, 1] < Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (b[1, 1] == Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))))) || (1/Sqrt[ 2] < a[1, 1] < 1 && ((b[1, 1] == -Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (-Sqrt[ 1 - a[1, 1]^2] < b[1, 1] <= 0 && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (0 < b[1, 1] < Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && ((b[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]) || (b[1, 2] == Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && a[2, 2] == a[1, 1] && b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))) || (b[1, 1] == Sqrt[1 - a[1, 1]^2] && a[1, 2] == 0 && b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((a[2, 2] == -Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[ 1 - a[2, 2]^2 - b[1, 2]^2]) || (-Sqrt[1 - b[1, 2]^2] < a[2, 2] < Sqrt[ 1 - b[1, 2]^2] && (b[2, 2] == -Sqrt[1 - a[2, 2]^2 - b[1, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2])) || (a[2, 2] == Sqrt[1 - b[1, 2]^2] && b[2, 2] == Sqrt[1 - a[2, 2]^2 - b[1, 2]^2]))))) || (a[1, 1] == 1 && b[1, 1] == 0 && a[1, 2] == 0 && b[1, 2] == 0 && ((a[2, 2] == -1 && b[2, 2] == 0) || (-1 < a[2, 2] < 1 && (b[2, 2] == -Sqrt[1 - a[2, 2]^2] || b[2, 2] == Sqrt[1 - a[2, 2]^2])) || (a[2, 2] == 1 && b[2, 2] == 0))) || (-1 < a[1, 1] < 1 && -Sqrt[1 - a[1, 1]^2] < b[1, 1] < Sqrt[ 1 - a[1, 1]^2] && ((a[1, 2] == -Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] && b[1, 2] == -Sqrt[1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/( a[1, 2]^2 + b[1, 2]^2)) || (-Sqrt[1 - a[1, 1]^2 - b[1, 1]^2] < a[1, 2] < 0 && ((b[1, 2] == -Sqrt[ 1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/( a[1, 2]^2 + b[1, 2]^2)) || (b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/( a[1, 2]^2 + b[1, 2]^2)))) || (0 < a[1, 2] < Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && ((b[1, 2] == -Sqrt[ 1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/( a[1, 2]^2 + b[1, 2]^2)) || (b[1, 2] == Sqrt[ 1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/( a[1, 2]^2 + b[1, 2]^2)))) || (a[1, 2] == Sqrt[ 1 - a[1, 1]^2 - b[1, 1]^2] && b[1, 2] == -Sqrt[1 - a[1, 1]^2 - a[1, 2]^2 - b[1, 1]^2] && a[2, 2] == (-a[1, 1] a[1, 2]^2 - 2 a[1, 2] b[1, 1] b[1, 2] + a[1, 1] b[1, 2]^2)/(a[1, 2]^2 + b[1, 2]^2))) && b[2, 2] == -((-a[1, 2] b[1, 1] + a[1, 1] b[1, 2] - a[2, 2] b[1, 2])/a[1, 2]))

I don't think it is a good idea to do this for $$n\ge3$$.

• I don't think so neither. Thanks! – Alberto Navarro Jun 23 at 14:11