# Quantum XOR: How do you generalize it?

+ 1 like - 0 dislike
567 views

Consider the classical XOR Gate:

Given a 2 bit system: $G = [u_1, u_2]$

$$XOR(G) = (u_1 + u_2) \ mod \ 2$$

Is the following a good generalizaiton of a Quantum XOR Gate:

Given a 2-qubit system: $Q = a_1|00] + a_2|01] + a_3|10] + a_4|11]$

We now write:

$$XOR(Q) = a_1|0] + a_2|1] + a_3|1] + a_4|0] = (a_1 + a_4)|0] + (a_2 + a_3)|1]$$

Notice that if we set $a_i = 1$ and the rest to $0$ that the quantum XOR behaves exactly like a classical XOR but it also has the ability to generalize to fractional and complex $a_i$

This post imported from StackExchange Physics at 2014-06-11 15:05 (UCT), posted by SE-user frogeyedpeas

+ 1 like - 0 dislike

Usually, a XOR quantum gate is implemented by the function :

$XOR(Q) = a_1|00 \rangle + a_2|01 \rangle + a_4|10\rangle + a_3|11 \rangle$

The first bit is conserved, while the second bit is the result of an XOR operation between the first and second bit.

For instance, if we have the combination $|11\rangle$, this means, after the transformation : $1$ for the first bit (conserved bit) and $1$ XOR $1 = 0$ for the second bit, so $|11\rangle$ transforms in $|10\rangle$

This post imported from StackExchange Physics at 2014-06-11 15:05 (UCT), posted by SE-user Trimok
answered Jul 23, 2013 by (950 points)
+ 1 like - 0 dislike

The XOR gate is almost always called the NOT gate in quantum information and computation. To implement the XOR gate unitarily one must do it in a reversible way, since unitary gates must be invertible; conversely, any reversible logic gate defines a physical unitary operation. The XOR gate is itself not invertible, since e.g. both inputs "00" and "11" yield the same output: "0".

The standard way to implement a reversible XOR gate is by means of a controlled-NOT gate or CNOT; this is the "standard quantum XOR operation". The action of this gate on a two-qubit computational basis states is

$$\text{CNOT}|a, b\rangle \rightarrow |a, a\oplus b\rangle,\quad\text{where a,b\in\{0,1\}}.$$

That is, the gate leaves the first bit unchanged (the control qubit) and computes the XOR gate of the two bits in the second register.

Intuitively, you can imagine the action of the CNOT gate as if it were "reading the first qubit" and doing a controlled XOR in the second qubit depending on this value. However, it is important that the gate actually performs the operation coherently (ie. without measuring the physical state)!; the action of this gate on an arbitrary input state $|\psi\rangle = \sum_{a,b}\psi_{a,b} |ab \rangle$ is

$$\text{CNOT} |\psi\rangle = \text{controlled}-\text{XOR}(Q) = \sum_{ab}\psi_{a,b}|a, a\oplus b\rangle = \sum_{ab}\psi_{a,b}|a, \text{XOR}(a,b)\rangle.$$

For the particular state $Q$ that you gave us, you would obtain $$\text{CNOT}(Q) = a_1|00 \rangle + a_2|01 \rangle + a_4|10\rangle + a_3|11 \rangle$$

This post imported from StackExchange Physics at 2014-06-11 15:05 (UCT), posted by SE-user Juan Bermejo Vega
answered Jul 23, 2013 by (285 points)

 Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead. To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL. Please consult the FAQ for as to how to format your post. This is the answer box; if you want to write a comment instead, please use the 'add comment' button. Live preview (may slow down editor)   Preview Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:p$\hbar$ysicsOver$\varnothing$lowThen drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds). To avoid this verification in future, please log in or register.