Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “In the second cell, type print(x), and then press Shift+Enter.”
A block of code is set as follows:
circ = QuantumCircuit(2, 1)circ.h(1) circ = get_oracle(circ, function) circ.measure(0, 0) display(circ.draw('latex'))
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
device = provider.get_backend('ibmq_qasm_simulator')job = execute(circuit, backend=device, shots=1000) print(job.job_id()) result = job.result() counts = result.get_counts(circuit)$
Any command-line input or output is written as follows:
$ mkdir quantum$ cd quantum
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “In Figure 8.30, the alice and bob qubit checks to see whether both Alice and Bob get their wishes.”
Tips or important notes
Appear like this.