Hi Bill,

On Sat, Nov 15, 2014 at 9:18 AM, Bill Page <bill.p...@newsynthesis.org> wrote:
> On 14 November 2014 14:29, Ondřej Čertík <ondrej.cer...@gmail.com> wrote:
>>
>> On Nov 14, 2014 11:30 AM, "Bill Page" <bill.p...@newsynthesis.org> wrote:
>>>
>>> What do you mean by "the real derivative"?
>>
>> The absolute value doesn't have a complex derivative, but it has a real
>> derivative, over the real axis.
>>
>
> It seems to me that the concept of "real axis" is rather foreign to
> the algebra.  Assuming conjugate is implemented properly, i.e.
> "algebraically",  what you are actually saying is just that
>
>   z = conjugate(z)

That's fine.

>
>> ...
>>> You are not differentiating with respect to x, you are differentiating
>>> with respect to
>>>
>>>   (z+conjugate(z))/2
>>
>> Is that how you propose to define the derivatives for non-analytic
>> functions? I am a little confused what exactly is your proposal.
>>
>
> I am sorry for the confusion.  What I am proposing is that the
> Wirtinger derivative(s) be considered the fundamental case (valid for
> complex or even quaternion variables). As you noted previously this is
> fine and doesn't change anything for the case of analytic functions.
> If someone wants the derivative of a non-analytic function over a
> given domain that should be called something else.

I still don't understand exactly your proposal. We've played with a
few ideas above, in particular we have considered at least (below d/dz
is the Wirtinger derivative, d/dx and d/d(iy) are partial derivatives
with respect to "x" or "iy" in z=x+i*y) :

1) d/dz
2) d/dz + d/d conjugate(z) = d/dx
3) d/dz - d/d conjugate(z) = d/d(iy)
4) 2 * (d/dz + d/d conjugate(z))
5) 2 * d/dz

Which of these do you propose to use? For analytic functions, only 1)
and 2) reduce to the usual complex derivative. 4) and 5) will be off
by a factor of 2. For example, for a function z^2 we get:

1) 2*z
2) 2*z
3) 2*z
4) 4*z
5) 4*z

Since z^2 is analytic, the correct derivative is 2*z, so 1), 2) and 3)
give the right answer.

For abs(z), we get:

1) conjugate(z) / (2*|z|)
2) Re(z) / |z|
3) -i*Im(z) / |z|
4) 2*Re(z) / |z|
5) conjugate(z) / |z|

When "z" is real, then the (real) derivative of |z|' = z/|z|. We want
our complex formula to be equal to z/|z| if "z" is real. Of the above,
only 2) and 5) is equal to z/|z| when "z" is real. Note that I made a
sign mistake in my previous email regarding 3).


Comparing these two cases, options 1) and 3) are eliminated because
the results for abs(z) do not reduce to the correct real derivative.
Option 4) is eliminated, because it gives wrong results for analytic
functions, as well as it doesn't reduce to the correct real derivative
for abs(z). Option 5) is eliminated because it gives wrong results for
analytic functions.

As such, only option 2) is consistent. For all analytic functions, it
gives the correct complex derivative, and for non-analytic functions,
at least for abs(z) it reduces to the correct real derivative in the
special case when "z" is real, i.e. z = conjugate(z). Note that you
cannot apply z = conjugate(z) to the definition of 2) to obtain the
(incorrect) result 2*d/dz, you need to treat z and conjugate(z)
separately when differentiating and only at the end apply z =
conjugate(z).

It seems to work for other non-analytic functions, for example for
Re(z) = (z+conjugate(z))/2, we get:

2) 1

for Im(z) = (-z+conjugate(z))*i/2 we get:

2) 0

