To better understand how quantum computing works, I am trying to sort two numbers using unitary matrix. Based on this definition, I understand a quantum Turing machine to have the automorphism (unitary matrix) of a Hilbert state as its state transition function.
Now supposed the input is $ \begin{bmatrix}1 & 0 \end{bmatrix} $, the following program $\begin{bmatrix}0 & 1\\1 & 0 \end{bmatrix}$sorts the input:
$$ \begin{bmatrix}1 & 0 \end{bmatrix}\begin{bmatrix}0 & 1\\1 & 0 \end{bmatrix}=\begin{bmatrix}0 &1 \end{bmatrix} \tag{1} $$
However, if the input is $ \begin{bmatrix}0 & 1 \end{bmatrix} $, then it is already sorted and the program should be the identity matrix
$$ \begin{bmatrix}0 & 1 \end{bmatrix}\begin{bmatrix}1 & 0\\0 & 1 \end{bmatrix}=\begin{bmatrix}0 &1 \end{bmatrix} \tag{2} $$
How do I create a program that works with either inputs? That is, how do I implement a conditional branch such that if the input is $ \begin{bmatrix}1 & 0 \end{bmatrix} $ then the unitary matrix of case (1) is executed. Whereas if the input is $ \begin{bmatrix}0 & 1 \end{bmatrix} $ then the identity matrix is executed.
I do not see how I can implement a conditional branch that depends on the input using unitary matrices.