Quantum Computing Algorithms: Discover how a little math goes a long way [1 ed.] 9781804617373

Explore essential quantum computing algorithms and master concepts intuitively with minimal math expertise required Key

162 118 19MB

English Pages 460 Year 2023

Report DMCA / Copyright

DOWNLOAD FILE

Quantum Computing Algorithms: Discover how a little math goes a long way [1 ed.]
 9781804617373

Table of contents :
Quantum Computing Algorithms
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
Introduction to Quantum Computing
What is quantum computing?
Baby steps toward quantum computing
Programming a quantum computer
The future of quantum computing
Further reading
Part 1 Nuts and Bolts
1
New Ways to Think about Bits
Technical requirements
Bits and logic gates
Binary representation
Working with matrices
Vectors
Matrix multiplication
The tensor product
Combining gates and bits
Matrix representation of bits and gates
Matrix operations and computer logic
Jupyter notebooks
Creating and displaying values
Which values are (or are not) defined?
Stopping a run of the code
Saving your work
Copying this book’s example code
Matrices in Python
Summary
Questions
2
What Is a Qubit?
Technical requirements
A qubit’s values between 0 and 1
Are qubits useful?
How to make a qubit
What does “between |0⟩ and |1⟩” mean?
Qubits and Qiskit
Creating and running a quantum circuit
Understanding the Qiskit code
Variations of this chapter’s code
Summary
Questions
3
Math for Qubits and Quantum Gates
Matrices for qubit states and operations
Qubits on the Bloch sphere
More points on the Bloch sphere
The X gate
The Hadamard rotation
Combining gates along a single wire
Reversible operations
Reversing a matrix operation
Unitary matrices
Rotating the Bloch sphere around an axis
Experimenting with rotations
What is a radian?
A taste of trigonometry
Summary
Questions
4
Qubit Conspiracy Theories
Multi-qubit gates
CNOT and flipped CNOT gates
SWAP gate
Toffoli gate
Magic tricks with multi-qubit gates
Introducing entanglement
Entanglement with matrices
Working with Qiskit
The four Bell states
Role of entanglement in quantum computing
Qubits don’t plan ahead
What quantum theory predicts
What would happen if there were hidden variables?
Bell’s experiment in Qiskit
Combining probabilities
Addition (either this event or that event)
Subtraction (not this event)
Multiplication (this event and that event)
Division (this event assuming that event)
Summary
Questions
Further readings
Part 2 Making Qubits Work for You
5
A Fanciful Tale about Cryptography
Technical requirements
Sharing secrets
Adding Hadamard gates
Introducing randomness
Adding more randomness
Alice and Bob compare some of their bits
Some remaining bits form the secret key
Is the BB84 algorithm useful?
You can’t copy a qubit
Qiskit code for the BB84 algorithm
Creating the circuits
Running the quantum circuits
Displaying the outcome
Getting more information about a circuit
Summary
Questions
6
Quantum Networking and Teleportation
Technical requirements
Transmitting bits and qubits
Classical networks
Quantum networks
Teleporting a qubit
Quantum operations for teleportation
Teleportation versus cloning
Coding the teleportation circuitry
Creating registers
Adding gates to the registers
Running the quantum circuit
Summary
Questions
Further reading
Part 3 Quantum Computing Algorithms
7
Deutsch’s Algorithm
Technical requirements
Describing Deutsch’s problem
Algorithms
Functions
Constant and balanced functions
Deutsch’s problem
Solving Deutsch’s problem
Phase kickback
Detecting a CNOT gate
Embedding a function in quantum circuitry
Creating oracles
Putting it all together
Deutsch’s algorithm F.A.Q.
Coding Deutsch’s algorithm
Summary
Questions
8
Grover’s Algorithm
How long does it take to find what you need?
The idea behind Grover’s algorithm
The oracle
The diffuser
Searching among eight items
Searching among any number of items
The optimal number of Grover iterate applications
Matrices for Grover’s algorithm
A matrix for the oracle
A matrix for the diffuser
Coding Grover’s algorithm with matrices
When to use Grover’s algorithm
Encrypting passwords
Finding better approximations
Satisfying Boolean expressions
Coding Grover’s algorithm with high-level functions
Gates and circuits for Grover’s algorithm
Gates for the oracle
Gates for the diffuser
Coding Grover’s algorithm with quantum gates
Epilogue – what does have to do with Grover’s algorithm?
Summary
Questions
9
Shor’s Algorithm
Technical requirements
A popular encryption scheme
An example of RSA encryption
How Shor’s algorithm works
The role of a period in factoring a number
Repeated squaring
Complex numbers
Complex number basics
Unitary matrices
The connection between complex numbers and circles
Finding a sequence’s period
The QFT matrix
Shoring up your knowledge
Illustrating Shor’s algorithm with Qiskit code
Testing the QFT
Another implementation of Shor’s algorithm
Summary
Further reading
Questions
Part 4 Beyond Gate-Based Quantum Computing
10
Some Other Directions for Quantum Computing
What is reducibility?
Quantum simulation
Quantum annealing
Quantum neural nets
Solving unsolvable problems
Summary
References
Assessments
Chapter 1, New Ways to Think about Bits
Chapter 2, What Is a Qubit?
Chapter 3, Math for Qubits and Quantum Gates
Chapter 4, Qubit Conspiracy Theories
Chapter 5, A Fanciful Tale about Cryptography
Chapter 6, Quantum Networking and Teleportation
Chapter 7, Deutsch’s Algorithm
Chapter 8, Grover’s Algorithm
Chapter 9, Shor’s Algorithm
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
Download a free PDF copy of this book

Polecaj historie