So that all works as expected. To prove that this works for all
non-analytic functions, we just use the fact that d/dz + d/d
conjugate(z) = d/dx, as we talked about above. So we are just
calculating the partial derivative with respect to "x"  (we use the
notation z = x+i*y). When "z" is real, i.e. z = conjugate(z), it
follows that y = 0, and d/dx is just the usual (real) derivative. When
y is non-zero, we still calculate d/dx but using z and conjugate(z).
As shown above, for analytic functions this d/dx derivative is equal
to the complex derivative. For non-analytic functions the complex
derivative doesn't exist, so it's just our definition, but it reduces
to the usual real derivative (which is always equal to d/dx). In one
of my previous emails, I raised a question for non-analytic functions,
why we can't define it in some other way, perhaps d/d(iy), i.e. the
option 3) above. I think the answer is that we can, but it will not
reduce to the real derivative d/dx if "z" is real, simply because
d/d(iy) is not equal to d/dx, unless the function is analytic, i.e. 3)
works for analytic functions, but fails for abs(z), as shown above (as
well as in my previous email --- note again that I made a sign mistake
there).

>
>> I think one either leaves the derivatives of non analytic functions
>> unevaluated,
>
> No, this is just giving up.  We should be able to do much better than that.
>
>> or defines them in such a way that one recovers the real derivative
>> as a special case, as long as there are no inconsistencies.
>>
>
> Yes exactly, the concept of "real derivative" is a special case.

Hopefully the above clarifies, that from everything that we have
considered so far, only the option 2) can work. It turns out that
that's also precisely what also ginac considered for abs(z)'. So the
conclusion seems clear --- simply use 2) for any function, be it
analytic or not.



However, Bill, from your emails, you seem to be giving conflicting
statements. It seems you agree that 2) is the way to go in some
emails, but then in some other emails you write:

> It seems to me that we should forget about x and y.  All we really need is
>
>  |z|'  = d |z| / d z = conjugate(z) / (2*|z|)

Which is the case 1) above, and it is shown that it doesn't work.

Right in the next paragraph you wrote:

>
> The constant 1/2 is irrelevant.

What do you mean that the constant 1/2 is irrelevant? I think it is
very relevant, as it makes the answer incorrect.

Or:

> You are not differentiating with respect to x, you are differentiating
> with respect to
>
>   (z+conjugate(z))/2

But differentiating with respect to (z+conjugate(z))/2 is just the
case 5) above, and it is shown that it doesn't work. While
differentiating with respect to "x" is the case 2) above and it is
shown that it works.

Finally, in your last email you wrote:

> I am sorry for the confusion.  What I am proposing is that the
> Wirtinger derivative(s) be considered the fundamental case (valid for
> complex or even quaternion variables). As you noted previously this is
> fine and doesn't change anything for the case of analytic functions.
> If someone wants the derivative of a non-analytic function over a
> given domain that should be called something else.

I am completely confused with this paragraph. Let's try to clarify this.

When you say "I am proposing that the Wirtinger derivative(s) be
considered the fundamental case", which of the five cases above are
you proposing? Strictly speaking, Wirtinger derivative is the case 1),
but that doesn't work. Are you proposing the case 2) instead?

> As you noted previously this is
> fine and doesn't change anything for the case of analytic functions.

Correct, cases 1), 2) and 3) don't change anything for analytic functions.

> If someone wants the derivative of a non-analytic function over a
> given domain that should be called something else.

Are you proposing to only consider analytic functions? I thought the
whole conversation in this thread was about how to extend this to
non-analytic functions... If you only consider analytic functions,
then we don't need Wirtinger derivatives at all, since we can just use
the usual complex derivative, as is already the case in most CAS
systems. Of course, then we need to leave abs(z) unevaluated, as it is
not analytic.

I thought the goal was rather to extend the definition of "derivative"
to also apply for non-analytic functions, in the whole complex domain
in such a way, so that it reduces to a complex derivative for analytic
functions, and a real derivative if we restrict "z" to be real. It
seems that 2) above is one such definition that would allow that.

Bill, would you mind clarifying the above misunderstandings? I think
we are on the same page, probably we both just understood something
else with the terminology we used, but I want to make 100% sure.

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.

Reply via email to