Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright and Credits
Mastering Quantum Computing with IBM QX
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
What is Quantum Computing?
Technical requirements
What are quantum computers?
Uses of quantum computers
Experts weigh in – why is quantum computing important?
History, present, and future of quantum computing
History of quantum computing
Present/current state of quantum computing
Future of quantum computing
Experts weigh in – what is the outlook for quantum computing in the future?
Setting up and running Python code examples
Get the book code
Set up Jupyter Notebook
Setting up and running IBM QX examples
Hello quantum world
API key
Setting up and running Qiskit examples
Summary
Exercises and questions
Qubits
Technical requirements
Qubits
Storing a qubit
Simulating a qubit
|"0"> and |"1">
Combinations of |"0"> and |"1">
Three different representations of qubits
Zero and one basis – additional notes
The plus and minus basis
The clockwise and counterclockwise basis
The Bloch sphere
|"0"> and |"1"> and other basis' on the Bloch sphere
Bloch coordinates from qubit
Plotting Bloch coordinates on the Bloch sphere
Superposition and measurement of qubits
Quantum superposition for qubits
Quantum measurement for qubits
Measurement of a single qubit on the Bloch sphere
Summary
Questions
Quantum States, Quantum Registers, and Measurement
Technical requirements
Quantum states and registers
Separable states
Entanglement
Quantum measurement and entanglement
An algorithm for simulating quantum measurement in Python
Decoherence, T1, and T2
Decoherence
T1 and T2
Summary
Questions
Evolving Quantum States with Quantum Gates
Technical requirements
Gates
Classical gates
Quantum gates
Gates acting on states
Single-qubit gates
Hadamard gate (H)
Pauli gates (X, Y, Z)
The X gate
The Y gate
The Z gate
Phase gate (S) and π/8 gate (T)
Phase gate (S)
π/8 gate (T)
The "dagger" gates S† and T†
Multi-qubit gates
CNOT gate
Python code for the CNOT gate
CNOT with control qubit of choice, target qubit of choice
Summary
Questions
Quantum Circuits
Technical requirements
Quantum circuits and quantum circuit diagrams
Using Qiskit to generate quantum circuits
Single-qubit circuits in Qiskit
Qiskit's QuantumCircuit class and universal gate methods
Multiqubit gates in Qiskit
Classical registers in Qiskit circuit
Measurement in a Qiskit circuit
Reversible computation
Useful quantum circuits
Using the X gate to prepare any binary input
Swapping two qubits
Summary
Questions
The Quantum Composer
Technical requirements
The Quantum Composer
Hardware
Gates, operations, and barriers
Translating quantum circuits into the Quantum Composer
Executing quantum circuits in simulation or hardware from the Quantum Composer
Executing a quantum circuit in simulation
Executing a quantum circuit on quantum computing hardware
Summary
Questions
Working with OpenQASM
Technical requirements
OpenQASM
Translating OpenQASM programs into quantum scores
OpenQASM to negate one qubit
OpenQASM to apply gates to two qubits, and measure the first qubit
Representing quantum scores in OpenQASM 2.0 programs
Using OpenQASM to interface with IBM QX
Advanced OpenQASM usage
Resetting a qubit
if statements
User-defined gates and primitive gates
Primitive gates CX and U
2-qubit gate CX
1-qubit gate U
Opaque gates
Summary
Questions
Qiskit and Quantum Computer Simulation
Technical requirements
Qiskit installation and usage
Testing Qiskit installation
Using OpenQASM with Qiskit
Load OpenQASM from a file
Working with OpenQASM loaded from a string
Qiskit Aqua introduction and installation
Qiskit Terra – Capstone project
A brief introduction to the MIDI specification
Quantum computing with MIDI
Synthesizing notes
Playing notes and chords to represent quantum measurement
Playing a note for each quantum measurement
Playing a chord (group of notes at the same time) to represent the results of many quantum measurements
Creating a superposition of notes
Two note chord
Four note chord
Summary
Questions
Quantum AND (Toffoli) Gates and Quantum OR Gates
Technical requirements
Boolean satisfiability problem (SAT)
3SAT classical implementation
3SAT – why is it so interesting?
Quantum AND and OR
Toffoli gate – quantum AND gate
Quantum OR gate
Quantum AND and Quantum OR over multiple qubits
3SAT quantum circuit implementation
Summary
Questions
Grover's Algorithm
Technical requirements
An overview and example use case of Grover's algorithm
Grover's algorithm steps
Setup step
Checker and mover steps
Naming conventions
Measurement step
3SAT as a Grover's algorithm checker
Two- and three-qubit quantum AND (Toffoli) in Qiskit
Quantum AND reverse
Two- and three-qubit quantum OR in Qiskit
Quantum OR reverse
Testing gates and their reversibility
General framework
Solving a 3SAT problem with Grover's algorithm
Oracle implementation in Qiskit
Test classic logic
Quantum 3sat_mystery implementation logic
Setup or teardown logic function
Compute clauses one by one
Combine clauses
Reverse logic so that we are back to the original
Testing the _3sat_mystery_3 function
Testing the _3sat_mystery_3 function without reverse
Testing the _3sat_mystery_3 function's reversibility
Testing _3sat_mystery_3 function reversibility (except for final result)
Mover step implementation
Full implementation of the mover function
Full algorithm setup
Running the algorithm on Qiskit
Summary
Questions
Quantum Fourier Transform
Classical Fourier Transform
Sine waves
The Fourier transform in action
The Quantum Fourier Transform
Implementing the Quantum Fourier Transform
Implementing a controlled rotation gate, Rk, in Python
Reverse gate – REV
QFT circuit
QFT circuit implementation in IBM QX
Implementing the REV gate in IBM QX
Implementing the Rk gate in IBM QX
1-qubit QFT in IBM QX
2-qubit QFT in IBM QX
3-qubit QFT in IBM QX
Generalizations
Summary
Questions
Shor's Algorithm
Shor's algorithm
Factoring large integers efficiently disrupts modern cryptography
Shor's algorithm overview
Shor's algorithm described
Shor's algorithm described in symbols/mathematics
Shor's algorithm examples
Example when N is prime, N = 7
Example when N is the product of two prime numbers, N is small, N = 15
Example when N is the product of two prime numbers, N is larger, N = 2257
Example when N is the product of one prime number and one non-prime number, N = 837
Implementing Shor's algorithm in Python
Shor's algorithm – classical implementation
Shor's algorithm – quantum implementation
Example implementation on a quantum computer, N = 15, a = 2
Finding the period of f(x) = ax (mod N) = 2x (mod 15) using a quantum computer
Subroutine to find g(x) = 2x (mod 15)
Full algorithm implementation
Reading out the results
Running Shor's algorithm on a quantum computer
Tracing after the period is found on the quantum computer
Example implementation on a quantum computer, N = 35, a = 8
Finding the period of f(x) = ax (mod N) = 8x (mod 35) using a quantum computer
After the period is found
Summary
Questions
Quantum Error Correction
Quantum errors
Errors on hardware, demonstrating a bit flip error
Modeling errors in a simulator
Quantum error correction
Single bit flip error correction
Classic error correction bit flip
Quantum error correction single qubit flip
Quantum error correction single phase flip
The Shor code – single bit and/or phase flip
Summary
Questions
Conclusion - The Future of Quantum Computing
Key concepts of quantum computing
Fields where quantum computing will be useful
Pessimism about the quantum computing field
Optimism about the quantum computing field
Concluding thoughts on quantum computing
Appendix
Useful mathematics
Summation
Complex numbers
Complex conjugation
Linear algebra
Matrix
Matrix multiplication
A constant multiplied by a matrix
Two matrices multiplied together
Conjugate matrix
Matrix transpose
Matrix conjugate transpose
Matrix Kronecker product
Bra-ket notation
Qubits, states, and gates in terms of matrices
Qubits
Gates
Gate definitions in terms of matrices
Additional gates
Quantum measurement
Other Books You May Enjoy
Leave a review - let other readers know what you think
← Prev
Back
Next →
← Prev
Back
Next →