Re: [sage-devel] Bug in module_morphism

2016-08-23 Thread Vincent Delecroix

On 23/08/16 18:08, Travis Scrimshaw wrote:

PS - We also should make matrices know they are morphisms and things like
Hom(V, V) return the matrix space. At least we should be able to implement
this without affecting the speed of matrix creation and manipulation by
putting things in the matrix space and adding methods to matrices. I don't
exactly see the point for these wrapper classes...


Not so sure... to be a morphism you (currently) need to inherit from 
Morphism which is incompatible with inheriting from RingElement or 
ModuleElement. Might be possible after #20767.


--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Bug in module_morphism

2016-08-23 Thread Travis Scrimshaw
However, there is a more general issue that the module morphism is not 
currently designed to work with Sage's FreeModule code.

sage: V = ZZ^3
sage: A = matrix.random(ZZ, 3)
sage: phi = V.module_morphism(codomain=V, matrix=A)
---
AttributeErrorTraceback (most recent call last)
...
AttributeError: 'Sequence_generic' object has no attribute 'keys'

Granted, it should work and shouldn't be too hard to make it compatible, 
but it is something that needs to be done. At least for now, you can just 
use the matrices with M * v to do the morphism action.

Best,
Travis

PS - We also should make matrices know they are morphisms and things like 
Hom(V, V) return the matrix space. At least we should be able to implement 
this without affecting the speed of matrix creation and manipulation by 
putting things in the matrix space and adding methods to matrices. I don't 
exactly see the point for these wrapper classes...

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: [Yet again] Sage's R vs system's R

2016-08-23 Thread leif
kcrisman wrote:
> 
> Make R optional?  (Nothing in Sage depends on it, except for the
> interface to it, including Rpy2.)
> 
> Gosh, R has been standard for*ever*, practically,

Hört sich nach Schwäbischem Dreiklang an.


> and is often heavily
> advertised as a good reason to use Sage.  There are certainly many who
> have been using them together (as mentioned, obviously nowhere near the
> number of "pure" R users, but still we definitely get queries about this
> regularly)

Well, I guess the ratio of R-thru-Sage users to Sage users is as
"negligible" as that to pure R users. ;-)

I know of exactly /one/ person who reported errors concerning R because
he was using (or trying to use) R; all others just had build issues
(some also doctest failures) with R, and just because it was/is a
standard package.


> and of course optional=untested=broken all too often.

While that's true to some extent, I'd say you confuse cause and effect
here.  If hardly anybody is interested in a package, it will presumably
rotten with time, orthogonal to what its type is (except that build and
test issues with /standard/ packages bug every developer and user, no
matter whether anybody actually uses them).

What happened to the role of an spkg maintainer by the way?


> Take
> the Maple or Mathematica interfaces and their on-again, off-again
> nature...

