To get the most out of this book
- You will need to have internet access to access the IBM Quantum systems available to you. Since the platform is hosted on the cloud, you will not need anything more than a browser and to register a free account.
- You will also need an up-to-date browser (Firefox, Chrome, Safari)
- OS requirements (only if installing the software locally): Windows, Mac, and Linux.
Download the example code files
The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Learning-Quantum-Computing-with-Python-and-IBM-Quantum-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781803244808.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; “Simply run pip install qiskit-aer
from your command line, or Python environment, and that should be all you need.”
A block of code is set as follows:
from qiskit_ibm_runtime import QiskitRuntimeService
# Save your IBM Quantum account to allow you to use systems:
QiskitRuntimeService.save_account(channel="ibm_quantum", token='PASTE-API-TOKEN-HERE', set_as_default=True)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
import numpy as np
#Bind the parameters with a value, in this case 2π
qc = qc.assign_parameters(parameters={param_theta: 2*np.pi})
#Draw the circuit with the set parameter values
qc.draw(output='mpl')
Any command-line input or output is written as follows:
pip install qiskit
Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes, also appear in the text like this. For example: “One of the more popular experiments that have come out of quantum mechanics is the double-slit experiment.”
Warnings or important notes appear like this.
Tips and tricks appear like this.