Errata

Programming Quantum Computers

Errata for Programming Quantum Computers

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Ch. 2
FIGURE 2.1

On the lower diagram, should
A = 1 and B = 0 ?

Tony Holdroyd  Aug 31, 2019 
ePub Page Chapter 3, Section titled Drawing a Multi-Qubit Register
2nd paragraph

'the random eight-qubyte circuit' -> (i.e., should be changed to) either 'the random qubyte circuit' or 'the random eight-qubit circuit'

Moez AbdelGawad  Oct 22, 2019 
ePub Page Chapter 2.
Line right after Figure 2-12

The line right after Figure 2-12 states 'These four states will be used in Example 2-4'. That isn't true. Example 2-4 uses states |0>, |1>, |+> and |->. In particular, the example does *not* use the states |+Y> and |-Y> presented in Figure 2-12.

Moez AbdelGawad  Oct 31, 2019 
ePub Page Chapter 3
Label of Figure 3-28.

Walthrough -> Walkthrough

Moez AbdelGawad  Nov 01, 2019 
ePub Page Chapter 3
Text of Example 3-6

Text discussing Example 3-6 first, correctly, mentions the probabilities are 85%/15%, but then later, incorrectly, mentions the probabilities are 70%/30% and sticks to these figures. Luckily, the *code* in the book and online sticks to the correct 85%/15% probabilities.

Moez AbdelGawad  Nov 01, 2019 
ePub Page Chapter 5, Second section (Arithmetic on a QPU)
Second paragraph

which performs NOT(b and b) -> which performs NOT(a and b)

Moez AbdelGawad  Nov 14, 2019 
ePub Page Chapter 7
Figure 7-6

Figure 7-6 is missing an all-green column of circles on the very right of the figure, for state value |15>

Moez AbdelGawad  Nov 24, 2019 
ePub Page Chapter 8 (Phase Estimation)
Section titled "Inside the QPU"

It seems the use of invQFT in this section is not fully justified. Why is not QFT used instead is not clear. It seems to me that, to justify using invQFT, it should be mentioned that negation then a QFT is needed (for phase estimation), then (without justification) that 'negation then QFT' is equivalent to invQFT.

Moez AbdelGawad  Nov 26, 2019 
ePub Page Chapter 8 (Phase Estimation)
Figure 8-8 in Section titled "Inside the QPU"

Based on my earlier comment on the use of invQFT in this section, Fig. 8-8 should be changed to reflect that invQFT actually outputs -2 (ie, 6) on input with eigenphase 90°. Also, less seriously, for eigenphase 180° the output of invQFT should be interpreted, rather, as being -4 (which, in this case, is equivalent to 4).

Moez AbdelGawad  Nov 26, 2019 
Printed Page 2
1st paragraph

The book LEARNING JAVASCRIPT is recommended in this para, giving the name of the author as Todd Brown. There is a book with this title on Amazon, but the first name of the author is not Todd?

Bharath  Dec 13, 2019 
Printed Page 3
footer

The last sentence in the footer seems to be missing something, "Gravitational singularities make computing (and existing) very hard". It feels like there should be a word after the bracket.

Kamal  Jan 15, 2022 
ePub Page 9
line -3

The expression 'most of all the authors...' can be read in multiple ways, some of which if true are embarrassing to (some of) the authors. I think a better wording and punctuation would be: 'most important of all, the authors...'.

Anonymous  Oct 22, 2019 
Printed Page 25
In box titled SAMPLE CODE

I think at the end there should be a line qc.print(result) as is given
in the next example of SAMPLE CODE on page 27 ?

Bharath  Dec 13, 2019 
PDF Page 31
Figure 2-16, Sample Code (Example 2-3) and Figure 2-17

PDF
Bought on ebooks.com (2019-12-28)

On page 31 the ROOT-of-NOT operation is implemented, in Figure 2-16, with:
HAD, PHASE(90), HAD
This agrees with the code sample in Example 2-3.

