# quantum / Deriving my own proof for Unitary matrices

Getting to grips with why Unitary matrices preserve length has been the highest hurdle so far. The internet is full of complex formulas for why this is the case, but I drowned in notation and couldn’t develop any understanding.

So I spent hours and paper trying to write proofs for myself.

The below is a first-principles proof of Unitary matrices I came up with independently, which may or may not hold up to real mathematics.

Necessary Background

The length preserving property of unitary matrices is evidently useful for quantum gates, because qubit vectors must always have length 1.

Explaining U: the conjugate transpose

Given a matrix:

[
a
c
b
d
]

The transpose is a mirror operation, a line of symmetry top-left to bottom-right:

[
a
b
c
d
]

Taking the conjugate means inverting the complex elements of the matrix. As an example, taking matrix:

[
1
i
-i
0
]

Its conjugate would be:

[
1
-i
i
0
]

The conjugate of a is written a*.

Putting it all together, the conjugate transpose of matrix

[
a
c
b
d
]

...is:

[
a^*
b^*
c^*
d^*
]

Explaining UU = I

`I` is the identity matrix. The product of any vector with this matrix is the input vector:

[
1
0
0
1
]

For example vector:

[
1
0
0
1
]
[
a
b
]
=
[
a
b
]

The definition of a Unitary matrix is that the product of that matrix with its conjugate transpose is I.

[
a^*
c^*
b^*
d^*
]
[
a
b
c
d
]
=
[
1
0
0
1
]

e.g. The Y gate:

[
0
-i
i
0
]

Note: Its conjugate transpose is itself

[
0
-i
i
0
]
[
0
-i
i
0
]
=
[
1
0
0
1
]

But why do unitary matrices preserve length?

This is where I was stumped. What is it about this property UU = I which means that the matrix preserves length?

[A formal proof can be seen here.] I started from here, and couldn’t translate it into a meaningful understanding of why this actually worked.

So I set about toying around with this myself, for hours, and eventually I think I’ve come up with a fairly intuitive explanation.

Let’s start off by performing UU = I algebraically.

[
a*
b*
c*
d*
]
[
a
c
b
d
]
=
[
(a*a+b*b)
(a*c+b*d)
(c*a+d*b)
(c*c+d*d)
]

If this matrix is Unitary then it must be true that:

[
(a*a+b*b)
(a*c+b*d)
(c*a+d*b)
(c*c+d*d)
]
=
[
1
0
0
1
]

…because that’s the definition of a Unitary matrix: matrix multiplied by conjugate tranpose is I.

That means that a* a+b* b = 1 & c* c+c* d = 1.

a & b represent the transformed î. The above identity proves that when the transformation was a Unitary matrix, î retains length 1. This is because a* a+b* b = 1 is equivalent to a2 + b2= 1, which is how we calculate the length of î.

In the same way c & d are the elements of the transformed ĵ. c* c+d* d = 1. is equivalent to c2 + d2= 1, which demonstrates that the length of j is unchanged. As all vectors are composed of scaled î & ĵ, retaining their lengths means that the length of the vector will not be changed.

This proves that Unitary matrices retain the length of the input vector.

We get two more identities from the matrix multiplication.

ac + bd = 0 ca + db = 0

What does this tell us about why Unitary matrices preserve vector lengths?

I found it helpful here to go back to what retaining vector length would mean for matrix multiplication.

[
a
c
b
d
]
[
k
m
]
=
[
ak + cm
bk + dm
]

The new vector has an x value of ak + cm, and a y values of bk + dm.

If the resulting vector has the same length as the input vector then we know that:

(ak + cm)2 + (bk + dm)2 = k2 + m2

(ak)2 + (cm)2 + 2akcm + (bk)2 + (dm)2 + 2bkdm = k2 + m2

Rearrange:

(ak)2 + (bk)2 + (cm)2 + (dm)2 + 2akcm + 2bkdm = k2 + m2

Extract factors:

k2(a2 + b2) + m2(c2 + d2) + 2akcm + 2bkdm = k2 + m2

Recall that a2 + b2= 1 and c2 + d2= 1.

Substitute:

k2(1) + m2(1) + 2akcm + 2bkdm = k2 + m2

k2 + m2 + 2akcm + 2bkdm = k2 + m2

2akcm + 2bkdm = 0

Factorise:

km(ac + bd) = 0

Therefore either k = 0, m = 0, or ac + bd = 0.

From above, ac + bd = 0 was an identity we derived from UU = I. This reinforces my proof of U preserving the vector’s length.

Questions

I don’t think so, because we embedded the assumption that this matrix was Unitary by substituting a2 + b2= 1 and c2 + d2= 1. A matrix with different values for those identities could theoretically (but not really) have another path to preserving vector lengths.

Therefore I will continue searching for a proof along these lines for Unitary matrices being the only length-preserving transformations.