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

Matrices for Grover’s algorithm

As we saw in the previous sections, each application of the Grover iterate has two parts:

  1. In the first part, the oracle marks the target amplitude.
  2. In the second part, the diffuser inverts all amplitudes about the mean.

Each part is a collection of quantum gates, and those gates apply a matrix to the circuit’s qubits. In this section, we’ll describe the matrix representations of the oracle and the diffuser.

A matrix for the oracle

Let’s assume that we have only two qubits. After these qubits go through Hadamard gates, we have a matrix representation of {"mathml":"<math style=\"font-family:stix;font-size:16px;\" xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle mathsize=\"16px\"><mfrac><mn>1</mn><mn>2</mn></mfrac><mo>&#xA0;</mo><mfenced><mtable><mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>1</mn></mtd></mtr></mtable></mfenced></mstyle></math>"}. If we want to mark the |10 amplitude, we must do the following:

In general, the oracle’s matrix is the identity matrix with one of the 1s along the diagonal changed to a -1. Simple as this is, it’s also somewhat disconcerting. To know which diagonal element becomes -1, you have to know which item is...

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}