Quantum Computing Experimentation with Amazon Braket

BIRMINGHAM—MUMBAI

Quantum Computing Experimentation with Amazon Braket

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Kushal Dave

Senior Editor: Keagan Carneiro

Content Development Editor: Adrija Mitra

Technical Editor: Saurabh Kadave

Copy Editor: Safis Editing

Project Coordinator: Rashika Ba

Proofreader: Safis Editing

Indexer: Tejal Daruwale Soni

Production Designer: Jyoti Chauhan

Marketing Coordinator: Sonakshi Bubbar

First published: July 2022

Production reference: 2060423

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

978-1-80056-526-5

www.packtpub.com

To my family and friends who have suffered through my crazy ideas and tangents; believe it or not, it is you who inspire me to take risks and be myself.

To the authors, researchers, and entrepreneurs in quantum computing who have taken the time to share their wisdom and stories with the rest of us.

And, to you, my reader, since you are curious and taking a chance. It is my hope that this book will help to clarify some aspects of a complicated discipline.

– Alex Khan

Foreword

It is truly an honor to receive a request to write a foreword for a book like this, in this particular space, at this specific time in history, and by a colleague whom I believe will make significant contributions to this industry during his tenure. That book is Quantum Computing Experimentation with Amazon Braket, the space is quantum computing, the time in history is the infancy of an advanced technology that realistically expects the change the world, and my colleague is Alex Khan.

Alex and I got involved with quantum computing at roughly the same time, and with connections and collaborations with other esteemed colleagues in the domain, such as Dr. Keeper Lane Sharkey, we all began our journey in this space, making contributions where our respective talents best positioned us to: Alex in the quantum start-up, education, and consultancy space; Keeper in the quantum chemistry space; and I brought quantum computing to a fortune-five health company with 350,000 global employees and continue to lead the quantum efforts there.

It’s not surprising to see contributions by industry leaders such as Alex manifested in books of this nature and undergirded by quantum vendors such as AWS, who bring significant and diverse computational capabilities to the table. The fusion of these two actors in the wild brings a richness to both the educational process and the process of developing valued industry skills, resulting in a far better outcome for the individual, and this is likely to be a key training model in the quantum space moving forward.

The book’s focus is as the title suggests: it’s a journey to explore and experiment with quantum computing using the Amazon Braket experience. This is appealing to both the neophyte and the experienced practitioner, as the latter will procure a solid tactical vendor education through a digestible and methodical pedagogy, and the former will get that plus an introduction to quantum basics as well. Readers will explore advanced topics in the later chapters, which is the ultimate commission of the book: to show real-world applications.

The book begins with the mechanics and specifics of the AWS platform, which is both necessary and wise since AWS brings an “infrastructure as code” approach to quantum computing, in addition to being the only vendor to make multiple quantum hardware architectures available under one cost-effective platform. This is important to industries in the wild seeking to get into quantum because experimentation now becomes an OpEx (operational expenditure) as opposed to a CapEx (capital expenditure), and that significantly lowers the entry price to quantum experimentation and increases the potential for senior leadership buy-in. Practitioners developing quantum capabilities on that framework will have more highly valued skill sets in the marketplace because of the exposure to multiple hardware platforms, as each platform brings something unique and different to the table when it comes to solving problems.

This book also provides a solid introduction to and overview of the two different quantum architectures (gate-based and annealing) and how to use them. The differences between the architectural variants within the gate-based architectures are significant, but nuanced. The differences between the annealing and the gate-based architectures are significant and glaring. The practitioner who gets hands-on experience in comparing and contrasting these two significantly different architectures and how they relate to specific use cases will have developed valuable capabilities. To this end, the book provides a solid journey through the D-Wave, OQC, IonQ, and Rigetti quantum architectures.

This book does a great job of weaving together specific use cases with general quantum education in the flow of its content. That’s a non-trivial task since the annealing architecture is so different than the gate-based architectures, and the ways of conceptualizing the problems (and solutions) vary significantly between any architecture being used, particularly at the algorithm level.

This book spends a decent amount of time on advanced subjects such as QAOA, QUBO, and hybrid algorithms, doing a solid job of laying out the use cases under consideration and how the various architectures would be used to address those subjects at a tactical level. This approach is particularly helpful when addressing the single versus multiple objective optimization use case as it highlights the differences between the annealing approach and the gate-based approach, something that’s found in later chapters.

The quantum computing space is following a very similar maturation trajectory to the classical computing space in that it begins in the lab and ends in the hands of the consumer. We call that the producer/consumer difference. The producers make the technology, and the consumers use it to solve real problems in the wild. The consumers can only make proper use of the technology when both it and their understanding of how to effectively use it reach a certain level of maturity. The time between when producers mature the technology enough for consumers to effectively engage it can be viewed as eras, and certain seminal events have to occur before computation moves from one era to another. The classical illustration of one of those seminal events of this is when Dennis Ritchie invented C and UNIX, which enabled classical computing to move out from the labs and into the hands of the consumer.

