introduction to data state stored in n bits an element of
play

Introduction to Data (state) stored in n bits: an element of { 0 ; 1 - PowerPoint PPT Presentation

Introduction to Data (state) stored in n bits: an element of { 0 ; 1 } n , quantum algorithms often viewed as representing Daniel J. Bernstein an element of { 0 ; 1 ; : : : ; 2 n 1 } . University of Illinois at Chicago &


  1. Some examples of 3-qubit states: Fast quantum operations, part 1 (1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0) is ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ “ | 0 � ” in standard notation. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) Measurement produces 0. is complementing index bit 0, hence “complementing qubit 0”. (0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 1 ; 0) is “ | 6 � ” in standard notation. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) Measurement produces 6. is measured as ( q 0 ; q 1 ; q 2 ), representing q = q 0 + 2 q 1 + 4 q 2 , (0 ; 0 ; 0 ; 0 ; 0 ; 0 ; − 7 i; 0) = − 7 i | 6 � : with probability | a q | 2 = P r | a r | 2 . Measurement produces 6. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) (0 ; 0 ; 4 ; 0 ; 0 ; 0 ; 8 ; 0) = 4 | 2 � + 8 | 6 � : is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), Measurement produces representing q ⊕ 1, 2 with probability 20%, with probability | a q | 2 = P r | a r | 2 . 6 with probability 80%.

  2. examples of 3-qubit states: Fast quantum operations, part 1 ( a 0 ; a 1 ; a ( a 4 ; a 5 ; a ; 0 ; 0 ; 0 ; 0 ; 0) is ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing in standard notation. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q Measurement produces 0. is complementing index bit 0, hence “complementing qubit 0”. ; 0 ; 0 ; 0 ; 1 ; 0) is in standard notation. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) Measurement produces 6. is measured as ( q 0 ; q 1 ; q 2 ), representing q = q 0 + 2 q 1 + 4 q 2 , ; 0 ; 0 ; 0 ; − 7 i; 0) = − 7 i | 6 � : with probability | a q | 2 = P r | a r | 2 . Measurement produces 6. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ; 0 ; 0 ; 0 ; 8 ; 0) = 4 | 2 � + 8 | 6 � : is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), Measurement produces representing q ⊕ 1, probability 20%, with probability | a q | 2 = P r | a r | 2 . probability 80%.

  3. of 3-qubit states: Fast quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 0) is ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing rd notation. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; roduces 0. is complementing index bit 0, hence “complementing qubit 0”. 0) is rd notation. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) roduces 6. is measured as ( q 0 ; q 1 ; q 2 ), representing q = q 0 + 2 q 1 + 4 q 2 , 7 i; 0) = − 7 i | 6 � : with probability | a q | 2 = P r | a r | 2 . roduces 6. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) 0) = 4 | 2 � + 8 | 6 � : is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), roduces representing q ⊕ 1, y 20%, with probability | a q | 2 = P r | a r | 2 . y 80%.

  4. states: Fast quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: notation. ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). is complementing index bit 0, hence “complementing qubit 0”. notation. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) is measured as ( q 0 ; q 1 ; q 2 ), representing q = q 0 + 2 q 1 + 4 q 2 , 7 i | 6 � : with probability | a q | 2 = P r | a r | 2 . ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) + 8 | 6 � : is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), representing q ⊕ 1, with probability | a q | 2 = P r | a r | 2 .

  5. Fast quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). is complementing index bit 0, hence “complementing qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) is measured as ( q 0 ; q 1 ; q 2 ), representing q = q 0 + 2 q 1 + 4 q 2 , with probability | a q | 2 = P r | a r | 2 . ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), representing q ⊕ 1, with probability | a q | 2 = P r | a r | 2 .

  6. Fast quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). is complementing index bit 0, hence “complementing qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) is “swapping qubits 0 and 2”: is measured as ( q 0 ; q 1 ; q 2 ), ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). representing q = q 0 + 2 q 1 + 4 q 2 , with probability | a q | 2 = P r | a r | 2 . ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), representing q ⊕ 1, with probability | a q | 2 = P r | a r | 2 .

  7. Fast quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). is complementing index bit 0, hence “complementing qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) is “swapping qubits 0 and 2”: is measured as ( q 0 ; q 1 ; q 2 ), ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). representing q = q 0 + 2 q 1 + 4 q 2 , with probability | a q | 2 = P r | a r | 2 . Complementing qubit 2 = swapping qubits 0 and 2 ( a 1 ; a 0 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ◦ complementing qubit 0 is measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), ◦ swapping qubits 0 and 2. representing q ⊕ 1, with probability | a q | 2 = P r | a r | 2 . Similarly: swapping qubits i; j .

  8. quantum operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: is a “reversible ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). “controlled complementing index bit 0, ( q 0 ; q 1 ; q “complementing qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) Example ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) is “swapping qubits 0 and 2”: ( a 0 ; a 1 ; a measured as ( q 0 ; q 1 ; q 2 ), ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 resenting q = q 0 + 2 q 1 + 4 q 2 , a 16 ; a 17 ; robability | a q | 2 = P r | a r | 2 . Complementing qubit 2 a 24 ; a 25 ; = swapping qubits 0 and 2 ; a 3 ; a 2 ; a 5 ; a 4 ; a 7 ; a 6 ) �→ ( a 0 ; a ◦ complementing qubit 0 measured as ( q 0 ⊕ 1 ; q 1 ; q 2 ), a 8 ; a 9 ; a 11 ◦ swapping qubits 0 and 2. resenting q ⊕ 1, a 16 ; a 17 ; robability | a q | 2 = P r | a r | 2 . Similarly: swapping qubits i; j . a 24 ; a 25 ;

  9. operations, part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a ; a 5 ; a 6 ; a 7 ) �→ is “complementing qubit 2”: is a “reversible XOR ; a 4 ; a 7 ; a 6 ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). “controlled NOT gate”: complementing index bit 0, ( q 0 ; q 1 ; q 2 ) �→ ( q 0 “complementing qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) Example with more ; a 5 ; a 6 ; a 7 ) is “swapping qubits 0 and 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a q 0 ; q 1 ; q 2 ), ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; q 0 + 2 q 1 + 4 q 2 , a 16 ; a 17 ; a 18 ; a 19 ; a 20 | a q | 2 = P r | a r | 2 . Complementing qubit 2 a 24 ; a 25 ; a 26 ; a 27 ; a 28 = swapping qubits 0 and 2 ; a 4 ; a 7 ; a 6 ) �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a ◦ complementing qubit 0 q 0 ⊕ 1 ; q 1 ; q 2 ), a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; ◦ swapping qubits 0 and 2. 1, a 16 ; a 17 ; a 19 ; a 18 ; a 20 | a q | 2 = P r | a r | 2 . Similarly: swapping qubits i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28

  10. part 1 ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ) �→ is “complementing qubit 2”: is a “reversible XOR gate” = ) ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). “controlled NOT gate”: bit 0, ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q qubit 0”. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) Example with more qubits: ) is “swapping qubits 0 and 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ), ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a + 4 q 2 , a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 | a r | 2 . Complementing qubit 2 a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 = swapping qubits 0 and 2 ) �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ◦ complementing qubit 0 ; q 2 ), a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a ◦ swapping qubits 0 and 2. a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 | a r | 2 . Similarly: swapping qubits i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31

  11. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 4 ; a 5 ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) is “complementing qubit 2”: is a “reversible XOR gate” = ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). “controlled NOT gate”: ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 4 ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) Example with more qubits: is “swapping qubits 0 and 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( q 0 ; q 1 ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; Complementing qubit 2 a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) = swapping qubits 0 and 2 �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; ◦ complementing qubit 0 a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; ◦ swapping qubits 0 and 2. a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; Similarly: swapping qubits i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ).

  12. ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a ; a 6 ; a 7 ; a 0 ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a “complementing qubit 2”: is a “reversible XOR gate” = is a “Toffoli ; q 2 ) �→ ( q 0 ; q 1 ; q 2 ⊕ 1). “controlled NOT gate”: “controlled ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ; a 2 ; a 6 ; a 1 ; a 5 ; a 3 ; a 7 ) Example with more qubits: Example apping qubits 0 and 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a ; q 2 ) �→ ( q 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; Complementing qubit 2 a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; pping qubits 0 and 2 �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a complementing qubit 0 a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 apping qubits 0 and 2. a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; rly: swapping qubits i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ;

  13. ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a ; a 1 ; a 2 ; a 3 ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a “complementing qubit 2”: is a “reversible XOR gate” = is a “Toffoli gate” 0 ; q 1 ; q 2 ⊕ 1). “controlled NOT gate”: “controlled controlled ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ; a 5 ; a 6 ; a 7 ) �→ ; a 5 ; a 3 ; a 7 ) Example with more qubits: Example with more qubits 0 and 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 2 ; q 1 ; q 0 ). a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 qubit 2 a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 qubits 0 and 2 �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a complementing qubit 0 a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; qubits 0 and 2. a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 apping qubits i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28

  14. ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ) ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) 2”: is a “reversible XOR gate” = is a “Toffoli gate” = 1). “controlled NOT gate”: “controlled controlled NOT ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ) �→ ) Example with more qubits: Example with more qubits: 2”: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 2 �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 0 a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a and 2. a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 i; j . a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31

  15. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) is a “reversible XOR gate” = is a “Toffoli gate” = “controlled NOT gate”: “controlled controlled NOT gate”: ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). Example with more qubits: Example with more qubits: ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) �→ ( a 0 ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; a 8 ; a 9 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; a 16 ; a 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; a 24 ; a 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ).

  16. ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) Say p is “reversible XOR gate” = is a “Toffoli gate” = of { 0 ; 1 ; “controlled NOT gate”: “controlled controlled NOT gate”: General strategy ; q 2 ) �→ ( q 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). these fast Example with more qubits: Example with more qubits: to obtain ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) ; a 1 ; a 3 ; a 2 ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; a 11 ; a 10 ; a 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; 17 ; a 19 ; a 18 ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; 25 ; a 27 ; a 26 ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ).

  17. ; a 5 ; a 6 ; a 7 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible computa ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) Say p is a permutation OR gate” = is a “Toffoli gate” = of { 0 ; 1 ; : : : ; 2 n − 1 gate”: “controlled controlled NOT gate”: General strategy to 0 ⊕ q 1 ; q 1 ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). these fast quantum more qubits: Example with more qubits: to obtain index permutation ; a 5 ; a 6 ; a 7 ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p 12 ; a 13 ; a 14 ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − ; a 20 ; a 21 ; a 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; ; a 28 ; a 29 ; a 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) ; a 4 ; a 5 ; a 7 ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; 12 ; a 13 ; a 15 ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; ; a 20 ; a 21 ; a 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; ; a 28 ; a 29 ; a 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ).

  18. ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible computation ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) Say p is a permutation = is a “Toffoli gate” = of { 0 ; 1 ; : : : ; 2 n − 1 } . “controlled controlled NOT gate”: General strategy to compose ; q 2 ). ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). these fast quantum operations qubits: Example with more qubits: to obtain index permutation ; ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) ; a 15 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): 22 ; a 23 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; 30 ; a 31 ) a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) ; a 6 ; �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; ; a 14 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; 23 ; a 22 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; 31 ; a 30 ). a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ).

  19. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible computation ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) Say p is a permutation is a “Toffoli gate” = of { 0 ; 1 ; : : : ; 2 n − 1 } . “controlled controlled NOT gate”: General strategy to compose ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). these fast quantum operations Example with more qubits: to obtain index permutation ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ).

  20. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible computation ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) Say p is a permutation is a “Toffoli gate” = of { 0 ; 1 ; : : : ; 2 n − 1 } . “controlled controlled NOT gate”: General strategy to compose ( q 0 ; q 1 ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). these fast quantum operations Example with more qubits: to obtain index permutation ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; 1. Build a traditional circuit a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) to compute j �→ p ( j ) �→ ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; using NOT/XOR/AND gates. a 8 ; a 9 ; a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; a 16 ; a 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; 2. Convert into reversible gates: a 24 ; a 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ). e.g., convert AND into Toffoli.

  21. � ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Reversible computation Example: ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a Say p is a permutation offoli gate” = ( a 7 ; a 0 ; a of { 0 ; 1 ; : : : ; 2 n − 1 } . “controlled controlled NOT gate”: permutation General strategy to compose ; q 2 ) �→ ( q 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). 1. Build these fast quantum operations Example with more qubits: to compute to obtain index permutation ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) q 0 a 10 ; a 11 ; a 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): ❉ ✷ ❉ ❉ ✷ 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 22 ; a 23 ; ✷ ✷ ✷ 1. Build a traditional circuit 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 30 ; a 31 ) ✷ to compute j �→ p ( j ) ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 7 ; a 6 ; using NOT/XOR/AND gates. a 10 ; a 11 ; a 12 ; a 13 ; a 15 ; a 14 ; 17 ; a 18 ; a 19 ; a 20 ; a 21 ; a 23 ; a 22 ; 2. Convert into reversible gates: q 0 ⊕ 1 25 ; a 26 ; a 27 ; a 28 ; a 29 ; a 31 ; a 30 ). e.g., convert AND into Toffoli.

  22. � � � � � ; a 5 ; a 6 ; a 7 ) �→ Reversible computation Example: Let’s com ; a 5 ; a 7 ; a 6 ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a Say p is a permutation gate” = ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a of { 0 ; 1 ; : : : ; 2 n − 1 } . controlled NOT gate”: permutation q �→ q General strategy to compose 0 ⊕ q 1 q 2 ; q 1 ; q 2 ). 1. Build a traditional these fast quantum operations to compute q �→ q more qubits: to obtain index permutation ; a 5 ; a 6 ; a 7 ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) q 0 q 1 12 ; a 13 ; a 14 ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): ❉ ✷ ❉ ✷ ❉ ; a 20 ; a 21 ; a 22 ; a 23 ; ✷ ❉ ❉ ✷ ❉ ✷ ❉ 1. Build a traditional circuit ; a 28 ; a 29 ; a 30 ; a 31 ) ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 to compute j �→ p ( j ) ✷ ; a 4 ; a 5 ; a 7 ; a 6 ; ✷ ✷ ❉ using NOT/XOR/AND gates. ✷ 12 ; a 13 ; a 15 ; a 14 ; ✷ ✷ ✷ ; a 20 ; a 21 ; a 23 ; a 22 ; ✷ 2. Convert into reversible gates: ✷ q 0 ⊕ 1 q 1 ⊕ q ; a 28 ; a 29 ; a 31 ; a 30 ). e.g., convert AND into Toffoli.

  23. � � � � � � � ) �→ Reversible computation Example: Let’s compute ) ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Say p is a permutation ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); of { 0 ; 1 ; : : : ; 2 n − 1 } . NOT gate”: permutation q �→ q + 1 mod General strategy to compose q 1 ; q 2 ). 1. Build a traditional circuit these fast quantum operations to compute q �→ q + 1 mod qubits: to obtain index permutation ; ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) q 0 q 1 q ; a 15 ; �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): ❉ ✷ ❉ ✷ ❉ 22 ; a 23 ; ✷ ❉ ❉ ✷ ❉ ✷ ❉ 1. Build a traditional circuit 30 ; a 31 ) ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 to compute j �→ p ( j ) ✷ ; a 6 ; ✷ ✷ ❉ ❉ using NOT/XOR/AND gates. ✷ ; a 14 ; ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ 23 ; a 22 ; ❉ ✷ ❉ 2. Convert into reversible gates: ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ 31 ; a 30 ). e.g., convert AND into Toffoli.

  24. � � � � � � � Reversible computation Example: Let’s compute ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Say p is a permutation ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); of { 0 ; 1 ; : : : ; 2 n − 1 } . permutation q �→ q + 1 mod 8. General strategy to compose 1. Build a traditional circuit these fast quantum operations to compute q �→ q + 1 mod 8. to obtain index permutation ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) q 0 q 1 q 2 �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ): ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ 1. Build a traditional circuit ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 to compute j �→ p ( j ) ✷ ✷ ✷ ❉ ❉ using NOT/XOR/AND gates. ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ 2. Convert into reversible gates: ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1 e.g., convert AND into Toffoli.

  25. � � � � � � � Reversible computation Example: Let’s compute 2. Convert ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ is a permutation Toffoli fo ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); 1 ; : : : ; 2 n − 1 } . ( a 0 ; a 1 ; a permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a General strategy to compose 1. Build a traditional circuit fast quantum operations to compute q �→ q + 1 mod 8. obtain index permutation a p (1) ; : : : ; a p (2 n − 1) ) q 0 q 1 q 2 ; a 1 ; : : : ; a 2 n − 1 ): ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ Build a traditional circuit ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 compute j �→ p ( j ) ✷ ✷ ✷ ❉ ❉ NOT/XOR/AND gates. ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ Convert into reversible gates: ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1 convert AND into Toffoli.

  26. � � � � � � � omputation Example: Let’s compute 2. Convert into reversible ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ ermutation Toffoli for q 2 ← q 2 ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); − 1 } . ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a to compose 1. Build a traditional circuit quantum operations to compute q �→ q + 1 mod 8. permutation ; a p (2 n − 1) ) q 0 q 1 q 2 n − 1 ): ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ traditional circuit ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 p ( j ) ✷ ✷ ✷ ❉ ❉ OR/AND gates. ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ reversible gates: ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1 AND into Toffoli.

  27. � � � � � � � Example: Let’s compute 2. Convert into reversible gates. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). ose 1. Build a traditional circuit erations to compute q �→ q + 1 mod 8. ermutation q 0 q 1 q 2 ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ circuit ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 ✷ ✷ ✷ ❉ ❉ gates. ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ gates: ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1 offoli.

  28. � � � � � � � Example: Let’s compute 2. Convert into reversible gates. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). 1. Build a traditional circuit to compute q �→ q + 1 mod 8. q 0 q 1 q 2 ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 ✷ ✷ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1

  29. � � � � � � � Example: Let’s compute 2. Convert into reversible gates. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). 1. Build a traditional circuit Controlled NOT for q 1 ← q 1 ⊕ q 0 : to compute q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). q 0 q 1 q 2 ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 ✷ ✷ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1

  30. � � � � � � � Example: Let’s compute 2. Convert into reversible gates. ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ permutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). 1. Build a traditional circuit Controlled NOT for q 1 ← q 1 ⊕ q 0 : to compute q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). q 0 q 1 q 2 ❉ ✷ ❉ ✷ NOT for q 0 ← q 0 ⊕ 1: ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). ✷ ✷ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ q 0 ⊕ 1 q 1 ⊕ q 0 q 2 ⊕ c 1

  31. � � � � � � Example: Let’s compute 2. Convert into reversible gates. This permutation ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ was deceptively Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t ermutation q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large Build a traditional circuit Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many compute q �→ q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really w ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). q 1 q 2 NOT for q 0 ← q 0 ⊕ 1: ❉ ❉ ❉ ❉ ✷ ❉ ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ ✷ ❉ ❉ ✷ ❉ ✷ c 1 = q 1 q 0 ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). ✷ ✷ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ ❉ ✷ ❉ ✷ ❉ 1 q 1 ⊕ q 0 q 2 ⊕ c 1

  32. � � � compute 2. Convert into reversible gates. This permutation example ; a 5 ; a 6 ; a 7 ) �→ was deceptively easy Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ; a 4 ; a 5 ; a 6 ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large n , most p traditional circuit Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many operations q + 1 mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). q 2 NOT for q 0 ← q 0 ⊕ 1: ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ q 1 q 0 ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). ❉ ❉ ❉ ❉ ❉ ❉ ❉ ❉ ❉ ❉ q 0 q 2 ⊕ c 1

  33. � 2. Convert into reversible gates. This permutation example ) �→ was deceptively easy. Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ); ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many operations. mod 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large n , most permutations circuit Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many operations ⇒ slo d 8. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). q 2 NOT for q 0 ← q 0 ⊕ 1: ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). ⊕ c 1

  34. 2. Convert into reversible gates. This permutation example was deceptively easy. Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many operations. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large n , most permutations p Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many operations ⇒ slow. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). NOT for q 0 ← q 0 ⊕ 1: ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ).

  35. 2. Convert into reversible gates. This permutation example was deceptively easy. Toffoli for q 2 ← q 2 ⊕ q 1 q 0 : ( a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many operations. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large n , most permutations p Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many operations ⇒ slow. ( a 0 ; a 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). Also, it didn’t need extra storage: NOT for q 0 ← q 0 ⊕ 1: circuit operated “in place” after ( a 0 ; a 7 ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ computation c 1 ← q 1 q 0 was ( a 7 ; a 0 ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). merged into q 2 ← q 2 ⊕ c 1 . Typical circuits aren’t in-place.

  36. Convert into reversible gates. This permutation example Start from was deceptively easy. inputs b 1 for q 2 ← q 2 ⊕ q 1 q 0 : b i +1 = 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many operations. b i +2 = 1 ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ). For large n , most permutations p : : : Controlled NOT for q 1 ← q 1 ⊕ q 0 : need many operations ⇒ slow. b T = 1 ⊕ ; a 2 ; a 7 ; a 4 ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. specified ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ). Also, it didn’t need extra storage: for q 0 ← q 0 ⊕ 1: circuit operated “in place” after ; a 2 ; a 1 ; a 4 ; a 3 ; a 6 ; a 5 ) �→ computation c 1 ← q 1 q 0 was ; a 1 ; a 2 ; a 3 ; a 4 ; a 5 ; a 6 ). merged into q 2 ← q 2 ⊕ c 1 . Typical circuits aren’t in-place.

  37. reversible gates. This permutation example Start from any circuit: was deceptively easy. inputs b 1 ; b 2 ; : : : ; b q 2 ⊕ q 1 q 0 : b i +1 = 1 ⊕ b f ( i +1) ; a 5 ; a 6 ; a 7 ) �→ It didn’t need many operations. b i +2 = 1 ⊕ b f ( i +2) ; a 5 ; a 6 ; a 3 ). For large n , most permutations p : : : for q 1 ← q 1 ⊕ q 0 : need many operations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( ; a 5 ; a 6 ; a 3 ) �→ Really want fast circuits. specified outputs. ; a 3 ; a 6 ; a 5 ). Also, it didn’t need extra storage: 0 ⊕ 1: circuit operated “in place” after ; a 3 ; a 6 ; a 5 ) �→ computation c 1 ← q 1 q 0 was ; a 4 ; a 5 ; a 6 ). merged into q 2 ← q 2 ⊕ c 1 . Typical circuits aren’t in-place.

  38. gates. This permutation example Start from any circuit: was deceptively easy. inputs b 1 ; b 2 ; : : : ; b i ; : b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; ) �→ It didn’t need many operations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; ). For large n , most permutations p : : : q 1 ⊕ q 0 : need many operations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; ) �→ Really want fast circuits. specified outputs. ). Also, it didn’t need extra storage: circuit operated “in place” after ) �→ computation c 1 ← q 1 q 0 was ). merged into q 2 ← q 2 ⊕ c 1 . Typical circuits aren’t in-place.

  39. This permutation example Start from any circuit: was deceptively easy. inputs b 1 ; b 2 ; : : : ; b i ; b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; It didn’t need many operations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; For large n , most permutations p : : : need many operations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; Really want fast circuits. specified outputs. Also, it didn’t need extra storage: circuit operated “in place” after computation c 1 ← q 1 q 0 was merged into q 2 ← q 2 ⊕ c 1 . Typical circuits aren’t in-place.

  40. This permutation example Start from any circuit: was deceptively easy. inputs b 1 ; b 2 ; : : : ; b i ; b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; It didn’t need many operations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; For large n , most permutations p : : : need many operations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; Really want fast circuits. specified outputs. Also, it didn’t need extra storage: Reversible but dirty: circuit operated “in place” after inputs b 1 ; b 2 ; : : : ; b T ; computation c 1 ← q 1 q 0 was b i +1 ← 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; merged into q 2 ← q 2 ⊕ c 1 . b i +2 ← 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; : : : Typical circuits aren’t in-place. b T ← 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . Same outputs if all of b i +1 ; : : : ; b T started as 0.

  41. ermutation example Start from any circuit: Reversible deceptively easy. inputs b 1 ; b 2 ; : : : ; b i ; after finishing b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; set non-outputs didn’t need many operations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; by repeating rge n , most permutations p : : : on non-outputs many operations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; Original want fast circuits. specified outputs. (inputs) it didn’t need extra storage: Reversible but dirty: (inputs ; dirt operated “in place” after inputs b 1 ; b 2 ; : : : ; b T ; Dirty reversible computation c 1 ← q 1 q 0 was b i +1 ← 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros merged into q 2 ← q 2 ⊕ c 1 . b i +2 ← 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt : : : ypical circuits aren’t in-place. Clean reversible b T ← 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . (inputs ; zeros Same outputs if all of (inputs ; zeros b i +1 ; : : : ; b T started as 0.

  42. ermutation example Start from any circuit: Reversible and clean: easy. inputs b 1 ; b 2 ; : : : ; b i ; after finishing dirty b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; set non-outputs back many operations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; by repeating same most permutations p : : : on non-outputs in erations ⇒ slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; Original computation: circuits. specified outputs. (inputs) �→ need extra storage: Reversible but dirty: (inputs ; dirt ; outputs). “in place” after inputs b 1 ; b 2 ; : : : ; b T ; Dirty reversible computation: ← q 1 q 0 was b i +1 ← 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros ; zeros) ← q 2 ⊕ c 1 . b i +2 ← 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt ; outputs). : : : aren’t in-place. Clean reversible computation: b T ← 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . (inputs ; zeros ; zeros) Same outputs if all of (inputs ; zeros ; outputs). b i +1 ; : : : ; b T started as 0.

  43. Start from any circuit: Reversible and clean: inputs b 1 ; b 2 ; : : : ; b i ; after finishing dirty computation, b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; set non-outputs back to 0, erations. b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; by repeating same operations ermutations p : : : on non-outputs in reverse order. slow. b T = 1 ⊕ b f ( T ) b g ( T ) ; Original computation: specified outputs. (inputs) �→ storage: Reversible but dirty: (inputs ; dirt ; outputs). after inputs b 1 ; b 2 ; : : : ; b T ; Dirty reversible computation: as b i +1 ← 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros ; zeros) �→ . b i +2 ← 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt ; outputs). : : : in-place. Clean reversible computation: b T ← 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . (inputs ; zeros ; zeros) �→ Same outputs if all of (inputs ; zeros ; outputs). b i +1 ; : : : ; b T started as 0.

  44. Start from any circuit: Reversible and clean: inputs b 1 ; b 2 ; : : : ; b i ; after finishing dirty computation, b i +1 = 1 ⊕ b f ( i +1) b g ( i +1) ; set non-outputs back to 0, b i +2 = 1 ⊕ b f ( i +2) b g ( i +2) ; by repeating same operations : : : on non-outputs in reverse order. b T = 1 ⊕ b f ( T ) b g ( T ) ; Original computation: specified outputs. (inputs) �→ Reversible but dirty: (inputs ; dirt ; outputs). inputs b 1 ; b 2 ; : : : ; b T ; Dirty reversible computation: b i +1 ← 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros ; zeros) �→ b i +2 ← 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt ; outputs). : : : Clean reversible computation: b T ← 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . (inputs ; zeros ; zeros) �→ Same outputs if all of (inputs ; zeros ; outputs). b i +1 ; : : : ; b T started as 0.

  45. from any circuit: Reversible and clean: Given fast b 1 ; b 2 ; : : : ; b i ; after finishing dirty computation, and fast 1 ⊕ b f ( i +1) b g ( i +1) ; set non-outputs back to 0, build fast 1 ⊕ b f ( i +2) b g ( i +2) ; by repeating same operations ( x; zeros) on non-outputs in reverse order. 1 ⊕ b f ( T ) b g ( T ) ; Original computation: ecified outputs. (inputs) �→ Reversible but dirty: (inputs ; dirt ; outputs). b 1 ; b 2 ; : : : ; b T ; Dirty reversible computation: 1 ⊕ b i +1 ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros ; zeros) �→ 1 ⊕ b i +2 ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt ; outputs). Clean reversible computation: 1 ⊕ b T ⊕ b f ( T ) b g ( T ) . (inputs ; zeros ; zeros) �→ outputs if all of (inputs ; zeros ; outputs). : : ; b T started as 0.

  46. circuit: Reversible and clean: Given fast circuit fo ; b i ; after finishing dirty computation, and fast circuit for +1) b g ( i +1) ; set non-outputs back to 0, build fast reversible +2) b g ( i +2) ; by repeating same operations ( x; zeros) �→ ( p ( x ) on non-outputs in reverse order. g ( T ) ; Original computation: outputs. (inputs) �→ dirty: (inputs ; dirt ; outputs). ; b T ; Dirty reversible computation: ⊕ b f ( i +1) b g ( i +1) ; (inputs ; zeros ; zeros) �→ ⊕ b f ( i +2) b g ( i +2) ; (inputs ; dirt ; outputs). Clean reversible computation: b f ( T ) b g ( T ) . (inputs ; zeros ; zeros) �→ all of (inputs ; zeros ; outputs). rted as 0.

  47. Reversible and clean: Given fast circuit for p and fast circuit for p − 1 , after finishing dirty computation, ; set non-outputs back to 0, build fast reversible circuit fo ; by repeating same operations ( x; zeros) �→ ( p ( x ) ; zeros). on non-outputs in reverse order. Original computation: (inputs) �→ (inputs ; dirt ; outputs). Dirty reversible computation: b g ( i +1) ; (inputs ; zeros ; zeros) �→ b g ( i +2) ; (inputs ; dirt ; outputs). Clean reversible computation: . (inputs ; zeros ; zeros) �→ (inputs ; zeros ; outputs).

  48. Reversible and clean: Given fast circuit for p and fast circuit for p − 1 , after finishing dirty computation, set non-outputs back to 0, build fast reversible circuit for by repeating same operations ( x; zeros) �→ ( p ( x ) ; zeros). on non-outputs in reverse order. Original computation: (inputs) �→ (inputs ; dirt ; outputs). Dirty reversible computation: (inputs ; zeros ; zeros) �→ (inputs ; dirt ; outputs). Clean reversible computation: (inputs ; zeros ; zeros) �→ (inputs ; zeros ; outputs).

  49. Reversible and clean: Given fast circuit for p and fast circuit for p − 1 , after finishing dirty computation, set non-outputs back to 0, build fast reversible circuit for by repeating same operations ( x; zeros) �→ ( p ( x ) ; zeros). on non-outputs in reverse order. Replace reversible bit operations Original computation: with Toffoli gates etc. permuting C 2 n + z → C 2 n + z . (inputs) �→ (inputs ; dirt ; outputs). Permutation on first 2 n entries is Dirty reversible computation: ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) (inputs ; zeros ; zeros) �→ �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ). (inputs ; dirt ; outputs). Typically prepare vectors supported on first 2 n entries Clean reversible computation: (inputs ; zeros ; zeros) �→ so don’t care how permutation acts on last 2 n + z − 2 n entries. (inputs ; zeros ; outputs).

  50. Reversible and clean: Given fast circuit for p Warning: and fast circuit for p − 1 , finishing dirty computation, ≈ number non-outputs back to 0, build fast reversible circuit for in original eating same operations ( x; zeros) �→ ( p ( x ) ; zeros). This can non-outputs in reverse order. Replace reversible bit operations than numb Original computation: with Toffoli gates etc. in the original permuting C 2 n + z → C 2 n + z . (inputs) �→ Many useful (inputs ; dirt ; outputs). Permutation on first 2 n entries is to compress reversible computation: ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) but often (inputs ; zeros ; zeros) �→ �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ). Many subtle (inputs ; dirt ; outputs). Typically prepare vectors Crude “p supported on first 2 n entries reversible computation: don’t care (inputs ; zeros ; zeros) �→ so don’t care how permutation but serious acts on last 2 n + z − 2 n entries. (inputs ; zeros ; outputs). is much

  51. clean: Given fast circuit for p Warning: Number and fast circuit for p − 1 , irty computation, ≈ number of bit op in original p; p − 1 circuits. back to 0, build fast reversible circuit for same operations ( x; zeros) �→ ( p ( x ) ; zeros). This can be much in reverse order. Replace reversible bit operations than number of bits computation: with Toffoli gates etc. in the original circuits. permuting C 2 n + z → C 2 n + z . Many useful techniques outputs). Permutation on first 2 n entries is to compress into few computation: ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) but often these lose zeros) �→ �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ). Many subtle tradeoffs. outputs). Typically prepare vectors Crude “poly-time” supported on first 2 n entries computation: don’t care about this, zeros) �→ so don’t care how permutation but serious cryptanalysis acts on last 2 n + z − 2 n entries. outputs). is much more prec

  52. Given fast circuit for p Warning: Number of qubits and fast circuit for p − 1 , computation, ≈ number of bit operations in original p; p − 1 circuits. 0, build fast reversible circuit for erations ( x; zeros) �→ ( p ( x ) ; zeros). This can be much larger order. Replace reversible bit operations than number of bits stored with Toffoli gates etc. in the original circuits. permuting C 2 n + z → C 2 n + z . Many useful techniques Permutation on first 2 n entries is to compress into fewer qubits, computation: ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) but often these lose time. �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ). Many subtle tradeoffs. Typically prepare vectors Crude “poly-time” analyses supported on first 2 n entries computation: don’t care about this, so don’t care how permutation but serious cryptanalysis acts on last 2 n + z − 2 n entries. is much more precise.

  53. Given fast circuit for p Warning: Number of qubits and fast circuit for p − 1 , ≈ number of bit operations in original p; p − 1 circuits. build fast reversible circuit for ( x; zeros) �→ ( p ( x ) ; zeros). This can be much larger Replace reversible bit operations than number of bits stored with Toffoli gates etc. in the original circuits. permuting C 2 n + z → C 2 n + z . Many useful techniques Permutation on first 2 n entries is to compress into fewer qubits, ( a p (0) ; a p (1) ; : : : ; a p (2 n − 1) ) but often these lose time. �→ ( a 0 ; a 1 ; : : : ; a 2 n − 1 ). Many subtle tradeoffs. Typically prepare vectors Crude “poly-time” analyses supported on first 2 n entries don’t care about this, so don’t care how permutation but serious cryptanalysis acts on last 2 n + z − 2 n entries. is much more precise.

  54. fast circuit for p Warning: Number of qubits Fast quan fast circuit for p − 1 , ≈ number of bit operations “Hadama in original p; p − 1 circuits. fast reversible circuit for ( a 0 ; a 1 ) �→ zeros) �→ ( p ( x ) ; zeros). This can be much larger Replace reversible bit operations than number of bits stored offoli gates etc. in the original circuits. ermuting C 2 n + z → C 2 n + z . Many useful techniques ermutation on first 2 n entries is to compress into fewer qubits, a p (1) ; : : : ; a p (2 n − 1) ) but often these lose time. ; a 1 ; : : : ; a 2 n − 1 ). Many subtle tradeoffs. ypically prepare vectors Crude “poly-time” analyses rted on first 2 n entries don’t care about this, don’t care how permutation but serious cryptanalysis on last 2 n + z − 2 n entries. is much more precise.

  55. circuit for p Warning: Number of qubits Fast quantum operations, for p − 1 , ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. ersible circuit for ( a 0 ; a 1 ) �→ ( a 0 + a x ) ; zeros). This can be much larger ble bit operations than number of bits stored gates etc. in the original circuits. → C 2 n + z . Many useful techniques first 2 n entries is to compress into fewer qubits, ; a p (2 n − 1) ) but often these lose time. n − 1 ). Many subtle tradeoffs. re vectors Crude “poly-time” analyses first 2 n entries don’t care about this, w permutation but serious cryptanalysis − 2 n entries. is much more precise.

  56. Warning: Number of qubits Fast quantum operations, pa ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. for ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). This can be much larger erations than number of bits stored in the original circuits. . Many useful techniques entries is to compress into fewer qubits, but often these lose time. Many subtle tradeoffs. Crude “poly-time” analyses entries don’t care about this, ermutation but serious cryptanalysis entries. is much more precise.

  57. Warning: Number of qubits Fast quantum operations, part 2 ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). This can be much larger than number of bits stored in the original circuits. Many useful techniques to compress into fewer qubits, but often these lose time. Many subtle tradeoffs. Crude “poly-time” analyses don’t care about this, but serious cryptanalysis is much more precise.

  58. Warning: Number of qubits Fast quantum operations, part 2 ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). This can be much larger ( a 0 ; a 1 ; a 2 ; a 3 ) �→ than number of bits stored ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). in the original circuits. Many useful techniques to compress into fewer qubits, but often these lose time. Many subtle tradeoffs. Crude “poly-time” analyses don’t care about this, but serious cryptanalysis is much more precise.

  59. Warning: Number of qubits Fast quantum operations, part 2 ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). This can be much larger ( a 0 ; a 1 ; a 2 ; a 3 ) �→ than number of bits stored ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). in the original circuits. Same for qubit 1: Many useful techniques ( a 0 ; a 1 ; a 2 ; a 3 ) �→ to compress into fewer qubits, ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). but often these lose time. Many subtle tradeoffs. Crude “poly-time” analyses don’t care about this, but serious cryptanalysis is much more precise.

  60. Warning: Number of qubits Fast quantum operations, part 2 ≈ number of bit operations “Hadamard”: in original p; p − 1 circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). This can be much larger ( a 0 ; a 1 ; a 2 ; a 3 ) �→ than number of bits stored ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). in the original circuits. Same for qubit 1: Many useful techniques ( a 0 ; a 1 ; a 2 ; a 3 ) �→ to compress into fewer qubits, ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). but often these lose time. Qubit 0 and then qubit 1: Many subtle tradeoffs. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ Crude “poly-time” analyses ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ don’t care about this, ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , but serious cryptanalysis a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ). is much more precise.

  61. rning: Number of qubits Fast quantum operations, part 2 Repeat n number of bit operations (1 ; 0 ; 0 ; : “Hadamard”: iginal p; p − 1 circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring can be much larger always p ( a 0 ; a 1 ; a 2 ; a 3 ) �→ number of bits stored ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring original circuits. can produce Same for qubit 1: useful techniques Pr[output ( a 0 ; a 1 ; a 2 ; a 3 ) �→ compress into fewer qubits, ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). often these lose time. Qubit 0 and then qubit 1: subtle tradeoffs. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ “poly-time” analyses ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ care about this, ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , serious cryptanalysis a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ). much more precise.

  62. er of qubits Fast quantum operations, part 2 Repeat n times: e.g., (1 ; 0 ; 0 ; : : : ; 0) �→ (1 bit operations “Hadamard”: circuits. ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; much larger always produces 0. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ bits stored ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; circuits. can produce any output: Same for qubit 1: techniques Pr[output = q ] = 1 ( a 0 ; a 1 ; a 2 ; a 3 ) �→ fewer qubits, ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). lose time. Qubit 0 and then qubit 1: tradeoffs. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ oly-time” analyses ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ this, ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , cryptanalysis a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ). recise.

  63. Fast quantum operations, part 2 Repeat n times: e.g., qubits (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : erations “Hadamard”: ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) always produces 0. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ red ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) can produce any output: Same for qubit 1: Pr[output = q ] = 1 = 2 n . ( a 0 ; a 1 ; a 2 ; a 3 ) �→ qubits, ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). Qubit 0 and then qubit 1: ( a 0 ; a 1 ; a 2 ; a 3 ) �→ analyses ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ).

  64. Fast quantum operations, part 2 Repeat n times: e.g., (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). “Hadamard”: ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) always produces 0. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) can produce any output: Same for qubit 1: Pr[output = q ] = 1 = 2 n . ( a 0 ; a 1 ; a 2 ; a 3 ) �→ ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). Qubit 0 and then qubit 1: ( a 0 ; a 1 ; a 2 ; a 3 ) �→ ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ).

  65. Fast quantum operations, part 2 Repeat n times: e.g., (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). “Hadamard”: ( a 0 ; a 1 ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) always produces 0. ( a 0 ; a 1 ; a 2 ; a 3 ) �→ ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) can produce any output: Same for qubit 1: Pr[output = q ] = 1 = 2 n . ( a 0 ; a 1 ; a 2 ; a 3 ) �→ ( a 0 + a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). Aside from “normalization” (irrelevant to measurement), Qubit 0 and then qubit 1: have Hadamard = Hadamard − 1 , ( a 0 ; a 1 ; a 2 ; a 3 ) �→ so easily work backwards ( a 0 + a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ from “uniform superposition” ( a 0 + a 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , (1 ; 1 ; 1 ; : : : ; 1) to “pure state” a 0 + a 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ). (1 ; 0 ; 0 ; : : : ; 0).

  66. quantum operations, part 2 Repeat n times: e.g., Simon’s (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). “Hadamard”: Assume: ) �→ ( a 0 + a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies always produces 0. for every ; a 2 ; a 3 ) �→ Can we find a 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast can produce any output: for qubit 1: Pr[output = q ] = 1 = 2 n . ; a 2 ; a 3 ) �→ a 2 ; a 1 + a 3 ; a 0 − a 2 ; a 1 − a 3 ). Aside from “normalization” (irrelevant to measurement), 0 and then qubit 1: have Hadamard = Hadamard − 1 , ; a 2 ; a 3 ) �→ so easily work backwards 1 ; a 0 − a 1 ; a 2 + a 3 ; a 2 − a 3 ) �→ from “uniform superposition” 1 + a 2 + a 3 ; a 0 − a 1 + a 2 − a 3 , (1 ; 1 ; 1 ; : : : ; 1) to “pure state” 1 − a 2 − a 3 ; a 0 − a 1 − a 2 + a 3 ). (1 ; 0 ; 0 ; : : : ; 0).

  67. operations, part 2 Repeat n times: e.g., Simon’s algorithm (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). Assume: nonzero s a 1 ; a 0 − a 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x always produces 0. for every x ∈ { 0 ; 1 Can we find this p ; a 2 + a 3 ; a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit can produce any output: 1: Pr[output = q ] = 1 = 2 n . ; a 0 − a 2 ; a 1 − a 3 ). Aside from “normalization” (irrelevant to measurement), then qubit 1: have Hadamard = Hadamard − 1 , so easily work backwards a 2 + a 3 ; a 2 − a 3 ) �→ from “uniform superposition” ; a 0 − a 1 + a 2 − a 3 , (1 ; 1 ; 1 ; : : : ; 1) to “pure state” ; a 0 − a 1 − a 2 + a 3 ). (1 ; 0 ; 0 ; : : : ; 0).

  68. part 2 Repeat n times: e.g., Simon’s algorithm (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). Assume: nonzero s ∈ { 0 ; 1 } n 1 ). Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) for every x ∈ { 0 ; 1 } n . always produces 0. Can we find this period s , a 2 − a 3 ). Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit for f ? can produce any output: Pr[output = q ] = 1 = 2 n . a 1 − a 3 ). Aside from “normalization” (irrelevant to measurement), have Hadamard = Hadamard − 1 , so easily work backwards − a 3 ) �→ from “uniform superposition” a 2 − a 3 , (1 ; 1 ; 1 ; : : : ; 1) to “pure state” − a 2 + a 3 ). (1 ; 0 ; 0 ; : : : ; 0).

  69. Repeat n times: e.g., Simon’s algorithm (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). Assume: nonzero s ∈ { 0 ; 1 } n Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) for every x ∈ { 0 ; 1 } n . always produces 0. Can we find this period s , Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit for f ? can produce any output: Pr[output = q ] = 1 = 2 n . Aside from “normalization” (irrelevant to measurement), have Hadamard = Hadamard − 1 , so easily work backwards from “uniform superposition” (1 ; 1 ; 1 ; : : : ; 1) to “pure state” (1 ; 0 ; 0 ; : : : ; 0).

  70. Repeat n times: e.g., Simon’s algorithm (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). Assume: nonzero s ∈ { 0 ; 1 } n Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) for every x ∈ { 0 ; 1 } n . always produces 0. Can we find this period s , Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit for f ? can produce any output: Pr[output = q ] = 1 = 2 n . We don’t have enough data if f has many periods. Aside from “normalization” Assume: only periods are 0 ; s . (irrelevant to measurement), have Hadamard = Hadamard − 1 , so easily work backwards from “uniform superposition” (1 ; 1 ; 1 ; : : : ; 1) to “pure state” (1 ; 0 ; 0 ; : : : ; 0).

  71. Repeat n times: e.g., Simon’s algorithm (1 ; 0 ; 0 ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). Assume: nonzero s ∈ { 0 ; 1 } n Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) for every x ∈ { 0 ; 1 } n . always produces 0. Can we find this period s , Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit for f ? can produce any output: Pr[output = q ] = 1 = 2 n . We don’t have enough data if f has many periods. Aside from “normalization” Assume: only periods are 0 ; s . (irrelevant to measurement), have Hadamard = Hadamard − 1 , Traditional solution: so easily work backwards Compute f for many inputs, from “uniform superposition” sort, analyze collisions. (1 ; 1 ; 1 ; : : : ; 1) to “pure state” Success probability is very low until #inputs approaches 2 n= 2 . (1 ; 0 ; 0 ; : : : ; 0).

  72. eat n times: e.g., Simon’s algorithm Simon’s ; : : : ; 0) �→ (1 ; 1 ; 1 ; : : : ; 1). is much, Assume: nonzero s ∈ { 0 ; 1 } n Measuring (1 ; 0 ; 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) Say f maps for every x ∈ { 0 ; 1 } n . produces 0. using z “ancilla” Can we find this period s , for reversibili Measuring (1 ; 1 ; 1 ; : : : ; 1) given a fast circuit for f ? roduce any output: Prepare n [output = q ] = 1 = 2 n . We don’t have enough data in pure zero if f has many periods. vector (1 from “normalization” Assume: only periods are 0 ; s . (irrelevant to measurement), Use n -fold Hadamard = Hadamard − 1 , Traditional solution: to move easily work backwards Compute f for many inputs, into unifo “uniform superposition” sort, analyze collisions. (1 ; 1 ; 1 ; : with 2 n entries ; : : : ; 1) to “pure state” Success probability is very low until #inputs approaches 2 n= 2 . ; : : : ; 0).

  73. e.g., Simon’s algorithm Simon’s algorithm (1 ; 1 ; 1 ; : : : ; 1). is much, much, much Assume: nonzero s ∈ { 0 ; 1 } n 0 ; : : : ; 0) satisfies f ( x ) = f ( x ⊕ s ) Say f maps n bits for every x ∈ { 0 ; 1 } n . 0. using z “ancilla” bits Can we find this period s , for reversibility. 1 ; : : : ; 1) given a fast circuit for f ? output: Prepare n + m + z 1 = 2 n . We don’t have enough data in pure zero state: if f has many periods. vector (1 ; 0 ; 0 ; : : : ). rmalization” Assume: only periods are 0 ; s . measurement), Use n -fold Hadama = Hadamard − 1 , Traditional solution: to move first n qubits backwards Compute f for many inputs, into uniform superp superposition” sort, analyze collisions. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; with 2 n entries 1, others to “pure state” Success probability is very low until #inputs approaches 2 n= 2 .

  74. Simon’s algorithm Simon’s algorithm : : ; 1). is much, much, much faster. Assume: nonzero s ∈ { 0 ; 1 } n satisfies f ( x ) = f ( x ⊕ s ) Say f maps n bits to m bits, for every x ∈ { 0 ; 1 } n . using z “ancilla” bits Can we find this period s , for reversibility. given a fast circuit for f ? Prepare n + m + z qubits We don’t have enough data in pure zero state: if f has many periods. vector (1 ; 0 ; 0 ; : : : ). rmalization” Assume: only periods are 0 ; s . measurement), Use n -fold Hadamard Hadamard − 1 , Traditional solution: to move first n qubits Compute f for many inputs, into uniform superposition: osition” sort, analyze collisions. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) with 2 n entries 1, others 0. state” Success probability is very low until #inputs approaches 2 n= 2 .

  75. Simon’s algorithm Simon’s algorithm is much, much, much faster. Assume: nonzero s ∈ { 0 ; 1 } n satisfies f ( x ) = f ( x ⊕ s ) Say f maps n bits to m bits, for every x ∈ { 0 ; 1 } n . using z “ancilla” bits Can we find this period s , for reversibility. given a fast circuit for f ? Prepare n + m + z qubits We don’t have enough data in pure zero state: if f has many periods. vector (1 ; 0 ; 0 ; : : : ). Assume: only periods are 0 ; s . Use n -fold Hadamard Traditional solution: to move first n qubits Compute f for many inputs, into uniform superposition: sort, analyze collisions. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) with 2 n entries 1, others 0. Success probability is very low until #inputs approaches 2 n= 2 .

  76. Simon’s algorithm Simon’s algorithm Apply fast is much, much, much faster. for reversible Assume: nonzero s ∈ { 0 ; 1 } n 1 in position satisfies f ( x ) = f ( x ⊕ s ) Say f maps n bits to m bits, moves to very x ∈ { 0 ; 1 } n . using z “ancilla” bits e find this period s , for reversibility. Note sym a fast circuit for f ? 1 at ( q; f Prepare n + m + z qubits 1 at ( q ⊕ don’t have enough data in pure zero state: has many periods. vector (1 ; 0 ; 0 ; : : : ). Apply n -fold Assume: only periods are 0 ; s . Use n -fold Hadamard Measure. raditional solution: to move first n qubits output is Compute f for many inputs, into uniform superposition: Repeat n analyze collisions. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) Use Gaussian with 2 n entries 1, others 0. Success probability is very low to (probably) #inputs approaches 2 n= 2 .

  77. rithm Simon’s algorithm Apply fast vector p is much, much, much faster. for reversible f computation: nonzero s ∈ { 0 ; 1 } n 1 in position ( q; 0 ; f ( x ⊕ s ) Say f maps n bits to m bits, moves to position ; 1 } n . using z “ancilla” bits period s , for reversibility. Note symmetry bet circuit for f ? 1 at ( q; f ( q ) ; 0) and Prepare n + m + z qubits 1 at ( q ⊕ s; f ( q ) ; 0). enough data in pure zero state: eriods. vector (1 ; 0 ; 0 ; : : : ). Apply n -fold Hadama eriods are 0 ; s . Use n -fold Hadamard Measure. By symme solution: to move first n qubits output is orthogonal any inputs, into uniform superposition: Repeat n + 10 tim collisions. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) Use Gaussian elimination with 2 n entries 1, others 0. robability is very low to (probably) find pproaches 2 n= 2 .

  78. Simon’s algorithm Apply fast vector permutation is much, much, much faster. for reversible f computation: } n 1 in position ( q; 0 ; 0) Say f maps n bits to m bits, moves to position ( q; f ( q ) ; 0). using z “ancilla” bits for reversibility. Note symmetry between 1 at ( q; f ( q ) ; 0) and Prepare n + m + z qubits 1 at ( q ⊕ s; f ( q ) ; 0). data in pure zero state: vector (1 ; 0 ; 0 ; : : : ). Apply n -fold Hadamard. 0 ; s . Use n -fold Hadamard Measure. By symmetry, to move first n qubits output is orthogonal to s . inputs, into uniform superposition: Repeat n + 10 times. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) Use Gaussian elimination with 2 n entries 1, others 0. low to (probably) find s . 2 n= 2 .

  79. Simon’s algorithm Apply fast vector permutation is much, much, much faster. for reversible f computation: 1 in position ( q; 0 ; 0) Say f maps n bits to m bits, moves to position ( q; f ( q ) ; 0). using z “ancilla” bits for reversibility. Note symmetry between 1 at ( q; f ( q ) ; 0) and Prepare n + m + z qubits 1 at ( q ⊕ s; f ( q ) ; 0). in pure zero state: vector (1 ; 0 ; 0 ; : : : ). Apply n -fold Hadamard. Use n -fold Hadamard Measure. By symmetry, to move first n qubits output is orthogonal to s . into uniform superposition: Repeat n + 10 times. (1 ; 1 ; 1 ; : : : ; 1 ; 0 ; 0 ; : : : ) Use Gaussian elimination with 2 n entries 1, others 0. to (probably) find s .

  80. Simon’s algorithm Apply fast vector permutation Grover’s much, much, much faster. for reversible f computation: Assume: 1 in position ( q; 0 ; 0) maps n bits to m bits, has f ( s ) moves to position ( q; f ( q ) ; 0). z “ancilla” bits Traditiona versibility. Note symmetry between compute 1 at ( q; f ( q ) ; 0) and re n + m + z qubits hope to 1 at ( q ⊕ s; f ( q ) ; 0). pure zero state: Success (1 ; 0 ; 0 ; : : : ). Apply n -fold Hadamard. until #inputs -fold Hadamard Measure. By symmetry, Grover’s move first n qubits output is orthogonal to s . reversible uniform superposition: Typically: Repeat n + 10 times. ; : : : ; 1 ; 0 ; 0 ; : : : ) is small enough Use Gaussian elimination entries 1, others 0. easily beats to (probably) find s .

  81. rithm Apply fast vector permutation Grover’s algorithm much faster. for reversible f computation: Assume: unique s 1 in position ( q; 0 ; 0) bits to m bits, has f ( s ) = 0. moves to position ( q; f ( q ) ; 0). bits Traditional algorithm Note symmetry between compute f for many 1 at ( q; f ( q ) ; 0) and z qubits hope to find output 1 at ( q ⊕ s; f ( q ) ; 0). state: Success probability : ). Apply n -fold Hadamard. until #inputs approaches Hadamard Measure. By symmetry, Grover’s algorithm qubits output is orthogonal to s . reversible computations erposition: Typically: reversibilit Repeat n + 10 times. 0 ; : : : ) is small enough that Use Gaussian elimination 1, others 0. easily beats traditional to (probably) find s .

  82. Apply fast vector permutation Grover’s algorithm faster. for reversible f computation: Assume: unique s ∈ { 0 ; 1 } n 1 in position ( q; 0 ; 0) bits, has f ( s ) = 0. moves to position ( q; f ( q ) ; 0). Traditional algorithm to find Note symmetry between compute f for many inputs, 1 at ( q; f ( q ) ; 0) and hope to find output 0. 1 at ( q ⊕ s; f ( q ) ; 0). Success probability is very lo until #inputs approaches 2 n Apply n -fold Hadamard. Measure. By symmetry, Grover’s algorithm takes only output is orthogonal to s . reversible computations of f osition: Typically: reversibility overhead Repeat n + 10 times. is small enough that this Use Gaussian elimination 0. easily beats traditional algorithm. to (probably) find s .

  83. Apply fast vector permutation Grover’s algorithm for reversible f computation: Assume: unique s ∈ { 0 ; 1 } n 1 in position ( q; 0 ; 0) has f ( s ) = 0. moves to position ( q; f ( q ) ; 0). Traditional algorithm to find s : Note symmetry between compute f for many inputs, 1 at ( q; f ( q ) ; 0) and hope to find output 0. 1 at ( q ⊕ s; f ( q ) ; 0). Success probability is very low until #inputs approaches 2 n . Apply n -fold Hadamard. Grover’s algorithm takes only 2 n= 2 Measure. By symmetry, output is orthogonal to s . reversible computations of f . Typically: reversibility overhead Repeat n + 10 times. is small enough that this Use Gaussian elimination easily beats traditional algorithm. to (probably) find s .

  84. fast vector permutation Grover’s algorithm Start from versible f computation: over all n Assume: unique s ∈ { 0 ; 1 } n osition ( q; 0 ; 0) has f ( s ) = 0. Step 1: to position ( q; f ( q ) ; 0). b q = − a Traditional algorithm to find s : symmetry between b q = a q compute f for many inputs, ; f ( q ) ; 0) and This is fast. hope to find output 0. ⊕ s; f ( q ) ; 0). Success probability is very low Step 2: until #inputs approaches 2 n . n -fold Hadamard. Negate a This is also Grover’s algorithm takes only 2 n= 2 Measure. By symmetry, is orthogonal to s . reversible computations of f . Repeat steps Typically: reversibility overhead about 0 : eat n + 10 times. is small enough that this Gaussian elimination Measure easily beats traditional algorithm. robably) find s . With high

  85. r permutation Grover’s algorithm Start from uniform computation: over all n -bit strings Assume: unique s ∈ { 0 ; 1 } n 0 ; 0) has f ( s ) = 0. Step 1: Set a ← b osition ( q; f ( q ) ; 0). b q = − a q if f ( q ) = Traditional algorithm to find s : between b q = a q otherwise. compute f for many inputs, and This is fast. hope to find output 0. ; 0). Success probability is very low Step 2: “Grover diffusion”. until #inputs approaches 2 n . Hadamard. Negate a around its This is also fast. Grover’s algorithm takes only 2 n= 2 symmetry, rthogonal to s . reversible computations of f . Repeat steps 1 and about 0 : 58 · 2 0 : 5 n times. Typically: reversibility overhead times. is small enough that this elimination Measure the n qubits. easily beats traditional algorithm. find s . With high probabilit

  86. ermutation Grover’s algorithm Start from uniform superposition computation: over all n -bit strings q . Assume: unique s ∈ { 0 ; 1 } n has f ( s ) = 0. Step 1: Set a ← b where ; 0). b q = − a q if f ( q ) = 0, Traditional algorithm to find s : b q = a q otherwise. compute f for many inputs, This is fast. hope to find output 0. Success probability is very low Step 2: “Grover diffusion”. until #inputs approaches 2 n . Negate a around its average. This is also fast. Grover’s algorithm takes only 2 n= 2 reversible computations of f . Repeat steps 1 and 2 about 0 : 58 · 2 0 : 5 n times. Typically: reversibility overhead is small enough that this Measure the n qubits. easily beats traditional algorithm. With high probability this finds

Recommend


More recommend