Quantum computers are no longer theoretical devices.
The authors of this book believe that the best uses for a new technology are not necessarily discovered by its inventors, but by domain experts experimenting with it as a new tool for their work. With that in mind, this book is a hands-on programmers guide to using quantum computing technology. In the chapters ahead, youll become familiar with symbols and operations such as those in , and learn how to apply them to problems you care about.
How This Book Is Structured
A tried-and-tested approach for getting hands-on with new programming paradigms is to learn a set of conceptual primitives. For example, anyone learning Graphics Processing Unit (GPU) programming should first focus on mastering the concept of parallelism, rather than on syntax or hardware specifics.
The heart of this book focuses on building an intuition for a set of quantum primitivesideas forming a toolbox of building blocks for problem-solving with a QPU. To prepare you for these primitives, we first introduce the basic concepts of qubits (the rules of the game, if you like). Then, after outlining a set of Quantum Processing Unit (QPU) primitives, we show how they can be used as building blocks within useful QPU applications.
Consequently, this book is divided into three parts. The reader is encouraged to become familiarwith Part I and gain some hands-on experience before proceeding to the more advanced parts:
: Programming a QPU
Here we introduce the core concepts required to program a QPU, such as qubits, essential instructions, utilizing superposition, and even quantum teleportation. Examples are provided, which can be easily run using simulators or a physical QPU.
: QPU Primitives
The second part of the book provides detail on some essentialalgorithms and techniques at a higher level. These include amplitude amplification, the QuantumFourier Transform, and phase estimation. These can be considered library functions that programmers call to build applications. Understanding how they work is essential to becoming a skilled QPU programmer. An active community of researchers is working on developing new QPU primitives, so expect this library to grow in the future.
: QPU Applications
The world of QPU applicationswhich combine the primitives from Part II to perform useful real-world tasksis evolving as rapidly as QPUs themselves. Here we introduce examples of existing applications.
By the end of the book we hope to provide the reader with an understanding of what quantum applications can do, what makes them powerful, and how to identify the kinds of problems that they can solve.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://oreilly-qc.github.io.
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: Programming Quantum Computers by Eric R. Johnston, Nic Harrigan, and Mercedes Gimeno-Segovia (OReilly). Copyright 2019 Eric R. Johnston, Nic Harrigan, and Mercedes Gimeno-Segovia, 978-1-492-03968-6.
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .
OReilly Online Learning
Note
For almost 40 years, OReilly Media has provided technology and business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their knowledge and expertise through books, articles, conferences, and our online learning platform. OReillys online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from OReilly and 200+ other publishers. For more information, please visit