power TypeErrors

Michael Hudson mwh at python.net
Thu Nov 7 14:06:11 EST 2002


Fernando Pérez <fperez528 at yahoo.com> writes:

> Michael Hudson wrote:
> 
> > For all my mathematical leanings, I still don't really see the point
> > of having complex numbers native to a language.
> 
> Well, other than the fact that not having them is pretty much a slap in the 
> face of everybody who does scientific computing, I guess it doesn't matter. 
> The fact that C lacks native complex numbers is one of the reasons many hard 
> core numerical computing people still frown upon it (not the only one).

Really?  OK.  I was under the impression that while one used complex
numbers heavily in deriving one algorithms, that when it came to
implementing them they weren't an overwhelmingly helpful abstraction
-- that it was often easier to split things up into arrays
real_values, imag_values or something.  Maybe this is just ignorance,
though.

The fact that Python's cmath module is and has remained so numerically
naive for so long suggests that *it* at least 

> The most trivial numerical problem with _real_ numbers can generate complex 
> numbers in its solution (think any random polynomial root finding problem, or 
> just about any eigenvalue problem you can write). 

Yes, of course.  But there are large domains where they are at best
under the hood, too.  What specific problems involve complex input or
output?  [This is just curiosity, it isn't meant to be a roundabout
way of saying "I think you're talking through your hat"].

> Therefore we *NEEED* good complex number support in any language
> that is going to be taken seriously for scientific computing.  I'm
> not sure what your background is,

Algebraic geometry, mainly, plus a little theoretical physics & number
theory.

> but I can tell you that python is gaining _very_ stronng support in
> scientific computing.

Given what I hear of IDL, this doesn't surprise me :)

Cheers,
M.

-- 
  Just put the user directories on a 486 with deadrat7.1 and turn the
  Octane into the afforementioned beer fridge and keep it in your
  office. The lusers won't notice the difference, except that you're
  more cheery during office hours.              -- Pim van Riezen, asr



More information about the Python-list mailing list