On Aug 3, 5:52 am, Jason Grout <jason-s...@creativetrax.com> wrote: > >> 6. TRANSPOSE/CONJUGATE > >> It seems that implementing this would just involve modifying the > >> __pos__(self) method for complexes, matrices and complex matrices, and > >> I think that both conjugating and transposing are common enough > >> operations to deserve its own operator. > > Numpy has: > > m.T for transpose > m.H for hermitian > m.I for inverse > > (seehttp://www.scipy.org/NumPy_for_Matlab_Users312) > > I think it would be great if we had similar shortcuts. >
I always assumed that the lack of these was just that nobody had bothered to implement them, not that anyone were actually against them? a) At least the .T is so completely ingrained into the NumPy/SciPy community that it would at least be very strange to go with some *other* form of operator (like has been proposed) b) It's Python compatible c) It's incredibly convenient. +1 to .T and .H. BUT, -1 to .I for the inverse, because the *intent* of arr.I * x is almost certainly arr.solve_right(x). Actually taking the inverse, "arr.inverse()", is something you rarely want to do, and in those cases, having to type out "inverse" is a good thing IMO. Just keeping shorthand syntax like that out helps reduce bad habits. (If a .I was supported I'd prefer it to be a "lazy symbolic inverse" that triggered solve_right on multiplication, i.e. a Python-compatible "\"-operator?, but obviously it's better to avoid the question currently.) Dag Sverre -- 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