TransWikia.com

How to get smooth square root of complex valued function?

Mathematica Asked on September 17, 2020

Let $f(x)$ be smooth complex valued function with real argument $xin[0,1]$.
I want to get square root $g(x)=pmsqrt{f(x)}$ where the sign is chosen so that g(x) is smooth. How can I do that?

In Mathematica, the branch cut of square root is on negative reals. Thus, for example, I want to flip the sign if $f(x)$ cross negative reals in complex plane when $x$ increases.

One Answer

The problem can be reduced (I think) to the problem of defining a phase function $arg(f(x))$ that is continuous on the interval $x in [0, 1]$. This is tricky, because the path $f(x)$ may "wind" around the origin, leading to different values of the "continuous argument" for the same value of the "conventional argument". A successful "continuous argument" function will need to "keep track of the history" of the function $f(x)$, so that it "knows" whether the phase along the positive real axis should be $0$, $2 pi$, or something else.

One way to do this is to note that although the conventional Arg function is discontinuous along the negative real axis, its derivative is continuous. Specifically, since $arg(f(x)) = Im ln(f(x))$, we have $$ frac{d}{dx} left[ arg(f(x)) right] = Im left[ frac{f'(x)}{f(x)} right]. $$ We can treat this as a differential equation for $arg(f(x))$; if we integrate it, we'll get a "continuous argument" function. $$ tilde{arg}(f(x)) equiv arg(f(0)) + int_0^x Im left[ frac{f'(t)}{f(t)} right] , dt. $$ With this in hand, we can then define $$ g(x) = sqrt{|f(x)|} e^{i tilde{arg}(f(x))/2} $$ and this function will be continuous.


Implementation:

I will test this function on $f(x) = e^{4 pi i x}$. Difficulties may arise for more complicated functions, particularly those which have roots where $f(x) = 0$. (However, I believe that no smooth $g(x)$ can be defined in such cases anyhow.)

Continuous argument function:

contarg[f_] :=
  Arg[f[0]] + Integrate[Im[f'[t]/f[t]], {t, 0, #}] &;
f[x_] = Exp[4 [Pi] I x];
Plot[{Arg[f[x]], Evaluate[contarg[f][x]]}, {x, 0, 1}]

enter image description here

Continuous square root:

contsqrt[f_] := Sqrt[Abs[f[#]]] Exp[I contarg[f][#]/2] &
contsqrt[f][x]
Plot[Evaluate[ReIm[contsqrt[f][x]]], {x, 0, 1}]
Plot[Evaluate[ReIm[Sqrt[f[x]]]], {x, 0, 1}, PlotStyle -> Dashed]

(* E^(2 I [Pi] x) Sqrt[E^(-4 [Pi] Im[x])] *)

enter image description here

enter image description here

For more complicated functions $f(x)$, Mathematica may not be able to perform the integral required to evaluate contarg[f][x]. In such cases, you may have to resort to using NIntegrate instead.

Correct answer by Michael Seifert on September 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP