Nathan Reed

Blog Stuff I’ve Made Talks About Me
New Ideas In RaytracingThe Radiance Field

Nested Complex Numbers

October 15, 2012 · Math · 5 Comments

As many of us learn in school, we can invent the complex numbers by starting with the real numbers, then simply “making up” a brand-new number, called iii, which is not equal to any real number, and whose only defined property is i2=−1i^2 = -1i2=−1. If we then allow real numbers and iii to be freely intermixed in formulas involving any of the standard arithmetic operations, we are forced to create additional numbers to represent the results of these operations. When the dust settles, we have the entire complex plane, each of whose points can be expressed as a+bia + bia+bi, where aaa and bbb are real.

Historically, this process of creating extra numbers by fiat made many mathematicians uncomfortable, and it took time for complex numbers to be accepted as “legitimate” mathematical entities on an equal footing with the real numbers. However, the modern view of mathematics holds that creating new numbers or other new entities at will is perfectly fine—so long as the rules for working with them are well-defined and self-consistent. And indeed it does not appear that defining i2=−1i^2 = -1i2=−1 creates any inconsistencies. Moreover, complex numbers have been quite a fruitful invention, with applications in engineering and physics, and a whole new branch of mathematics to their credit.

Well, if making up just one new number is so great, why stop there? Let’s make up some more!

There are lots of possible ways to make up a new number, of course. One in particular that I’m going to write about today is what I’ll call “nested complex numbers”. The idea is simple: just repeat the process of building the complex numbers, upon the complex numbers themselves.

We started by taking the real numbers, making up iii, and demanding that they all play nice together. Now, let’s start with the complex numbers, and make up another “imaginary” number. Call it jjj. Just as before, we’ll define j2=−1j^2 = -1j2=−1; however, jjj is not equal to any complex number. In particular, j≠ij \neq ij=i. However, jjj should play nice with complex numbers—i.e., we should be able to freely combine them in formulas involving the standard arithmetic operations.

What happens? Well, just as putting together real numbers with iii led to the whole set of complex numbers a+bia + bia+bi, putting together complex numbers with jjj leads to a whole new set of nested complex numbers of the form z+wjz + wjz+wj, where zzz and www are complex.

If we expand zzz and www into their real and imaginary parts, we can write out our whole nested complex number in terms of reals: z=a+biw=c+di}  ⟹  z+wj=a+bi+cj+dij \left. \begin{aligned} z &= a + bi \\ w &= c + di \end{aligned} \right\} \implies z + wj = a + bi + cj + dij zw​=a+bi=c+di​}⟹z+wj=a+bi+cj+dij Now, this is interesting—our nested complex numbers have four components: a real part, an iii part, a jjj part, and finally a part proportional to the product ijijij. What is ijijij? It can’t be simplified any further, since it involves both of our magical not-equal-to-anything-else imaginary units! Indeed, ijijij behaves much like a third imaginary unit. We might as well admit this and give it a name: k≡ijk \equiv ijk≡ij. So by introducing jjj we actually got kkk as well—two for the price of one! Our nested complex numbers now break down as a+bi+cj+dka + bi + cj + dka+bi+cj+dk.

Since i2=j2=−1i^2 = j^2 = -1i2=j2=−1, we have k2=(ij)2=(i2)(j2)=+1k^2 = (ij)^2 = (i^2)(j^2) = +1k2=(ij)2=(i2)(j2)=+1. So kkk doesn’t behave like the other imaginary units in our number system: it squares to +1, not −1!

It turns out that mathematicians have investigated this number system; they call it the tessarines, also known as bicomplex numbers. Like complex numbers, tessarines are a self-consistent extended number system. The oddball kkk unit that squares to +1 instead of −1 causes some interesting things to happen.

