Canonical Voiceshttp://voices.canonical.com2018-03-11T13:55:21ZAlfonso Sanchez-Beato's blog: Analysis and Plots of Solutions to Complex Powers2018-03-11T13:55:21Zabeatonospam@nospam.comhttp://www.alfonsobeato.net/math/analysis-and-plots-of-solutions-to-complex-powers/<p>In chapter 5 of his mind-blowing <a href="https://en.wikipedia.org/wiki/The_Road_to_Reality" target="_blank">“The Road to Reality”</a>, Penrose devotes a section to complex powers, that is, to the solutions to</p>
<p>$$w^z~~~\text{with}~~~w,z \in \mathbb{C}$$</p>
<p>In this post I develop a bit more what he exposes and explore what the solutions look like with the help of some simple Python scripts. The scripts can be found in <a href="https://github.com/alfonsosanchezbeato/exponential-spiral" target="_blank">this github repo</a>, and all the figures in this post can be replicated by running</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
git clone https://github.com/alfonsosanchezbeato/exponential-spiral.git
cd exponential-spiral; ./spiral_examples.py
</pre>
<p>The scripts make use of numpy and matplotlib, so make sure those are installed before running them.</p>
<p>Now, let’s develop the math behind this. The values for \(w^z\) can be found by using the exponential function as</p>
<p>$$w^z=e^{z\log{w}}=e^{z~\text{Log}~w}e^{2\pi nzi}$$</p>
<p>In this equation, “log” is the <a href="https://en.wikipedia.org/wiki/Complex_logarithm" target="_blank">complex natural logarithm</a> multi-valued function, while “Log” is one of its branches, concretely the principal value, whose imaginary part lies in the interval \((−\pi, \pi]\). In the equation we reflect the fact that \(\log{w}=\text{Log}~w + 2\pi ni\) with \(n \in \mathbb{Z}\). This shows the remarkable fact that, in the general case, we have infinite solutions for the equation. For the rest of the discussion we will separate \(w^z\) as follows:</p>
<p>$$w^z=e^{z~\text{Log}~w}e^{2\pi nzi}=C \cdot F_n$$</p>
<p>with constant \(C=e^{z~\text{Log}~w}\) and the rest being the sequence \(F_n=e^{2\pi nzi}\). Being \(C\) a complex constant that multiplies \(F_n\), the only influence it has is to rotate and scale equally all solutions. Noticeably, \(w\) appears only in this constant, which shows us that the \(z\) values are what is really determinant for the number and general shape of the solutions. Therefore, we will concentrate in analyzing the behavior of \(F_n\), by seeing what solutions we can find when we restrict \(z\) to different domains.</p>
<p>Starting by restricting \(z\) to integers (\(z \in \mathbb{Z}\)), it is easy to see that there is only one resulting solution in this case, as the factor \(F_n=e^{2\pi nzi}=1\) in this case (it just rotates the solution \(2\pi\) radians an integer number of times, leaving it unmodified). As expected, a complex number to an integer power has only one solution.</p>
<p>If we let \(z\) be a rational number (\(z=p/q\), being \(p\) and \(q\) integers chosen so we have the <a href="https://proofwiki.org/wiki/Definition:Rational_Number/Canonical_Form" target="_blank">canonical form</a>), we obtain</p>
<p>$$F_n=e^{2\pi\frac{pn}{q} i}$$</p>
<p>which makes the sequence \(F_n\) periodic with period \(q\), that is, there are \(q\) solutions for the equation. So we have two solutions for \(w^{1/2}\), three for \(w^{1/3}\), etc., as expected as that is the number of solutions for square roots, cube roots and so on. The values will be the vertex of a regular polygon in the complex plane. For instance, in figure 1 the solutions for \(2^{1/5}\) are displayed.</p>
<figure class="wp-caption aligncenter" id="attachment_196" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/pentagon.svg"><img alt="Figure 1" class="aligncenter size-full wp-image-196" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/pentagon.svg" /></a><figcaption class="wp-caption-text"><br />
<center>Fig. 1: The five solutions to \(2^{1/5}\)</center><br /></figcaption></figure>
<p>If \(z\) is real, \(e^{2\pi nzi}\) is not periodic anymore has infinite solutions in the unit circle, and therefore \(w^z\) has infinite values that lie on a circle of radius \(|C|\).</p>
<p>In the more general case, \(z \in \mathbb{C}\), that is, \(z=a+bi\) being \(a\) and \(b\) real numbers, and we have</p>
<p>$$F_n=e^{-2\pi bn}e^{2\pi ani}.$$</p>
<p>There is now a scaling factor, \(e^{-2\pi bn}\) that makes the module of the solutions vary with \(n\), scattering them across the complex plane, while \(e^{2\pi ani}\) rotates them as \(n\) changes. The result is an infinite number of solutions for \(w^z\) that lie in an <a href="https://en.wikipedia.org/wiki/Logarithmic_spiral" target="_blank">equiangular spiral</a> in the complex plane. The spiral can be seen if we change the domain of \(F\) to \(\mathbb{R}\), this is</p>
<p>$$F(t)=e^{-2\pi bt}e^{2\pi ati}~~~\text{with}~~~t \in \mathbb{R}.$$</p>
<p>In figure 2 we can see one example which shows some solutions to \(2^{0.4-0.1i}\), plus the spiral that passes over them.</p>
<figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral0.svg"><img alt="Fig. 2: Roots for \(2^{0.4-0.1i}\)" class="aligncenter size-full wp-image-179" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral0.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 2: Roots and spiral for \(2^{0.4-0.1i}\)</center><br /></figcaption></figure>
<p>In fact, in Penrose’s book it is stated that these values are found in the intersection of two equiangular spirals, although he leaves finding them as an exercise for the reader (problem 5.9).</p>
<p>Let’s see then if we can find more spirals that cross these points. We are searching for functions that have the same value as \(F(t)\) when \(t\) is an integer. We can easily verify that the family of functions</p>
<p>$$F_k'(t)=F(t)e^{2\pi kti}~~~\text{with}~~~k \in \mathbb{Z}$$</p>
<p>are compatible with this restriction, as \(e^{2\pi kti}=1\) in that case (integer \(t\)). Figures 3 and 4 represent again some solutions to \(2^{0.4-0.1i}\), \(F(t)\) (which is the same as the spiral for \(k=0\)), plus the spirals for \(k=-1\) and \(k=1\) respectively. We can see there that the solutions lie in the intersection of two spirals indeed.</p>
<p><figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral1.svg"><img alt="Fig. 3" class="aligncenter size-full wp-image-244" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral1.svg" /><figcaption class="wp-caption-text"></a><center>Fig. 3: Roots for \(2^{0.4-0.1i}\) plus spirals for k=0 and k=-1</center><br /></figcaption></figure><br />
<figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral2.svg"><img alt="Fig. 4" class="aligncenter size-full wp-image-244" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral2.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 4: Roots for \(2^{0.4-0.1i}\) plus spirals for k=0 and k=1</center><br /></figcaption></figure></p>
<p>If we superpose these 3 spirals, the ones for \(k=1\) and \(k=-1\) cross also in places different to the complex powers, as can be seen in figure 5. But, if we choose two consecutive numbers for \(k\), the two spirals will cross only in the solutions to \(w^z\). See, for instance, figure 6 where the spirals for \(k=\{-2,-1\}\) are plotted. We see that any pair of such spirals fulfills Penrose’s description.</p>
<p><figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral3.svg"><img alt="Fig. 5" class="aligncenter size-full wp-image-244" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral3.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 5: Roots for \(2^{0.4-0.1i}\) plus spirals for k=-1,0,1</center><br /></figcaption></figure><br />
<figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral4.svg"><img alt="Fig. 6" class="aligncenter size-full wp-image-275" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/spiral4.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 6: Roots for \(2^{0.4-0.1i}\) plus spirals for k=-1,-2</center><br /></figcaption></figure></p>
<p>In general, the number of places at which two spirals cross depends on the difference between their \(k\)-number. If we have, say, \(F_k’\) and \(F_l’\) with \(k>l\), they will cross when</p>
<p>$$t=…,0,\frac{1}{k-l},\frac{2}{k-l},…,\frac{k-l-1}{k},1,1+\frac{1}{k-l},…$$</p>
<p>That is, they will cross when \(t\) is an integer (at the solutions to \(w^z\)) and also at \(k-l-1\) points between consecutive solutions.</p>
<p>Let’s see now another interesting special case: when \(z=bi\), that is, it is pure imaginary. In this case, \(e^{2\pi ati}\) is \(1\), and there is no turn in the complex plane when \(t\) grows. We end up with the spiral \(F(t)\) degenerating to a half-line that starts at the origin (which is reached when \(t=\infty\) if \(b>0\)). This can be appreciated in figure 7, where the line and the spirals for \(k=-1\) and \(k=1\) are plotted for \(20^{0.1i}\). The two spirals are mirrored around the half-line.</p>
<figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/line0.svg"><img alt="Fig. 7" class="aligncenter size-full wp-image-258" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/line0.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 7: Roots for \(10^{0.1i}\), \(F(t)\), and spirals for k=-1,1</center><br /></figcaption></figure>
<p>Digging more into this case, it turns out that a pure imaginary number to a pure imaginary power can produce a real result. For instance, for \(i^{0.1i}\), we see in figure 8 that the roots are in the half-positive real line.</p>
<figure class="wp-caption aligncenter" id="attachment_179" style="width: 500px;"><a href="https://www.alfonsobeato.net/wp-content/uploads/2018/03/line1.svg"><img alt="Fig. 8" class="aligncenter size-full wp-image-259" src="https://www.alfonsobeato.net/wp-content/uploads/2018/03/line1.svg" /></a><figcaption class="wp-caption-text"><center>Fig. 8: Roots for \(i^{0.1i}\), \(F(t)\), and spirals for k=-1,1</center><br /></figcaption></figure>
<p>That something like this can produce real numbers is a curiosity that has intrigued historically mathematicians (\(i^i\) has real values too!). And with this I finish the post. It is really amusing to start playing with the values of \(w\) and \(z\), if you want to do so you can use the <a href="https://github.com/alfonsosanchezbeato/exponential-spiral" target="_blank">python scripts</a> I pointed to in the beginning of the post. I hope you enjoyed the post as much as I did writing it.</p>