Re: [sympy] Simple methods for row operations

2022-11-09 Thread S.Y. Lee
This could be similar and have applications like intrinsic functions . In lower-level programming, it is often more efficient to use more specific methods (like unsigned + unsigned addition, scalar and vector multiplication, vector and vector

Re: [sympy] Simple methods for row operations

2022-11-05 Thread Chris Smith
See also 'elementary_row_op' and consider storing the string hints as 'mul, swap, add' and redefine (for typing convenience) the method as `do`: mul = "n->kn" swap = "n<->m" add = "n->n+km" Matrix.do = Matrix.elementary_row_op e=eye(3) assert e.do(mul, 0, 5) == Matrix([[5, 0, 0], [0, 1, 0], [0,

Re: [sympy] Simple methods for row operations

2022-11-04 Thread Phil Williams
Thank you all for the responses! This is all very helpful. Jonathan: I'll check out Algebra-with-Sympy. Looks interesting. Thanks for sharing. Oscar and Aaron: a bit on what I'm doing in the class. My approach is basically to convince them that using Python and Jupyter is easier and more

Re: [sympy] Simple methods for row operations

2022-11-04 Thread Chris Smith
Instead of redefining the class, why not use Python's ability to modify the class directly. Use the built-in `row_op` in the sugar you wish to add: >>> row_add = lambda M,i,j,m=1: M.row_op(i,lambda v,k: v+m*M[j,k]) >>> Matrix.row_add = row_add >>> N = eye(3) >>> N.row_add(0,1); N

Re: [sympy] Simple methods for row operations

2022-11-04 Thread Aaron Meurer
On Fri, Nov 4, 2022 at 11:28 AM Oscar Benjamin wrote: > > On Fri, 4 Nov 2022 at 14:23, Phil Williams wrote: > > Hi Phil, > > > I use sympy for matrix calculations in my Finite Math class that I teach. I > > have students working in a Jupyter Notebook. What I want is a > > student-friendly

Re: [sympy] Simple methods for row operations

2022-11-04 Thread Oscar Benjamin
On Fri, 4 Nov 2022 at 14:23, Phil Williams wrote: Hi Phil, > I use sympy for matrix calculations in my Finite Math class that I teach. I > have students working in a Jupyter Notebook. What I want is a > student-friendly interface for in-place row operations on matrices, so that > they can

Re: [sympy] Simple methods for row operations

2022-11-04 Thread gu...@uwosh.edu
If there is a need to extend sympy operations in a jupyter friendly manner, it might also be possible to add the operations you want to the Algebra-with-Sympy package. The hope is the user interface utilities will eventually be incorporated into

Re: [sympy] Simple methods for row operations

2022-11-04 Thread kuldeepborkarjr765
I would suggest you can open an issue on sympy git repository issues tab https://github.com/sympy/sympy/issues and describe which new feature you would like to add in SymPy and discuss there for a bit if that could be implemented in SymPy or not and then to get started working on that issue you

[sympy] Simple methods for row operations

2022-11-04 Thread Phil Williams
I use sympy for matrix calculations in my Finite Math class that I teach. I have students working in a Jupyter Notebook. What I want is a student-friendly interface for in-place row operations on matrices, so that they can work problems step by step that require these operations (e.g. solving