For example, in standard complex numbers we have Euler’s identity: eiθ=cosθ+isin⁡θfor all real θ e^{i\theta} = cos \theta + i \sin \theta \qquad\text{for all real }\theta eiθ=cosθ+isinθfor all real θ a fun relationship that allows many trigonometric identities to be seen as special cases of known properties of the exponential function. In tessarines, Euler’s identity also holds, as well as a copy of it with jjj substituted for iii—which makes sense because jjj is basically another copy of iii. But there’s a different version of the identity for kkk: ekθ=cosh⁡θ+ksinh⁡θfor all real θ e^{k\theta} = \cosh \theta + k \sinh \theta \qquad\text{for all real }\theta ekθ=coshθ+ksinhθfor all real θ Where regular complex numbers relate the exponential function to circular trigonometry, tessarines relate it to hyperbolic trigonometry! Indeed, the subset of tessarines that have only real and kkk parts, with zero iii and jjj parts, is a well-studied number system in its own right: the split-complex numbers.

Algebra, Undivided

Tessarines have some neat properties, but as a number system they also have some drawbacks. The most unfortunate thing is that division doesn’t work well: many tessarines fail to have a multiplicative inverse, and therefore you can’t divide by them.

We can get an idea of how this happens by recalling the usual procedure for calculating the inverse of a complex number. This involves using the complex conjugate: 1a+bi=a−bi(a+bi)(a−bi)=a−bia2+b2=aa2+b2+−ba2+b2i \frac{1}{a + bi} = \frac{a - bi}{(a + bi)(a - bi)} = \frac{a - bi}{a^2 + b^2} = \frac{a}{a^2 + b^2} + \frac{-b}{a^2 + b^2} i a+bi1​=(a+bi)(a−bi)a−bi​=a2+b2a−bi​=a2+b2a​+a2+b2−b​i This shows that every nonzero complex number has an inverse that is also a complex number. For this procedure to work, it’s critical that when a complex number is multiplied by its conjugate, the result is always a real number (a2+b2a^2 + b^2a2+b2). This enables the denominator to be distributed into the real and imaginary parts of the numerator, so we can express the inverse in the standard form of a complex number, a′+b′ia' + b'ia′+b′i.

What happens when we try this with a tessarine? Well, we need to extend the conjugate operation to tessarines. In complex numbers we have i∗=−ii^* = -ii∗=−i, so it makes sense to define j∗=−jj^* = -jj∗=−j as well. Then, since k=ijk = ijk=ij, we have k∗=i∗j∗=(−i)(−j)=+kk^* = i^* j^* = (-i)(-j) = +kk∗=i∗j∗=(−i)(−j)=+k. Therefore the conjugate of a whole tessarine is t=a+bi+cj+dk  ⟹  t∗=a−bi−cj+dk t = a + bi + cj + dk \quad\implies\quad t^* = a - bi - cj + dk t=a+bi+cj+dk⟹t∗=a−bi−cj+dk The iii and jjj parts change sign, but the kkk part doesn’t. When you multiply a tessarine by its conjugate, then you get t∗t=a2+b2+c2+d2+2(ad−bc)k t^* t = a^2 + b^2 + c^2 + d^2 + 2(ad - bc) k t∗t=a2+b2+c2+d2+2(ad−bc)k Whoops! That’s not a real number, since it has a nonzero kkk part (unless we get lucky and ad=bcad = bcad=bc). This throws a wrench into the inversion procedure above. Now, this isn’t a proof that this tessarine doesn’t have an inverse; it’s still possible that you can obtain an inverse by some other method. But this is suggestive of how things can go wrong because the conjugate isn’t doing its job. And indeed it turns out there are some tessarines that don’t have inverses by any method: 1+k1 + k1+k and 1−k1 - k1−k are two examples.

Now, we can probably live with tessarines occasionally failing to be invertible; after all, that’s the case for matrices as well, and people manage to use those for lots of things. Still, it’s an unfortunate property. Is there an alternative way we could construct a number system by nesting complex numbers that would preserve division?

You Win Some, You Lose Some

Since the article isn’t over yet, you can surmise the answer is yes. But there’s a price.

If we can fix the conjugate, the same inversion procedure used for complex numbers will also work for our nested complex numbers, and we’ll again be able to divide by anything (other than zero). The product of a tessarine and its conjugate fails to be a real number because k∗=+kk^* = +kk∗=+k. If we had k∗=−kk^* = -kk∗=−k instead, the conjugate would work right again.

