Reader small image

You're reading from  Dancing with Qubits - Second Edition

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837636754
Edition2nd Edition
Right arrow
Author (1)
Robert S. Sutor
Robert S. Sutor
author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor

Right arrow

About the reviewers

Gerhard Hellstern (Prof., Dr. rer. nat, graduate physicist, *1971) is a full professor at the Faculty of Economics at the Baden-Württemberg Cooperative State University in Stuttgart. From 1990–1995, he studied physics at the University of Tübingen and the State University of New York at Stony Brook; in 1998, he graduated as Dr. rer. nat. From 1998 to 2018, he was employed by several commercial banks and then for 17 years at Deutsche Bundesbank. There, he was in charge of the banking audits division for many years.

Gerhard Hellstern has been involved in the application of data science methods (data analytics as well as machine and deep learning) in finance for many years. These methods also include quantum computing as well as quantum machine learning based on it. He is a Qiskit advocate at IBM and a member of the research network Quantum Computing of the Fraunhofer Gesellschaft, Germany. His current research focuses on applications of quantum computing and quantum machine learning in the financial sector and beyond and he has published several papers in this domain.

Prateek Jain is an inquisitive person with a lifelong passion for science. He is currently focusing and researching quantum computing technologies and algorithms, focusing on the intersection of quantum computing and AI. He leads Quantum AI research at Fractal Analytics. He has over 5 years’ research experience in quantum computing and technologies and 18 years' experience in machine learning and artificial intelligence. He possesses a Master’s in quantum computing technologies from the Technical University of Madrid and a Master's in innovation and entrepreneurship from HEC Paris. He is also an IBM Quantum advocate and educator and his research interests include quantum computing, quantum machine learning, machine learning, and AI because it is fascinating to ponder the greatest questions of our age and catch a glimpse of how the world would look in the future.

For whom did I write this book?

This book is for anyone who has a very healthy interest in mathematics and wants to start learning about the computer science, engineering, and a bit of the physics of quantum computing. I review the basic math, but things move quickly, so we can dive deeply into an exposition of how to work with qubits and quantum algorithms. There are exercises in every chapter for you to test and deepen your knowledge.

While this book contains a lot of math, it is not of the definition-theorem-proof variety. I’m more interested in presenting the topics to give you insight into the relationships between the ideas than giving you a strictly formal development of all results.

Another goal is to prepare you to read more advanced texts and articles on the subject, perhaps returning here to understand some core topic. You do not need to be a mathematician, and certainly not a physicist, to read this book, nor do you need to understand quantum mechanics beforehand.

At several places in the book, I give some code examples using Python 3. Consider these extra and not required, but if you know Python, they may help your understanding. programming language$Python

What does this book cover?

Before we jump into understanding how quantum computing works from the ground up, we need to take a little time to see how things are done classically. This is not only for the sake of comparison. The future, I believe, will be a hybrid of classical and quantum computers.

The best way to learn about something is to start with basic principles and then work your way up. That way, you know how to reason about it and don’t rely on rote memorization or faulty analogies.

Part I – Foundations

The first part covers the mathematics you need to understand quantum computing concepts. While we will ultimately be operating in very large dimensions and using complex numbers, you can gain a lot of insight from what happens in traditional 2D and 3D.

Chapter 1 – Why Quantum Computing

In the first chapter, we ask the most basic question that applies to this book: why quantum computing? Why do we care? In what ways will our lives change? What are the use cases to which we hope to apply quantum computing and see a significant improvement? What do we even mean by “significant improvement”?

Chapter 2 – They’re Not Old, They’re Classics

Classical computers are pervasive, but relatively few people know what’s inside them and how they work. To contrast them later with quantum computers, we look at the basics along with the reasons why they have problems doing some kinds of calculations. I introduce the simple notion of a bit, a single 0 or 1, but show that working with many bits can eventually give you all the software you use today.

Chapter 3 – More Numbers Than You Can Imagine

The numbers people use every day are called real numbers. Included in these are integers, rational numbers, and irrational numbers. Other kinds of numbers and structures have many of the same algebraic properties. We look at these to lay the groundwork for understanding the “compute” part of what a quantum computer does.

Chapter 4 – Planes and Circles and Spheres, Oh My

From algebra, we move to geometry and relate the two. What is a circle, really, and what does it have in common with a sphere when we move from two to three dimensions? Trigonometry becomes more obvious, though that is not a legally binding statement. What you thought of as a plane becomes the basis for understanding complex numbers, which are key to the definition of quantum bits, usually known as qubits.

Chapter 5 – Dimensions

After laying the algebraic and geometric groundwork, we move beyond the familiar two- and three-dimensional world. Vector spaces generalize to many dimensions and are essential for understanding the exponential power that quantum computers can harness. What can you do when working in many dimensions, and how should you think about such operations? This extra elbow room comes into play when we consider how quantum computing might augment AI.

Chapter 6 – What Do You Mean “Probably”?

“God does not play dice with the universe,” said Albert Einstein. Einstein, Albert

This was not a religious statement but rather an expression of his lack of comfort with the idea that randomness and probability play a role in how nature operates. Well, he didn’t get that quite right. Quantum mechanics, the deep and often mysterious part of physics on which quantum computing is based, very much has probability at its core. Therefore, we cover the fundamentals of probability to aid your understanding of quantum processes and behavior.

Part II – Quantum Computing

The next part is the core of how quantum computing really works. We look at quantum bits—qubits—singly and together, and then create circuits that implement algorithms. Much of this is the ideal case when we have fault-tolerant, error-corrected qubits. When we build quantum computers, we must deal with the physical realities of noise and the need to reduce errors.

Chapter 7 – One Qubit

