Skip to main content
added 983 characters in body
Source Link
glS
  • 27.8k
  • 7
  • 40
  • 136

IfThe question may not be entirely well-defined, in the sense that to ask for a way to compute $C(U)$ from a decomposition of $U$ you need to specify the set of gates that you are willing to use. Indeed, it is a known result that any $n$-qubit gate can be exactly decomposed using $\text{CNOT}$ and single-qubit unitaryoperations, thenso that a naive answer to the general decompositionquestion would be: just decompose $C(U)$ using single-qubit and $\text{CNOT}$s.

A different interpretation of the question is the following: given $U$, can I compute $C(U)$ using a set of single-qubit operations and $\text{CNOT}$s not on the control qubit, and $\text{CNOT}$s with the control being the first qubit? This can be done generalising a result found in chapter 4four of Nielsen & Chuang.

The idea is that anyLet $U$ be a single-qubit unitarygate. It can then be proved that $U$ can always be written as $U = e^{i\alpha} AXBXC$, where $X$ is the Pauli X gate, and $A, B$ and $C$ are single-qubit operations such that $ABC=I$ (see N&C for a proof). It follows that $$C(U)=\Phi_1(\alpha)A_2C(X)B_2C(X) C_2,$$ where $\Phi_1(\alpha)\equiv\begin{pmatrix}1&0\\0&e^{i\alpha}\end{pmatrix}\otimes I$ is a phase gate applied to the first qubit, and $A_2, B_2, C_2$ are $A, B, C$ applied to the second qubit. This is immediate once you realise that, if that first qubit is $|0\rangle$, then $C(X)$ becomes an identity, and on the second qubit you have the operations $ABC$, which give the identity. On the other hand, if the first qubit is $|1\rangle$, then on the second rail you have $AXBXC$, which (together with the phase) equals $U$ by definition.

The above decomposition can be used to find a naive way to compute $C(U)$ for a general $n$-qubit unitary gate. The main observation is that if $U=A_1 A_2\cdots A_m$ for any set of gates $\{A_1,..,A_m\}$, then $$C(U)=C(A_1)C(A_2)\cdots C(A_m).$$ But we also know that any $n$-qubit $U$ can be decomposed in terms of CNOTs and single-qubit operations. It follows that $C(U)$ is a sequence of CCNOT and $C(V)$ operations, where CCNOT is here an $X$ gate applied to some qubit conditioned to two other qubits being $|1\rangle$, and $V$ is a single-qubit operation on some qubit. But again, any CCNOT operation (also called Toffoli), can be decomposed as shown in Figure 4.9 in N&C, and the $C(V)$ are decomposed as shown in the first part of the answer.

This method allows decomposing a general $n$-qubit unitary gate $U$ using only $\text{CNOT}$ and single-qubit gates. You may then go further and generalise this to find a decomposition for the case of multiple control qubits. For this you only now need a way to decompose the Toffoli gates, which is again found in Figure 4.9 of N&C.

If $U$ is a single-qubit unitary, then the general decomposition of the $C(U)$ can be found in chapter 4 of Nielsen & Chuang.

The idea is that any single-qubit unitary $U$ can always be written as $U = e^{i\alpha} AXBXC$, where $X$ is the Pauli X gate, and $A, B$ and $C$ are single-qubit operations such that $ABC=I$ (see N&C for a proof). It follows that $$C(U)=\Phi_1(\alpha)A_2C(X)B_2C(X) C_2,$$ where $\Phi_1(\alpha)\equiv\begin{pmatrix}1&0\\0&e^{i\alpha}\end{pmatrix}\otimes I$ is a phase gate applied to the first qubit, and $A_2, B_2, C_2$ are $A, B, C$ applied to the second qubit. This is immediate once you realise that, if that first qubit is $|0\rangle$, then $C(X)$ becomes an identity, and on the second qubit you have the operations $ABC$, which give the identity. On the other hand, if the first qubit is $|1\rangle$, then on the second rail you have $AXBXC$, which (together with the phase) equals $U$ by definition.

The above decomposition can be used to find a naive way to compute $C(U)$ for a general $n$-qubit unitary gate. The main observation is that if $U=A_1 A_2\cdots A_m$ for any set of gates $\{A_1,..,A_m\}$, then $$C(U)=C(A_1)C(A_2)\cdots C(A_m).$$ But we also know that any $n$-qubit $U$ can be decomposed in terms of CNOTs and single-qubit operations. It follows that $C(U)$ is a sequence of CCNOT and $C(V)$ operations, where CCNOT is here an $X$ gate applied to some qubit conditioned to two other qubits being $|1\rangle$, and $V$ is a single-qubit operation on some qubit. But again, any CCNOT operation (also called Toffoli), can be decomposed as shown in Figure 4.9 in N&C, and the $C(V)$ are decomposed as shown in the first part of the answer.