But we can’t just declare by fiat that k∗=−kk^* = -kk∗=−k, can we? After all, k=ijk = ijk=ij by definition, so if the conjugate for our nested complex numbers is supposed to be an extension of the complex conjugate, then k∗k^*k∗ must be determined by i∗i^*i∗ and j∗j^*j∗—which we don’t want to change.

There’s only one little hole in this logic we can exploit. The only way to make k∗=−kk^* = -kk∗=−k is to give up commutative multiplication. In fact, we need to make iii and jjj anticommute with each other, so that ij=kij = kij=k, but ji=−kji = -kji=−k. If we do this, and also define the conjugate operation to reverse the order of its factors, then k∗=(ij)∗=j∗i∗=(−j)(−i)=ji=−k k^* = (ij)^* = j^* i^* = (-j)(-i) = ji = -k k∗=(ij)∗=j∗i∗=(−j)(−i)=ji=−k and we have the conjugate we were looking for.

What other effects does anticommuting iii and jjj have? First of all, k2=−1k^2 = -1k2=−1 now, not +1! This is because in calculating out k2k^2k2 we have to swap an iii and jjj, and that introduces a minus sign. k2=(ij)2=ijij=−iijj=−(−1)(−1)=−1 k^2 = (ij)^2 = ijij = -iijj = -(-1)(-1) = -1 k2=(ij)2=ijij=−iijj=−(−1)(−1)=−1 Also, a little algebra will show that kkk also anticommutes with iii and jjj, so the full multiplication table looks like i2=−1ij=kik=−jji=−kj2=−1jk=iki=jkj=−ik2=−1 \begin{aligned} i^2 &= -1 & ij &= k & ik &= -j \\ ji &= -k & j^2 &= -1 & jk &= i \\ ki &= j & kj &= -i & k^2 &= -1 \end{aligned} i2jiki​=−1=−k=j​ijj2kj​=k=−1=−i​ikjkk2​=−j=i=−1​ This is all very neat and antisymmetrical. What number system do we have here? Turns out we’ve just constructed quaternions! Of course, they’re another well-known and widely used number system, with applications in physics, engineering, and computer graphics due to their ability to represent rotations of 3D space, just as complex numbers represent rotations in 2D.

So, “nesting” the complex numbers, by repeating the process of building the complex numbers upon themselves, leads us to two different 4-dimensional algebras: the tessarines and the quaternions. In tessarines, multiplication is commutative, but not all nonzero tessarines have inverses, so division does not always work for them. For quaternions, division works properly—but the price of regaining full division is that we must give up the commutativity of multiplication.

What if we go further? We can make up as many additional imaginary units as we like; since they will get multiplied with each other in all combinations, algebras constructed this way have power-of-two dimensionality. (If nnn imaginary units are introduced, there will be 2n2^n2n combinations of them, including the empty combination—that is, plain old real numbers.) But every time we add another imaginary unit we are presented with a set of tradeoffs and have to give something up. For example, if we continue to choose to maintain division, we are going along a path known as the Cayley-Dickson construction. In going to 4 dimensions we lose commutative multiplication; in 8 dimensions we lose associative multiplication; and in 16 dimensions division cannot be made to completely work, no matter what we do. If we are willing to give up division, there are still other number systems that can be created in 2, 4, or 8 dimensions. The Wikipedia article on hypercomplex numbers (the general term for all these constructions) gives an overview of the possibilities.

New Ideas In RaytracingThe Radiance Field

5 Comments on “Nested Complex Numbers”

Subscribe

  • RSS RSS

Recent Posts

  • Reading Veach’s Thesis, Part 2
  • Reading Veach’s Thesis
  • Texture Gathers and Coordinate Precision
  • git-partial-submodule
  • Slope Space in BRDF Theory
  • Hash Functions for GPU Rendering
  • All Posts

Categories

  • Graphics(32)
  • Coding(23)
  • Math(21)
  • GPU(15)
  • Physics(6)
  • Eye Candy(4)
© 2007–2024 by Nathan Reed. Licensed CC-BY-4.0.