[sympy] public API for the linear algebra module

2011-07-11 Thread SherjilOzair
For those who've not read my latest blog, I'm working on implementing a new structure for the matrices module of sympy. I faced many decision problems while doing so, like what should be named what and what should be where. Should matrix and linear algebra be separated ? I'm +1 for minimal code

[sympy] Re: How to not print Tuple in function args

2011-07-05 Thread SherjilOzair
+1 for good looking expressions '(...)' instead of 'Tuple(...)'. On Jul 5, 9:05 pm, Mateusz Paprocki matt...@gmail.com wrote: Hi, On 5 July 2011 17:38, Vinzent Steinberg vinzent.steinb...@googlemail.comwrote: On Jul 5, 1:16 pm, Tom Bachmann e_mc...@web.de wrote: I will change the code

[sympy] Re: symbolic matrix differentiaton

2011-06-30 Thread SherjilOzair
Hello Amit, The line of code you have given is not clear. Could you give a more concrete example of a functionality that you're expecting ? If you want to calculate the hessian of a function, Sympy has a hessian function which takes in a function and a list of variables of the function, and

[sympy] Re: Matrix Symbol

2011-06-27 Thread SherjilOzair
Hello Matthew, As Aaron says correctly, work on matrices and work on the matrix symbol is quite separate. The Matrix class provides fundamental operations like addition, multiplication. We only have to make Add, Mul call the required routines in the Matrix class. I'm not sure what .flatten

[sympy] Re: Matrix of finite field

2011-06-21 Thread SherjilOzair
https://github.com/sympy/sympy/pull/444 -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options,

[sympy] Re: Matrix of finite field

2011-06-20 Thread SherjilOzair
on it or not. Regards, Sherjil Ozair [1] https://github.com/sherjilozair/sympy/tree/lilmatrix -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy

[sympy] Re: Matrix of finite field

2011-06-20 Thread SherjilOzair
a lot. I think this implies that matrix over finite fields can be solved for certain or all cases. Will update if I have more good news. Sherjil Ozair On Jun 21, 6:34 am, SherjilOzair sherjiloz...@gmail.com wrote: On Jun 21, 4:45 am, Craig McQueen googlegro...@craig.mcqueen.id.au wrote

[sympy] Re: Uses and Size of Sympy Matrices

2011-06-12 Thread SherjilOzair
On Jun 12, 3:09 am, Vinzent Steinberg vinzent.steinb...@googlemail.com wrote: On 11 Jun., 10:47, SherjilOzair sherjiloz...@gmail.com wrote: Do you require to solve eigenvalue problems of matrices bigger than 4*4 ? How are you doing it currently ? Matrix.diagonalize only works

[sympy] Re: Uses and Size of Sympy Matrices

2011-06-12 Thread SherjilOzair
than the other. Aaron Meurer On Sun, Jun 12, 2011 at 6:49 AM, SherjilOzair sherjiloz...@gmail.com wrote: On Jun 12, 3:09 am, Vinzent Steinberg vinzent.steinb...@googlemail.com wrote: On 11 Jun., 10:47, SherjilOzair sherjiloz...@gmail.com wrote: Do you require to solve

[sympy] Re: Uses and Size of Sympy Matrices

2011-06-11 Thread SherjilOzair
. Or direct me to pieces of code which generate the matrices that you use. On Sat, May 28, 2011 at 6:56 AM, SherjilOzair sherjiloz...@gmail.com wrote: I would like to know how and where Sympy's matrices are used. Is Sympy matrices used for numeric computing anywhere ? Are Sympy Matrices

[sympy] Re: Uses and Size of Sympy Matrices

2011-06-11 Thread SherjilOzair
, but in many cases we really want the symbolic forms. On Sat, May 28, 2011 at 6:56 AM, SherjilOzair sherjiloz...@gmail.com wrote: I would like to know how and where Sympy's matrices are used. Is Sympy matrices used for numeric computing anywhere ? Are Sympy Matrices expected to offer any

[sympy] Re: Uses and Size of Sympy Matrices

2011-06-11 Thread SherjilOzair
I meant the Frac class. On Jun 11, 1:48 pm, SherjilOzair sherjiloz...@gmail.com wrote: Aaron, it would be wonderful if we could discuss the implementation of the Frac function. On Jun 2, 10:37 pm, Aaron Meurer asmeu...@gmail.com wrote: I use Matrices in the Risch algorithm

[sympy] Re: Borrowing ideas from Polys to Matrix

2011-06-02 Thread SherjilOzair
/184/files (lines 534, 536, 573, 575, 599, etc.) On Jun 2, 9:55 am, Mateusz Paprocki matt...@gmail.com wrote: Hi, On 2 June 2011 06:37, SherjilOzair sherjiloz...@gmail.com wrote: This hasn't been implemented yet. Should I go ahead and add it ? sums for QQ, etc also needed. First it would

[sympy] Re: A simple idea regarding groundtypes for Matrix

2011-06-02 Thread SherjilOzair
I added my views there. http://code.google.com/p/sympy/issues/detail?id=2042 On Jun 2, 9:34 am, SherjilOzair sherjiloz...@gmail.com wrote: I need review on this style for matrix groundtypes, i.e. having a list of builtin dtypes, and an other option for misc backends. Do you think the list

Re: [sympy] Re: A simple idea regarding groundtypes for Matrix

2011-06-02 Thread sherjilozair
work inside numpy matrices? Are you considering making sympy.Expr work inside scipy.sparse matrices? Cheers, Brian On Wed, Jun 1, 2011 at 9:27 PM, SherjilOzair sherjiloz...@gmail.com wrote: scipy.sparse implements a dtype kwarg argument, but which currently cannot take in arbitrary unknown types

Re: [sympy] Reorganise the package structure

2011-06-01 Thread sherjilozair
How about having having two folders, dense and sparse, in the matrices folder. The dense folder contains densematrix.py and linalg.py. densematrix.py contains the class DenseMatrix (the current Matrix class, or should the name remain the same ? ). The sparse folder has dokmatrix.py, linalg.py.

[sympy] Re: Segmentation fault when importing sympy

2011-06-01 Thread SherjilOzair
Mac:sympy sherjilozair$ git checkout cholesky Switched to branch 'cholesky' Mac:sympy sherjilozair$ bin/isympy Segmentation fault Mac:sympy sherjilozair$ git diff Mac:sympy sherjilozair$ I tried it with a non-experimental branch. It still doesn't work. That means, the sympy code is fine. import

[sympy] Re: Segmentation fault when importing sympy

2011-06-01 Thread SherjilOzair
Issue resolved. -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at

[sympy] Re: A simple idea regarding groundtypes for Matrix

2011-06-01 Thread SherjilOzair
scipy.sparse implements a dtype kwarg argument, but which currently cannot take in arbitrary unknown types though. One thing that can be done about this, is to define an interface for the dtype. It would be taken for granted that it will have +, *, / defined. Checks will be used in algorithms if

[sympy] Re: A simple idea regarding groundtypes for Matrix

2011-06-01 Thread SherjilOzair
, and user wants to take its inverse, then the dtype will automatically be changed to Rational, and the inverse calculated in the Rational field. The original Matrix however would remain the same. ( In accordance to immutability). On Jun 2, 9:27 am, SherjilOzair sherjiloz...@gmail.com wrote: scipy.sparse

[sympy] Re: Borrowing ideas from Polys to Matrix

2011-06-01 Thread SherjilOzair
This hasn't been implemented yet. Should I go ahead and add it ? sums for QQ, etc also needed. See [1] for the types I need. [1] http://groups.google.com/group/sympy/browse_thread/thread/c793f7030853f3da On May 31, 9:43 pm, Vinzent Steinberg vinzent.steinb...@googlemail.com wrote: On May 30,

