Skip to content

Walkthrough ‐ Quantum II.D: Drive‐by AND

Glen Evenbly edited this page Jul 8, 2024 · 4 revisions

Learning Objectives

  • The player is challenged produce the quantum equivalent of an AND gate (also known as the Toffoli gate).
  • This task is significantly more difficult than producing the classical AND gate; this follows since the quantum version needs to be reversible while the classical version does not.
  • A key difference from the classical AND gate is that the qubits in the initial two channels must be returned to their original states, with the result stored in a separate third channel. This usage of a third channel is necessary in order to realize the AND gate while allowing the full circuit to be reversible.

Solution

The solution here follows the Sleator-Weinfurter construction:

  1. Controlled rotations of +90° are performed from A to α and from from B to α.
  2. A controlled rotation of -90° is performed from A XOR B to α.

image

Level File (copy then paste into Qubit Factory)

{"name":"QII.D: Drive-by AND","tag":"adderC","version":"v1.1.1","tiles":[75,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,75,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,78,-1,3,2,2,2,2,2,70,2,2,5,-1,4,2,2,70,2,6,-1,-1,4,2,2,2,2,70,68,70,5,3,70,6,-1,4,68,2,5,-1,4,6,-1,-1,-1,4,62,2,62,11,2,62,2,5,1,-1,-1,3,79,1,-1,-1,-1,-1,1,-1,-1,-1,3,2,2,2,11,6,-1,-1,-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,77,-1,74,2,2,6,-1,-1,-1,-1,-1,-1,-1,78,2,2,2,76,77],"gates":[[13,13,"qCompare","free",0,0,0,3,-1],[18,5,"qCompare","free",0,0,0,2,-1],[18,8,"qCompare","free",1,3.14159265359,0,4,-1],[0,0,"qCreate","free",1,0,0,1,95],[0,13,"qCreate","free",3,1,0,1,95],[2,13,"qCreate","free",0,0,0,0,96],[18,0,"qCreate","free",1,0,0,2,95],[18,13,"qCreate","free",3,1,0,2,95],[17,13,"qCreate","free",2,2,0,2,95],[7,6,"qControl","free",0,0,0,0,-1],[7,7,"qFlip","free",0,1.570796326795,0,0,-1],[7,7,"qFlip","free",0,1.570796326795,1,0,-1],[6,7,"qControl","free",0,0,0,0,-1],[6,8,"rotate","free",0,1.570796326795,0,0,-1],[6,8,"rotate","free",0,0.785398163397,1,0,-1],[8,7,"qControl","free",0,0,0,0,-1],[8,8,"rotate","free",0,4.712388980385,0,0,-1],[8,8,"rotate","free",0,0.785398163397,1,0,-1],[11,7,"qControl","free",0,0,0,0,-1],[11,8,"rotate","free",0,1.570796326795,0,0,-1],[11,8,"rotate","free",0,0.785398163397,1,0,-1],[15,6,"qControl","free",0,0,0,0,-1],[15,7,"qFlip","free",0,1.570796326795,0,0,-1],[15,7,"qFlip","free",0,1.570796326795,1,0,-1]]}

Clone this wiki locally