appendix A Math refresher
This appendix contains a quick review of binary strings and complex numbers.
A.1 Diving deeper into binary strings
The only information we can get from a quantum computation is the measurement outcome. We represent this outcome as a binary string. Therefore, to interpret the results of a quantum computation, we need to be able to interpret binary strings.
Typically, the information processed by a classical computer uses a binary system, so you may already be familiar with interpretations of binary strings. Of course, present-day programmers rarely need to interact with binary code. In contrast, in the current stage of quantum computing, we have to be able to think in terms of binary representations of variables to implement quantum programs. In the following sections, we will review a few relevant features of binary strings.
A.1.1 Converting between binary and decimal values
Most of the time, we work with integers in their decimal (base 10) form. The decimal form of an integer is a sequence of digits, where each digit is one of 10 possible values (0 through 9). The position of each digit then tells us which power of 10 the value represents. As we move from right to left, the power of 10 increases. For example, in a three-digit positive integer, the leftmost digit represents how many hundreds (102) are in the integer, the middle digit how many tens (101), and the rightmost is how many ones (100), as shown in figure A.1.