On Wed, Nov 26, 2014 at 10:17 AM, Bill Page <bill.p...@newsynthesis.org> wrote: > On 25 November 2014 at 14:51, Ondřej Čertík <ondrej.cer...@gmail.com> wrote: >> On Tue, Nov 25, 2014 at 11:30 AM, Bill Page <bill.p...@newsynthesis.org> >> wrote: > ... >>>>> Try it this way: >>>>> >>>>> a*b = exp(?1) >>>>> a = exp(?2) >>>>> b = exp(?3) >>>>> >>>>> I think 'normalize' is saying that there is a solution that makes >>>>> >>>>> ?1 - ?2 - ?3 = 0. >>>> >>>> Ok, but why wouldn't normalize return 2*pi*i instead? Or 4*pi*i? >>> >>> These are equivalent in the sense of having the same number of >>> algebraically independent transcendental kernels, i.e. none. >> >> I don't understand that. Is the result of normalize() multivalued? > > No. > >> Or how else could 0 be equivalent to 2*pi*i or 4*pi*i? > > It is not equality it is an equivalence relation i.e. "modulo > constants". To dig deeper on this I think would need to consult the > source code and someone who is much more of an expert in this subject: > Waldek Hebisch. > >>>> In other words, how exactly are the operations on the multivalued >>>> sets log(x) defined? >>> >>> FriCAS does not perform operations on multivalued sets to determine >> the above. >> >> Ok. Though my question stands, how are the operations defined in your >> approach? >> > > Does it help if a say the operations are defined "symbolically"?
All I want is if you can give me an algorithm of your approach in sufficient detail, so that it can be implemented by me on a computer. And by "your approach", I mean an approach, where conjugate(log(x)) = log(conjugate(x)) for all x. I have provided all the details of the algorithm (B). In approach (B), it is not true that conjugate(log(x)) = log(conjugate(x)) for all x. This equation (when conjugate(log(x)) = log(conjugate(x)) holds) started this whole discussion. So I was trying to understand your approach how to make this hold for all "x", and I suggested various ways how maybe it could be implemented, and to most of it you said "that's not how FriCAS does it". At this point I don't have any more ideas how it could be done, so I don't know how to implement your approach. Which is sad -- even though I am not advocating for your approach, I wanted to really understand it, so that I can make my own opinion on the pros and cons. > Maybe we need to define exactly what operations we are talking about. Sure. Let's just stick to one example, let me just copy & paste it from my previous email: >>> from cmath import log >>> a = -1 >>> b = -1 >>> log(a*b) 0j >>> log(a)+log(b) 6.283185307179586j >>> def arg(x): return log(x).imag ... >>> from math import floor, pi >>> I = 1j >>> log(a)+log(b)+2*pi*I*floor(( pi-arg(a)-arg(b))/(2*pi)) 0j As you confirmed, even if you evaluate this in FriCAS, log(a*b) is not equal to log(a) + log(b), when a=b=-1. However, you claim that "symbolically" it is true that log(a*b) = log(a) - log(b) for all "a" and "b" and you provided a FriCAS function "normalize" that does it, but you said that for deeper understanding you would need to consult Waldek Hebisch. Can you explain the discrepancy/inconsistency? How exactly are the operations in log(a*b) = log(a) - log(b) defined, so that this equation holds, even though when you put in a=b=-1, you get a different number on the LHS and RHS, as confirmed by FriCAS? Once we resolve this, we can get back to conjugate(log(x)) = log(conjugate(x)) which also clearly doesn't hold for x=-1 for the same reason, and so you must be able to somehow extend the operations so that this equation holds even for x=-1 somehow in your approach. > >> ... >> Essentially the [derivative] formula with theta is equivalent to just >> returning a tuple of the two Wirtinger derivatives. So what holds for >> one approach holds for the other one. >> > > Yes, so we agree that in general more than one derivative operator is > necessary. > >> ... >> My current best solution is to define a function `diff(x, theta=0)`, >> where the theta argument is 0 by default, but you can pass any >> angle into it, or a symbol theta if you want. That way you won't get >> the theta factors by default, but if in doubt, you can always get them. >> > > It seems that you prefer an "infinite" number of derivative operators > while I still think it is best to define only two. The two approaches are equivalent, as I just pointed out. Even if you define only the two Wirtinger derivatives, nothing stops you from adding the theta factor and you also obtain the "infinite" number of derivatives. > >> Let me know if you have a better proposal. >> > > After continued thinking about this and my current experiments in > FriCAS I am still of the opinion that the best option is to implement > just the Wirtinger derivative (only one since the other can be > obtained by 'conjugate'). This has the affect of making the derivative > of non-analytic functions subtly different than what you call the > conventional "real derivative" (e.g. factor of 1/2 in derivative of > 'abs'). I have decided that I would prefer to explain this difference > to a less experienced user, rather than to get into a discussion of > theta and directional derivatives. Cool, thanks. So you propose that abs(x).diff(x) returns conjugate(x)/(2*abs(x)) ? I personally don't think that's a good idea for a CAS, if this was the case, then I would prefer "diff" to return unevaluated, and create a new function diff_wirtinger() that returns conjugate(x)/(2*abs(x)). Then there is no issue. 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.