Preface

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 programmer’s guide to using quantum computing technology. In the chapters ahead, you’ll become familiar with symbols and operations such as those in Figure P-1, and learn how to apply them to problems you care about.

Quantum programs can look a bit like sheet music
Figure P-1. Quantum programs can look a bit like sheet music

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 primitives—ideas 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 familiar with Part I and gain some hands-on experience before proceeding to the more advanced parts:

Part I: 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.

Part II: QPU Primitives

The second part of the book provides detail on some essential algorithms and techniques at a higher level. These include amplitude amplification, the Quantum Fourier 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.

Part III: QPU Applications

The world of QPU applications—which combine the primitives from Part II to perform useful real-world tasks—is 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:

Italic

Indicates 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 you’re 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 O’Reilly 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 product’s 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 (O’Reilly). 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 .

O’Reilly Online Learning

Note

For almost 40 years, O’Reilly 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. O’Reilly’s 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 O’Reilly and 200+ other publishers. For more information, please visit http://oreilly.com.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • O’Reilly Media, Inc.
  • 1005 Gravenstein Highway North
  • Sebastopol, CA 95472
  • 800-998-9938 (in the United States or Canada)
  • 707-829-0515 (international or local)
  • 707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://bit.ly/programming-quantum-computers.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

This book could not have been possible without a supporting team of talented people passionate about quantum computing. The authors would like to thank Michele, Mike, Kim, Rebecca, Chris, and the technical team at O’Reilly for sharing and amplifying our enthusiasm for the topic. Although the authors are responsible for all errors and omissions, this book benefited immensely from the invaluable feedback and inspiration of a number of technical reviewers, including Konrad Kieling, Christian Sommeregger, Mingsheng Ying, Rich Johnston, James Weaver, Mike Shapiro, Wyatt Berlinic, and Isaac Kim.

EJ would like to thank Sue, his muse. Quantum computation started to make sense to him on the week that they met. EJ also sends thanks to friends at the University of Bristol and at SolidAngle, for encouraging him to color outside the lines.

Nic would like to thank Derek Harrigan for first teaching him to talk binary, the other Harrigans for their love and support, and Shannon Burns for her pending Harrigan application.

Mercedes would like to thank José María Gimeno Blay for igniting her interest on computers early, and Mehdi Ahmadi for being a constant source of support and inspiration.

But clichéd as it may be, most of all the authors would like to thank you, the reader, for having the sense of adventure to pick up this book and learn about something so different and new.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset