Praise for Qiskit Pocket Guide
Qiskit Pocket Guide is a convenient, compact Qiskit reference book for quantum programming all in one place.
Jay Gambetta, IBM Fellow and VP of IBM Quantum
This pocket guide is an excellent overview of core Qiskit functionality with a concise, yet practical, code-first approach .
Abby Mitchell, Quantum Developer Advocate
Learning quantum computing can be daunting, and remembering all the functionality in the Qiskit API can be equally so. This book provides a necessary companion for coders who want to take full advantage of the power and elegant features provided by Qiskit.
Dr. Bob Sutor, Quantum industry expert and author, Dancing with Qubits and Dancing with Python
This is an incredibly handy bookfor beginners and advanced users alikethat describes the many functionalities and features of Qiskit, organized in a clear and intuitive way. I expect it is unlikely to find its way off my desk and into a bookshelf any time soon.
Dr. John Watrous, Technical Director, IBM Quantum Education
Concise yet extensive, this belongs in the pocket of every Qiskit developer .
Lia Yeh, CS PhD student, Quantum Group , University of Oxford
Very crisp and clear book for quantum developers of all levels!
Robert Loredo, IBM Quantum Ambassador Worldwide Lead
A clear and well-organized reference; readers exploring quantum programming will enjoy simple and specific steps to get QPU programs up and running, while even experienced Qiskit users may discover some surprising features.
Eric R. Johnston, coauthor of Programming Quantum Computers
Qiskit Pocket Guide
by James L. Weaver and Frank J. Harkins
Copyright 2022 James Weaver and Francis Harkins. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
- Acquisitions Editor: Suzanne McQuade
- Development Editor: Shira Evans
- Production Editor: Katherine Tozer
- Copyeditor: Piper Editorial Consulting, LLC
- Proofreader: Tom Sullivan
- Indexer: nSight, Inc.
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
Revision History for the First Release
- 2022-06-15: First Release
See https://oreil.ly/qkpgERR for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Qiskit Pocket Guide, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the authors and do not represent the publishers views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-11247-9
[LSI]
Preface
Qiskit is an open source SDK (software development kit) for working with quantum computers at the level of pulses, circuits, and application modules. The purpose of this book is to provide a succinct guide for developers to use while creating applications that leverage quantum computers and simulators.
We hope this book will enable developers to actively participate in the open source Qiskit community. The Qiskit community, as well as documentation, tutorials, and other resources, is available at Qiskit.
How This Book Is Structured
Our goal in this guide is to address much of the functionality of Qiskit that application developers will routinely use. Some of this Qiskit functionality is considered to be fundamental to quantum computing. Other Qiskit functionality supports quantum computing concepts such as quantum information and quantum algorithms. Qiskit has additional functionality that weve deemed essential for quantum application development. Weve structured the book at a high level according to the aforementioned functionality, with individual chapters drilling into the specifics. The chapters are divided into three parts:
, Qiskit FundamentalsIn the first part of the book, we show you how to use Qiskit to create quantum circuits. Quantum circuits contain instructions and gates, so we discuss how to use the ones provided in Qiskit, as well as how to create your own. We then show you how to run quantum circuits on quantum computers and simulators and demonstrate how to visualize results. To round out Part I, we discuss the transpiler and how it converts a quantum circuit into instructions that run on a target quantum computer or simulator.
, Quantum Information and AlgorithmsIn the second part of this book, we discuss Qiskit modules responsible for implementing quantum information concepts (specifically states, operators, channels, and measures). We also present facilities in Qiskit that implement quantum algorithms, as well as a facility known in Qiskit as operator flow. A developer may use some of the functionality in Part II to develop quantum applications at higher levels of abstraction than quantum circuits.
, Additional Essential FunctionalityIn the third and final part of this book, we cover essential Qiskit functionality, some of which drills into information already discussed and some of which is newly presented. Specifically, we explore the standard operations of the Qiskit circuit library, and new ground is uncovered when we discuss how to work with quantum providers and backends. In addition, well introduce QASM 3.0 and demonstrate how to create quantum programs with this quantum assembly language.
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.
Note
This element signifies a general note.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/qiskit-community/qiskit-pocket-guide#readme.
If you have a technical question or a problem using the code examples, please send email to .
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 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.