Errata

Q# Pocket Guide

Errata for Q# Pocket Guide

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. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

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

Version Location Description Submitted By Date submitted Date corrected
Printed
Page page 15/Primitive Classical Data Types
Description of Double data type

NaN is not a literal but a value that can be obtained as a result of arithmetic operation, similar to Infinity and NegativeInfinity.

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023
Printed
Page page 74/Quantum Gates and Measurements
Code snippet showing the Measure operation

The order of parameters for the Measure operation should be swapped, with the array of bases first and the array of qubits measured last:

let parity = Measure([PauliZ, PauliZ], qs);

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023
Printed
Page page 93/Defining and Using Type-Parameterized Callables
Code snippet defining Min<'T> with additional lessThan parameter

The code snippet doesn't need the line "open Microsoft.Quantum.Logical;", since it defines the comparison argument using lambda expressions rather than LessThanI and LessThanD functions from that namespace

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023
Printed
Page page 137/Microsoft.Quantum.Logical: Logical and Comparison Functions
Code snippet defining lessThanAI function

There is an extra closing bracket after a2 on the last line of the code snippet:

Message($"{lessThanAI(a1, a2)}");

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023
Printed
Page page 147/Microsoft.Quantum.Canon: Catchall
Applying callables to arrays paragraph

ApplyToMost applies an operation to the whole subarray consisting of all array elements except the last one, not to each of the elements except the last one individually.

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023
Printed
Page page 166/Standalone Q# Test Projects
Example 8-2. Defining standalone Q# unit tests

The second line of the fail statement has an extra closing bracket:

fail "Incorrect return for input {i}: " +
"expected {expected}, got {actual}";

Mariia Mykhailova
Mariia Mykhailova
 
May 18, 2023  Dec 01, 2023