scipy has an error function that takes complex arguments

sage:  import numpy, scipy
sage:  from scipy import special
sage:  j=numpy.complex(0,1)
sage: -j*float(sqrt(pi))*special.erf(2*j)/2
(16.45262776550727+0j)

Unfortunately numpy and sage's complex numbers are not compatible yet.

On Nov 15, 11:32 am, [EMAIL PROTECTED] wrote:
> I posted a link on the trac ticket, to a reasonably precise implementation in 
> C.  It's built to work in Octave, but it would be rather simple to adapt it 
> to, for example, GSL complex numbers.
>
> On Thu, 15 Nov 2007, Fredrik Johansson wrote:
>
> > On Nov 15, 2007 8:49 AM, William Stein <[EMAIL PROTECTED]> wrote:
> >> Unfortunately, Sage does not have an implementation of computing
> >> a numerical approximation of erf(a) when a is not real, as PARI only
> >> provides this function in case a is real, and maxima also seems to
> >> only provide it in that case.   Thus you can't actually numerically 
> >> evaluate
> >> the result at some point.
>
> > mpmath and SymPy's numerics module provide complex erf, though I
> > should note that the implementation is not particularly efficient and
> > may lose accuracy in some cases.
>
> > Fredrik
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to