The question may not be entirely well-defined, in the sense that to ask for a way to compute $C(U)$ from a decomposition of $U$ you need to specify the set of gates that you are willing to use. Indeed, it is a known result that any $n$-qubit gate can be exactly decomposed using $\text{CNOT}$ and single-qubit operations, so that a naive answer to the question would be: just decompose $C(U)$ using single-qubit and $\text{CNOT}$s.

A different interpretation of the question is the following: given $U$, can I compute $C(U)$ using a set of single-qubit operations and $\text{CNOT}$s not on the control qubit, and $\text{CNOT}$s with the control being the first qubit? This can be done generalising a result found in chapter four of Nielsen & Chuang.

Let $U$ be a single-qubit gate. It can then be proved that $U$ can always be written as $U = e^{i\alpha} AXBXC$, where $X$ is the Pauli X gate, and $A, B$ and $C$ are single-qubit operations such that $ABC=I$ (see N&C for a proof). It follows that $$C(U)=\Phi_1(\alpha)A_2C(X)B_2C(X) C_2,$$ where $\Phi_1(\alpha)\equiv\begin{pmatrix}1&0\\0&e^{i\alpha}\end{pmatrix}\otimes I$ is a phase gate applied to the first qubit, and $A_2, B_2, C_2$ are $A, B, C$ applied to the second qubit. This is immediate once you realise that, if that first qubit is $|0\rangle$, then $C(X)$ becomes an identity, and on the second qubit you have the operations $ABC$, which give the identity. On the other hand, if the first qubit is $|1\rangle$, then on the second rail you have $AXBXC$, which (together with the phase) equals $U$ by definition.

The above decomposition can be used to find a naive way to compute $C(U)$ for a general $n$-qubit unitary gate. The main observation is that if $U=A_1 A_2\cdots A_m$ for any set of gates $\{A_1,..,A_m\}$, then $$C(U)=C(A_1)C(A_2)\cdots C(A_m).$$ But we also know that any $n$-qubit $U$ can be decomposed in terms of CNOTs and single-qubit operations. It follows that $C(U)$ is a sequence of CCNOT and $C(V)$ operations, where CCNOT is here an $X$ gate applied to some qubit conditioned to two other qubits being $|1\rangle$, and $V$ is a single-qubit operation on some qubit. But again, any CCNOT operation (also called Toffoli), can be decomposed as shown in Figure 4.9 in N&C, and the $C(V)$ are decomposed as shown in the first part of the answer.

This method allows decomposing a general $n$-qubit unitary gate $U$ using only $\text{CNOT}$ and single-qubit gates. You may then go further and generalise this to find a decomposition for the case of multiple control qubits. For this you only now need a way to decompose the Toffoli gates, which is again found in Figure 4.9 of N&C.

Source Link
glS
  • 27.8k
  • 7
  • 40
  • 136

If $U$ is a single-qubit unitary, then the general decomposition of the $C(U)$ can be found in chapter 4 of Nielsen & Chuang.

The idea is that any single-qubit unitary $U$ can always be written as $U = e^{i\alpha} AXBXC$, where $X$ is the Pauli X gate, and $A, B$ and $C$ are single-qubit operations such that $ABC=I$ (see N&C for a proof). It follows that $$C(U)=\Phi_1(\alpha)A_2C(X)B_2C(X) C_2,$$ where $\Phi_1(\alpha)\equiv\begin{pmatrix}1&0\\0&e^{i\alpha}\end{pmatrix}\otimes I$ is a phase gate applied to the first qubit, and $A_2, B_2, C_2$ are $A, B, C$ applied to the second qubit. This is immediate once you realise that, if that first qubit is $|0\rangle$, then $C(X)$ becomes an identity, and on the second qubit you have the operations $ABC$, which give the identity. On the other hand, if the first qubit is $|1\rangle$, then on the second rail you have $AXBXC$, which (together with the phase) equals $U$ by definition.

The above decomposition can be used to find a naive way to compute $C(U)$ for a general $n$-qubit unitary gate. The main observation is that if $U=A_1 A_2\cdots A_m$ for any set of gates $\{A_1,..,A_m\}$, then $$C(U)=C(A_1)C(A_2)\cdots C(A_m).$$ But we also know that any $n$-qubit $U$ can be decomposed in terms of CNOTs and single-qubit operations. It follows that $C(U)$ is a sequence of CCNOT and $C(V)$ operations, where CCNOT is here an $X$ gate applied to some qubit conditioned to two other qubits being $|1\rangle$, and $V$ is a single-qubit operation on some qubit. But again, any CCNOT operation (also called Toffoli), can be decomposed as shown in Figure 4.9 in N&C, and the $C(V)$ are decomposed as shown in the first part of the answer.