ARA MEDINA

View Original

Euler's Formula for Quantum Computing Beginners

I’m taking a break from working on my linear algebra cheat sheets to focus on a particular topic that I originally had a bit of trouble with.

The quantum computing textbook I’m working through mentions Euler’s formula a few times, but I was missing some background knowledge I needed in order to feel like I really understood the concept and how it was relevant. I ended up needing to search elsewhere for some supplementary resources, but now that I have a more solid grasp, I thought I would save y’all the trouble and synthesize the information into a blog post.

I’ll be using concepts like the imaginary number, complex numbers, the complex plane, etc. so if you need a refresher on these before getting started with this post, I suggest checking out the second post in my Linear Algebra For Quantum Computing Series before moving forward.

Otherwise, let’s go!


SHort intro to euler’s formula

A complex number z that has a radius of 1 (meaning it lives on the unit circle) and an angle theta can be expressed with Euler’s formula in the following way:

See this content in the original post

Visually, this can be represented like so (theta is replaced with phi here):

See this content in the original post

In the above figure, where the black line with the arrow ends is where z sits on the unit circle, and the length of said black line is 1 (this is the radius, we’ll call it r from now on).


Laying the groundwork for euler’s formula

Before we get in to what’s going on with the mathematical constant e in Euler’s formula, also called Euler’s number or the natural number, let’s focus just on this part:

See this content in the original post

If z takes the form of a + bi, and z = 2 + 3i, then on the complex plane that would look like:

So to find the length of the radius, we can use the Pythagorean theorem:

See this content in the original post

And to find the angle theta, we can do the following:

See this content in the original post

However, what if we are given the radius r and the angle theta, and need to work backwards to find a and b? Imagine that:

See this content in the original post

Using basic trigonometry, we can find that:

See this content in the original post

And:

See this content in the original post

Since r = 1, we know:

See this content in the original post

As you can see, we’ve made it to the spot we were trying to get to in this section, which is where:

See this content in the original post

In this case, the answer is:

See this content in the original post

The natural number

The natural number, or e, is a constant and is roughly equal to 2.71828, which is visualized on the graph below:

See this content in the original post

This is the graph of the equation y = 1/x, and the area under the curve that is shaded-in blue is equal to 1, which is one thing that makes e special.

Another way it is special is that it is the sum of the following infinite series:

See this content in the original post

Which can be written as:

See this content in the original post

The first number in the series tripped me up when I was studying originally, because I forgot that the following is true:

See this content in the original post

As a refresher to understand why this is the case, remember that

“…the definition of a factorial is the product of all integers equal to or less in value to the original number—in other words, a factorial is the number of combinations possible with numbers less than or equal to that number.

Because zero has no numbers less than it but is still in and of itself a number, there is but one possible combination of how that data set can be arranged: it cannot. This still counts as a way of arranging it, so by definition, a zero factorial is equal to one…”


PUTTING EVERYTHING TOGETHER WITH power series

So far, we have shown that there is an intrinsic relationship between complex numbers and trigonometry. We’ve also started to get an in idea of what e is.

Our next step is to recall the power series of the cosine and sine functions:

See this content in the original post

These are called Taylor series, and you’ll notice that cos(x) has only even powers while sin(x) has only odd powers. For now, it’s not super important to understand how these power series were derived, but if you’re curious for more information, I suggest checking out this resource from Khan Academy.

There is one more important Taylor series to know:

See this content in the original post

Which can also be expressed as:

See this content in the original post

However, in Euler’s formula, the exponent on e is multiplied by the imaginary number i. What happens when we introduce i into the power series we just looked at?

See this content in the original post

Which can be rearranged to…

See this content in the original post

And if we factor i out from the elements in the second set of parentheses, we get…

See this content in the original post

Which, if you look closely, simplifies to exactly the trigonometric side of Euler’s formula!

See this content in the original post

And this is Very Cool.


Why is this very cool?

There are many reasons why Euler’s formula is Very Cool, but one reason is that it “establishes the fundamental relationship between the trigonometric functions and the complex exponential function.” It is useful for differential equations, electrical engineering, signal processing, and other areas. Richard Feynman is said to have called it “the most remarkable formula in mathematics”. Aren’t you glad you read a whole post about it now?

By the way, Euler didn’t exactly get to this formula on his own - he built off some work by Roger Cotes and he would discuss the formula at various points with Johann Bernoulli.

In upcoming posts, we’ll look at matrices, what they are, how to work with them, and what happens when you introduce them to Euler’s formula (spoiler alert: everything works out).