On Mar 10, 6:36 am, Felix Lawrence <fe...@physics.usyd.edu.au> wrote: > Hi David, > > I haven't looked into these since #3587 rewrote > MathematicaElement._sage_() for mathematica objects, but I did a bit > of work getting the generic ExpectElement._sage_() to work with > mathematica lists. Mathematica does return different results > depending on whether it's running in 32-bit or 64 bit modes. This was > on a mac. > > Furthermore I recall seeing complex numbers from mathematica commonly > printed with the imaginary part first. Futhermore for particularly > long outputs from mathematica, it would seemingly randomly intersperse > '\n' new line characters with '\r\n' new line characters, which would > mess up any sage_eval()s. > > So don't expect mathematica to give consistent, well-behaved output! > > BTW > sage: def math_bessel_K(nu,x): > ... return mathematica(nu).BesselK(x).N(20).sage() > ... > sage: math_bessel_K(2,I) > > now gives me an error: NotImplementedError: Unable to parse > Mathematica output: > -2.5928861754911969781676606702635284285719718407749199115289`20.149465350282203 > + > > 0.1804899720669620266296208808560650432663536549483055754141`18.99213497581376*i > > Does this work on anyone else's machine? I think #3587 may be > responsible for the breakage. I'll look into this. > > Cheers, > Felix
I got that failure - I think I reported it here. There may be some way of getting a consistent output. I'll ask on sci.math.symbolic, where some Wolfram Research employees hang out. It may be the only way to get a semi-consistant result is to use the Mathlink protocol, but that would require linking to a proprietry library, so it could only be possible as an optional package, as otherwise it would breach the GPL. I'm really surprised by the outputting of the imaginary component of a number before the real. Dave -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org