[sympy] Re: a sequence of variables

2009-02-07 Thread Ondrej Certik
On Thu, Feb 5, 2009 at 6:57 PM, chu-ching huang cchu...@mail.cgu.edu.tw wrote: Just rebuild sympy-git source and test the following: from sympy import * a=DeferredVector('a') b=DeferredVector('b') n=10 A=eye(11) a=Matrix(1,n,lambda i,j: 'a%g' %j) b=Matrix(1,n,lambda i,j: 'b%g' %j)

[sympy] Re: a sequence of variables

2009-02-05 Thread chu-ching huang
Just rebuild sympy-git source and test the following: from sympy import * a=DeferredVector('a') b=DeferredVector('b') n=10 A=eye(11) a=Matrix(1,n,lambda i,j: 'a%g' %j) b=Matrix(1,n,lambda i,j: 'b%g' %j) A[0,1:]=a A[1:,0]=b.transpose() A.det() and it shows the right answer: 1 - a0*b0 - a1*b1 -

[sympy] Re: a sequence of variables

2009-02-04 Thread Friedrich Hagedorn
On Wed, Feb 04, 2009 at 07:12:54AM -0800, chu-ching huang wrote: Hi, Maybe this had been discussed: how to define a sequence of variables (by symbols), {x_1,x_2,---,x_n} in case n is also a variable? Do you want this: In [1]: var('x_1 x_2 x_n') Out[1]: (x_1, x_2, x_n) In [2]: x_1 +

[sympy] Re: a sequence of variables

2009-02-04 Thread Fabian Seoane
On Wed, Feb 4, 2009 at 4:27 PM, Friedrich Hagedorn friedric...@gmx.dewrote: On Wed, Feb 04, 2009 at 07:12:54AM -0800, chu-ching huang wrote: Hi, Maybe this had been discussed: how to define a sequence of variables (by symbols), {x_1,x_2,---,x_n} in case n is also a variable? Do