Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Quantum Computing Algorithms

You're reading from  Quantum Computing Algorithms

Product type Book
Published in Sep 2023
Publisher Packt
ISBN-13 9781804617373
Pages 342 pages
Edition 1st Edition
Languages
Author (1):
Barry Burd Barry Burd
Profile icon Barry Burd

Table of Contents (19) Chapters

Preface 1. Introduction to Quantum Computing 2. Part 1 Nuts and Bolts
3. Chapter 1: New Ways to Think about Bits 4. Chapter 2: What Is a Qubit? 5. Chapter 3: Math for Qubits and Quantum Gates 6. Chapter 4: Qubit Conspiracy Theories 7. Part 2 Making Qubits Work for You
8. Chapter 5: A Fanciful Tale about Cryptography 9. Chapter 6: Quantum Networking and Teleportation 10. Part 3 Quantum Computing Algorithms
11. Chapter 7: Deutsch’s Algorithm 12. Chapter 8: Grover’s Algorithm 13. Chapter 9: Shor’s Algorithm 14. Part 4 Beyond Gate-Based Quantum Computing
15. Chapter 10: Some Other Directions for Quantum Computing 16. Assessments 17. Index 18. Other Books You May Enjoy

Chapter 9, Shor’s Algorithm

      1. We start by finding values of 3n % 14:

      Next, we calculate the following:

      {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><mfenced><mrow><msup><mn>3</mn><mfrac bevelled=\"true\"><mn>6</mn><mn>2</mn></mfrac></msup><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mn>1</mn><mo>&#xA0;</mo></mrow></mfenced><mfenced><mrow><msup><mn>3</mn><mfrac bevelled=\"true\"><mn>6</mn><mn>2</mn></mfrac></msup><mo>&#xA0;</mo><mo>-</mo><mo>&#xA0;</mo><mn>1</mn><mo>&#xA0;</mo></mrow></mfenced><mo>=</mo><mo>&#xA0;</mo><mn>28</mn><mo>&#xB7;</mo><mn>26</mn><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mfenced><mrow><mn>2</mn><mo>&#xB7;</mo><mn>2</mn><mo>&#xB7;</mo><mn>7</mn></mrow></mfenced><mo>&#xB7;</mo><mfenced><mrow><mn>2</mn><mo>&#xB7;</mo><mn>13</mn></mrow></mfenced><mspace linebreak=\"newline\"/></mstyle></math>","origin":"MathType for Microsoft Add-in"}

      When we calculate 14/13, we find that it isn’t an integer. But 14/2 = 7. So, 14 = 2·7.

      1. We start by finding values of 2n % 35:

      Next, we calculate the following:

      {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><mfenced><mrow><msup><mn>2</mn><mfrac bevelled=\"true\"><mn>12</mn><mn>2</mn></mfrac></msup><mo>&#xA0;</mo><mo>+</mo><mo>&#xA0;</mo><mn>1</mn><mo>&#xA0;</mo></mrow></mfenced><mfenced><mrow><msup><mn>2</mn><mfrac bevelled=\"true\"><mn>12</mn><mn>2</mn></mfrac></msup><mo>&#xA0;</mo><mo>-</mo><mo>&#xA0;</mo><mn>1</mn><mo>&#xA0;</mo></mrow></mfenced><mo>=</mo><mo>&#xA0;</mo><mn>65</mn><mo>&#xB7;</mo><mn>63</mn><mo>&#xA0;</mo><mo>=</mo><mo>&#xA0;</mo><mfenced><mrow><mn>5</mn><mo>&#xB7;</mo><mn>13</mn></mrow></mfenced><mo>&#xB7;</mo><mfenced><mrow><mn>3</mn><mo>&#xB7;</mo><mn>3</mn><mo>&#xB7;</mo><mn>7</mn></mrow></mfenced><mspace linebreak=\"newline\"/></mstyle></math>","origin":"MathType for Microsoft Add-in"}

      When we calculate 35/13 and 35/3, we find that these aren’t integers. But 35/5 = 7. So, 35 = 5·7.

      1. Dividing 71 by 8 gives us 8 with a remainder of 7. So, {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><msup><mi>e</mi><mfenced><mrow><mn>71</mn><mo>&#xB7;</mo><mfrac><mi>&#x3C0;</mi><mn>4</mn></mfrac></mrow></mfenced></msup></mstyle></math>","origin":"MathType for Microsoft Add-in"} is the same as {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><msup><mi>e</mi><mfenced><mrow><mn>7</mn><mo>&#xB7;</mo><mfrac><mi>&#x3C0;</mi><mn>4</mn></mfrac></mrow></mfenced></msup></mstyle></math>","origin":"MathType for Microsoft Add-in"}. According to Figures 9.9 and 9.13, {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><msup><mi>e</mi><mfenced><mrow><mn>7</mn><mo>&#xB7;</mo><mfrac><mi>&#x3C0;</mi><mn>4</mn></mfrac></mrow></mfenced></msup></mstyle></math>","origin":"MathType for Microsoft Add-in"} is equal to {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><mfrac><mn>1</mn><msqrt><mn>2</mn></msqrt></mfrac><mo>-</mo><mfrac><mn>1</mn><msqrt><mn>2</mn></msqrt></mfrac><mi>i</mi></mstyle></math>","origin":"MathType for Microsoft Add-in"}.
      2. The QFT and QFT† matrices are shown here:
      1. The 2 × 2 QFT matrix is the Hadamard matrix because the second roots of unity are 1 and -1.
      2. The missing values are shown here:
      1. In the coprime powers sequence for 22 (with coprime 3), the period is 5. But 5 isn’t divisible by 2. You can’t find 35/2 + 1 or 35/2 &...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}