Re: [sage-support] Re: Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Vincent Delecroix
2014-12-04 7:37 UTC+01:00, Jernej : > val*bm.transpose() is actually a number but the way Sage handles it is > awkward: > > sage: M = Matrix(RR,[[1],[1]]) > sage: Matrix(RR,[[-1,0]])*M > [-1.00] > sage: abs(Matrix(RR,[[-1,0]])*M) > -1.00 # some norm of the matrix?? For this

[sage-support] Mpmath and matrix from "normal" matrix

2014-12-03 Thread Jori Mantysalo
M1=Matrix([[1,2],[3,4]]) import scipy M2=scipy.matrix(M1) import mpmath as mp M3=mp.matrix(M1) --> TypeError: could not interpret given arguments Is there some reason why mpmath matrix constructor can not use "normal" matrix of Sage as input just like scipy does? -- Jori Mäntysalo

[sage-support] Re: Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Jernej
On Thursday, 4 December 2014 07:27:21 UTC+1, Nathann Cohen wrote: > > Also, I do not understand why you have so many expressions like: > > (val*bm.transpose())[0,0] > val*bm.transpose() is actually a number but the way Sage handles it is awkward: sage: M = Matrix(RR,[[1],[1]]) sage: Matrix(RR

Re: [sage-support] Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Jori Mantysalo
On Wed, 3 Dec 2014, Jernej wrote: field = RR # this looks like the fastest option     D = Matrix(field,D) I have used scipy when doing matrix arithmetic. I.e. import scipy M=scipy.matrix(. . .) -- Jori Mäntysalo

[sage-support] Re: Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Nathann Cohen
Also, I do not understand why you have so many expressions like: (val*bm.transpose())[0,0] If you have performance problems, do not compute a whole matrix if you are only interested by its [0,0] coordinate O_o You call j.transpose() repeatedly. Store jt=j.transpose() and use it. Store and use b

[sage-support] Re: Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Nils Bruin
On Wednesday, December 3, 2014 1:33:46 PM UTC-8, Jernej wrote: > > > for i in xrange(1, cur): > for j in xrange(i+1, cur): > iv = (cache[i]*vec2int[j].transpose())[0,0] > It looks like you should rewrite this loop so that j is the out variable, so that you can pull vec

[sage-support] Improving a Sage program that is heavy on matrix multipliaction

2014-12-03 Thread Jernej
Dear sage-support, I have stumbled into a performance bottleneck in one of my Sage programs. I would like to share the relevant problem here in hope anyone has a constructive suggestion for optimizing the given program. I am given a n x n, (0,1) matrix C where n < 20. C has up to 30% of nonz

[sage-support] Re: issue in the Singular interface or in Singular

2014-12-03 Thread Jakob Kroeker
Remarkable is that for f = x^4+1/(b)*(1/zzz) f is correctly translated to Singular: sage: K0=GF(11) sage: #K0=QQ sage: R0.=K0[] sage: K.=K0.extension(b^5+4) sage: R1.=K[] sage: L=FractionField(R1) sage: R.=L[] sage: f=x^4+1/(b)*(1/zzz) sage: f._singular_() -1/(4*zzz)*b^4+x^4 That looks problem

Re: [sage-support] Re: issue in the Singular interface or in Singular

2014-12-03 Thread Vincent Delecroix
Note that already sage: (1/(b*zzz))._singular_() 0 2014-12-03 17:54 UTC+01:00, Nils Bruin : > On Wednesday, December 3, 2014 3:07:14 AM UTC-8, Jakob Kroeker wrote: >> >> ... >> sage: f=x^4+1/(b*zzz) >> sage: f._singular_() # where is the fraction 1/(b*zzz) ? >> x^4 >> > ... >> > se

[sage-support] Re: issue in the Singular interface or in Singular

2014-12-03 Thread Nils Bruin
On Wednesday, December 3, 2014 3:07:14 AM UTC-8, Jakob Kroeker wrote: > > ... > sage: f=x^4+1/(b*zzz) > sage: f._singular_() # where is the fraction 1/(b*zzz) ? > x^4 > ... > see also > http://ask.sagemath.org/question/25083/bug-in-roots/ > That looks problematic, but is likely a

[sage-support] Re: Launch the sage notebook specifying notebook location

2014-12-03 Thread kcrisman
> > a user says calling > > sage -notebook "/path/to/mysagenotebook.sagenb" > > no longer works in Sage 6.4.1, while it worked in Sage 6.3. > > Is this linked to the recent incorporation of the ipython notebook > and related changes in syntax for launching the notebook with > certain options?

[sage-support] Re: Launch the sage notebook specifying notebook location

2014-12-03 Thread Volker Braun
First of all, the error message makes it clear that you need to specify the notebook now: $ ./sage -notebook ~/.sage/sage_notebook.sagenb CRITICAL:root:unknown notebook: /home/vbraun/.sage/sage_notebook.sagenb Error, notebook must be one of default, ipython, sagenb but got /home/vbraun/.sage/sag

[sage-support] issue in the Singular interface or in Singular

2014-12-03 Thread Jakob Kroeker
It seems there is an issue either in the Singular interface or in Singular: sage: K0=GF(11) sage: #K0=QQ sage: R0.=K0[] sage: K.=K0.extension(b^5+4) sage: R1.=K[] sage: L=FractionField(R1) sage: R.=L[] sage: f=x^4+1/(b*zzz) sage: f._singular_() # where is the fraction 1/(b*zzz) ? x^4 sage: f=

[sage-support] Launch the sage notebook specifying notebook location

2014-12-03 Thread slelievre
In this question on ask-sage http://ask.sagemath.org/question/25092/sage-641-modification-notebook-order-in-shell-mode/ a user says calling sage -notebook "/path/to/mysagenotebook.sagenb" no longer works in Sage 6.4.1, while it worked in Sage 6.3. Is this linked to the recent incorporation