# Matrix entries of a Unitary matrix

Basically, I'm working on a problem in my quantum computation class. I am down to the last line of the proof, I just need to understand why this line makes sense. I will write out the entire problem, and show the last step which I can not understand.

Define $U$ such that $$U|x\rangle := \displaystyle\sum_{y} K(y,x) |y\rangle$$

Let $$\displaystyle U\sum_{x=0}^{N-1}f(x)|x\rangle = \sum_{x=0}^{N-1}\widetilde{f}(x)|x\rangle$$ where $\widetilde{f}(x) = \displaystyle \sum_{y} K(x,y)f(x)$, defining the $N \times N$ matrix $(K)_{xy} := K(x,y)$. Show that $U$ is unitary if and only if $K$ is unitary.

My instructor recommended I show that $\langle Ux, Uy\rangle = \langle x, y\rangle = \delta_{xy}$ if and only if $K$ is unitary. We assume that all vectors are orthonormal basis vectors. So:

$\langle Ux,Uy\rangle = \displaystyle \langle \sum_a K(a,x)|a\rangle, \sum_b K(b,y) |b\rangle \rangle = \sum_{a,b} \overline{K(a,x)}K(b,y)\langle a,b\rangle$

Since $\langle a,b\rangle = \delta_{ab}$, we get the following expression: $$\sum_a \overline{K(a,x)}K(a,y)$$

Now, apparently, this last expression equals $\delta_{xy}$ if and only if $K$ is unitary. But I do not understand this. Any explanation would be great.

Thank you.

The definition of a unitary matrix is $(K^+)K=I$ or $\sum_a \overline{K(a,x)}K(a,y)=\delta_{x,y}$. Here we are using the plus sign instead of the dagger to indicate the complex conjugate transpose of the matrix.
To belabor the point, the matrix product $P=QK$ is defined as having elements $P(x,y)=\sum_a Q(x,a)K(a,y)$. So, if $Q=K^+$, then $Q(x,a)=\overline{K(a,x)}$. Further, the identiry matrix elements are given by $\delta_{x,y}$, so your last equation is true if and only if $K$ is a unitary matrix, which should answer your question.