On Fri, Nov 21, 2014 at 9:37 AM, Bill Page <bill.p...@newsynthesis.org> wrote:
> On 20 November 2014 22:08, Ondřej Čertík <ondrej.cer...@gmail.com> wrote:
>> On Thu, Nov 20, 2014 at 7:53 PM, Bill Page <bill.p...@newsynthesis.org> 
>> wrote:
>> ...
>>> This problem can be reduced to finding an algorithm to determine
>>> if f(x) is everywhere non-negative. Richardson proves that no such
>>> algorithm exists.
>>
>> I see. But what does this have to do with the derivative of |f(x)| that
>> we are trying to figure out?
>>
>
> This has to do with 'conjugate' in general, not just derivatives of
> expressions containing 'conjugate'.  The problem is that 'conjugate'
> is transcendental but it cannot be written in terms of log and exp.
>
>> As you pointed out, the challenge is that if you include conjugate(x),
>> then you might be out of luck. But aren't you out of luck already if
>> you have abs(x) in the expression in the first place? I.e. taking a
>> derivative is not going to change anything, you are still out of luck.
>>
>
> You are right about the derivative.  But my limited understanding is
> that the strategy is not to avoid 'abs(x)' but rather to avoid 'sin'.
> We cannot similarly avoid 'conjugate' and in general the effect of
> including 'conjugate' is apparently unknown.  But one effect of
> including 'conjugate' is that we can have expressions like
>
>   x+conjugate(x)
>
> which is necessarily real-valued, rather like 'abs(x)' for x
> real-valued is non-negative.  So it would be nice to know, for example
> for any expression composed of x, integers, +, *, sin, and conjugate,
> if there is an algorithm to determine if this expression is everywhere
> real-valued.

I am still confused about one thing: is this issue is already present
in FriCAS before your changes?
Because you can already use conjugate, sin, +, *, ..., even without defining
the derivative for abs(x). I fail to see how defining the
abs(x).diff(x) in the way you did it
can introduce issues that weren't present in the first place.

-----

I have finished the writeup, it starts here (you might want to refresh
your browser
to see the latest changes):

http://www.theoretical-physics.net/dev/math/complex.html#complex-conjugate

and it was implemented with these two PRs:

https://github.com/certik/theoretical-physics/pull/39
https://github.com/certik/theoretical-physics/pull/40

I must say one thing that I like about the "theta" is that it tells
you immediately if the function is analytic or not (if theta is
present it is not, if it is not present, then the expression does not
depend on theta, and thus is analytic). For example, for log(z), the
theta cancels, and so the result 1/z is analytic.

I found a bug in these results from FriCAS:

> (4) -> D(abs(f(x)),x)
>
>              , _      _  ,
>         f(x)f (x) + f(x)f (x)
>
>    (4)  ---------------------
>               2abs(f(x))
>                                                     Type:
> Expression(Integer)
> (5) -> D(abs(log(x)),x)
>
>         _    _
>         xlog(x) + x log(x)
>    (5)  ------------------
>             _
>           2xxabs(log(x))
>                                                     Type:
> Expression(Integer)

The bar must be over the whole f(x) as well as log(x), because
conjugate(log(x)) is only equal log(conjugate(x)) if x is not negative
real number. See the example here:
http://www.theoretical-physics.net/dev/math/complex.html#id1 where I
have it explicitly worked out. You can also check that easily in
Python:

In [1]: from cmath import log

In [2]: x = -1+1j

In [3]: log(x).conjugate()
Out[3]: (0.34657359027997264-2.356194490192345j)

In [4]: log(x.conjugate())
Out[4]: (0.34657359027997264-2.356194490192345j)

In [5]: x = -1

In [6]: log(x).conjugate()
Out[6]: -3.141592653589793j

In [7]: log(x.conjugate())
Out[7]: 3.141592653589793j

In [8]: log(x.conjugate()) - 2*pi*1j
Out[8]: -3.141592653589793j


Where [3] and [4] are equal, but [6] and [7] are not (you need to
subtract 2*pi*i from [7], as in [8], in order to recover [6],
consistent with the formula in the writeup).


Apart from this issue, all other examples that you posted seem to be
correct and agree with my hand based step by step calculation in the
writeup.

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