[sympy] Re: Borrowing ideas from Polys to Matrix

2011-05-29 Thread SherjilOzair
? - Sherjil Ozair On May 28, 11:34 pm, Mateusz Paprocki matt...@gmail.com wrote: Hi, On 28 May 2011 15:30, SherjilOzair sherjiloz...@gmail.com wrote: Hello everyone, I've been successful in writing the symbolic cholesky decomposition for sparse matrices in O(n * c**2) time

[sympy] Re: Borrowing ideas from Polys to Matrix

2011-05-29 Thread SherjilOzair
On May 29, 3:44 pm, SherjilOzair sherjiloz...@gmail.com wrote: Thanks for the pointers. I'm working on what you said. Here are a few questions. 1. Poly(123) should not give an error, why not treat it as a constant polynomial ? 2. I used construct_domain on the list of elements of the Matrix

[sympy] Re: Borrowing ideas from Polys to Matrix

2011-05-29 Thread SherjilOzair
-equivalence problem would be to check if the numerator is zero only, etc. What does the community think about this class, the RationalFunction ? Do add ideas from your knowledge and experience also. On May 29, 3:49 pm, SherjilOzair sherjiloz...@gmail.com wrote: Could you explain why normal multiplication

[sympy] A simple idea regarding groundtypes for Matrix

2011-05-29 Thread SherjilOzair
Why didn't anyone think of this before ?! Q : What benefits does groundtypes give ? A : Operations are faster, as one does not have to type-check. Each groundtype has its own __add__, __mul__ installed, and global Add, Mul are avoided. The Matrix doesn't have to worry about the zero- equivalence.

[sympy] Re: A simple idea regarding groundtypes for Matrix

2011-05-29 Thread SherjilOzair
, SherjilOzair wrote: Why didn't anyone think of this before ?! Q : What benefits does groundtypes give ? A : Operations are faster, as one does not have to type-check. Each groundtype has its own __add__, __mul__ installed, and global Add, Mul are avoided. The Matrix doesn't have to worry

Re: [sympy] Re: Borrowing ideas from Polys to Matrix

2011-05-29 Thread sherjilozair
: [sympy] Re: Borrowing ideas from Polys to Matrix Hi, On 29 May 2011 12:49, SherjilOzair sherjiloz...@gmail.com wrote: Could you explain why normal multiplication/addition operations on Poly is slower than on Muls and Adds, when Poly is supposed to be lower level than Mul, Add ? In some cases

[sympy] Borrowing ideas from Polys to Matrix

2011-05-28 Thread SherjilOzair
Hello everyone, I've been successful in writing the symbolic cholesky decomposition for sparse matrices in O(n * c**2) time. This is a reasonable order for sparse systems, but still the performance is not very good. Using python bulitins, It factors a 100 * 100 Matrix with sparsity 0.57 in 961

[sympy] Uses and Size of Sympy Matrices

2011-05-28 Thread SherjilOzair
I would like to know how and where Sympy's matrices are used. Is Sympy matrices used for numeric computing anywhere ? Are Sympy Matrices expected to offer any advantage that matrices in numpy/scipy or other libraries cannot offer ? Is its use limited to symbolic ? What size of Matrices with

[sympy] Re: Structure of Matrix module

2011-05-17 Thread SherjilOzair
Taking into account the views of Aaron, Ronan, and Vinzent on whether to follow an OO or procedural design, I think the best idea (as it always had been) would be to use a combination of both. The high level user interface would be and also appear completely OO. However the core would contain

[sympy] Re: Structure of Matrix module

2011-05-13 Thread SherjilOzair
, SherjilOzair sherjiloz...@gmail.com wrote: By 'rational function terms' and'general expression terms' do you mean that a matrix should take Expr objects as elements ? Of course, I missed to add it in the list of groundtypes. Felt it was obvious. On May 13, 4:53 am, Aaron Meurer

