From: SourceForge.net <noreply@so...>  20050130 22:27:00

Bugs item #1045514, was opened at 20041012 11:38 Message generated for change (Comment added) made by macrakis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1045514&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: conjugate(complex) wrong Initial Comment: declare(z,complex) conjugate(z) > z  should be nounform (conjugate loaded from EIGEN)  Comment By: Stavros Macrakis (macrakis) Date: 20050130 17:26 Message: Logged In: YES user_id=588346 I am not sure why you mention lists and matrices  all Maxima functions are supposed to handle those cases (though admittedly they don't all do it). For all *analytic* functions and real variables, the current definition is correct, and often gives far smaller expressions than using rectform would. However, it is incorrect for nonanalytic functions (like carg) and nonreal variables. For that matter, rectform also assumes that functions it doesn't know always have purereal values. Try, for example, realpart(f(%i)) or rp(%i!). It is straightforward enough to write a proper $conjugate function that takes that into account  most of the work would in fact go into establishing the list of analytic functions!: though there is in principle a Maxima feature 'analytic', it is not used at all currently. It is not clear what the right thing to do about unknown functions is. In general, Maxima assumes that functions and variables are realvalued  even if the function arguments are nonreal. We probably don't want rectform(f(x)) for unknown f and x to return 'realpart(f(x)) + 'imagpart(f(x))*%i.... But returning that only if x is known nonreal seems arbitrary, too. Consider realpart(f(x)) => f(x) ... where f turns out to be sqrt.  Comment By: Nobody/Anonymous (nobody) Date: 20050130 17:25 Message: Logged In: NO I am not sure why you mention lists and matrices  all Maxima functions are supposed to handle those cases (though admittedly they don't all do it). For all *analytic* functions and real variables, the current definition is correct, and often gives far smaller expressions than using rectform would. However, it is incorrect for nonanalytic functions (like carg) and nonreal variables. For that matter, rectform also assumes that functions it doesn't know always have purereal values. Try, for example, realpart(f(%i)) or rp(%i!). It is straightforward enough to write a proper $conjugate function that takes that into account  most of the work would in fact go into establishing the list of analytic functions!: though there is in principle a Maxima feature 'analytic', it is not used at all currently. It is not clear what the right thing to do about unknown functions is. In general, Maxima assumes that functions and variables are realvalued  even if the function arguments are nonreal. We probably don't want rectform(f(x)) for unknown f and x to return 'realpart(f(x)) + 'imagpart(f(x))*%i.... But returning that only if x is known nonreal seems arbitrary, too. Consider realpart(f(x)) => f(x) ... where f turns out to be sqrt.  Comment By: Robert Dodier (robert_dodier) Date: 20050129 13:15 Message: Logged In: YES user_id=501686 The defn of conjugate is conjugate(x) := sublis('([%i =  %i]), x)$ which is useful since it can be applied to lists and matrices (among other objects) but it seems too simpleminded. The defn above can yield a wrong answer if its argument is a real function of a complex variable. E.g., conjugate('carg(a+b %i)) yields 'carg (ab %i)  oops. Maybe the right answer is to kill off the existing defn and replace it with conjugate(x) := realpart(x)  %i*imagpart(x)$ ?? realpart and imagpart know about lists and matrices, maybe other objects, so the convenience of the existing defn doesn't seem compelling. Also realpart and imagpart know about carg (as they should).  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1045514&group_id=4933 