HandsOn Quantum Machine Learning With Python
HandsOn Quantum Machine Learning With Python
Volume 1: Get Started
About the Book
Story
HandsOn Quantum Machine Learning With Python
You're interested in quantum computing and machine learning... ...But you don't know how to get started? Let me help!
Whether you just get started with quantum computing and machine learning or you're already a senior machine learning engineer, HandsOn Quantum Machine Learning With Python is your comprehensive guide to get started with Quantum Machine Learning  the use of quantum computing for the computation of machine learning algorithms.
Quantum computing promises to solve problems intractable with current computing technologies. But is it fundamentally different and asks us to change the way we think.
HandsOn Quantum Machine Learning With Python strives to be the perfect balance between theory taught in a textbook and the actual handson knowledge you’ll need to implement realworld solutions.
Inside this book, you will learn the basics of quantum computing and machine learning in a practical and applied manner.
HandsOn Quantum Machine Learning With Python provides a nononsense teaching style guaranteed to cut through all the cruft and help you master Quantum Machine Learning
Handson tutorials (with lots of code) that not only show you the concepts of quantum computing and the algorithms behind machine learning but their implementations as well.
Inside HandsOn Quantum Machine Learning With Python, you'll learn the basics of machine learning and quantum computing.
You'll learn how to create parameterized quantum circuits and variational hybrid quantumclassical algorithms that solve classification tasks.
Learn about quantum superposition, entanglement, and interference and how you can use it to solve problems intractable for classical computers.
Before you do anything else, take a look at the first three chapters of the book for free. You can download this preview at www.pyqml.com. This sample contains almost 100 pages that get you started with quantum machine learning.
This book offers a practical, handson exploration of quantum machine learning. Rather than working through tons of theory, we will build up practical intuition about the core concepts. We will acquire the exact knowledge we need to solve practical examples with lots of code. Step by step, you will extend your knowledge and learn how to solve new problems.
Of course, we will do some math. Of course, we will cover a little physics. But I don’t expect you to hold a degree in any of these two fields. We will go through all the concepts we need. While this includes some mathematical notation and formulae, we keep it at the minimum required to solve our practical problems.
The theoretical foundation of quantum machine learning may appear overwhelming at first sight.
Be assured, when put into the right context and when explained conceptually, it is not as hard as it sounds. And this is what’s inside HandsOn Quantum Machine Learning With Python.
Is this book right for me?
You don't need to be a mathematician.
You don't need to be a physicist, either.
This book is for developers, programmers, students, and researchers who have at least some programming experience and who want to become proficient in quantum machine learning. Don’t worry if you’re just getting started with quantum computing and machine learning. We will begin with the very basics. We don’t assume prior knowledge of machine learning or quantum computing. You will not get left behind.
Of course, we will write code. A lot of code, actually. If you know a little Python, great! If you don’t know Python but another language, such as Java, Javascript, or PHP, you’ll be fine, too. If you know programming concepts (such as ifthenelseconstructs and loops) then learning the syntax is a piece of cake. If you’re familiar with functional programming constructs, such as map, filter, and reduce, you’re already well equipped. If not, don’t worry, we will get you started with these constructs, too. We don’t expect you to be a senior software developer. We will go through all the code. Line by line. By the time you finish this book, you will be proficient with doing the math, understanding the physics, and writing the code you need to graduate to more advanced content.
The time you’ll save by reading through HandsOn Quantum Machine Learning With Python will more than pay for itself.
Libraries
For all examples inside HandsOn Quantum Machine Learning With Python, we use Python as our programming language. Python is easy to learn. Its simple syntax allows you to concentrate on learning quantum machine learning, rather than spending your time with the specificities of the language.
The most important library we use is Qiskit. It is IBM's quantum computing SDK. Qiskit is opensource. It provides tools for creating and manipulating quantum programs and running them on prototype quantum devices on IBM Quantum Experience or on simulators on your local computer.
For all the machine learning parts, we will use ScikitLearn. Scikitlearn is the most useful library for machine learning in Python. It contains a range of supervised and unsupervised learning algorithms. Scikitlearn builds upon a range of other very useful libraries, such as:
 NumPy: Work with ndimensional arrays
 SciPy: Fundamental library for scientific computing
 Matplotlib: Comprehensive 2D/3Dbplotting
 IPython: Enhanced interactive console
 Sympy: Symbolic mathematics
 Pandas: Data structures and analysis
Algorithms
Inside this book, we will learn how to create actual algorithms from the scratch, such as:
 Quantum Probabilistic Classifier
 Quantum Bayesian Network
 Quantum Optimization Algorithms
Table of Contents

1 Introduction
 1.1 Who This Book Is For
 1.2 Book Organization
 1.3 Why Should I Bother With Quantum Machine Learning?
 1.4 Quantum Machine Learning ‐ Beyond The Hype
 1.5 Quantum Machine Learning In The NISQ Era
 1.6 I learned Quantum Machine Learning The Hard Way
 1.7 Quantum Machine Learning Is Taught The Wrong Way
 1.8 Configuring Your Quantum Machine Learning Workstation