[sympy] Re: Who uses SymPy?

2011-05-12 Thread SherjilOzair
A very smart and to-the-point question, Matthew. I've been wanting the answer to this question myself when working on my project. The answer to this question is critical for code writing. Another issue I would like to raise, that I believe is related to this topic, is a phrase in the Sympy

[sympy] Re: Structure of Matrix module

2011-05-12 Thread SherjilOzair
Did I leave anything Vinzent ? On May 13, 3:51 am, Sherjil Ozair sherjiloz...@gmail.com wrote: Hello everyone, I took ideas from mattpap's thesis at [1], specifically the idea of multi level structure. The hierarchy I have in mind is Level 0 : A collection of functions that operate on

[sympy] Re: Structure of Matrix module

2011-05-12 Thread SherjilOzair
By 'rational function terms' and'general expression terms' do you mean that a matrix should take Expr objects as elements ? Of course, I missed to add it in the list of groundtypes. Felt it was obvious. On May 13, 4:53 am, Aaron Meurer asmeu...@gmail.com wrote: I think a Matrix could also have,

[sympy] Re: Structure of Matrix module

2011-05-12 Thread SherjilOzair
On May 13, 5:23 am, Ronan Lamy ronan.l...@gmail.com wrote: Le vendredi 13 mai 2011 à 03:51 +0400, Sherjil Ozair a écrit : Hello everyone, I took ideas from mattpap's thesis at [1], specifically the idea of multi level structure. The hierarchy I have in mind is Level 0 : A

[sympy] Pull request 184

2011-04-23 Thread SherjilOzair
Hey everyone, The pull request 184 [0] has some work on Cholesky and LDL decomposition with some very useful auxiliary functions like triangular and diagonal solves. Its been waiting to be pushed in for a long time now. It enables solving for least square which currently sympy completely lacks.

[sympy] Re: RFC: Linear algebra in SymPy

2011-04-04 Thread SherjilOzair
Brian, Could you give an example of how you construct large sparse matrices. What sort of constructors would you like to see in the class ? Are there any special class of sparse matrices that you guys use often, like tridiagonal matrix or permutation matrix ? I should also mention that we are

[sympy] Sparse Matrix Project

2011-03-31 Thread SherjilOzair
Hello Andy, I'm working to submit a proposal on Sparse Matrices for this GSoC. I wanted some help regarding the project. Would be very grateful if you could help me. According to my calculations, I'd take roughly 8 weeks to implement a full SMatrix class and rewriting Matrix class to add GMPY

[sympy] Re: Solving f(x) congruent to 0 mod (n)

2011-03-28 Thread SherjilOzair
Hi Hector, You raise a very interesting problem. Its surprising Sympy doesn't have this already. Do you have this functionality coded in for a general function f(x) ? Would like to see your code. Regards, Sherjil Ozair On Mar 28, 12:06 pm, Hector hector1...@gmail.com wrote: Hello ppl, I was

[sympy] Re: More GSoC Ideas

2011-03-24 Thread SherjilOzair
Cool ideas, indeed. Very useful, I'm sure, and quite easy to implement. For the abstract Matrix part, A new constructor-less data-less class AbstractMatrix which inherits class Matrix. This class' objects will serve as pointers to Matrices. And the object would later be made to point to a

[sympy] A formal Introduction for GSoC

2011-03-19 Thread SherjilOzair
Hello all, My name is Sherjil Ozair and I'm a first year student of Indian Institute of Technology, Delhi pursuing a dual degree(B.Tech +M.Tech) in Computer Science and Engineering. I got to know about GSoC just a couple of weeks back. I have an immense passion for coding and algorithms, and have

[sympy] Re: Sparse Matrix

