Re: [sage-devel] Bug in integer factorization (or primality test)

2014-06-21 Thread gofortu...@gmail.com
I didn't get such answer as you got,my Sage factor 2007193456621 correctly.
N.factor() returns 1001797*2003593.
Did you use an old version of Sage?



發自我的小米手機

John Cremona 提到:

>I noticed an announcement on the flint-dev list which led me to try
>this, and indeed we have the bug:
>
>sage: n=2007193456621
>sage: n.is_prime()
>False
>sage: n.factor() # !!
>2007193456621
>sage: pari(n).factor()
>[1001797, 1; 2003593, 1]
>sage: n == 1001797 * 2003593
>True
>
>See flint-dev for more details, but this seems serious enough to
>report here too.  I do not understand why Sage fails to factor n since
>the documentation says that pari is the default, and pari can factor
>this n (as above), however:
>
>sage: n.factor(algorithm='pari')
>2007193456621
>
>but
>
>sage: from sage.rings.factorint import factor_using_pari
>sage: factor_using_pari(n)
>[(1001797, 1), (2003593, 1)]
>
>so something is going wrong before pari is getting called, perhaps a
>primality test?
>
>John
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Bug in integer factorization (or primality test)

2014-06-21 Thread gofortu...@gmail.com
I use Sage 6.1.1 which I build from source code on my x86 Ubuntu14.04

William Stein 提到:

>
>On Jun 21, 2014 7:17 PM, "gofortu...@gmail.com"  wrote:
>>
>> I didn't get such answer as you got,my Sage factor 2007193456621 correctly.
>> N.factor() returns 1001797*2003593.
>> Did you use an old version of Sage?
>>
>
>What version are *you* using?
>
>>
>>
>> 發自我的小米手機
>>
>> John Cremona 提到:
>>
>> >I noticed an announcement on the flint-dev list which led me to try
>> >this, and indeed we have the bug:
>> >
>> >sage: n=2007193456621
>> >sage: n.is_prime()
>> >False
>> >sage: n.factor()                 # !!
>> >2007193456621
>> >sage: pari(n).factor()
>> >[1001797, 1; 2003593, 1]
>> >sage: n == 1001797 * 2003593
>> >True
>> >
>> >See flint-dev for more details, but this seems serious enough to
>> >report here too.  I do not understand why Sage fails to factor n since
>> >the documentation says that pari is the default, and pari can factor
>> >this n (as above), however:
>> >
>> >sage: n.factor(algorithm='pari')
>> >2007193456621
>> >
>> >but
>> >
>> >sage: from sage.rings.factorint import factor_using_pari
>> >sage: factor_using_pari(n)
>> >[(1001797, 1), (2003593, 1)]
>> >
>> >so something is going wrong before pari is getting called, perhaps a
>> >primality test?
>> >
>> >John
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups 
>> >"sage-devel" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an 
>> >email to sage-devel+unsubscr...@googlegroups.com.
>> >To post to this group, send email to sage-devel@googlegroups.com.
>> >Visit this group at http://groups.google.com/group/sage-devel.
>> >For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-devel@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: How to write packages of sage

2014-06-24 Thread gofortu...@gmail.com
Thank you,Kcrisman.
I am so sorry that I did not ask my question clearly, but luckly you understand 
most of my question.
The link to publication that use sage is great.
I do hope sage can have a lot of packages like R.
It seems that sage focus on pure mathematics more than application.I do not 
find some module such as neural network.

kcrisman 提到:

>Dear Hilbert/fresh man,
>
>
>In my opinion,the packages of matlab are more important than matlab itself.
>
>So I wonder if there is any packages of sage,like an implement of some 
>simulation models.
>
>And if I want to write some packages of sage,waht format should I use, *.sage 
>or *.py?
>
>
>
>Yes, R is a similar type of program, where the real benefit is in the many 
>user-contributed packages.  Sage tends to be "all-in-one"; if there is some 
>useful functionality to people in general, it might as well be in it.  I do 
>not know what kind of simulations you want to do, but hopefully someone else 
>will have a better sense of this.
>
>
>For formal inclusion in Sage, we do use .py files.  (You may want to learn 
>Cython if you are interested in fast stuff.)  However, for your own private 
>use it's often easier to use .sage files, which assume that all the many 
>pieces of Sage are already imported; I usually do this for my own research 
>needs.
>
> 
>
>BTW:If there some cool cases that solve problem with sage,please tell me.
>
>
>Again, not sure what you mean, but 
>http://www.sagemath.org/library-publications.html is a good place to start - 
>which reminds me to remind people to submit to this if they have something!
>
>
>Best,
>
>- kcrisman 
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: How to write packages of sage

2014-06-24 Thread gofortu...@gmail.com
In fact,I like the pure math part of sage.But it would be better if I can do 
some modelling on sage.
Recently I was reading the reference manual of probability, but I found that 
RealDistribution does not support normal distribution.
RealDistribution supports uniform, gaussian,rayleigh,lognormal, pareto ,t 
,F,chisquared,exppow, beta, weibull.

kcrisman 提到:

