How do you implement a negative controlled gate using the regular controlled gate? - Quantum Computing Stack Exchange most recent 30 from quantumcomputing.stackexchange.com 2019-11-11T21:21:12Z https://quantumcomputing.stackexchange.com/feeds/question/6546 https://creativecommons.org/licenses/by-sa/4.0/rdf https://quantumcomputing.stackexchange.com/q/6546 2 How do you implement a negative controlled gate using the regular controlled gate? Josu Etxezarreta Martinez https://quantumcomputing.stackexchange.com/users/2371 2019-06-21T10:50:02Z 2019-06-24T09:36:16Z <p>I have been reading a <a href="https://arxiv.org/pdf/quant-ph/9602019.pdf" rel="nofollow noreferrer">paper</a> about perfect error correction codes, and when the circuit is described, the author uses some negative controlled gates, that is:</p> <p><em>The gate is applied if the control is <span class="math-container">$|0\rangle$</span> and trivial operation is applied when the control is <span class="math-container">$|1\rangle$</span>.</em> </p> <p>Consequently, it is the reverse operation that a regular controlled gate. The author represents such gates with an empty circle instead of the filled dot used for regular controlled gates.</p> <p>I am wondering how could one implement one of such negative controlled gates by using a standard controlled gate, that is, add some other gates to the controlled unitary so that its operation is reversed.</p> https://quantumcomputing.stackexchange.com/questions/6546/-/6547#6547 4 Answer by Sanchayan Dutta for How do you implement a negative controlled gate using the regular controlled gate? Sanchayan Dutta https://quantumcomputing.stackexchange.com/users/26 2019-06-21T11:39:45Z 2019-06-21T11:50:27Z <blockquote> <p>I am wondering how could one implement one of such negative controlled gates by using a standard controlled gate, that is, add some other gates to the controlled unitary so that its operation is reversed.</p> </blockquote> <p>This is addressed in Nielsen and Chuang's section 4.3 (~ p. 184, 10th edition).</p> <p>Basically,<span class="math-container">$$c_{|0\rangle}U_{AB} \equiv (X_A\otimes I_B)c_{|1\rangle}U_{AB}(X_A\otimes I_B),$$</span> </p> <p>i.e. the <span class="math-container">$X$</span> gate does a basis transformation <span class="math-container">$|0\rangle_A\to|1\rangle_A$</span> for you such that you can apply the required unitary and then transform back to the original basis using another <span class="math-container">$X$</span>. </p> <p><a href="https://i.stack.imgur.com/RAsVv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RAsVv.png" alt=""></a></p> <blockquote> <p>In the controlled gates we have been considering, conditional dynamics on the target qubit occurs if the control bits are set to <em>one</em>. Of course, there is nothing special about one, and it is often useful to consider dynamics which occur conditional on the control bit being set to zero. For instance, suppose we wish to implement a two qubit gate in which the second (‘target’) qubit is flipped, conditional on the first (‘control’) qubit being set to zero. In Figure 4.11 we introduce a circuit notation for this gate, together with an equivalent circuit in terms of the gates we have already introduced. Generically we shall use the open circle notation to indicate conditioning on the qubit being set to zero, while a closed circle indicates conditioning on the qubit being set to one.</p> </blockquote> https://quantumcomputing.stackexchange.com/questions/6546/-/6569#6569 2 Answer by glS for How do you implement a negative controlled gate using the regular controlled gate? glS https://quantumcomputing.stackexchange.com/users/55 2019-06-24T09:36:16Z 2019-06-24T09:36:16Z <p>Let me work out here the more general case, in which you have a controlled operation but in which the "turned-off" and "turned-on" states are not necessarily <span class="math-container">$\ket0$</span> and <span class="math-container">$\ket1$</span>.</p> <p>Consider a generic controlled operation <span class="math-container">$$\newcommand{\ket}{\lvert #1\rangle}\newcommand{\ketbra}{\lvert #1\rangle\!\langle #2\rvert} \mathcal U=\ketbra{\phi_1}{\phi_1}\otimes U_1+\ketbra{\phi_2}{\phi_2}\otimes U_2 \equiv \mathbb P_{\phi_1}\otimes U_1+\mathbb P_{\phi_2}\otimes U_2,$$</span> with <span class="math-container">$\ket{\phi_1},\ket{\phi_2}$</span> arbitrary orthogonal states and <span class="math-container">$\mathbb P_{\psi}$</span> denotes the projector onto the state <span class="math-container">$\ket\psi$</span>: <span class="math-container">$\mathbb P_{\psi}\equiv\ketbra\psi\psi$</span>.</p> <p>Define now the "inverse-controlled" operation <span class="math-container">$\tilde{\mathcal U}$</span> defined as <span class="math-container">$$\tilde{\mathcal U}\equiv \mathbb P_{\phi_2}\otimes U_1+\mathbb P_{\phi_1}\otimes U_2.$$</span> The question is whether you can implement <span class="math-container">$\tilde{\mathcal U}$</span> by using only <span class="math-container">$\mathcal U$</span> and local operations.</p> <p>More specifically, it is easy to see that we can do this by only using local operations on the controlling qubit. To see this, let <span class="math-container">$V$</span> be a single-qubit unitary, and consider the composition of <span class="math-container">$\mathcal U$</span> with two <span class="math-container">$V$</span> on the first qubit:</p> <p><span class="math-container">$$(V\otimes I)\mathcal U(V^\dagger\otimes I)= (V\mathbb P_{\phi_1} V^\dagger)\otimes U_1+ (V\mathbb P_{\phi_2} V^\dagger)\otimes U_2.$$</span> We thus simply need a <span class="math-container">$V$</span> such that <span class="math-container">$V\mathbb P_{\phi_i}V^\dagger=\mathbb P_{\phi_{3-i}}$</span>. This is equivalent to asking for a <span class="math-container">$V$</span> such that <span class="math-container">\begin{align} V\ket{\phi_1} &amp;=\ket{\phi_2} \\ V\ket{\phi_2} &amp;=\ket{\phi_1}. \end{align}</span> In the case <span class="math-container">$\ket{\phi_1}=\ket0, \ket{\phi_2}=\ket1$</span> you recover <span class="math-container">$V=X$</span>, while more in general you want an operation <span class="math-container">$V$</span> whose <a href="https://en.wikipedia.org/wiki/Singular_value_decomposition" rel="nofollow noreferrer">SVD</a> reads <span class="math-container">$$V=\ketbra{\phi_1}{\phi_2}+\ketbra{\phi_2}{\phi_1}.$$</span></p>