2011-03-19 Thread SherjilOzair
I'll also code in a function which converts a normal Matrix class to a Sparse Matrix representation. I'll use the List of Non-zero values method, ie a list of (coordinates,value) tuple, sorted coordinate-wise with the earlier coordinate having more precedence. This is as yet, the most elegant

[sympy] Re: Sparse Matrix

2011-03-19 Thread SherjilOzair
Thank you, I've been reading the Matrices class. The SMatrix class borrows its transpose, determinant and mult functions from Matrix, and thus is inefficient for Sparse Matrices. The transpose doesn't even work for SMatrix. a=SMatrix(10,10,lambda i,j:isprime(i)) a.T Traceback (most recent

[sympy] Re: A formal Introduction for GSoC

2011-03-19 Thread SherjilOzair
Thank you for your reply, Aaron. A few small independent things can be implemented from this project. But the problem is that Sympy lacks the base infrastructure, for me to add anything remarkable. Effort would be first put in to make a infrastructure and design a web of class hierarchies, which

[sympy] Re: Sparse Matrix

2011-03-19 Thread SherjilOzair
wrote: Sounds good.  Let us know if you need help making the patch using git. Aaron Meurer On Mar 19, 2011, at 4:03 AM, SherjilOzair wrote: Thank you, I've been reading the Matrices class. The SMatrix class borrows its transpose, determinant and mult functions from Matrix, and thus

[sympy] Sets in sympy

2011-03-18 Thread SherjilOzair
The Set class of sympy is not complete. I plan to add a full FiniteSet class functionality which will inherit the Set class, we can also have an InfiniteSet abstract class later which Interval and Union can inherit. A FiniteSet would behave something like this, a=Set([1,2,3,4,5])

[sympy] numpy array for sympy

2011-03-18 Thread SherjilOzair
Hi, I'm working on a small base implementation of numpy-style array for sympy. Currently I've added component-wise addition, subtraction, multiplication, mult by integer. I've uploaded the code on GitHub. Here are some points of discussion. 1) If unequal-sized arrays are added, should an error

[sympy] Re: Hi

2011-03-17 Thread SherjilOzair
Thank you Mr Aaron, Many issues like issue 754 which interest me, but when I try to reproduce the error, It's already fixed. Issue 754 says : Here is a nice integral that SymPy is able to compute: from sympy import * var('y') y a = integrate((16*y-16)/(y**4-2*y**3+4*y-4), (y, 0, 1)) a =

[sympy] how to edit modules vectorization of subs

2011-03-17 Thread SherjilOzair
How to edit modules to make patches ? What is the cleanest method to do this, that will make debugging and testing easier ? I'm working on the vectorization of subs. Will make it possible that one can give a list of substitutions for a variable. for example, x=Symbol('x') e=x**2 a=[1,2,3]

[sympy] Re: how to edit modules vectorization of subs

2011-03-17 Thread SherjilOzair
Mr. Ronan, You've been a great help. Please help me start up my suggesting me a small project or patch. I would be very grateful. Thanks, Sherjil On Mar 17, 10:46 pm, Ronan Lamy ronan.l...@gmail.com wrote: Le jeudi 17 mars 2011 à 10:12 -0700, SherjilOzair a écrit : How to edit modules

[sympy] Hi

2011-03-16 Thread SherjilOzair
Hi, My name is Sherjil, and I'm a first year Engineering student in IIT Delhi, India. I have some coding experience, and I'm very interested in putting math and code together for sympy. Could you suggest me a small project in sympy to help me get started. Thanks, Sherjil Ozair -- You received

[sympy] Re: Hi

2011-03-16 Thread SherjilOzair
, Ondrej Certik ond...@certik.cz wrote: Hi Sherjil, On Wed, Mar 16, 2011 at 3:50 PM, SherjilOzair sherjiloz...@gmail.com wrote: Hi, My name is Sherjil, and I'm a first year Engineering student in IIT Delhi, India. I have some coding experience, and I'm very interested in putting math and code