[Python-ideas] Re: basic matrix object

2020-08-23 Thread Stephen J. Turnbull
Oscar Benjamin writes: > On Mon, 17 Aug 2020 at 07:14, Stephen J. Turnbull > wrote: > > SymPy. > > > > Except that in this conversation, "linear algebra" is likely neither > > restricted to linearity nor so much algebraic as computational, so > > SymPy likely won't do. :-/ > SymPy is exa

[Python-ideas] Re: basic matrix object

2020-08-23 Thread Oscar Benjamin
On Mon, 17 Aug 2020 at 07:14, Stephen J. Turnbull wrote: > > Christopher Barker writes: > > > Anyway, I would like to see a nice linear algebra lib -- but not 'cause I'd > > use it, only because I find it interesting. > > SymPy. > > Except that in this conversation, "linear algebra" is likely ne

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Christopher Barker
On Sun, Aug 16, 2020 at 11:20 PM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > It's getting the fiddly stuff right (numerical stability and accuracy, > catching edge cases in algorithms) so that you can use it with > confidence for work that has consequences if you get it wro

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Stephen J. Turnbull
Greg Ewing writes: > On 16/08/20 4:26 am, Ricky Teachey wrote: > > There are certainly > > instances where I've needed to used matrices to solve a system of > > equations in an automated way. But most of time it's simply not needed, > > If we're going to have a class that supports matrix

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Stephen J. Turnbull
Christopher Barker writes: > Anyway, I would like to see a nice linear algebra lib -- but not 'cause I'd > use it, only because I find it interesting. SymPy. Except that in this conversation, "linear algebra" is likely neither restricted to linearity nor so much algebraic as computational, so

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Christopher Barker
On Sun, Aug 16, 2020 at 10:50 AM David Mertz wrote: > What is happening in the discussion is that each potential user who > comments finds some related capability that is relevant to their particular > needs. But the union of all those wishes is something substantially > large... Maybe not NumPy

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Ricky Teachey
On Sun, Aug 16, 2020 at 1:19 AM Christopher Barker wrote: Well, I was trained and an engineer, but now call myself an oceanographer, but in any case, I don't need to submit my calculations for review to anyone. Though I do need to present algorithms / calculations / methods in written form that

[Python-ideas] Re: basic matrix object

2020-08-16 Thread David Mertz
The more this discussion goes on, the more convinced I am of my initial opinion. A matrix library doesn't belong in the standard library. What is happening in the discussion is that each potential user who comments finds some related capability that is relevant to their particular needs. But the u

[Python-ideas] Re: basic matrix object

2020-08-16 Thread Tobias Kohn
+1 for the idea of a module for matrices and vectors in the stdlib. One aspect that I would like to highlight is that NumPy is not always so easily available. I got feedback from many schools that they were using tablet computers or something like Chrome books and thus basically limited to anyt

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Christopher Barker
Well, I was trained and an engineer, but now call myself an oceanographer, but in any case, I don't need to submit my calculations for review to anyone. Though I do need to present algorithms / calculations / methods in written form that others can understand -- so a similar problem. But frankly,

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Greg Ewing
On 16/08/20 4:26 am, Ricky Teachey wrote: There are certainly instances where I've needed to used matrices to solve a system of equations in an automated way. But most of time it's simply not needed, If we're going to have a class that supports matrix multiplication, I think we should at leas

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Stefano Borini
On Fri, 14 Aug 2020 at 05:37, Guido van Rossum wrote: > My own strawman would be to limit a Matrix to 2-dimensionality -- I believe > that even my college linear algebra introduction (for math majors!) didn't > touch upon higher dimensionality, and I doubt that what I learned in high > school

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Ricky Teachey
On Sat, Aug 15, 2020, 11:20 AM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > Ricky Teachey writes: > > > Well keep in mind that generally an engineer submits calculations-- not > > code-- to be reviewed. This leaves me with a few options: > > [...] > > > Hiding the portion

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Stephen J. Turnbull
Ricky Teachey writes: > Well keep in mind that generally an engineer submits calculations-- not > code-- to be reviewed. This leaves me with a few options: [...] > Hiding the portion of code that looks too much like programming (and not > enough like equations) takes some time, but if I do n

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Ricky Teachey
On Fri, Aug 14, 2020 at 1:32 PM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > Ricky Teachey writes: > > > I'll try to speak to [what would engineers use a matrix library > > for] below. > > I don't get it. Among other things, the object uwt_per_ft isn't > defined. I think

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Stephen J. Turnbull
Ricky Teachey writes: > I'll try to speak to [what would engineers use a matrix library > for] below. I don't get it. Among other things, the object uwt_per_ft isn't defined. I think it's a typo for the one-dimensional array γ_per_foot, but not sure. I don't see any advantage to numpy or a m

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Stephen J. Turnbull
Guido van Rossum writes: > That's food for thought. Thank you. Let me confirm to the proponents that "food for thought" is all I intended. I know a fair amount about statistics, and almost as much about linear algebra, but nothing about physics or engineering. > Certainly I trust [Steven D'A

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Greg Ewing
On 14/08/20 9:05 pm, Marco Sulla wrote: Another big problem with tensors is the covariance and contravariance. Usually in informatic you denote the covariance with the subscript operator, that on paper is written as subscript. Contravariant index on the contrary is a superscript. Not sure how a p

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Greg Ewing
Another class of folks who might find something like this useful is those playing around with computer graphics using pygame, pyglet, etc. where coordinate transformations are used a lot. Bringing in numpy for that can seem like massive overkill for a tiny game. -- Greg __

