On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík <ondrej.cer...@gmail.com> wrote: > Hi Bill, > > On Thu, Nov 13, 2014 at 10:16 AM, Bill Page <bill.p...@newsynthesis.org> > wrote: >> It has always seemed very inconvenient to me that "computer algebra >> programs such as Mathematica" choose to define derivative as >> complex-derivative. I believe a reasonable alternative is what is >> known as a Wirtinger derivative. Wirtinger derivatives exist for all >> continuous complex-valued functions including non-holonomic functions >> and permit the construction of a differential calculus for functions >> of complex variables that is analogous to the ordinary differential >> calculus for functions of real variables >> >> http://en.wikipedia.org/wiki/Wirtinger_derivatives >> >> Wirtinger derivatives come in conjugate pairs but we have >> >> f(x).diff(conjugate(x)) = conjugate(conjugate(f(x).diff(x)) >> >> so we really only need one derivative given an appropriate conjugate >> function. The Cauchy-Riemann equations reduce to >> >> f(x).diff(conjugate(x)) = 0 >> >> I also like that abs is related to the sgn function >> >> abs(x).diff(x) = x/abs(x) >> >> This is consistent with >> >> abs(x)=sqrt(x*conjugate(x)) >> >> The Wirtinger derivative of abs(x) is 1/2 x/abs(x). Its total >> Wirtinger derivative is x/abs(x). >> >> I have implemented conjugate and Wirtinger derivatives in FriCAS >> >> http://axiom-wiki.newsynthesis.org/SandBoxWirtinger >> >> Unfortunately I have not yet been able to convince the FriCAS >> developers of the appropriateness of this approach. I would be happy >> to find someone with whom to discuss this further, pro and con. The >> discussion on the FriCAS email list consisted mostly of the related >> proper treatment of conjugate without making explicit assumptions >> about variables. > > Thanks for your email! I haven't talked to you in a long time. > Literally just today I learned about Wirtinger derivatives. The > wikipedia page is *really* confusing to me. It took me a while to > realize, that Wirtinger derivatives is simply the derivative with > respect to z or conjugate(z). I.e. > > z = x + i*y > conjugate(z) = x - i*y > > From this it follows: > > x = 1/2*(z + conjugate(z)) > y = i/2*(-z+conjugate(z)) > > Then I take any function and write it in terms of z and conjugate(z), > some examples: > > |z| = sqrt(z*conjugate(z)) > Re z = x = 1/2 * (z + conjugate(z)) > z^2 = (x+i*y)^2 > > And then I simply differentiate with respect to z or conjugate(z). > This is called the Wirtinger derivative. So: > > d|z|/dz = d sqrt(z*conjugate(z)) / dz = 1/2*conjugate(z) / |z| > > As you said, the function is analytic if it doesn't functionally > depend on conjugate(z), as can be shown easily. So |z| or Re z are not > analytic, while z^2 is. If the function is analytic, then df/d > conjugate(z) = 0, and df/dz is the complex derivative. Right?
To elaborate on this point, if the function has a complex derivative (i.e. it is analytic), then the complex derivative f'(z) = \partial f / \partial x. So to calculate a complex derivative with respect to z=x+i*y, we just need to differentiate with respect to x. It can be shown, that the Wirtinger derivatives df/dz is equal to \partial f / \partial x for analytic functions, i.e. when df/d conjugate(z) = 0. So in a CAS, we can simply define the derivative f'(z) as \partial f / \partial x for any function, even if it doesn't have a complex derivative. For any function we can show that: \partial f / \partial x = d f / d z + d f / d conjugate(z) Bill, is this what you call the "total Wirtinger derivative"? For example, for |z| we get: |z|' = \partial |z| / \partial x = d |z| / d z + d |z| / d conjugate(z) = conjugate(z) / (2*|z|) + z / (2*|z|) = Re(z) / |z| Using our definition, this holds for any complex "z". Then, if "z" is real, we get: |z|' = z / |z| Which is exactly the usual real derivative. Bill, is this what you had in mind? That a CAS could return the derivative of abs(z) as Re(z) / abs(z) ? Ondrej > > So for analytic functions, Wirtinger derivative gives the same answer > as Mathematica. For non-analytic functions, Mathematica leaves it > unevaluated, but Wirtinger derivative gives you something. > > How do you calculate the total Wirtinger derivative? How is that defined? > > Because I would like to get > > d|x| / d x = x / |x| > > for real x. And I don't see currently how is this formula connected to > Wirtinger derivatives. Finally, the derivative operator in a CAS could > return Wirtinger derivatives, I think it's a great idea, if somehow we > can recover the usual formula for abs(x) with real "x". > > What are the cons of this approach? > > Ondrej -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.