Iterating Hamilton’s construction $\Bbb R\to \Bbb C$ yields what type of algebraic structure on $\Bbb C^2$ (e.g. occurs in nested complex datatypes).

abstract-algebracomplex numbershypercomplex-numbers

The C++ language provides a general template-based implementation of complex numbers. Normally, these are using to manipulate numbers of the form $a + b i$, where $a, b$ are chosen as either 32 or 64 bit floating point numbers. These are respectively denoted by std::complex<float> and std::complex<double>. The language implements the standard multiplication, division, addition etc. operators on complex numbers.

Because the code provided to manipulate complex numbers is general, we can embed complex numbers within complex numbers, e.g. using std::complex<std::complex<double>>, nesting arbitrarily deeply. The doubly nested data type is uniquely defined by four floating point numbers. It is thus representing numbers in a form $(a + b i) + (c + d i) j$, where $i^2 = -1$, $j^2 = -1$, and $a, b, c, d \in \mathbb{R}$.

I initially thought these would be related to quaternions, but the structure encountered here is not anti-commutative in the $i, j$ basis units which is apparently a property of quaternions. On top of that, these seem to not be equivalent to bicomplex numbers, because there is no third analog of the imaginary unit present, named $k$ in this article. I get the suspicion that std::complex<std::complex<double>> is isomorphic to the complex numbers after reading the Frobenius theorem about real division algebras.

Is this the correct conclusion? If so, why? If not, what algebraic structure is std::complex<std::complex<double>> isomorphic to?

Best Answer

This structure cannot possibly be isomorphic to complex numbers; as you say yourself, it is four-dimensional over $\mathbb R$ while the complex numbers are two dimensional.

What you're missing is that the bicomplex $j, k$ from the article you linked have $j^2 = 1$ and $k^2 = -1$, but your $j$ has $j^2 = -1$. So take your $i,j$ and define $$ i' = i,\quad j' = ij,\quad k' = j. $$ You will find using the basis $1,i',j',k'$ that your algebra is the bicomplex numbers exactly as described in the article.