I am trying to plot certain holomorphic functions that contain square and higher roots. In the complex analysis sense, the function $f:z\mapsto z^\alpha$ for some $\alpha\in\mathbb C$ has a phase factor $e^{2\pi i\alpha}$ at $z=0$, which means that on a small circular path around $0$ the function $f$ picks up this factor. Is there a way to implement this in Mathematica?
For instance,
g[z_] = z^4;
Sqrt[g[Exp[Pi I/2]]]
gives 1 as a result, where I would like Mathematica to keep the phase $g(e^{\pi i/2})=e^{2\pi i}$ and then compute
$$\sqrt{g(e^{\pi i/2})}=e^{\pi i}=-1.$$
With Sqrt
or $(\cdot)^{1/2}$ this does not seem possible, as they pick the principal square roots.
Many thanks for your help!
EDIT Here is an example:
lim = 5; dlim = 20;
f1[z_] = Sqrt[z^8];
f2[z_] = z^4;
p1 = ParametricPlot[{Re[f1[1 + d I]], Im[f1[1 + d I]]}, {d, -dlim,
dlim}, PlotRange -> {{-lim, lim}, {-lim, lim}}];
p2 = ParametricPlot[{Re[f2[ 1 + d I]], Im[f2[1 + d I]]}, {d, -dlim,
dlim}, PlotRange -> {{-lim, lim}, {-lim, lim}}];
GraphicsGrid[{{p1, p2}}]
Obviously the functions f1
and f2
are not the same, just as $\sqrt{x^2}=|x|$ is not equal to $x$ on $\mathbb R\ni x$. For my purpose I'm rather interested in a resolution of the square root that leads to a smooth function. The above plots look as follows:
In the left picture one sees points where the function crosses the branch cut of the square root. I am wondering whether there is a way to avoid it, such as in the right picture, without being able to resolve the square root by hand. For instance, if one adds an expression to $z^8$ that contains similar phases, I would like to take a common phase out of the square root, in order not to be affected by the branch cut.
One can also deform the above function to say $f(z)=\sqrt{z^8+\varepsilon}$ for some $\varepsilon>0$. Then there is no way to take the square root for generic $z$, and it is not possible to plot a deformation of the right picture. I am regardless interested in finding a way to do so, such that the right picture is deformed continuously.
The actual interest of mine comes square roots of the modular functions EllipticTheta
and DedekindEta
, which transform under certain fractional linear transformations with phases. Then it is well-defined to have expressions such as $\sqrt{\vartheta_4(z)^8+\varepsilon \vartheta_2(z)^4\vartheta_3(z)^4}$ since both summands transform with the same phases.
All of the above issues come from the fact that Mathematica expresses complex numbers at each step either in Cartesian coordinates or ignores everything modulo $2\pi$ in polar form. It would be nice to find a way to prevent Mathematica from doing this, without having to redefine every single operation. Thanks a lot!
EllipticTheta
andDedekindEta
, which themselves transform under modular transformation with phases. $\endgroup$Sqrt
is not the issue sinceg[Exp[Pi I/2]]
evaluates to1
before theSqrt
sees its input. $\endgroup$