Re: [sage-support] method to get the left-lower and right-upper triangular parts of a matrix

2015-05-20 Thread Vincent Delecroix
Hi, On 20/05/15 08:54, Huayi Wei wrote: Hi, Vincent, Yes, my matrix is sparse. I just move here from matlab, so I am a newbie for sage and python. The function you have offered can do the job. But I am worried about its efficiency, because my sparse matrix maybe very large which comes from Fi

Re: [sage-support] method to get the left-lower and right-uppertriangular parts of a matrix

2015-05-20 Thread 魏华祎
Hi, Vincent, Thanks for your reply. I will try it following your suggestion. Best Huayi -- Original -- From: "Vincent Delecroix"<20100.delecr...@gmail.com>; Date: Wed, May 20, 2015 03:55 PM To: "sage-support"; Subject: Re: [sage-support] method to get t

[sage-support] Coefficient of element of polynomial ring over series ring

2015-05-20 Thread switzel
Suppose I have K. = PowerSeriesRing(GF(2), 't') R. = PolynomialRing(K, 'x, y') and elt is an element of t. How do I obtain the coefficient of t in elt? Do I have to implement a coercion from R to PowerSeriesRing(PolynomialRing(GF(2), 'x, y'), 't')? Also, assuming that the degree of t in elt is

[sage-support] Did something happen with matrix_plot in 6.7

2015-05-20 Thread David Einstein
In 6.6 if I did sage: matrix_plot(matrix([[1,2,3,4],[4,3,2,1]])) I'd get a boring image (a bunch of squares) In 6.7 I just get an axis. This happens on my Mac OSX 10.10.3 and My linux machine (some recent Fedora). Both sages are built from source. There do not seem to be any open trac tickets

[sage-support] About creating a bunch of matrices using "itertools"

2015-05-20 Thread Phoenix
I am trying to create the set of 3x3 matrices which have entries in the set [0,1,-1] The simple way to do that would be to create 9 nested loops and run over all the possibilities. One hopefully better way I could think of doing is possibly this, from itertools import product from itertools

[sage-support] Re: Did something happen with matrix_plot in 6.7

2015-05-20 Thread John H Palmieri
On Wednesday, May 20, 2015 at 2:54:57 PM UTC-7, David Einstein wrote: > > In 6.6 if I did > sage: matrix_plot(matrix([[1,2,3,4],[4,3,2,1]])) > > I'd get a boring image (a bunch of squares) > > In 6.7 I just get an axis. > > This happens on my Mac OSX 10.10.3 and My linux machine (some recent > F

Re: [sage-support] About creating a bunch of matrices using "itertools"

2015-05-20 Thread William Stein
On Wed, May 20, 2015 at 4:37 PM, Phoenix wrote: > I am trying to create the set of 3x3 matrices which have entries in the set > [0,1,-1] > > The simple way to do that would be to create 9 nested loops and run over all > the possibilities. Use cartesian_product_iterator: v = [] for x in cartesian