[sage-support] Re: random_matrix -- should returned matrix contain zeros?

2015-05-17 Thread Dominique Laurain

+1 

it looks like parameter "density" is useful to control how sparse is the 
matrix (density of zero elements)

at least, we can use density parameter with value "greater" than 1...to get 
(maybe :-) ) matrix with no zero

random_matrix(ZZ, 5, 5, distribution="uniform",density=1.5)
print
random_matrix(ZZ, 5, 5, distribution="uniform",density=1.5)
print
random_matrix(ZZ, 5, 5, distribution="uniform",density=1.5)

Dominique

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


[sage-support] installing optional packages

2015-05-17 Thread Luis Garcia-Puente
After installing sage 6.6, I tried to install the optional packages 4ti2, 
macaulay2, and nauty but the command

sage -i 4ti2

returns:

/Applications/sage/src/bin/sage-spkg: line 312: cd: 
/Applications/sage/upstream: No such file or directory
Attempting to download package 4ti2
>>> Checking online list of optional packages.
[Traceback (most recent call last):
  File "", line 35, in 
  File "/Applications/sage/local/lib/python/urllib.py", line 240, in 
retrieve
fp = self.open(url, data)
  File "/Applications/sage/local/lib/python/urllib.py", line 208, in open
return getattr(self, name)(url)
  File "/Applications/sage/local/lib/python/urllib.py", line 359, in 
open_http
return self.http_error(url, fp, errcode, errmsg, headers)
  File "/Applications/sage/local/lib/python/urllib.py", line 376, in 
http_error
return self.http_error_default(url, fp, errcode, errmsg, headers)
  File "", line 17, in http_error_default
IOError: [Errno 404] Not Found: '//www.sagemath.org/spkg/optional/list'
Error: failed to download http://www.sagemath.org/spkg/optional/list, 
aborting

I get the same output for the other two packages. Furthermore, the webpage

http://www.sagemath.org/spkg/optional/list

returns the error: 404 Error: page not found

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


[sage-support] Re: installing optional packages

2015-05-17 Thread Volker Braun
Fixed in Sage 6.7-rc0 and later...6.7 should be out today.


On Sunday, May 17, 2015 at 6:43:20 PM UTC+2, Luis Garcia-Puente wrote:
>
> After installing sage 6.6, I tried to install the optional packages 4ti2, 
> macaulay2, and nauty but the command
>
> sage -i 4ti2
>
> returns:
>
> /Applications/sage/src/bin/sage-spkg: line 312: cd: 
> /Applications/sage/upstream: No such file or directory
> Attempting to download package 4ti2
> >>> Checking online list of optional packages.
> [Traceback (most recent call last):
>   File "", line 35, in 
>   File "/Applications/sage/local/lib/python/urllib.py", line 240, in 
> retrieve
> fp = self.open(url, data)
>   File "/Applications/sage/local/lib/python/urllib.py", line 208, in open
> return getattr(self, name)(url)
>   File "/Applications/sage/local/lib/python/urllib.py", line 359, in 
> open_http
> return self.http_error(url, fp, errcode, errmsg, headers)
>   File "/Applications/sage/local/lib/python/urllib.py", line 376, in 
> http_error
> return self.http_error_default(url, fp, errcode, errmsg, headers)
>   File "", line 17, in http_error_default
> IOError: [Errno 404] Not Found: '//www.sagemath.org/spkg/optional/list'
> Error: failed to download http://www.sagemath.org/spkg/optional/list, 
> aborting
>
> I get the same output for the other two packages. Furthermore, the webpage
>
> http://www.sagemath.org/spkg/optional/list
>
> returns the error: 404 Error: page not found
>

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


Re: [sage-support] random_matrix -- should returned matrix contain zeros?

2015-05-17 Thread William Stein
On Sat, May 16, 2015 at 8:17 PM, Ronald L. Rivest  wrote:
> When I type
> random_matrix?
> at the sage notebook, I get documentation that says, for example, that the
> matrix
> entries will never be zero.  But they are, even in the given example.  What
> does
> "and never zero" mean here?

It's definitely a mistake in the documentation.  I wrote the code that
generates these matrices, and there's nothing at all in there to
restrict to nonzero values in the given interval.Somebody else
inexplicably added the nonzero business to the documentation... 5
years ago in this ticket:

http://trac.sagemath.org/ticket/9803

I'll ask them to open a ticket and fix the mistake in the documentation.

And... I'm excited to see you trying Sage !   I'm a big fan of RSA :-)

 -- William

> Thanks,
> Ron Rivest
>
> The distribution keyword set to uniform will limit values between -2 and 2,
> and never zero.
>
> sage: random_matrix(ZZ, 5, 5, distribution='uniform')
> [ 1  0 -2  1  1]
> [ 1  0  0  0  2]
> [-1 -2  0  2 -2]
> [-1 -1  1  1  2]
> [ 0 -2 -1  0  0]
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

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


[sage-support] Re: installing optional packages

2015-05-17 Thread Dima Pasechnik


On Sunday, 17 May 2015 17:43:20 UTC+1, Luis Garcia-Puente wrote:
>
> After installing sage 6.6, I tried to install the optional packages 4ti2, 
> macaulay2, and nauty but the command
>

please note that macaulay2 package is very, very old, and should not be 
used (the current Macaulay2 version is 1.7, and the
package gives 1.1 (it's a really obsolete one, see 
http://www.math.uiuc.edu/Macaulay2/Downloads/Common/)

 

>
> sage -i 4ti2
>
> returns:
>
> /Applications/sage/src/bin/sage-spkg: line 312: cd: 
> /Applications/sage/upstream: No such file or directory
> Attempting to download package 4ti2
> >>> Checking online list of optional packages.
> [Traceback (most recent call last):
>   File "", line 35, in 
>   File "/Applications/sage/local/lib/python/urllib.py", line 240, in 
> retrieve
> fp = self.open(url, data)
>   File "/Applications/sage/local/lib/python/urllib.py", line 208, in open
> return getattr(self, name)(url)
>   File "/Applications/sage/local/lib/python/urllib.py", line 359, in 
> open_http
> return self.http_error(url, fp, errcode, errmsg, headers)
>   File "/Applications/sage/local/lib/python/urllib.py", line 376, in 
> http_error
> return self.http_error_default(url, fp, errcode, errmsg, headers)
>   File "", line 17, in http_error_default
> IOError: [Errno 404] Not Found: '//www.sagemath.org/spkg/optional/list'
> Error: failed to download http://www.sagemath.org/spkg/optional/list, 
> aborting
>
> I get the same output for the other two packages. Furthermore, the webpage
>
> http://www.sagemath.org/spkg/optional/list
>
> returns the error: 404 Error: page not found
>

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


Re: [sage-support] random_matrix -- should returned matrix contain zeros?

2015-05-17 Thread Ronald L. Rivest
Thanks for the quick reply!  

Cheers,
Ron

On Sunday, May 17, 2015 at 2:05:04 PM UTC-4, William wrote:
>
> On Sat, May 16, 2015 at 8:17 PM, Ronald L. Rivest  > wrote: 
> > When I type 
> > random_matrix? 
> > at the sage notebook, I get documentation that says, for example, that 
> the 
> > matrix 
> > entries will never be zero.  But they are, even in the given example. 
>  What 
> > does 
> > "and never zero" mean here? 
>
> It's definitely a mistake in the documentation.  I wrote the code that 
> generates these matrices, and there's nothing at all in there to 
> restrict to nonzero values in the given interval.Somebody else 
> inexplicably added the nonzero business to the documentation... 5 
> years ago in this ticket: 
>
> http://trac.sagemath.org/ticket/9803 
>
> I'll ask them to open a ticket and fix the mistake in the documentation. 
>
> And... I'm excited to see you trying Sage !   I'm a big fan of RSA :-) 
>
>  -- William 
>
> > Thanks, 
> > Ron Rivest 
> > 
> > The distribution keyword set to uniform will limit values between -2 and 
> 2, 
> > and never zero. 
> > 
> > sage: random_matrix(ZZ, 5, 5, distribution='uniform') 
> > [ 1  0 -2  1  1] 
> > [ 1  0  0  0  2] 
> > [-1 -2  0  2 -2] 
> > [-1 -1  1  1  2] 
> > [ 0 -2 -1  0  0] 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sage-support...@googlegroups.com . 
> > To post to this group, send email to sage-s...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/sage-support. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> William (http://wstein.org) 
>

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