## Random unitaries

As a first step toward understanding the quantum description of an evolving open system, consider a “two-qubit universe” in which we observe *only one* of the qubits.
Let us revisit the controlled-\texttt{NOT} gate, in which two qubits undergo the unitary transformation
U
= |0\rangle\langle 0|\otimes\mathbf{1}+|1\rangle\langle 1|\otimes X
= \begin{bmatrix}\mathbf{1}&0\\0&X\end{bmatrix}
and let us focus on the transformation of the target qubit alone.
We know that it depends on the state of the control qubit:

- if the input state of the control qubit is |0\rangle, the target qubit evolves unitarily according to the identity operator \mathbf{1};
- if the input state of the control qubit is |1\rangle, the target qubit evolves unitarily according to the bit flip operator X;
- but for input states of the control that are superpositions of |0\rangle and |1\rangle the evolution of the target qubit is
*not* unitary.

To justify this last point, note that, if the control qubit is in the state \alpha_0|0\rangle+\alpha_1|1\rangle and the target qubit is in some state |\psi\rangle, then the output state can be written as
\alpha_0|0\rangle\otimes\mathbf{1}|\psi\rangle + \alpha_1|1\rangle\otimes X|\psi\rangle
which shows that the control and the target become entangled.
The target qubit alone ends up in the statistical mixture of states |\psi\rangle (with probability |\alpha_0|^2) and X|\psi\rangle (with probability |\alpha_1|^2).
This can be easily verified by expressing the above output state of the two qubits as the density matrix
\begin{aligned}
|\alpha_0|^2|0\rangle\langle 0|\otimes \mathbf{1}|\psi\rangle\langle\psi|\mathbf{1}
\quad &+\quad |\alpha_1|^2|1\rangle\langle 1|\otimes X|\psi\rangle\langle\psi|X
\\+\, \alpha_0\alpha_1^\star|0\rangle\langle 1| \otimes \mathbf{1}|\psi\rangle\langle\psi|X
\quad &+\quad \alpha_0^\star\alpha_1|1\rangle\langle 0| \otimes X|\psi\rangle\langle\psi|\mathbf{1}
\end{aligned}
and then tracing over the control qubit, which gives
|\alpha_0|^2 \mathbf{1}|\psi\rangle\langle\psi|\mathbf{1}
+ |\alpha_1|^2 X|\psi\rangle\langle\psi| X.
We can then say that the input state of the target qubit evolves either according to the identity operator (with probability |\alpha_0|^2) or according to the operator X (with probability |\alpha_1|^2).

This argument works even if the target qubit is initially in a mixed state, since we are dealing with a linear transformation, and any mixed state can be expressed as a statistical ensemble of pure states (via the convex decomposition of a density matrix).
Thus, in general, we can express the evolution of the target qubit as

\rho\longmapsto
\rho'= |\alpha_0|^2 \mathbf{1}\rho\mathbf{1}+ |\alpha_1|^2 X\rho X
where \rho and \rho' are the input and the output states, respectively.
We may think about this input-output relation as a mathematical representation of a quantum communication channel in which an input qubit is bit-flipped (via the operator X) with some prescribed probability.
But we may also take a more “global” view and see the action of the channel as arising from a unitary evolution on a larger (dilated) system, here composed of two qubits.

Our discussion can easily be extended beyond the qubits to cover any conditional dynamics of the type
U
= \sum_i |i\rangle\langle i|\otimes U_i
=
\begin{bmatrix}
U_1 & 0 & 0 & \ldots
\\0 & U_2 & 0 & \ldots
\\0 & 0 & U_3 & \ldots
\\\vdots & \vdots &\vdots & \ddots
\end{bmatrix}
where the vectors |i\rangle form an orthonormal basis in the Hilbert space associated with a control system, and the U_i are the corresponding unitary operations performed on a target system.
If the control system is prepared in state \sum_i\alpha_i|i\rangle and the target in state |\psi\rangle, then the final state of the two systems is
\sum_i \alpha_i|i\rangle\otimes U_i|\psi\rangle
and, by the same sequence of arguments as before, we obtain the evolution of the target system alone, and express it as
\rho\longmapsto
\rho' = \sum_{i=1} p_i U_i \rho U^\dagger_i
where p_i=|\alpha_i|^2.
That is, the state of the target system is modified by the unitary U_i, chosen randomly with probability p_i.

The reason we are paying particular attention to the random unitaries is that each unitary is invertible, and, as such, they offer a sliver of hope for reversing the action of the channel.
If we can learn, post factum, which particular unitary operation U_i was chosen then we can simply apply the inverse of that unitary and recover the original state.
For example, if we can measure the control system in the |i\rangle basis, then measuring the outcome to be k tells us that we have to apply U_k^\dagger to the target to recover its input state.
However, if we do not have access to the control system, then there is very little we can do: *we cannot figure out which particular unitary was applied by inspecting the target system alone*.
In this case the best we can do is to apply the inverse of the most likely unitary, which will then recover the input state, *but only with some probability of success*.
In order to do better than that we have to look at slightly different channels.

First though, a fundamental example of a random unitary evolution: a **single qubit Pauli channel** applies one of the Pauli operators, X, Y or Z, chosen randomly with some prescribed probabilities p_x, p_y and p_z, giving
\rho\longmapsto
p_0 \mathbf{1}\rho\mathbf{1}+ p_x X\rho X+ p_y Y\rho Y+ p_z Z\rho Z.
The Pauli operators represent **quantum errors**: bit-flip X, phase-flip Z, and the composition of the two Y=iXZ.