>
>
>Thank you,Kcrisman.
>I am so sorry that I did not ask my question clearly, but luckly you 
>understand most of my question.
>The link to publication that use sage is great.
>I do hope sage can have a lot of packages like R.
>It seems that sage focus on pure mathematics more than application.I do not 
>find some module such as neural network.
>
>
>This is true in Sage proper, but luckily there are many Python packages as 
>well that do many applications.    For example, "pybrain" and "conx" seem to 
>be good things to check out.  And then you can use them within Sage as well as 
>standalone.   The idea is that Sage does the mathematics and related packages 
>can join modeling to it - though we would not object to modeling!  For 
>instance, "brian" is an optional Sage package.
>
>
>- kcrisman
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: How to write packages of sage

2014-06-24 Thread gofortu...@gmail.com
I am so sorry that I forget about this as the 'gaussian'distribution in sage 
only take one parameter sigma. I think 'normal' distribution should have two 
parameters mu and sigma.


Kannappan Sampath 提到:

>On Tue, Jun 24, 2014 at 8:28 PM, gofortu...@gmail.com  
>wrote:
>
>In fact,I like the pure math part of sage.But it would be better if I can do 
>some modelling on sage.
>Recently I was reading the reference manual of probability, but I found that 
>RealDistribution does not support normal distribution.
>RealDistribution supports uniform, gaussian,rayleigh,lognormal, pareto ,t 
>,F,chisquared,exppow, beta, weibull.
>
>
>gaussian is another well-known name for the normal distribution, isn't it? 
>
> 
>
>kcrisman 提到:
>
>
>
>
>
>Thank you,Kcrisman.
>I am so sorry that I did not ask my question clearly, but luckly you 
>understand most of my question.
>The link to publication that use sage is great.
>I do hope sage can have a lot of packages like R.
>It seems that sage focus on pure mathematics more than application.I do not 
>find some module such as neural network.
>
>
>This is true in Sage proper, but luckily there are many Python packages as 
>well that do many applications.    For example, "pybrain" and "conx" seem to 
>be good things to check out.  And then you can use them within Sage as well as 
>standalone.   The idea is that Sage does the mathematics and related packages 
>can join modeling to it - though we would not object to modeling!  For 
>instance, "brian" is an optional Sage package.
>
>
>- kcrisman
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.
>
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: How to write packages of sage

2014-06-28 Thread gofortu...@gmail.com
Thanks a lot.I was learning how to use R in Sage recently.
The norm function of R provides a normal distribution of two parameters mean 
and sd.So I would use the R interface in Sage instead.
But I have problem ploting wuth R interface in Sage.
I use the folliwing code to plot a histogram hut failed.
###
x=r([1,2,3,4])
x.hist()
###
I can find a fule named Rplot001.png in the current directory but it was empty.
And if I use r.X11(),I can see correct graph.

kcrisman 提到:

>
>
>On Tuesday, June 24, 2014 7:02:44 PM UTC-4, 张秦川 wrote:
>
>I am so sorry that I forget about this as the 'gaussian'distribution in sage 
>only take one parameter sigma. I think 'normal' distribution should have two 
>parameters mu and sigma.
>
>
>Correct, currently you have to "manually" shift it around - I think there are 
>some examples in the documentation or perhaps in the PREP tutorials.  See 
>https://groups.google.com/forum/#!topic/sage-support/eD7xBdvd6YE among other 
>places where there are things about this.  I agree this is suboptimal, but 
>also perhaps the authors of the GSL had a reason for not using mu?
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] FiniteDimensionalAlgebra does not check associative

2014-07-07 Thread gofortu...@gmail.com
I want to use FiniteDimensionalAlgebra to check if a given table of 
multiplicayion can form a associative algebra. But the function 
FiniteDimensionalAlgebra do not check for association.
Code is as below.
##
FinitDimensionalAlgebra(CC,[Matrix([[1,1],[1,0]]),Matrix([[0,1],[1,1]])])
##

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: FiniteDimensionalAlgebra does not check associative

2014-07-07 Thread gofortu...@gmail.com
Thank you,Peter.
I have another stupid question that does not related to this topic, I think it 
difficult to write a matrix as a list of list in Sage.And it is confused that 
matrix is immutable that I cannot modify the element of a matrix.
Is there some smart way to define and use a matrix in Sage?
Thanks again.

Peter Bruin 提到:

>Hello,
>
>> I want to use FiniteDimensionalAlgebra to check if a given table of
>> multiplicayion can form a associative algebra. But the function
>> FiniteDimensionalAlgebra do not check for association.
>
>A FiniteDimensionalAlgebra can be very general: any finite-dimensional
>vector space A equipped with a bilinear map A x A -> A is regarded as a
>finite-dimensional algebra.  You can use methods like is_associative()
>to check if your algebra has certain properties:
>
>sage: A = 
>FiniteDimensionalAlgebra(CC,[Matrix([[1,1],[1,0]]),Matrix([[0,1],[1,1]])])
>sage: A.is_associative()
>False
>sage: A.is_commutative()
>False
>sage: A.is_unitary()
>False
>
>Peter
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to sage-devel@googlegroups.com.
>Visit this group at http://groups.google.com/group/sage-devel.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Have problem with R Interpreter

2014-07-23 Thread gofortu...@gmail.com
I use the following code but failed.
###
x=[1,2,3,4,5]
y=[2,3,4,5,6]
x=r(x)
y=r(y)
r.t_test(x,y,alternative="less")
###
It returns that error:object 48 not found
But it works if I didn't use alternative.
r.t_test(x,y) will return the result of two side test.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.