Reader small image

You're reading from  Dancing with Qubits - Second Edition

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837636754
Edition2nd Edition
Right arrow
Author (1)
Robert S. Sutor
Robert S. Sutor
author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor

Right arrow

More Numbers Than You Can Imagine

The methods of theoretical physics should be applicable to all those branches of thought in which the essential features are expressible with numbers.

Paul Dirac, 1933 Nobel Prize Banquet Speech

People use numbers for counting, percentages, ratios, prices, math homework, taxes, and other practical applications.

Displayed math

These are all examples of real numbers. In this chapter, we look at the properties and operations of real numbers, especially those of subsets such as the integers. We extend those properties and operations to other collections, such as the complex numbers, that are core to understanding quantum computing.

For example, we define a quantum bit, or qubit, as a pair of complex numbers with additional properties. We begin to lay the foundation for the algebraic side of quantum computing. In the next chapter, we’ll turn to geometry.

Topics covered in this chapter

  1. 3.1. Natural numbers
  2. 3.2. Whole numbers
  3. 3.3. Integers
  4. 3.4. Rational numbers
    1. 3.4.1. Fractions
    2. 3.4.2. Getting formal again
    3. 3.4.3. Is √2 rational?
  5. 3.5. Real numbers
    1. 3.5.1. Decimals
    2. 3.5.2. Irrationals and limits
    3. 3.5.3. Binary forms
    4. 3.5.4. Continued fractions
  6. 3.6. Structure
    1. 3.6.1. Groups
    2. 3.6.2. Rings
    3. 3.6.3. Fields
    4. 3.6.4. Even greater abstraction
  7. 3.7. Modular arithmetic
  8. 3.8. Doubling down
  9. 3.9. Complex numbers, algebraically
    1. 3.9.1. Arithmetic
    2. 3.9.2. Conjugation
    3. 3.9.3. Units
    4. 3.9.4. Polynomials and roots
  10. ...

3.1 Natural numbers

While there are special and famous numbers such as π, the numbers we use for counting are much simpler: 1, 2, 3, … . I might say, “Look, there is 1 puppy, 2 kittens, 3 cars, and 4 apples.” If you give me 2 more apples, I will have 6. If I give my sister 1 of them, I will have 5. If I buy 2 more bags of 5 apples, I will have 15 in total, which is 3 × 5.” natural number number$natural

The set of natural numbers is the collection of increasing values

Displayed math

where we get from one number to the next by adding 1. 0 is not included. The braces “{“ and “}” indicate we are talking about the entire set of these numbers.

When we want to refer to some arbitrary natural number but not any particular one specifically, we use a variable name such as n or m.

The set of natural numbers is infinite. Suppose otherwise and that some specific number n is the largest natural number...

3.2 Whole numbers

If we append 0 to N as a new smallest value, we get the whole numbers, denoted W. They are both infinite sets of numbers, but N is a subset of W. We do not use the whole numbers a lot in mathematics, but let’s see what we get with this additional value. whole number number$whole W`bold

We are still closed under addition and multiplication and not closed under division. We do now have to watch out for division by 0. Expressions such as 3 – 3 or nn, in general, are in W, so that’s a little better for subtraction, but this does not give us closure.

So far, there’s not much that we’ve gained, it seems. Or have we?

0 is an identity element for addition, a new concept for us to consider. I’ve put it in bold to show how special it is. This element is a unique (meaning there is one and only one) number such that for any whole number w, we have w + 0 = 0 + w = w.

Thus, 14...

3.3 Integers

People are sometimes confused by negative numbers when they first encounter them. How can I have a negative amount of anything? I can’t physically have fewer than no apples, can I?

To get around this, we introduce the idea that a positive number of things or amount of money means something you have. A negative number or amount means what you owe someone else.

If you have $100 and you write a check or pay a bill electronically for $120, one of two things will likely happen. The first option is for the payment to fail, and your bank may charge you a fee. The second is that the bank will pay the full amount, let you know you are overdrawn, and charge you a fee. You will then need to pay the overdrawn amount quickly or have it paid from some other account.

You started with $100 and ended up with $–20 before repayment. You owe the bank $20. If you deposit $200 in your account immediately, your balance will be $180, which is $–...

3.4 Rational numbers

The rational numbers, denoted Q, take care of the problem of the integers not being closed under division by nonzero values. rational number number$rational Q`bold

3.4.1 Fractions

Let’s start by talking about fractions, also known as the rational numbers, in the way a teacher may have introduced them to you. We then relate this review to what we have in the big picture with Q.

Given a loaf of bread, if we cut it right down the middle, we say we have divided it into halves. Fraction-wise, one-half = 1/2. The two halves equal one whole loaf, so 1/2 + 1/2 = 2 × 1/2 = 1. Two halves are 2/2, which is 1. Four halves would make two loaves: 4/2 = 2.

Considering whole loaves, 1/1 is one loaf, 2/1 is two loaves, and 147/1 is one hundred and forty-seven loaves. We can represent any integer n as a fraction n/1.

To multiply fractions, we multiply the tops (numerators) together, put those over the product...

3.5 Real numbers

In this section, we look at the real numbers, denoted R, to conclude our analysis of the typical numbers most people encounter. Let’s begin with decimals. real number number$real R`bold

3.5.1 Decimals

A decimal expression for a real number looks like decimal

  • an optional minus sign,
  • followed a finite number of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9,
  • followed by a period, also called the decimal point,
  • followed by a finite or infinite number of digits.

In many parts of the world, the decimal point is a comma instead of a period, but I use the United States and UK convention here.

You may omit the decimal point if there are no digits after the decimal point.

We usually omit trailing 0s on the right when we use the number in a general mathematical context. We may keep them when they indicate the precision of a measurement...

3.6 Structure

I took time to show the operations and the properties of R and its subsets such as Z and Q because these are very common in other parts of mathematics when abstracted. This structure allows us to learn and prove things and then apply them to new mathematical collections as we encounter them. We start with three: groups, rings, and fields.

These will come into play when we consider modular arithmetic in section 3.7, complex numbers in section 3.9, and vector spaces, linear transformations, and matrices in Chapter 5, “Dimensions.”

3.6.1 Groups

Consider a collection of objects we call G. For example, G might be Z, Q, or R, as above. We also have some pairwise operation between elements of G that we denote by “★”. This is a placeholder for an action that operates on two objects. group

This “★” operation could be addition “+” or multiplication “...

3.7 Modular arithmetic

There are an infinite number of integers and hence rationals and real numbers. Are there sets of numbers that behave somewhat like them but are finite? number$modular integer integer$modular

Consider the integers modulo 6: {0, 1, 2, 3, 4, 5}. We write 3 mod 6 when we consider the 3 in this collection. Given any integer n, we can map it into this collection by computing the remainder modulo 6. We do arithmetic in the same way: modulo

Displayed math

Instead of “=”, we write “≡”. We say that a is congruent to b mod 6 when we see ab mod 6, which means ab is evenly divisible by 6: 6 | (ab). congruent

These six elements form a group under addition with identity 0. In the last example, 2 is the additive inverse of 4. We denote this group Z/6Z.

Exercise 3.22

What is –1 mod 6? For n a natural number greater than 1, what is –1 mod n?

...

3.8 Doubling down

So far, we’ve seen finite and infinite groups, rings, and fields, some of which are extensions of others. In this section, we look at combining them.

Consider the collection of all pairs of integers (a, b), where we define addition and multiplication component-wise.

Displayed math

This is a ring, denoted Z2, but it is not an integral domain. (1, 0) × (0, 1) = (0, 0), but neither of the factors is 0.

For the same reason, neither Q2 nor R2 can be an integral domain. In particular, they are not fields with these operations.

Let’s change the definitions for R2 so that 1 = (1, 0) and multiplication is

Displayed math

For (a, b) ≠ 0, we define

Displayed math

With these unusual definitions for multiplication and inversion, we not only have an integral domain, we have a field, which we examine in the next section.

3.9 Complex numbers, algebraically

In section 3.6.2, I gave an example of extending the integers by considering elements of the form a + b√2. We can similarly extend R. complex number number$complex C`bold

The real numbers R do not contain the square roots of negative numbers. We define the value i as √(–1), which means i2 = –1. i`italic

For a and b in R, consider all elements of the form z = a + bi. This is the field of complex numbers C formed as R[i] = R[√(–1)]. We call a the real part of z and denote it by Re(z). b is the imaginary part Im(z). a and b are real numbers. Every real number is also a complex number with a zero imaginary part. complex number$arithmetic complex number$real part complex number$imaginary part Re() Im()

While we can always determine if x < y for two real numbers, there is no equivalent ordering for arbitrary complex ones that extends what works for the reals. ordered

...

3.10 Summary

There’s more to numbers than you might have thought, despite using them daily. Starting with the simplest kind, the natural numbers N, we systematically added operations and properties to gain functionality. The idea of “closure” drove us to understand the value of extending to increasingly larger collections of numbers that could handle the problems we wanted to solve.

We briefly delved into abstract algebra to look at groups, rings, and fields and see their structure. Complex numbers are key to working with quantum computing, and we began to look at their algebraic properties. Though they involve the imaginary i, they are very real in describing the way the universe evidently works.

The following table brings together the number collections we have seen and some of their properties.

Displayed math

The following diagram shows the inclusion relationships among the collections of numbers. The expressions

...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Dancing with Qubits - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781837636754
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Robert S. Sutor

Robert S. Sutor has been a technical leader and executive in the IT industry for over 40 years. More than two decades of that were spent in IBM Research in Yorktown Heights, New York USA. During his time there, he worked on and led efforts in symbolic mathematical computation, mathematical programming languages, optimization, AI, blockchain, and quantum computing. He is the author of Dancing with Qubits: How quantum computing works and how it can change the world and Dancing with Python: Learn Python software development from scratch and get started with quantum computing, also with Packt. He is the published co-author of several research papers and the book Axiom: The Scientific Computation System with the late Richard D. Jenks. Sutor was an IBM executive on the software side of the business in areas including Java web application servers, emerging industry standards, software on Linux, mobile, and open source. He was the Vice President of Corporate Development and, later, Chief Quantum Advocate, at Infleqtion, a quantum computing and quantum sensing company based in Boulder, Colorado USA. He is currently an Adjunct Professor in the Department of Computer Science and Engineering at the University at Buffalo, New York, USA. He is a theoretical mathematician by training, has a Ph.D. from Princeton University, and an undergraduate degree from Harvard College. He started coding when he was 15 and has used most of the programming languages that have come along.
Read more about Robert S. Sutor