2 Binary Classification
 2.1 Predicting Survival On The Titanic
 2.2 Get the Dataset
 2.3 Look at the data
 2.4 Data Preparation and Cleaning
 2.5 Baseline
 2.6 Classifier Evaluation and Measures
 2.7 Unmask the Hypocrite Classifier

3 Qubit and Quantum States
 3.1 Exploring the Quantum States
 3.2 Visual Exploration Of The Qubit State
 3.3 Bypassing The Normalization
 3.4 Exploring The Observer Effect
 3.5 Parameterized Quantum Circuit
 3.6 Variational Hybrid Quantum‐Classical Algorithm

4 Probabilistic Binary Classifier
 4.1 Towards Naïve Bayes
 4.2 Bayes' Theorem
 4.3 Gaussian Naïve Bayes

5 Working with Qubits
 5.1 You Don't Need To Be A Mathematician
 5.2 Quantumic Math ‐ Are You Ready For The Red Pill?
 5.3 If You Want To Gamble With Quantum Computing

6 Working With Multiple Qubits
 6.1 Hands‐On Introduction To Quantum Entanglement
 6.2 The Equation Einstein Could Not Believe
 6.3 Quantum Programming For Non‐mathematicians

7 Quantum Naïve Bayes
 7.1 Pre‐processing
 7.2 PQC
 7.3 Post‐Processing

8 Quantum Computing Is Different
 8.1 The No‐Cloning Theorem
 8.2 How To Solve A Problem With Quantum Computing
 8.3 The Quantum Oracle Demystified

9 Quantum Bayesian Networks
 9.1 Bayesian Networks
 9.2 Composing Quantum Computing Controls
 9.3 Circuit implementation

10 Bayesian Inference
 10.1 Learning Hidden Variables
 10.2 Estimating A Single Data Point
 10.3 Estimating A Variable
 10.4 Predict Survival

11 The World Is Not A Disk
 11.1 The Qubit Phase
 11.2 Visualize The Invisible Qubit Phase
 11.3 Phase Kickback
 11.4 Quantum Amplitudes and Probabilities

12 Working With The Qubit Phase
 12.1 The Intuition Of Grover's Algorithm
 12.2 Basic Amplitude Amplification
 12.3 Two‐Qubit Amplification

13 Search For The Relatives
 13.1 Turning the Problem into a Circuit
 13.2 Multiple Results

14 Sampling
 14.1 Forward Sampling
 14.2 Bayesian Rejection Sampling
 14.3 Quantum Rejection Sampling
 15 What's Next?
The Leanpub 45day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Do Well. Do Good.
Authors have earned$10,795,682writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books inprogress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copyprotection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
Aprendiendo Git
Miguel Angel Durán GarcíaGit no es complicado... ¡Si lo entiendes! 😜
¿Sientes que sabes usarlo porque has memorizado todos los comandos que necesitas? ¡Pero no entiendes qué hace cada cosa y por qué! Así es normal que, cuando exista un problema, te cueste resolverlo.
¡Con este libro vas a entender de una vez por todas todo lo que es Git y cómo sacarle provecho!
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Functional Programming Made Easier
Charles ScalfaniA Functional Programming book from beginner to advanced without skipping a single step along the way.
In my 40 years of programming, I've felt that programming books always let me down, especially Functional Programming books. So, I wrote the book I wish I had 5 years ago.
Functional Programming will never be easy, but it can be easier.
Rector  The Power of Automated Refactoring
Matthias Noback and Tomas VotrubaLearn how to automatically and continuously upgrade and improve your PHP code base
Windows 10 System Programming, Part 2
Pavel YosifovichOpenIntro Statistics
David Diez, Christopher Barr, Mine CetinkayaRundel, and OpenIntroAtomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multiawardwinning Thinking in C++ and Thinking in Java and a Kotlin team member comes a book that breaks concepts into small, easytodigest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA! Full support at www.AtomicKotlin.com.
Thinking with Types
Sandy MaguireThis book aims to be the comprehensive manual for typelevel programming. It's about getting you from here to therefrom a competent Haskell programmer to one who convinces the compiler to do their work for them.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Top Bundles
 #1
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification...  #2
Software Architecture for Developers: Volumes 1 & 2  Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before...  #3
The Python Craftsman
3 Books
The Python Craftsman series comprises The Python Apprentice, The Python Journeyman, and The Python Master. The first book is primarily suitable for for programmers with some experience of programming in another language. If you don't have any experience with programming this book may be a bit daunting. You'll be learning not just a programming...  #4
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also...  #7
PatternOriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible...  #9
Development and Deployment of Multiplayer Online Games, Part ARCH. Architecture (Vol. IIII)
3 Books
What's the Big Idea? The idea behind this book is to summarize the body of knowledge that already exists on multiplayer games but is not available in one single place.And quite a fewof the issues discussed within this series (planned as three nine volumes ~300 pages each), while known in the industry, have not been published at all (except for...