[Python-ideas] Re: basic matrix object

2020-08-14 Thread fribl
In my role as an engineering professor and instructor, I find linear algebra to be essential. To my knowledge, almost any book on engineering mathematics contains a large section on linear algebra. numpy is an extremely useful package, but is overwhelming for some novices (e.g. dealing with the

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Ricky Teachey
On Fri, Aug 14, 2020, 12:05 AM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > I cannot speak to engineering uses of matrix computations. If someone > produces use cases that fit into the list of operations proposed > (addition, negation, multiplication, inverse, transposition

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Marco Sulla
Excuse me, I sent this message from the wrong email address: On Fri, 14 Aug 2020 at 09:24, Steven D'Aprano wrote: > Tensors generalise matrices to an arbitrary number of > dimensions, 3D and above. > > https://medium.com/@quantumsteinke/whats-the-difference-between-a-matrix-and-a-tensor-4505fbdc5

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Marco Sulla
LaTeX for example uses the underscore for subscripts and the ^ for the superscript. This is not acceptable, since Python (and almost all languages) uses [] for subscript, and ^ in Python is the XOR logical operator. ___ Python-ideas mailing list -- pytho

[Python-ideas] Re: basic matrix object

2020-08-14 Thread Steven D'Aprano
On Thu, Aug 13, 2020 at 09:33:46PM -0700, Guido van Rossum wrote: > That's food for thought. I have to admit that I have forgotten almost > everything about linear algebra that I was ever taught In Australia, at least, secondary schools don't spend a lot of time teaching matrices for linear alge

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Marco Sulla
On Fri, 14 Aug 2020 at 03:16, Steven D'Aprano wrote: > Funny you mention this, I have been working on a Matrix object for > precisely the use-case you discuss (secondary school maths), where > performance is not critical and the dimensions of the matrix is > typically single digits. This is reall

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Guido van Rossum
That's food for thought. I have to admit that I have forgotten almost everything about linear algebra that I was ever taught -- and I was never taught numerical accuracy concerns in this context, since we were allowed to use only pencil and paper (in high school as well as college), so the problems

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Stephen J. Turnbull
Guido van Rossum writes: > I was going to say that such a matrix module would be better of in > PyPI, but then I recalled how the statistics module got created, > and I think that the same reasoning from PEP 450 applies here too > (https://www.python.org/dev/peps/pep-0450/#rationale). > > So

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Guido van Rossum
I was going to say that such a matrix module would be better of in PyPI, but then I recalled how the statistics module got created, and I think that the same reasoning from PEP 450 applies here too ( https://www.python.org/dev/peps/pep-0450/#rationale). So I'd say go for it! I think it would even b

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Matthias Bussonnier
numpy arrays are ... arrays, if you want * to do matmul, use numpy.matrix (which is soft deprecated since now we have @), and will do what you expect with square matrix times vector. broadcasting is the natural extension of array `op` scalar on... arrays. Say you have an array Pressure with 3 coo

[Python-ideas] Re: basic matrix object

2020-08-13 Thread Steven D'Aprano
On Thu, Aug 13, 2020 at 11:17:00PM +0100, Stefano Borini wrote: > The math module has plenty of mathematical functions that are very > interesting, but no Matrix object. Funny you mention this, I have been working on a Matrix object for precisely the use-case you discuss (secondary school maths)

[Python-ideas] Re: basic matrix object

2020-08-13 Thread David Mertz
This is a lot to add to Python itself to poorly reproduce well-tested functionally in a very popular library. There are many Python distributions that come with that extra battery included, just not the one from the PSF. On Thu, Aug 13, 2020, 6:20 PM Stefano Borini wrote: > Excuse me if I am out