If I'm not mistaken, Sage never shipped Maple nor Mathematica, nor have
there ever been optional packages of them, unfortunately.  (So we had no
influence on which version was used either, besides that most developers
and buildbots simply couldn't test, not to mention develop further.)

Also, Rpy wasn't invented by Sage, and is developed independently by others.


> Is this only a Cygwin problem, or on other platforms?  I
> couldn't see anything about other problems on this thread.

Wait and see.  The prerequisites R removed from its tarball certainly
won't be present on every system.  We'd at least have to make them
explicit prerequisites for building Sage(!) if we keep R standard,
despite (my impression being) that only few people at all need Sage's R.


-leif


-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: [Yet again] Sage's R vs system's R

2016-08-23 Thread leif
Emmanuel Charpentier wrote:
> I agree that losing a standard package for failing to build it on one
> particular target would be bad.
> 
> From Trac#20523  :
> 
> Replying to [comment:11 embray]:
> On Cygwin I needed to `apt-cyg install liblzma-devel` (if you have
> `apt-cyg`, otherwise use setup as normal).  Without the `-devel` package
> it doesn't install the import library, so `-llzma` doesn't work
> (`-llzma.dll` should though).
> 
> Okay. I just checked on my (Linux) system : xz is not installed in the
> $(SAGE_ROOT) tree, probably because I have it installed at system level
> and the build script detects that somehow. (BTW : it is an /optional/
> package.
> 
> Therefore, what is needed is :
> a. ensure that xz /and its development files/ are installed, either in
> the system or in the Sage package) ;
> b. that this is done /before/ the R installation begins ; and
> c. that R installation /depends/ on xz being somehow available.
> 
> This can be simplified, at the expense of making xz a /standard/
> package, just by ensuring that xz is installed /before/ R compilation.

I'm all for making xz standard, although for different reason.


> I have little idea on how to proceed, since the Sage build system is
> still a (large) bit obscure to me. What I need is a way to check in the
> Makefile that xz and its development files are available, install xz if
> not (can an optional package be installed before the compilation of
> standard packages is finished ?), and make the R compilation dependent
> on this target.
> 
> Any ideas or advice ?

Checking whether xz libs and headers are available (in other words,
whether Sage's xz package needs to get installed) belongs to Sage's
top-level 'configure'.  (A probably simpler but dumb way I don't really
like is to act in xz's spkg-install like we do -- for historical reasons
-- in e.g. iconv's:  Do nothing in some cases.  This would still require
making xz standard of course.)

We still would have to deal with other stuff R no longer includes, OTOH
at least libpcre.

(And standard packages must not depend on optional ones, just saying.)


-leif


-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee
Right. Perhaps I was just thinking of "cosmetics". Lots of parents in Sage 
should be finite enumerated sets. If their category is a join of some 
category X and the category of finite enumerated sets, then it is printed as

Join of some category X and the category of finite enumerated sets.

I thought this is not "elegant"..., perhaps just a personal feeling.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Bug in module_morphism

2016-08-23 Thread Vincent Delecroix

An other one (that is responsible for the bug)

sage: V = VectorSpace(QQ, 12)

sage: Modules(Fields())
Category of vector spaces over fields
sage: V in Modules(Fields())
False

Maybe this is also wrong

sage: Modules(QQ).is_subcategory(Modules(Fields()))
False


On 23/08/16 14:32, Vincent Delecroix wrote:

Indeed

sage: VectorSpace(QQ,12) in Modules(QQ)
True
sage: VectorSpace(QQ,12) in Modules(QQ).FiniteDimensional()
False

On 23/08/16 13:29, VictorMiller wrote:

I just tried the following code on sagemath cloud.  Note the last line in
the error message -- clearly not correct!

Victor

sage> V = VectorSpace(QQ,12)

sage> C = ModulesWithBasis(V.base_ring())

sage> C0 = C.FiniteDimensional()

sage> V in C0
False
sage> v = V.random_element()

sage> V0 = V.subspace([v])

sage> V0 in C0
False
sage> def DualMorphism(S):
sage>A = matrix(S.gens())
sage>V = S.ambient_vector_space()
sage>return V.module_morphism(matrix=A)

sage> foo = DualMorphism(V0)

Error in lines 1-1
Traceback (most recent call last):
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py",

line 947, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in 
  File "", line 4, in DualMorphism
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.py",

line 541, in module_morphism
return ModuleMorphismFromMatrix(domain=self, matrix=matrix,
**keywords)
  File "sage/misc/lazy_import.pyx", line 379, in
sage.misc.lazy_import.LazyImport.__call__
(/projects/sage/sage-6.10/src/build/cythonized/sage/misc/lazy_import.c:3560)

return self._get_object()(*args, **kwds)
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/modules/with_basis/morphism.py",

line 1270, in __init__
raise ValueError("The domain %s should be finite dimensional"%domain)
ValueError: The domain Vector space of dimension 12 over Rational Field
should be finite dimensional



--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Bug in module_morphism

2016-08-23 Thread Vincent Delecroix

Indeed

sage: VectorSpace(QQ,12) in Modules(QQ)
True
sage: VectorSpace(QQ,12) in Modules(QQ).FiniteDimensional()
False

On 23/08/16 13:29, VictorMiller wrote:

I just tried the following code on sagemath cloud.  Note the last line in
the error message -- clearly not correct!

Victor

sage> V = VectorSpace(QQ,12)

sage> C = ModulesWithBasis(V.base_ring())

sage> C0 = C.FiniteDimensional()

sage> V in C0
False
sage> v = V.random_element()

sage> V0 = V.subspace([v])

sage> V0 in C0
False
sage> def DualMorphism(S):
sage>A = matrix(S.gens())
sage>V = S.ambient_vector_space()
sage>return V.module_morphism(matrix=A)

sage> foo = DualMorphism(V0)

Error in lines 1-1
Traceback (most recent call last):
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py",
line 947, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in 
  File "", line 4, in DualMorphism
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.py",
line 541, in module_morphism
return ModuleMorphismFromMatrix(domain=self, matrix=matrix, **keywords)
  File "sage/misc/lazy_import.pyx", line 379, in
sage.misc.lazy_import.LazyImport.__call__
(/projects/sage/sage-6.10/src/build/cythonized/sage/misc/lazy_import.c:3560)
return self._get_object()(*args, **kwds)
  File
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/modules/with_basis/morphism.py",
line 1270, in __init__
raise ValueError("The domain %s should be finite dimensional"%domain)
ValueError: The domain Vector space of dimension 12 over Rational Field
should be finite dimensional



--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Simon King
Hi Kwankyu,

On 2016-08-23, Kwankyu Lee  wrote:
> For (1): Joining categories works. However, this seems not a standard nor 
> an elegant way... 

Why not? It is absolutely standard in mathematics to consider objects A
that belong to the category of rings and belong at the same time to the
category of modules over a ring R.

Cheers,
Simon

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Bug in module_morphism

2016-08-23 Thread VictorMiller
I just tried the following code on sagemath cloud.  Note the last line in 
the error message -- clearly not correct!

Victor

sage> V = VectorSpace(QQ,12)

sage> C = ModulesWithBasis(V.base_ring())

sage> C0 = C.FiniteDimensional()

sage> V in C0
False
sage> v = V.random_element()

sage> V0 = V.subspace([v])

sage> V0 in C0
False
sage> def DualMorphism(S):
sage>A = matrix(S.gens())
sage>V = S.ambient_vector_space()
sage>return V.module_morphism(matrix=A)

sage> foo = DualMorphism(V0)

Error in lines 1-1
Traceback (most recent call last):
  File 
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py",
 
line 947, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in 
  File "", line 4, in DualMorphism
  File 
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/categories/modules_with_basis.py",
 
line 541, in module_morphism
return ModuleMorphismFromMatrix(domain=self, matrix=matrix, **keywords)
  File "sage/misc/lazy_import.pyx", line 379, in 
sage.misc.lazy_import.LazyImport.__call__ 
(/projects/sage/sage-6.10/src/build/cythonized/sage/misc/lazy_import.c:3560)
return self._get_object()(*args, **kwds)
  File 
"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/modules/with_basis/morphism.py",
 
line 1270, in __init__
raise ValueError("The domain %s should be finite dimensional"%domain)
ValueError: The domain Vector space of dimension 12 over Rational Field 
should be finite dimensional

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Vincent Delecroix
You are right, must be a join with EnumeratedSet (Finite is an axiom but 
enumerated is not).


On 23/08/16 11:59, Kwankyu Lee wrote:




Yes. In your case it will be one of .Finite() or .Finite().Enumerated()
or .Enumerated()



Hmm. I get

{{{

sage: m=FreeModule(GF(*2*),*2*)

sage: c=m.category()

sage: c.Finite()

Category of finite finite dimensional vector spaces with basis over (finite
fields and subquotients of monoids and quotients of semigroups)

sage: c.Enumerated()

---

AttributeErrorTraceback (most recent call last)

 in ()

> 1 c.Enumerated()


AttributeError: 'JoinCategory_with_category' object has no attribute
'Enumerated'

sage: c.Finite().Enumerated()

---

AttributeErrorTraceback (most recent call last)

 in ()

> 1 c.Finite().Enumerated()


AttributeError: 'JoinCategory_with_category' object has no attribute
'Enumerated'
sage:
}}}



--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Nicolas M. Thiery
On Tue, Aug 23, 2016 at 08:01:31AM -0700, Kwankyu Lee wrote:
>This is about so-called categories with axioms. Right? I think
>".Finite().Enumerated()" is a nice construct. But this seems not
>implemented yet... Am I right?

This does not work because "Enumerated" is not an axiom (maybe it
should be; there are pros and cons). Anyway if you have a category,
and want to build the subcategory of objects that are also enumerated
(and possibly finite), you can do:

sage: C = Groups(); C
Category of groups

sage: D = C & EnumeratedSets()
Join of Category of groups and Category of enumerated sets

sage: D.Finite()
Join of Category of finite groups and Category of finite enumerated sets

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: sage server and test_notebook

2016-08-23 Thread Brian Beavers
On Tuesday, August 16, 2016 at 4:33:13 AM UTC-5, slelievre wrote:
> cc-ing sage-notebook
> 
> 2016-08-14 17:01:04 UTC+2, Mike Zabrocki:
> Hi,
> 
> 
> I was trying to get a sage server running on a computer at work and I kept 
> finding that it would not connect.  I then started debugging and ran into 
> further issues.
> 
> 
> When I execute the documentation
>  
> http://doc.sagemath.org/html/en/reference/notebook/sagenb/notebook/notebook_object.html
> (bottom of the page)
> 
> 
> sage: from sagenb.notebook.notebook_object import test_notebook
> sage: passwd = str(randint(1,1<<128))
> sage: nb = test_notebook(passwd, interface='localhost', port=8060)
> 
> 
> I get the error
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---
> AttributeError                            Traceback (most recent call last) 
>  in () 
> > 1 nb = test_notebook(passwd, interface='localhost', port=Integer(8060)) 
> /Applications/sage/local/lib/python2.7/site-packages/sagenb/notebook/notebook_object.pyc
>  in test_notebook(admin_passwd, secure, directory, port, interface, verbose) 
>     282  
>     283     nb = _notebook.load_notebook(directory) 
> --> 284     nb.set_accounts(True) 
>     285     nb.add_user('admin', admin_passwd, '') 
>     286     nb.set_accounts(False)
> 
> AttributeError: 'Notebook' object has no attribute 'set_accounts'
> 
> 
> 
> which makes me think that this whole function is out of date.  Are others 
> using the notebook server and finding that it is still working?  My problems 
> with the server are probably not related, but I can't seem to test it and 
> this makes me think that maybe some of this code is not going through the 
> usual testing.
> 
> 
> Thanks,
> -Mike

I'm running sage 7.3 (the binaries downloaded from sagemath.org) on Ubuntu 
14.04 as a notebook server with no problem. However, I'm having issues trying 
to do a clean install with 16.04. I've been following Jason Grout's old 
instructions and trying to figure out what needs updating. I've gotten up to 
the point where you run the "startnotebook" script to start the notebook server 
to start on the machine, but I get "connection refused" messages when trying to 
connect to the server from other machines (and even by trying to connect by IP 
address on the server itself, rather than localhost:8000). I had no problem 
loading my user database, and everything is fine from localhost, but not from 
outside that. Perhaps we're hitting the same problem.

Brian

Brian Beavers, Ph.D., Associate Professor
Coordinator of Computing and Webmaster
Department of Mathematics and Statistics
Stephen F. Austin State University
Math Building 310 | 936.468.1433
Science Building 200 | 936.468.2177
beaver...@sfasu.edu

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee

>
> Yes. In your case it will be one of .Finite() or .Finite().Enumerated() 
> or .Enumerated()


Hmm. I get

{{{

sage: m=FreeModule(GF(*2*),*2*)

sage: c=m.category()

sage: c.Finite()

Category of finite finite dimensional vector spaces with basis over (finite 
fields and subquotients of monoids and quotients of semigroups)

sage: c.Enumerated()

---

AttributeErrorTraceback (most recent call last)

 in ()

> 1 c.Enumerated()


AttributeError: 'JoinCategory_with_category' object has no attribute 
'Enumerated'

sage: c.Finite().Enumerated()

---

AttributeErrorTraceback (most recent call last)

 in ()

> 1 c.Finite().Enumerated()


AttributeError: 'JoinCategory_with_category' object has no attribute 
'Enumerated'
sage: 
}}} 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee
This is about so-called categories with axioms. Right? I think 
".Finite().Enumerated()" is a nice construct. But this seems not 
implemented yet... Am I right?

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Vincent Delecroix

On 23/08/16 11:42, Kwankyu Lee wrote:




For example, have a look at sage/combinat/free_module.py lines 1170-1175.



Are you referring specifically the construct ".FiniteDimensional()" to get
a subcategory? Then can I use ".FiniteEnumerable()" for my case? I guess
not... On the other hand, in other examples, I see ".Finite()" give a
finite set, but I want the category of finite enumerable set...


Yes. In your case it will be one of .Finite() or .Finite().Enumerated() 
or .Enumerated()


--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee
For (1): Joining categories works. However, this seems not a standard nor 
an elegant way... 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee

>
> For example, have a look at sage/combinat/free_module.py lines 1170-1175. 
>

Are you referring specifically the construct ".FiniteDimensional()" to get 
a subcategory? Then can I use ".FiniteEnumerable()" for my case? I guess 
not... On the other hand, in other examples, I see ".Finite()" give a 
finite set, but I want the category of finite enumerable set...

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Vincent Delecroix

On 23/08/16 05:43, Kwankyu Lee wrote:

I am not familiar with the category framework. My questions are

(1) I want certain parents in a category C to be also in the category of
finite enumerated sets such that I can use .list() method. Not all objects
in the category C is not finite. What is the standard way to implement that?

>

(2) All objects in a category D are finite, and I want .list() method
usable for all the objects(parents). What is the standard way to implement
that?


For example, have a look at sage/combinat/free_module.py lines 1170-1175.

--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: possibly controversial question: "Can I create commercial software using SageMath?"

2016-08-23 Thread Dima Pasechnik


On Tuesday, August 23, 2016 at 4:47:37 AM UTC+1, Robert Dodier wrote:
>
> On 2016-08-20, Volker Braun  wrote: 
>
> > And, as you know, if there is any question about interpretation then 
> > the court will almost certainly side with the interpretations written 
> > previously by the FSF, so in practice the FSF's interpretation does 
> > matter. 
>
> I hadn't heard about that. Can you refer to some cases in which the 
> court relied on the FSF interpretation? 
>

business cases are mostly settled out of court. There was a number of 
litigations (co)ged by FSF:
https://wiki.fsfe.org/Migrated/GPL%20Enforcement%20Cases
but none of these went as far as to actual court sittings.

 

>
> best, 
>
> Robert Dodier 
>
>

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Iterators and KeyboardInterrupt

2016-08-23 Thread Sébastien Labbé

On Tuesday, August 23, 2016 at 10:16:53 AM UTC+2, Salvatore Stella wrote:
>
> Indeed RecursivelyEnumeratedSet seems to be a good fit for my needs. 
> The only problem I encountered so far is that it does not handle 
> KeybordInterrupts nicely either: if you interrupt the computation of 
> graded_component(n) then graded_component(m) with m desired input while all the remaining m raise a StopIterator. 
> S. 
>
>
I see. Using alarm, I managed to create a reprocable bug:

https://trac.sagemath.org/ticket/21312

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: [Yet again] Sage's R vs system's R

2016-08-23 Thread Emmanuel Charpentier
I agree that losing a standard package for failing to build it on one 
particular target would be bad.

>From Trac#20523  :

Replying to [comment:11 embray]:
On Cygwin I needed to `apt-cyg install liblzma-devel` (if you have 
`apt-cyg`, otherwise use setup as normal).  Without the `-devel` package it 
doesn't install the import library, so `-llzma` doesn't work (`-llzma.dll` 
should though).

Okay. I just checked on my (Linux) system : xz is not installed in the 
$(SAGE_ROOT) tree, probably because I have it installed at system level and 
the build script detects that somehow. (BTW : it is an *optional* package.

Therefore, what is needed is :
a. ensure that xz *and its development files* are installed, either in the 
system or in the Sage package) ;
b. that this is done *before* the R installation begins ; and
c. that R installation *depends* on xz being somehow available.

This can be simplified, at the expense of making xz a *standard* package, 
just by ensuring that xz is installed *before* R compilation.

I have little idea on how to proceed, since the Sage build system is still 
a (large) bit obscure to me. What I need is a way to check in the Makefile 
that xz and its development files are available, install xz if not (can an 
optional package be installed before the compilation of standard packages 
is finished ?), and make the R compilation dependent on this target.

Any ideas or advice ?


Le mardi 23 août 2016 03:27:54 UTC+2, kcrisman a écrit :
>
>  
>
>>
>> Make R optional?  (Nothing in Sage depends on it, except for the 
>> interface to it, including Rpy2.) 
>>
>>
> Gosh, R has been standard for*ever*, practically, and is often heavily 
> advertised as a good reason to use Sage.  There are certainly many who have 
> been using them together (as mentioned, obviously nowhere near the number 
> of "pure" R users, but still we definitely get queries about this 
> regularly) and of course optional=untested=broken all too often.  Take the 
> Maple or Mathematica interfaces and their on-again, off-again nature... Is 
> this only a Cygwin problem, or on other platforms?  I couldn't see anything 
> about other problems on this thread. 
>

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Declaring a parent in a category as a finite enumerated set

2016-08-23 Thread Kwankyu Lee
I am not familiar with the category framework. My questions are

(1) I want certain parents in a category C to be also in the category of 
finite enumerated sets such that I can use .list() method. Not all objects 
in the category C is not finite. What is the standard way to implement that?

(2) All objects in a category D are finite, and I want .list() method 
usable for all the objects(parents). What is the standard way to implement 
that?

Please give me some guides. Thank you!

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Iterators and KeyboardInterrupt

2016-08-23 Thread VulK
Indeed RecursivelyEnumeratedSet seems to be a good fit for my needs.
The only problem I encountered so far is that it does not handle
KeybordInterrupts nicely either: if you interrupt the computation of
graded_component(n) then graded_component(m) with m [2016-08-23 00:51:34]:

>  > Are you really getting benefit from storing the state (i.e., the
>  actual
>  > iterator) on the parent itself? (I see you haven't made
>  ClusterAlgebra
>  > UniqueRepresentation, so it's not an immediate bug to have it this
>  way)
>  > Perhaps it's cleaner to hand out iterator objects that are kept
>  track
>  > of in the relevant loop. That iterator would then just die
>  whenever the
>  > frames of a KeyboardInterrupt exception are discarded and the
>  flawed
>  > state wouldn't persist.
>  The main benefit I get from storing the iterator is that, if the
>  user is
>  careful in calling the various functions with reasonable stopping
>  points, the
>  code never has to start searching from scratch. For example
>  currently
>  Â  Â  sage: A = ClusterAlgebra(['A',2,1])
>  Â  Â  sage: A.explore_to_depth(10)
>  Â  Â  sage: A.explore_to_depth(11)
>  effectively only traverses the tree once to depth 11. If I were not
>  to store
>  the iterator then I would be traversing the tree twice. And
>  unfortunately
>  this is expensive.
> 
>The method graded_component does exactly what you want. See
> 
>https://github.com/sagemath/sage/blob/master/src/sage/sets/recursively_
>enumerated_set.pyx#L607
>Â
> 
>--
>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 [1]sage-devel+unsubscr...@googlegroups.com.
>To post to this group, send email to [2]sage-devel@googlegroups.com.
>Visit this group at [3]https://groups.google.com/group/sage-devel.
>For more options, visit [4]https://groups.google.com/d/optout.
> 
> References
> 
>1. mailto:sage-devel+unsubscr...@googlegroups.com
>2. mailto:sage-devel@googlegroups.com
>3. https://groups.google.com/group/sage-devel
>4. 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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Iterators and KeyboardInterrupt

2016-08-23 Thread Sébastien Labbé


>
> > Are you really getting benefit from storing the state (i.e., the actual 
> > iterator) on the parent itself? (I see you haven't made ClusterAlgebra 
> > UniqueRepresentation, so it's not an immediate bug to have it this way) 
> > Perhaps it's cleaner to hand out iterator objects that are kept track 
> > of in the relevant loop. That iterator would then just die whenever the 
> > frames of a KeyboardInterrupt exception are discarded and the flawed 
> > state wouldn't persist. 
>
> The main benefit I get from storing the iterator is that, if the user is 
> careful in calling the various functions with reasonable stopping points, 
> the 
> code never has to start searching from scratch. For example currently 
>
> sage: A = ClusterAlgebra(['A',2,1]) 
> sage: A.explore_to_depth(10) 
> sage: A.explore_to_depth(11) 
>
> effectively only traverses the tree once to depth 11. If I were not to 
> store 
> the iterator then I would be traversing the tree twice. And unfortunately 
> this is expensive. 
>

The method graded_component does exactly what you want. See 

https://github.com/sagemath/sage/blob/master/src/sage/sets/recursively_enumerated_set.pyx#L607
 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: [sage-combinat-devel] Multiple versions of SageMath's documentation online

2016-08-23 Thread Nicolas M. Thiery
On Mon, Aug 22, 2016 at 09:10:55AM -0700, Samuel Lelievre wrote:
>I guess once the Google indexing of doc.sagemath.org is solved,
>we should probably remove this redirection.

No rush, but that would be nice indeed. It should be easy to add a
banner on the old combinat doc to warn that it's outdated.

>It would be worth to open a Sage trac ticket dedicated
>to moving the sage-combinat tutorials into Sage proper.

That's:

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

with this chunk completed recently:

https://trac.sagemath.org/ticket/20618

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

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


Re: [sage-devel] Re: [sage-combinat-devel] Multiple versions of SageMath's documentation online

2016-08-23 Thread Nicolas M. Thiery
On Mon, Aug 22, 2016 at 09:10:55AM -0700, Samuel Lelievre wrote:
>I guess once the Google indexing of doc.sagemath.org is solved,
>we should probably remove this redirection.

No rush, but that would be nice indeed. It should be easy to add a
banner on the old combinat doc to warn that it's outdated.

>It would be worth to open a Sage trac ticket dedicated
>to moving the sage-combinat tutorials into Sage proper.

That's:

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

with this chunk completed recently:

https://trac.sagemath.org/ticket/20618

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.