28.06.2014 Views

Chapter 5: Architecture - Computer and Information Science - CUNY

Chapter 5: Architecture - Computer and Information Science - CUNY

Chapter 5: Architecture - Computer and Information Science - CUNY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.3. REVERSIBLE GATES 21<br />

|x〉<br />

|x〉<br />

•<br />

(5.59)<br />

|y〉<br />

•<br />

|y〉<br />

|z〉<br />

<br />

|z ⊕ (x ∧ y)〉<br />

This is similar to the controlled-NOT gate but with two controlling bits.<br />

The bottom bit flips only when the top two bits are in state |1〉. We can write<br />

this operation as taking state |x, y, z〉 to |x, y, (x ∧ y) ⊕ z〉.<br />

Exercise 5.3.2 Show that the Toffoli gate is its own inverse.<br />

The matrix that corresponds to this gate is<br />

000 001 010 011 100 101 110 111<br />

⎡<br />

⎤<br />

000 1 0 0 0 0 0 0 0<br />

001 0 1 0 0 0 0 0 0<br />

010 0 0 1 0 0 0 0 0<br />

011 0 0 0 1 0 0 0 0<br />

100 0 0 0 0 1 0 0 0<br />

101 0 0 0 0 0 1 0 0<br />

⎢<br />

⎥<br />

110 ⎣ 0 0 0 0 0 0 0 1 ⎦<br />

111 0 0 0 0 0 0 1 0<br />

(5.60)<br />

The NOT gate has no controlling bit, the controlled-not gate has one controlling<br />

bit, <strong>and</strong> the Toffoli gate has two controlling bits. Can we go on with<br />

this? Yes. A gate with three controlling bits can be constructed from three<br />

Toffoli gates as follows.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!