While we are all still firmly in the producer era of the quantum adventure, we can (and should) expect a series of tactical improvements (or small victories) that help move the maturity of the whole just a little bit forward, and when added up over time, can move the overall industry’s maturity a great deal.

I think this book is one of those victories; it educates, inspires, and motivates quantum practitioners of the consumer stripe to enrich and broaden their experience in the quantum space, and that has great value to that type of individual who’ll make the greatest impact in the wild when fully enabled with mature tools.

Matthew R. Versaggi, MS, MBA – Optum Technology / United Health Care

  • Senior Director of Artificial Intelligence and Cognitive Technology
  • Distinguished Engineer
  • Academy of Technology Appointee

Contributor: O’Reilly Report: State of Healthcare Technology

  • Quantum Computing and Healthcare
  • Cognitive Technology and Healthcare

Minneapolis, MN, 2022

Reviews

“Informative, interesting, understandable, practical, comprehensive, thorough, effective – just excellent!” – Terrill Frantz, Professor at Harrisburg University of Science and Technology, USA

“Alex has done wonders by blending storytelling techniques with a crisp and clear explanation of the technical aspects of a complex quantum technology. Every element of the technological advances that service providers achieved inside Amazon Braket is well chronicled. On top of that, every piece of code is written in an optimized and self-explanatory manner. The managerial aspects of using quantum computers to solve real-life problems are also discussed, which will help users properly evaluate the tool. Overall, this book is a fantastic treasure trove to get you started on quantum computing, and on Amazon Braket in particular.” – Anshul Saxena, Christ University - India

Quantum Computing Experimentation with Amazon Braket is an essential resource for businesses and developers preparing for how quantum computers will impact their respective industries. Alex provides practical examples of familiar optimization problems accompanied by easy-to-understand coding guides for multiple available systems on Amazon Braket. Comforting hints, links to additional resources, and pre-execution cost estimation methods bring necessary clarity in what is a new frontier for many readers.” – Mike Heiner, Information Systems Professional

“An easily digestible guide for quantum-based cloud computing. Khan leverages Amazon Braket to take complex topics and simplify them for those interested in quantum computing. Readers familiar with AWS will recognize parallels between existing cloud services, while those familiar with quantum will be exposed to cloud fundamentals through a guided journey.” – Zia K. Mohammad, Senior Product Manager, AWS Quantum

“Alex Khan’s book provides a detailed step-by-step insight into Amazon’s quantum computing environment. The book is very insightful to both novices and experienced quantum computing software developers, with an examination into all the options available in Amazon Braket. Well done, Alex!” – John P. Cummings, Quantum Computing Engineer

“Well done! I thought the book was very well laid out and contained thoughtful code and explanations of how to solve optimization problems using Braket. Overall, I think this book will be very helpful to a wide variety of people, especially AWS users who want to experiment with QC. Congratulations!” – Salvatore Certo, Quantum Computing Technical Manager

Contributors

About the author

Alex Khan is an advisor, entrepreneur, and educator in quantum computing. He is CEO of ZebraKet, a Canadian startup in supply chain optimization using quantum methods. He has had roles at Chicago Quantum, where he co-authored papers on portfolio optimization using D-Wave, Harrisburg University where he taught quantum computing, and at QuantFi. He continues to be an advisor at QuSecure.

Alex is an experienced Health IT executive. He is an engineering/physics dual major and received his BSME from Purdue University, MSME from KSU, MBA with Health Sector Management from Duke University, and a certificate in quantum computing from MITxPro. He has been recognized by The Quantum Daily as one of the 126 advisors shaping the Quantum Computing Industry.

I would like to thank Michael Brett, whose support allowed me to experiment with Amazon Braket, eventually making this book possible. I am grateful to the Packt Publishing team, who trusted me to bring a unique book into the quantum computing ecosystem and have helped and guided me at every step. I am also indebted to the technical reviewers, who over the year have diligently given me very constructive feedback leading to many improvements.

About the reviewers

Rakshit Jain is a certified IBM Associate Quantum Developer who is very passionate about operating systems, quantum computing, and cyber security (white hat, obviously). He’s currently in the penultimate year of his studies at The Hong Kong Polytechnic University, where he leads the Google Developer Student Club as the Vice-President. Driven by curiosity, he experiments with (and breaks) any bleeding edge technology he can get his hands on. When he’s not writing scripts, he is DJing at events or climbing mountains.

Gopal Mahadevan is an optimization software engineer/quantum algorithms researcher and consultant to financial institutions, to help them apply quantum and quantum-inspired solutions to solve their computationally intractable problems and prepare for (inevitable) quantum disruption. He recently completed a master’s degree in Quantum Computing Technologies and is an IBM Certified Associate Quantum Developer (Qiskit).

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

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