At this point, we can finally talk about qubits in a nontrivial manner. We look at both the vector and Bloch sphere representations of the quantum states of qubits. We define superposition, which explains the common cliché about a qubit being “zero and one at the same time.”

Chapter 8 – Two Qubits, Three

With two qubits, we need more math, and so we introduce the notion of the tensor product. This allows us to explain entanglement, which Einstein called “spooky action at a distance.” Entanglement tightly correlates two qubits so that they no longer act independently. With superposition, entanglement gives rise to the very large spaces in which quantum computations can operate. spooky action at a distance qubit$entanglement

Chapter 9 – Wiring Up the Circuits

Given a set of qubits, how do you manipulate them to solve problems or perform calculations? The answer is you build circuits for them out of gates that correspond to reversible operations. For now, think about the classical term “circuit board.” I use the quantum analog of circuits to implement algorithms, the recipes computers use for accomplishing tasks.

Chapter 10 – From Circuits to Algorithms

With several simple algorithms discussed and understood, we turn to more complicated ones that fit together to give us Peter Shor’s 1995 fast integer factoring algorithm. This chapter’s math is more extensive, but we have everything we need from previous discussions.

Chapter 11 – Getting Physical

When you build a physical qubit, it doesn’t behave exactly like the math and textbooks say it should. There are errors, and they may come from noise in the environment of the quantum system. I don’t mean someone yelling or playing loud music, I mean fluctuating temperatures, radiation, vibration, and so on. We look at several factors you must consider when you build a quantum computer, introduce Quantum Volume as a whole-system metric of the performance of your system, and conclude with a discussion of the most famous quantum feline.

Part III – Advanced Topics

The final part of this book looks at more advanced topics that may require additional physics or machine learning background.

Chapter 12 – Considering NISQ Algorithms

Noisy Intermediate-Scale Quantum, or “NISQ,” computers have qubits that are not fully fault-tolerant and error-corrected. Decoherence, together with initialization, gate, and measurement errors, make calculations even more unpredictable than probability would indicate. Are there algorithms that use small quantum circuits intermixed with classical methods to approximate solutions to exponentially hard problems? NISQ Noisy Intermediate-Scale Quantum era

Chapter 13 – Introduction to Quantum Machine Learning

Many researchers have begun to look at whether quantum methods can augment AI and machine learning. This research has not yet shown an advantage over purely classical methods, but we survey several topics, such as neural networks and kernel methods, to understand the approaches and the issues.

Chapter 14 – Questions about the Future

This book concludes with a chapter that moves beyond today by asking motivating questions to determine how “quantum-ready” you are to work with this new technology today and as it evolves.

What conventions do I use in this book?

When I want to highlight something important that you should especially remember, I use this kind of box:

This is very important.

This book has exercises throughout the text. We answer some in later discussions, but others, the majority, are left for you as thought experiments. They are numbered within chapters.

Exercise 0.1

Is this a sample exercise?

Exercise 0.2

Is this another sample exercise?

Try to work each exercise as you go along. If you need assistance, I recommend:

  • asking your professor or instructor if you have one
  • looking on Wikipedia
  • checking the works cited in the References section
  • performing a web search, including the words “quantum computing” along with your other terms
  • searching the online documentation of the Qiskit and Cirq quantum software development kits
  • browsing or posting a question in r/QuantumComputing on Reddit or Quantum Computing on Stack Exchange
  • viewing videos on YouTube about quantum computing

Due to typographical restrictions, square roots in mathematical expressions within sentences in the eBook version of this book may not have lines over them. For example, an expression such as √(x + y) in a sentence is the same as

Displayed math

when it appears within a standalone centered formula.

Occasionally, you may see something such as 24. This is a reference to a book, article, or web content. The References section provides details about the works cited.

Though this is not a book about coding, I have included some sample calculations using Python version 3.11 or later. Most of the necessary features are available in earlier Python 3 versions.

Executable Python code and its produced results are shown in a monospace font and we mark them off in the text in the following way:

2**50
1125899906842624

The second expression shown is indented and results from running the code.

Code can also span several lines, as in this example where we create and display a set of numbers that contains no duplicates:

print({1, 2, 3, 2, 4,
       1, 5, 3, 6, 7,
       1, 3, 8, 2})
{1, 2, 3, 4, 5, 6, 7, 8}

When I refer to Python function, method, and property names in text, they appear like this: print. Python module and package names appear like math and numpy.

The code bundle for the book is hosted on GitHub at

https://github.com/PacktPublishing/Dancing-with-Qubits-2E.

We also have other code bundles from the rich Packt catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Share your thoughts

Once you’ve read Dancing with Qubits, Second Edition, we’d love to hear your thoughts! Scan the QR code below to go straight to the Amazon review page for this book and share your feedback.

QR code to share your thoughts

https://packt.link/r/1837636753

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Learn more on Discord

Join the Discord community for this book, where you can share feedback, ask questions to the author, and learn about new releases:

https://discord.com/invite/9sJCQvCAAD.

Get in touch

Feedback from my readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure our content’s accuracy, mistakes do happen. If you have found an error in this book, we would be grateful if you report this to us. Please visit

http://www.packt.com/submit-errata

selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit

http://authors.packtpub.com

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily.

Follow these simple steps to get the benefits:

  • Scan the QR code or visit the link below:

QR code to get free PDF of the book

https://packt.link/free-ebook/9781837636754

  • Submit your proof of purchase
  • That’s it! We’ll send your free PDF and other benefits to your email directly

Now let’s start seeing why we should look at quantum computing systems to try to solve problems that are intractable with classical systems.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Dancing with Qubits - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781837636754
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor