Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-12-05 Thread Ondřej Čertík
On Fri, Dec 5, 2014 at 1:20 PM, Ondřej Čertík wrote: > Hi Bill, > > I thought about this a lot (essentially I studied complex analysis > from several books as well as consulted with many colleagues) and I > figured out some answers to my questions. > > In the approach (A), you have: > > log(a*b) =

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-12-05 Thread Ondřej Čertík
Hi Bill, I thought about this a lot (essentially I studied complex analysis from several books as well as consulted with many colleagues) and I figured out some answers to my questions. In the approach (A), you have: log(a*b) = log(a) + log(b) What that means is that log() is multivalued, so yo

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 26 November 2014 at 12:58, Ondřej Čertík wrote: > On Wed, Nov 26, 2014 at 10:17 AM, Bill Page > wrote: >> >> 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 implemente

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Ondřej Čertík
On Wed, Nov 26, 2014 at 10:17 AM, Bill Page wrote: > On 25 November 2014 at 14:51, Ondřej Čertík wrote: >> On Tue, Nov 25, 2014 at 11:30 AM, Bill Page >> wrote: > ... > Try it this way: > > a*b = exp(?1) > a = exp(?2) > b = exp(?3) > > I think 'normalize' is sa

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 25 November 2014 at 15:14, Erik Massop wrote: > On Tue, 25 Nov 2014 13:30:33 -0500 > Bill Page wrote: > >> On 25 November 2014 at 01:11, Ondřej Čertík wrote: >> > On Mon, Nov 24, 2014 at 10:23 PM, Bill Page >> > wrote: > ... >> >> But I don't want to be forced to make a choice of branch unt

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-26 Thread Bill Page
On 25 November 2014 at 14:51, Ondřej Čertík wrote: > On Tue, Nov 25, 2014 at 11:30 AM, Bill Page > 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

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-25 Thread Erik Massop
On Tue, 25 Nov 2014 13:30:33 -0500 Bill Page wrote: > On 25 November 2014 at 01:11, Ondřej Čertík wrote: > > On Mon, Nov 24, 2014 at 10:23 PM, Bill Page > > wrote: ... > >> But I don't want to be forced to make a choice of branch until > >> I actually need to evaluate an expression numerically

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-25 Thread Ondřej Čertík
On Tue, Nov 25, 2014 at 11:30 AM, Bill Page wrote: > On 25 November 2014 at 01:11, Ondřej Čertík wrote: >> On Mon, Nov 24, 2014 at 10:23 PM, Bill Page >> wrote: >>> ... >>> I am not very interested in real numbers. I am interested in the >>> algebra. Would you say that >>> >>> sqrt(x^2).dif

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-25 Thread kcrisman
> > > > > This discussion is about how a CAS should handle (complex) > > differentiation. Since it started here, I would finish it here, so > > that the whole thread is in one mailinglist for future reference. > > > > OK. It would be nice to know if other sage-devel subscribers actually > r

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-25 Thread Bill Page
On 25 November 2014 at 01:11, Ondřej Čertík wrote: > On Mon, Nov 24, 2014 at 10:23 PM, Bill Page > wrote: >> ... >> I am not very interested in real numbers. I am interested in the >> algebra. Would you say that >> >> sqrt(x^2).diff(x) = sqrt(x^2)/x >> >> is OK? > > I think so, using the fol

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Ondřej Čertík
On Mon, Nov 24, 2014 at 10:23 PM, Bill Page wrote: > On 24 November 2014 at 17:43, Ondřej Čertík wrote: >> On Mon, Nov 24, 2014 at 1:57 PM, Bill Page >> wrote: >> ... >>> >>> In FriCAS 'abs' is already a kernel function and it implemented the >>> derivative of 'abs' even before my proposed patc

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Bill Page
On 24 November 2014 at 17:43, Ondřej Čertík wrote: > On Mon, Nov 24, 2014 at 1:57 PM, Bill Page wrote: > ... >> >> In FriCAS 'abs' is already a kernel function and it implemented the >> derivative of 'abs' even before my proposed patch but I think the >> current definition is wrong: >> >> (14) ->

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Ondřej Čertík
On Mon, Nov 24, 2014 at 1:57 PM, Bill Page wrote: > On 22 November 2014 at 12:34, Ondřej Čertík wrote: >> On Sat, Nov 22, 2014 at 7:23 AM, Bill Page >> wrote: >>> ... >>> FriCAS currently does not implement a symbolic 'conjugate' operator. >>> The issue concerns whether adding 'conjugate' is a

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-24 Thread Bill Page
On 22 November 2014 at 12:34, Ondřej Čertík wrote: > On Sat, Nov 22, 2014 at 7:23 AM, Bill Page wrote: >> ... >> FriCAS currently does not implement a symbolic 'conjugate' operator. >> The issue concerns whether adding 'conjugate' is a good idea and only >> secondly how to differentiate it. > > A

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-22 Thread Ondřej Čertík
On Sat, Nov 22, 2014 at 7:23 AM, Bill Page wrote: > On 21 November 2014 at 20:18, Ondřej Čertík wrote: >> >> 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

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-22 Thread Bill Page
On 21 November 2014 at 20:18, Ondřej Čertík wrote: > On Fri, Nov 21, 2014 at 9:37 AM, Bill Page wrote: >> >> 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 i

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-22 Thread Bill Page
On 21 November 2014 at 20:18, Ondřej Čertík wrote: > > 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 a

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-21 Thread Ondřej Čertík
On Fri, Nov 21, 2014 at 9:37 AM, Bill Page wrote: > On 20 November 2014 22:08, Ondřej Čertík wrote: >> On Thu, Nov 20, 2014 at 7:53 PM, Bill Page >> wrote: >> ... >>> This problem can be reduced to finding an algorithm to determine >>> if f(x) is everywhere non-negative. Richardson proves that

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-21 Thread Bill Page
On 20 November 2014 22:08, Ondřej Čertík wrote: > On Thu, Nov 20, 2014 at 7:53 PM, Bill Page 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 ha

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-21 Thread Ondřej Čertík
I've written up all the equations from this thread together with detailed step by step derivation: http://www.theoretical-physics.net/dev/math/complex.html e.g. the derivatives are here: http://www.theoretical-physics.net/dev/math/complex.html#complex-derivatives Most of the examples from this

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Ondřej Čertík
On Thu, Nov 20, 2014 at 7:53 PM, Bill Page wrote: > On 20 November 2014 12:56, Ondřej Čertík wrote: >> ... >> Can you give an example of an expression that cannot be decided by >> the Richardson's theorem? > > Well, no not exactly. Richardson's theorem is not about individual > expressions, it i

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
On 20 November 2014 12:56, Ondřej Čertík wrote: > ... > Can you give an example of an expression that cannot be decided by > the Richardson's theorem? Well, no not exactly. Richardson's theorem is not about individual expressions, it is about decidability, i.e. computability, in general. Conside

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Ondřej Čertík
On Thu, Nov 20, 2014 at 9:59 AM, Bill Page wrote: > Perhaps this is more or less where Richardson's theorem enters. > > http://en.wikipedia.org/wiki/Richardson%27s_theorem > > We badly want a reliable way to determine when an expression is > identically zero. In general this is not possible, but i

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
Perhaps this is more or less where Richardson's theorem enters. http://en.wikipedia.org/wiki/Richardson%27s_theorem We badly want a reliable way to determine when an expression is identically zero. In general this is not possible, but if we restrict our selves to a subset of "elementary" function

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Ondřej Čertík
On Thu, Nov 20, 2014 at 9:16 AM, Ondřej Čertík wrote: > On Thu, Nov 20, 2014 at 7:52 AM, Bill Page wrote: >> So here (20) is a simpler expression for derivative of arg: >> >> (16) -> abs(x)==sqrt(x*conjugate(x)) >>Compiled code for abs has been cleared. >>Compiled code for arg has been cl

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Ondřej Čertík
On Thu, Nov 20, 2014 at 7:52 AM, Bill Page wrote: > So here (20) is a simpler expression for derivative of arg: > > (16) -> abs(x)==sqrt(x*conjugate(x)) >Compiled code for abs has been cleared. >Compiled code for arg has been cleared. >1 old definition(s) deleted for function or rule a

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Ondřej Čertík
On Thu, Nov 20, 2014 at 7:41 AM, Bill Page wrote: > On 20 November 2014 01:54, Ondřej Čertík wrote: >> >> What you posted looks good. But we need to test it for arg(z), re(z), >> im(z) and any other non-analytic function that we can find. >> > > (1) -> re(x)==(conjugate(x)+x)/2 >

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
So here (20) is a simpler expression for derivative of arg: (16) -> abs(x)==sqrt(x*conjugate(x)) Compiled code for abs has been cleared. Compiled code for arg has been cleared. 1 old definition(s) deleted for function or rule abs

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-20 Thread Bill Page
On 20 November 2014 01:54, Ondřej Čertík wrote: > > What you posted looks good. But we need to test it for arg(z), re(z), > im(z) and any other non-analytic function that we can find. > (1) -> re(x)==(conjugate(x)+x)/2 Type: Void

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Ondřej Čertík
On Wed, Nov 19, 2014 at 7:36 PM, Bill Page wrote: > On 19 November 2014 21:23, kcrisman wrote: >> >> >>> Since this mostly concerns FriCAS I am cross posting to that group. I will >>> also post the patch there. For FriCAS list reference the original email >>> thread is here: >>> >> >> But if

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 19 November 2014 21:23, kcrisman wrote: > > >> Since this mostly concerns FriCAS I am cross posting to that group. I will >> also post the patch there. For FriCAS list reference the original email >> thread is here: >> > > But if you come up with a solution Sage (or Ginac, or whatever) can

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread kcrisman
> Since this mostly concerns FriCAS I am cross posting to that group. I > will also post the patch there. For FriCAS list reference the original > email thread is here: > > But if you come up with a solution Sage (or Ginac, or whatever) can implement too, please let us know! -- You receive

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
Since this mostly concerns FriCAS I am cross posting to that group. I will also post the patch there. For FriCAS list reference the original email thread is here: https://groups.google.com/forum/#!topic/sage-devel/6j-LcC6tpkE Here is the result of compiling the patch against the current SourceF

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Ondřej Čertík
On Wed, Nov 19, 2014 at 9:42 AM, Ondřej Čertík wrote: > On Wed, Nov 19, 2014 at 9:32 AM, Bill Page wrote: >> OK, this looks better! >> >> (1) -> D(abs(x),x) >> >> _ >> x + x >>(1) --- >> 2abs(x) >> Type: >> Exp

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Ondřej Čertík
On Wed, Nov 19, 2014 at 9:32 AM, Bill Page wrote: > OK, this looks better! > > (1) -> D(abs(x),x) > > _ > x + x >(1) --- > 2abs(x) > Type: > Expression(Integer) > (2) -> D(conjugate(x),y) > >(2) 0 >

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Ondřej Čertík
On Wed, Nov 19, 2014 at 8:19 AM, Bill Page wrote: > > On 2014-11-19 9:36 AM, "Bill Page" wrote: >> ... >> Then I noticed that if we have f=z we get >> >> conjugate(z).diff(z) >> >> which is 0. So the 2nd term is 0 and the result is just the first >> Wirtinger derivative. >> >> Perhaps I am mis

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
OK, this looks better! (1) -> D(abs(x),x) _ x + x (1) --- 2abs(x) Type: Expression(Integer) (2) -> D(conjugate(x),y) (2) 0 Type: Expression(Integer) (3) -

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 2014-11-19 9:36 AM, "Bill Page" wrote: > ... > Then I noticed that if we have f=z we get > > conjugate(z).diff(z) > > which is 0. So the 2nd term is 0 and the result is just the first Wirtinger derivative. > > Perhaps I am misinterpreting something? > Oops, my fault. According to your defi

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-19 Thread Bill Page
On 18 November 2014 21:22, Ondřej Čertík wrote: > On Tue, Nov 18, 2014 at 6:51 PM, Bill Page wrote: >> On 18 November 2014 17:40, Ondřej Čertík wrote: >>> >>> In my notation, the Wirtinger derivative is d f(z) / d z and d f(z) / >>> d conjugate(z). The Df(z) / Dz is the complex derivative taking

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 6:51 PM, Bill Page wrote: > On 18 November 2014 17:40, Ondřej Čertík wrote: >> >> In my notation, the Wirtinger derivative is d f(z) / d z and d f(z) / >> d conjugate(z). The Df(z) / Dz is the complex derivative taking in >> direction theta (where it could be theta=0). Giv

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 17:40, Ondřej Čertík wrote: > > In my notation, the Wirtinger derivative is d f(z) / d z and d f(z) / > d conjugate(z). The Df(z) / Dz is the complex derivative taking in > direction theta (where it could be theta=0). Given the chain rule, as > I derived above using chain rules

[sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread w huang
Hi, With Sage 6.3, I am getting: sage: abs(x).diff(x) x/abs(x) sage: abs(I*x).diff(x) -x/abs(I*x) But abs(I*x) == abs(x). So also abs(x).diff(x) and abs(I*x).diff(x) must be the same. But in the first case we get x/abs(x), and in the second we got -x/abs(x). In SymPy, the answer is: -

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 2:50 PM, Bill Page wrote: > On 18 November 2014 15:19, Ondřej Čertík wrote: >> On Tue, Nov 18, 2014 at 12:14 PM, Bill Page >> wrote: >>> >>> abs(x).diff(x) >>> >>> would return the symbolic expression >>> >>> conjugate(x)/(2*abs(x)) + conjugate(x)/(2*abs(x))* e^{-2*i

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 15:19, Ondřej Čertík wrote: > On Tue, Nov 18, 2014 at 12:14 PM, Bill Page > wrote: >> >> abs(x).diff(x) >> >> would return the symbolic expression >> >> conjugate(x)/(2*abs(x)) + conjugate(x)/(2*abs(x))* e^{-2*i*theta} > > I think you made a mistake, the correct expressio

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 1:19 PM, Ondřej Čertík wrote: > On Tue, Nov 18, 2014 at 12:14 PM, Bill Page > wrote: >> On 18 November 2014 13:41, Ondřej Čertík wrote: >>> On Tue, Nov 18, 2014 at 11:08 AM, Bill Page >>> wrote: ... Have you had a chance to consider the issue of the chain-rul

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 12:14 PM, Bill Page wrote: > On 18 November 2014 13:41, Ondřej Čertík wrote: >> On Tue, Nov 18, 2014 at 11:08 AM, Bill Page >> wrote: >>> ... >>> Have you had a chance to consider the issue of the chain-rule yet? >> >> Yes. Very straightforward, as I suggested in my last

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 14:14, Bill Page wrote: > On 18 November 2014 13:41, Ondřej Čertík wrote: >> On Tue, Nov 18, 2014 at 11:08 AM, Bill Page >> wrote: >>> ... >>> Have you had a chance to consider the issue of the chain-rule yet? >> >> Yes. Very straightforward, as I suggested in my last email.

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 13:41, Ondřej Čertík wrote: > On Tue, Nov 18, 2014 at 11:08 AM, Bill Page > wrote: >> ... >> Have you had a chance to consider the issue of the chain-rule yet? > > Yes. Very straightforward, as I suggested in my last email. Just start with: > > D f / D z = df/dz + df/d conjug

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 11:08 AM, Bill Page wrote: > On 18 November 2014 12:29, Ondřej Čertík wrote: >> On Tue, Nov 18, 2014 at 9:28 AM, David Roe wrote: >>> ... >>> Because derivative is not just used in the context of functions of a >>> complex variable (whether they are analytic or not). Pro

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 12:29, Ondřej Čertík wrote: > On Tue, Nov 18, 2014 at 9:28 AM, David Roe wrote: >> ... >> Because derivative is not just used in the context of functions of a >> complex variable (whether they are analytic or not). Probably more >> than 90% of Sage users don't know any comple

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Ondřej Čertík
On Tue, Nov 18, 2014 at 9:28 AM, David Roe wrote: > On Tue, Nov 18, 2014 at 8:05 AM, Bill Page wrote: >> On 18 November 2014 09:02, David Roe wrote: >>> On Tue, Nov 18, 2014 at 5:57 AM, Bill Page >>> wrote: > I think you are overly focused on trying to define a derivative that >

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread David Roe
On Tue, Nov 18, 2014 at 8:05 AM, Bill Page wrote: > On 18 November 2014 09:02, David Roe wrote: >> On Tue, Nov 18, 2014 at 5:57 AM, Bill Page >> wrote: >>> >>> > I think you are overly focused on trying to define a derivative that >>> > reduces to the conventional derivative of non-analytic fun

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 18 November 2014 09:02, David Roe wrote: > On Tue, Nov 18, 2014 at 5:57 AM, Bill Page wrote: >> >> > I think you are overly focused on trying to define a derivative that >> > reduces to the conventional derivative of non-analytic functions >> > over the reals. >> >> I've just been casually fol

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread kcrisman
> > > I think you are overly focused on trying to define a derivative that > > reduces to the conventional derivative of non-analytic functions over > > the reals. > > I've just been casually following this conversation, but I think it's > important that the derivative of abs(x) be sign(x) not

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread David Roe
On Tue, Nov 18, 2014 at 5:57 AM, Bill Page wrote: > On 17 November 2014 23:16, Ondřej Čertík wrote: >> Hi Bill, >> >> Thanks for the clarification. So your point is that 2) is not >> sufficient, that we really need two Wirtinger derivatives --- it's >> just that one can be expressed using the oth

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-18 Thread Bill Page
On 17 November 2014 23:16, Ondřej Čertík wrote: > Hi Bill, > > Thanks for the clarification. So your point is that 2) is not > sufficient, that we really need two Wirtinger derivatives --- it's > just that one can be expressed using the other and a conjugate, > so perhaps CAS can only return one,

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread Ondřej Čertík
Hi Bill, Thanks for the clarification. So your point is that 2) is not sufficient, that we really need two Wirtinger derivatives --- it's just that one can be expressed using the other and a conjugate, so perhaps CAS can only return one, but a chain rule needs modification and probably some other

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread Bill Page
On 17 November 2014 15:17, Ondřej Čertík wrote: > On Sat, Nov 15, 2014 at 9:18 AM, Bill Page 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

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread Ondřej Čertík
> 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)

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread Ondřej Čertík
Hi Bill, On Sat, Nov 15, 2014 at 9:18 AM, Bill Page wrote: > On 14 November 2014 14:29, Ondřej Čertík wrote: >> >> On Nov 14, 2014 11:30 AM, "Bill Page" wrote: >>> >>> What do you mean by "the real derivative"? >> >> The absolute value doesn't have a complex derivative, but it has a real >> der

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread kcrisman
> Vladimir V. Kisil kisilv's patch > > http://www.ginac.de/pipermail/ginac-devel/2013-November/002053 > > looks like a good start to me especially if one doesn't want to > consider the issue of derivatives of non-analytic functions in > general. > > http://www.ginac.de/pipermail/ginac-devel/

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread Bill Page
Vladimir V. Kisil kisilv's patch http://www.ginac.de/pipermail/ginac-devel/2013-November/002053 looks like a good start to me especially if one doesn't want to consider the issue of derivatives of non-analytic functions in general. On 17 November 2014 10:14, kcrisman wrote: > For reference (sin

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-17 Thread kcrisman
For reference (since Sage uses Ginac for most derivatives) see http://www.cebix.net/pipermail/ginac-devel/2014-April/002105.html -- 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, sen

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-15 Thread Bill Page
On 14 November 2014 14:29, Ondřej Čertík wrote: > > On Nov 14, 2014 11:30 AM, "Bill Page" 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 "re

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-14 Thread Ondřej Čertík
On Nov 14, 2014 11:30 AM, "Bill Page" wrote: > > On 14 November 2014 13:18, Ondřej Čertík wrote: > > > > On Nov 14, 2014 8:57 AM, "Bill Page" wrote: > >> > >> 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|) > >> >

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-14 Thread Bill Page
On 14 November 2014 13:18, Ondřej Čertík wrote: > > On Nov 14, 2014 8:57 AM, "Bill Page" wrote: >> >> 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|) >> >> and the appropriate algebraic properties of conjugate. > > Sur

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-14 Thread Ondřej Čertík
On Nov 14, 2014 8:57 AM, "Bill Page" wrote: > > On 14 November 2014 02:19, Ondřej Čertík wrote: > > On Fri, Nov 14, 2014 at 12:14 AM, Ondřej Čertík wrote: > >> ... > >> Ok, thanks for the confirmation. > >> > >> There is an issue though --- since |z| is not analytic, the > >> derivatives depend

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-14 Thread Bill Page
On 14 November 2014 02:19, Ondřej Čertík wrote: > On Fri, Nov 14, 2014 at 12:14 AM, Ondřej Čertík > wrote: >> ... >> Ok, thanks for the confirmation. >> >> There is an issue though --- since |z| is not analytic, the >> derivatives depend on the direction. So along "x" you get > > |z|' = \partial

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Ondřej Čertík
On Fri, Nov 14, 2014 at 12:14 AM, Ondřej Čertík wrote: > On Thu, Nov 13, 2014 at 6:56 PM, Bill Page wrote: >> Sorry, I hit send before I was quite ready. To continue ... >> >> On 13 November 2014 19:24, Ondřej Čertík wrote: >>> On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík >>> wrote: >>> ...

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Ondřej Čertík
On Thu, Nov 13, 2014 at 6:56 PM, Bill Page wrote: > Sorry, I hit send before I was quite ready. To continue ... > > On 13 November 2014 19:24, Ondřej Čertík wrote: >> On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík >> wrote: >> ... >> For example, for |z| we get: >> >> |z|' = \partial |z| / \pa

Fwd: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Bill Page
Sorry, I hit send before I was quite ready. To continue ... On 13 November 2014 19:24, Ondřej Čertík wrote: > On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík > wrote: > ... > For example, for |z| we get: > > |z|' = \partial |z| / \partial x = d |z| / d z + d |z| / d > conjugate(z) = conjugate(z

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Bill Page
On 13 November 2014 19:24, Ondřej Čertík wrote: > On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík > wrote: >> >> 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

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Ondřej Čertík
On Thu, Nov 13, 2014 at 2:00 PM, Ondřej Čertík wrote: > Hi Bill, > > On Thu, Nov 13, 2014 at 10:16 AM, Bill Page > 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 rea

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Ondřej Čertík
Hi Bill, On Thu, Nov 13, 2014 at 10:16 AM, Bill Page 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.

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Bill Page
On 13 November 2014 12:16, Bill Page wrote: > > The Wirtinger derivative of abs(x) is 1/2 x/abs(x). Its total > Wirtinger derivative is x/abs(x). > Sorry, I should have written that the Wirtinger derivative of abs(x) is 1/2 conjugate(x)/abs(x) Bill. -- You received this message because you

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Bill Page
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 functio

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-13 Thread Ondřej Čertík
Yes. Note also here: http://mathworld.wolfram.com/AbsoluteValue.html which says that complex derivative of d|z|/dz does not exist, as Cauchy-Riemann equations do not hold for Abs(z). And: "As a result of the fact that computer algebra programs such as Mathematica generically deal with complex va

Re: [sage-devel] Bug in abs(I*x).diff(x)

2014-11-12 Thread Clemens Heuberger
possibly related to http://trac.sagemath.org/ticket/12588 ? Regards, CH Am 2014-11-13 um 06:19 schrieb Ondřej Čertík: > Hi, > > With Sage 6.3, I am getting: > > sage: abs(x).diff(x) > x/abs(x) > sage: abs(I*x).diff(x) > -x/abs(I*x) > > But abs(I*x) == abs(x). So also abs(x).diff(x) and abs(I*

[sage-devel] Bug in abs(I*x).diff(x)

2014-11-12 Thread Ondřej Čertík
Hi, With Sage 6.3, I am getting: sage: abs(x).diff(x) x/abs(x) sage: abs(I*x).diff(x) -x/abs(I*x) But abs(I*x) == abs(x). So also abs(x).diff(x) and abs(I*x).diff(x) must be the same. But in the first case we get x/abs(x), and in the second we got -x/abs(x). In SymPy, the answer is: In [1]: ab