However the code on the online site implements it with a PHASE(-90) instead.
Also, the Circle Notation visualizations are, therefore, different!
Are they equivalent?
Is this a mistake? (The book doesn't agree with the QCEngine site)

Can someone elucidate the readers on this?

Thanks...

Anonymous  Jan 02, 2020 
Printed Page 31
Fig 2-17

Could it be that qubits 3 and 4 in the upper row should be exchanged with the qubits 3 and 4 in the lower row ?

Anonymous  Dec 12, 2023 
Printed Page 33
Section Title "Introducing Circle Notation"

Would it be possible for you to share your code for producing the circle notation diagrams used throughout the book, perhaps via GitHub? Code in Python would be preferred, but Java would be OK too. I would like to use it in Jupyter notebook using IBM Qiskit. Thank you!

Anonymous  Nov 05, 2023 
Printed Page 43
1st paragraph

On page 43, the sentence "Similarly, a single-qubit PHASE operation acting on (for example) the third qubit rotates each circle for which the third bit is 1," should be corrected to: "Similarly, a single-qubit PHASE operation acting on (for example) the first qubit rotates each circle for which the third bit is 1." See page 42: I think you should clarify that the top row of Figures 3-5 and 3-6 (for the first qubit or qubit "0x1") refers to flipping the third bit in the binary representation of the decimal numbers 0-7 (i.e., for the binary 000 through 111). (So in the top row, |0> and |1> are related by the binary numbers 000 and 001, respectively). The middle row of the two figures (for the second qubit or qubit "0x2") refers to flipping the second bit of three in the same binary representation. The bottom row of the two figures (for the third qubit or qubit "0x4") refers to flipping the first bit in the 3-bit representation.

Anonymous  Nov 05, 2023 
Printed Page 44
first paragraph

Figure 3-7 on page 43 appears to relate to reading the second of two qubits--not the first as described in two places at the top of page 44. Also, in Figure 3-7, the hex representation of "0x1" may need to be corrected to "0x2" if qubit indexing starts at "0x1" for the first qubit (as it appears it does from the other figures in the book).

Anonymous  Nov 05, 2023 
Printed Page 50
Figure 3-16 top diagram

The top diagram currently shows rotations ( denoted by pink highlight and red arrow ) for qubit states |3>, |5> and |7>
It ought to show such rotations for qubit states |1>, |3>, |5> and |7>, i.e., as the book fails to highlight the state |1>.

D Hemmick  Oct 08, 2019 
Printed Page 50
Figure 3-16, third (bottom) row

Please explain how you initialized the three qubits shown in the Figure 3-16 CPHASE(36) example on page 50. As I understand it, initializing one or more qubits to |1> probably requires an x-gate (at least in Qiskit). I initialized all three qubits to |1> using an x-gate, followed by a CPHASE(36) gate applied to the first and third qubits only. I obtained a final state vector of:
[[0. +0.j ]
[0. +0.j ]
[0. +0.j ]
[0. +0.j ]
[0. +0.j ]
[0. +0.j ]
[0. +0.j ]
[0.80901699+0.58778525j]].
The squared-magnitude of this vector is 1+0j. Your customized 'circle notation' diagrams are not available in Qiskit or on GitHub, as far as I can tell. The Bloch sphere representations of the state vector described above all appear to point to |1>. My point is that it is difficult to know whether these results are consistent with what you are showing in the bottom row of Figure 3-16. Please clarify the qubit initialization strategy.

Anonymous  Nov 05, 2023 
Printed Page 53
sample code

The error is actually on the webpage with the code execution window that runs the "QC Engine" simulator.

When you run this code, you see the circle notion showing amplitude circles, but the display is not what it should be. The amplitude circle display does not show *separate registers* for Register 1 and Register 2, as we see, for example at the top of page 52, in figure 3-19.

Because the separate circle amplitudes are not displayed as they should be, this makes it impossible to see the "phase kickback" we are looking for. In other words, as in the example displayed in figure 3-19, the phase should NOT change for register 2, while it does change for register 1.

In fact, the QC Engine also fails similarly in other places in the book, again making it hard to use these circle amplitudes to verify what happened when the code ran.
I will report further cases where found...

D. Hemmick  Oct 17, 2019 
Printed Page 53
Sample code for QCEngine and others; also, the "Program Circuit" diagram

The program circuit diagram shows a designation of "0x1" for the first circuit of register 2, and the code assumes it should be "0x4". It appears your code relabels or renumbers qubits starting from 0x1 in new registers, while your code assumes the numbering continues to 0x4. That's probably what is causing the circle notation diagrams to be inconsistent with what is shown in the text.

Separately, you should be clearer about how the circuit is initialized. Is it indicated by the small 'power off' and 'power on' symbols in the write operations shown in the program circuit? If so, does it mean the first two qubits are initialized to |0> while the third is initialized to |1>? Are there two separate Hadamard operations applied to qubits 0x1 and 0x2, or just one spanning two qubits?

Anonymous  Nov 06, 2023 
Printed Page 54
Figure 3-20

How were each of the circuits described in Figure 3-20 initialized? Were they all placed in superposition by an operation not shown in the figure before the NOT or CNOT gates were applied?

Anonymous  Nov 06, 2023 
Printed Page 60
The sample Qiskit code, program circuit, and circle notation for Example 3-5

The sample Qiskit code, program circuit, and circle notation for Example 3-5 appear to be incorrect. There is an extra -45-degree phase change, a 'barrier' not described in the problem, and a 90-degree phase change that was probably not intended. (The left hand side of Figure 3-27 equates a constructed CPHASE circuit to a 90-degree phase shift (shown on the right hand side), but the sample circuit code actually integrates a 90-degree phase change for some reason). The Qiskit code doesn't appear to match the provided program circuit diagram, and unfortunately, the circle notation for the sample code doesn't appear to match either the desired initial or final state for the circuit.

Anonymous  Nov 06, 2023 
Printed Page 62
Sample QCEngine code and circle notation diagram for Example 3-6 in Figure 3-29.

It appears the QCEngine code and circle notation generator for Example 3-6, "Remote-controlled randomness," output inconsistent results. When the code produces a program output of "01" in binary ("1" in decimal), the circle notation shows P(|2>)=1 (with -70-degree phase angle) when it should show a result for P(|1>)=1. Also, when the program produces an output of "10" in binary ("2" in decimal), the the circle notation shows P(|1>)=1 (with -70-degree phase angle) when it should show a result for P(|2>)=1. (It is understood you have to square the length of the radius shown in the diagram to derive a state probability). So the results appear to be backward for these two states (if I understand how circle notation works). If the code is actually running correctly, please clarify your convention for state notation.

Anonymous  Nov 07, 2023 
Printed Page 64
Figure at top of page

The text seems fine, although it seems a bit "condensed" and slightly difficult to work through.

The figure at the top of the page Fig 3-30 is incorrect. The circle corresponding to the 2 qubit state |0> should be given a weight less than one, namely a weight of approx. 0.837 to correspond to the probability of 70%.

As for the text, it would improve in clarity if a reference were included to send the reader back to page 43 at the bottom, where reading out one bit in a multi-qubit structure is explained. ( This concept is evidently needed only in the code example 3-6, so that the reader has had time to forget what he / she has seen )

D. Hemmick  Oct 17, 2019 
ePub Page 65
Figure 2-19. The quantum spy hunter program

On "set value" logic, the comment (in red arrow) should be "if A2" and on "apply had" should be Ïf A1". I mean, the two red arrows comments should be exchanged.

Therefore at the right part of the same figure, better change the text in red comment "random bit B2" to "random bit B1" and also "if B2" to "if B1" inside "apply had". Doing this, the last comment "if B2 eqv A2 then ... A1" should be
"if B1 eqv A1 then this should match A2.

Regards.

Charles Schrijnemaekers  Jun 26, 2021 
Printed Page 75
Figure 4-8 and the first paragraph

In my view, this very good book would benefit from a much more clear description of whether a person can determine if a pair of qubits (or a larger group of them) is entangled by looking at the circle notation you included everywhere. On page 75, you state "We can see that the bob and ep qubits are still dependent on one another (only the circles corresponding to the bob and ep qubits possessing equal values have nonzero magnitudes)," but if you try to convert this description (along with the information in circle notation of Figure 4-8) into a truth table for determining qubit dependence (i.e., entanglement), I don't think it will work. Perhaps you are bringing outside knowledge to the situation that is not obvious to the reader. Other references are pointing me toward the necessity of a 2-part test that includes analyzing the 'factorizability' of the state vector for an entire system, and a 'correlation test'. In my view, you should state more clearly what it is about the circle notation that is sufficient (or not) to indicate (1) superposition, and (2) entanglement. There are hints here and there, but I think it should be much clearer--especially when it comes to identifying entanglement.

Anonymous  Nov 07, 2023 
Printed Page 92
top of page

The error is actually in the behavior of the code on the website, but I don't know where else to post it but here.

Anyway, on the code website, when one activates example 5-2. the circle display is not properly separated into qubits for register a and qubits for register b.

The displayed qubits therefore act as if registers a and b are simply one large conglomerate of qubits, so that, for example, the first qubit of register b is treated as the conglomerate qubit corresponding to the state |16>. Therefore, when the new value of register a ought to be |2> for example (adding 1 from register a with 1 from register b) the displayed qubit circles are showing |18> which corresponds to a |2> in register a and a |1> in the first qubit of register b.

D Hemmick  Oct 17, 2019 
Printed Page 94
top of page

Same type of trouble in the website code as mentioned before. I.e., the website code in example 5-3 when executed gives circles which do not properly represent the registers a and b. It treats the two registers as a single conglomerate, so that the first qubit of register b is represented as a qubit of hex value 16 in the conglomerate, rather than weight 1 in the register b.

Therefore, when one of the sums in question comes to |2> the circles displayed offer the answer |18> since they are weighting the first qubit of register b as |16>.

D Hemmick  Oct 17, 2019 
ePub Page 100
3rd line

Word 'fert' should be 'tert'

Anonymous  Oct 22, 2019 
Printed Page 130
Figure 7-6

The |15> column is missing in Figure 7-6.

Jens Maßberg  Dec 15, 2019 
Printed Page 141
2nd paragraph

It says, “The FFT requires a number of operations that grows with the number of input bits n as O(n2^n). The QFT, however—by leveraging the 2^m states available in an m-cubit register—uses a number of gates that grows only as O(m^2).” And Figure 7-20 shows “Time to compute QFT and FFT on a linear scale”, with a very flat quadratic curve for QFT and a very steep exponential curve for FFT.

I’m confused: I thought a DFT took n^2 operations, and the FFT reduced that to n log n — see Wikipedia, for example (https://en.wikipedia.org/wiki/Fast_Fourier_transform). In the case of FFT, “n” refers to the number of samples in a data set; each sample would typically be represented by an integer or floating-point number. Could you help me understand how to compare the speed of FFT with the QFT?

Paul McJones  Mar 25, 2021 
Printed Page 175
RAM diagram

The order of bits seems to be different between the address and output registers in the RAM diagram. Reading top to bottom (i.e. treating vertically higher bits as more significant) the address selected is 0x10 which corresponds to the value 0x100 in RAM but the output register shows 0x001 (unless you read it bottom to top. Reading the address bottom to top doesn't help as it corresponds to 0x110 in RAM which doesn't look like the output register however you read it.

Tosh Afanasiev  Feb 04, 2022 
Printed Page 177
Second paragraph

The number 3 is encoded as binary 110 (which is 6) and 5 as 111 (which is 7)

Tosh Afanasiev  Feb 04, 2022 
Printed Page 183
Under Caveat 2: The requirement for normalized vectors, second paragraph

It's stated that we normalise the vector [0,1,2,3] by "dividing each component by the summed squares of each component", when it's actually the square root of this sum that we should use to normalise (3.74).

Tosh Afanasiev  Feb 04, 2022 
Printed Page 199
paragraphs starting with 'there is a twist' and 'that ll do it'

1. there's a twist. it is immediately obvious that it is not possible that both statements are false, which makes the further discussion pointless.
2. that ll do it. the princess overlooks the possibility that more than 1 configuration generates a 1. so getting a 1 does not prevent her from being eaten by a tiger ...

Anonymous  Mar 02, 2024 
Printed Page 201
in code for scratch qubit

|+> should be |->

Anonymous  Mar 02, 2024 
Printed Page 209
2nd paragraph, line 4 and 5

Typos within the running times:
"1.3(29" should be "1.329" and "1.1(53" should be "1.153".

Jens Maßberg  Dec 30, 2019 
Printed Page 209
1st paragraph

' To obtain a QPU ... amplification step.' Incorrect sentence.

Anonymous  Mar 03, 2024 
Printed Page 220
first paragraph in section "Sampling Phase-Encoded Images", line 5

Wrongly added "software verification" at the beginning of sentence.

Jens Maßberg  Dec 30, 2019 
Printed Page 258
Figure 12-19

The caption of the figure says "Quantum operations to perform a multiply by 2 modulo 35" while the figure only shows the "modulo 35" part.

Jens Maßberg  Dec 30, 2019 
PDF Page 269
Equation 13-5

The division of the first row of the matrix is a little wrong,
1/0.438 is 2.283... not 2.281

Yukitoshi Fujimura  May 08, 2020