Book Image

Dancing with Python

By : Robert S. Sutor
Book Image

Dancing with Python

By: Robert S. Sutor

Overview of this book

Dancing with Python helps you learn Python and quantum computing in a practical way. It will help you explore how to work with numbers, strings, collections, iterators, and files. The book goes beyond functions and classes and teaches you to use Python and Qiskit to create gates and circuits for classical and quantum computing. Learn how quantum extends traditional techniques using the Grover Search Algorithm and the code that implements it. Dive into some advanced and widely used applications of Python and revisit strings with more sophisticated tools, such as regular expressions and basic natural language processing (NLP). The final chapters introduce you to data analysis, visualizations, and supervised and unsupervised machine learning. By the end of the book, you will be proficient in programming the latest and most powerful quantum computers, the Pythonic way.
Table of Contents (29 chapters)
2
Part I: Getting to Know Python
10
PART II: Algorithms and Circuits
14
PART III: Advanced Features and Libraries
19
References
20
Other Books You May Enjoy
Appendices
Appendix C: The Complete UniPoly Class
Appendix D: The Complete Guitar Class Hierarchy
Appendix F: Production Notes

Why did I write this book?

How do you learn to code in this new world that involves both classical and quantum hardware?

One way to do it is to learn classical computing by itself. This is the traditional way of doing it, using a language such as C, C++, JavaScript, Java, Go, or Python. Along the way, you would learn how to use extra functionality in libraries of code along with the programming tools or from a third-party provider. Examples of these are the C++ Standard Library; the Java Platform, Enterprise Edition; the Python Standard Library; or the thousands of Python packages listed in the Python Package Index. [PYPI]

Once you have the philosophy, syntax, structure, and idioms of the classical programming language understood, you then learn quantum computing on top of that. For example, you could use the Qiskit open source quantum computing software development kit (SDK) along with Python. [QIS] These mesh together and operate exceptionally well. Thousands of people are already Qiskit coders. If you know Python, this is a great approach.

Our learning strategy
Figure 0.1: Our learning strategy

But what if you are learning to code or have only a small amount of experience? What if I could offer you the chance to learn classical and quantum computing in a unified manner? Would it be useful if I could help you understand the concepts of both so that you don’t see them as different disciplines? That’s what I do in this book.