Re: [sage-devel] Re: Please help with #23967 Coercion pushout for FGP_modules

2017-10-11 Thread Simon Brandhorst
OK I have implemented the less easy version with construction functors. 
That seems to be the best practice. The ticket is ready for review.

On Monday, October 9, 2017 at 7:55:13 PM UTC+2, David Roe wrote:
>
>
>
> On Mon, Oct 9, 2017 at 1:38 PM, Simon Brandhorst  > wrote:
>
>> It helps a bit. Though my problem right now is that fgp_modules do not 
>> have a construction defined in the tutorial this is the case. So I have to 
>> give fgp_modules a construction functor? Or is there an easier way to get a 
>> pushout?
>>
>
> Nope, that's how you get pushouts.  You can take a look at the 
> QuotientFunctor in sage/categories/pushout.py for inspiration.
> David
>
>
>
>> On Monday, October 9, 2017 at 12:45:17 PM UTC+2, Simon King wrote:
>>>
>>> On 2017-10-09, Simon Brandhorst  wrote: 
>>> > Would someone please guide me through this? 
>>> > I would like to learn now to implement such a thing in sage. Yet I 
>>> wouldn't 
>>> > know where to start here. 
>>> > It is mathematically quite simple. 
>>>
>>> Does 
>>> http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
>>>  
>>> help? 
>>>
>>> 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+...@googlegroups.com .
>> To post to this group, send email to sage-...@googlegroups.com 
>> .
>> Visit this group at https://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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] On (di)graph generation

2017-10-11 Thread David Joyner
On Oct 11, 2017 1:45 AM, "Jori Mäntysalo"  wrote:

1) list(graphs.nauty_geng(0)) gives empty list, whereas Sage knows a graph
of 0 vertices. Can someone ask McKay to handle this special case too?


Wouldn't it be easier to simply catch that case in the nauty_geng method?

2) Is there an example of graph property that holds after deleting any
vertex but not necessarily after deleting an edge? Or the converse?




Completeness, if you start with a complete graph, is preserved if you
delete a vertex but not if you delete an edge.





3) Currently graphs(...) has parameters vertices and augment. With
graphs(n, augment='edges') it generates all n-vertex graphs, whereas
graphs(n, augment='vertices') generates all graphs of 0, 1, ..., n
vertices. Would it be more logical to have parameters max_vertices and
min_vertices?

4) When is augment='edges' usefull? Is

sum(sum(1 for _ in graphs(i, augment='edges')) for i in range(9))

faster in someone's computer than

sum(1 for _ in graphs(8, augment='vertices'))

?

-- 
Jori Mäntysalo

-- 
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] Issues installing the optional "libhomfly" package

2017-10-11 Thread Erik Bray
On Tue, Oct 10, 2017 at 8:31 PM, Dima Pasechnik  wrote:
> to install Boehm GC Sage package, do
>
> sage -i gc

gc is a standard package (dependency of ecl) so it would already be installed.

-- 
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] On (di)graph generation

2017-10-11 Thread Jori Mäntysalo

On Wed, 11 Oct 2017, David Joyner wrote:

1) list(graphs.nauty_geng(0)) gives empty list, whereas Sage knows a 
graph of 0 vertices. Can someone ask McKay to handle this special case 
too?



Wouldn't it be easier to simply catch that case in the nauty_geng method?


Could be done, but needs some string processing, as the argument is given 
as a string to nauty. And anyways, isn't this a corner-case bug?


2) Is there an example of graph property that holds after deleting any 
vertex but not necessarily after deleting an edge? Or the converse?


Completeness, if you start with a complete graph, is preserved if you 
delete a vertex but not if you delete an edge. 


True. But it is propably not what one will generate orderly...

--
Jori Mäntysalo

Re: [sage-devel] Issues installing the optional "libhomfly" package

2017-10-11 Thread Erik Bray
On Tue, Oct 10, 2017 at 7:51 PM, Jesse H  wrote:
> Greetings,
>
> I have been trying to use the function "homfly_polynomial()" from the Link
> package in Sage, but it requires an optional package "libhomfly":
> http://files.sagemath.org/spkg/upstream/libhomfly/index.html.
>
> Unfortunately, when I try to install libhomfly ("sage -i libhomfly") the
> build always fails (see attached log file).
>
> One of the dependencies for libhomfly is Boehm GC, but when I try to install
> this package ("sage -i boehm_gc"), it is not even found on Sage's list of
> optional packages (even though it's displayed on the
> website:http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/boehm_gc/index.html).
> I'm not sure if this is indeed the issue, but it's just something I came
> across.
>
> For what it's worth, I'm running SageMath 8.0 and MacOS 10.12.6 on a mid
> 2012 MacBook Pro with a 2.3 GHz i7 processor and 8GB RAM.
>
> Any help is much appreciated.

This looks like a bug in libhomfly.  Just looking at the sources it
has some messy handling of extern variable declarations vs.
definitions, and many global variables are actually being defined in
multiple modules.  I haven't run into this problem myself building
libhomfly but maybe my compiler is more forgiving.  Regardless it
definitely looks wrong to me.  I could see if I can reproduce on OSX
now that I have shiny new access to a big OSX machine :)

Erik

-- 
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] On (di)graph generation

2017-10-11 Thread Dima Pasechnik


On Wednesday, October 11, 2017 at 10:20:02 AM UTC+1, Jori Mäntysalo wrote:
>
> On Wed, 11 Oct 2017, David Joyner wrote: 
>
> >> 1) list(graphs.nauty_geng(0)) gives empty list, whereas Sage knows a 
> >> graph of 0 vertices. Can someone ask McKay to handle this special case 
> >> too? 
>
> > Wouldn't it be easier to simply catch that case in the nauty_geng 
> method? 
>
> Could be done, but needs some string processing, as the argument is given 
> as a string to nauty. And anyways, isn't this a corner-case bug? 
>

it depends upon the definition of an empty graph, I guess...
 

>
> >> 2) Is there an example of graph property that holds after deleting any 
> >> vertex but not necessarily after deleting an edge? Or the converse? 
>
> > Completeness, if you start with a complete graph, is preserved if you 
> > delete a vertex but not if you delete an edge.  
>
> True. But it is propably not what one will generate orderly... 
>
> -- 
> Jori Mäntysalo

-- 
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] On (di)graph generation

2017-10-11 Thread Robert Miller
On Tue, Oct 10, 2017 at 10:45 PM, Jori Mäntysalo 
wrote:

> 4) When is augment='edges' usefull? Is
>

One reason it is useful:

You can use the argument "property" to restrict to a subclass of graphs.
This argument takes a function and filters the output by testing against
this property. If this property is preserved under vertex deletion, then
using augment='vertices' will give you all graphs satisfying the property.
Similarly for edges. If the property is not preserved as described, then
you may be missing some.

Also, if you use augment="edges" you get graphs on exactly N vertices, and
if you use augment="vertices" you get graphs on ≤ N vertices.

For any particular family of graphs it is likely there are faster ways to
do it - for example we have a method of generating iso-classes of trees in
constant time per tree. This is meant to be a useful general-purpose
generator.

-- 
Robert L. Miller
http://www.rlmiller.org/

-- 
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: optional package mpfrcx not on the mirror

2017-10-11 Thread Volker Braun
fixed!

On Tuesday, October 10, 2017 at 10:17:12 AM UTC+2, Maarten Derickx wrote:
>
> This is probably because it is still in beta. The tarbal can be found at 
> https://trac.sagemath.org/ticket/11806

-- 
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] Issues installing the optional "libhomfly" package

2017-10-11 Thread Dima Pasechnik
I can reproduce this linking error on OSX; I've opened #24015 
 to track this error.


On Wednesday, October 11, 2017 at 10:31:16 AM UTC+1, Erik Bray wrote:
>
> On Tue, Oct 10, 2017 at 7:51 PM, Jesse H > 
> wrote: 
> > Greetings, 
> > 
> > I have been trying to use the function "homfly_polynomial()" from the 
> Link 
> > package in Sage, but it requires an optional package "libhomfly": 
> > http://files.sagemath.org/spkg/upstream/libhomfly/index.html. 
> > 
> > Unfortunately, when I try to install libhomfly ("sage -i libhomfly") the 
> > build always fails (see attached log file). 
> > 
> > One of the dependencies for libhomfly is Boehm GC, but when I try to 
> install 
> > this package ("sage -i boehm_gc"), it is not even found on Sage's list 
> of 
> > optional packages (even though it's displayed on the 
> > website:
> http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/boehm_gc/index.html).
>  
>
> > I'm not sure if this is indeed the issue, but it's just something I came 
> > across. 
> > 
> > For what it's worth, I'm running SageMath 8.0 and MacOS 10.12.6 on a mid 
> > 2012 MacBook Pro with a 2.3 GHz i7 processor and 8GB RAM. 
> > 
> > Any help is much appreciated. 
>
> This looks like a bug in libhomfly.  Just looking at the sources it 
> has some messy handling of extern variable declarations vs. 
> definitions, and many global variables are actually being defined in 
> multiple modules.  I haven't run into this problem myself building 
> libhomfly but maybe my compiler is more forgiving.  Regardless it 
> definitely looks wrong to me.  I could see if I can reproduce on OSX 
> now that I have shiny new access to a big OSX machine :) 
>
> Erik 
>

-- 
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: optional package mpfrcx not on the mirror

2017-10-11 Thread Vincent Delecroix

Thanks Volker.

On 11/10/2017 20:05, Volker Braun wrote:

fixed!

On Tuesday, October 10, 2017 at 10:17:12 AM UTC+2, Maarten Derickx wrote:


This is probably because it is still in beta. The tarbal can be found at
https://trac.sagemath.org/ticket/11806




--
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] On (di)graph generation

2017-10-11 Thread Jori Mäntysalo
(There is #24004 with positive_review, so I code changes should be thinked 
after next beta.)


On Wed, 11 Oct 2017, Robert Miller wrote:


  4) When is augment='edges' usefull? Is

One reason it is useful:

You can use the argument "property" to restrict to a subclass of graphs. This 
argument takes a function and
filters the output by testing against this property. If this property is 
preserved under vertex deletion, then
using augment='vertices' will give you all graphs satisfying the property. 
Similarly for edges. If the property
is not preserved as described, then you may be missing some.


Yes, that's why I asked about properties like that.

But I already found an example where augment='edges' could be used: 
property=lambda g: g.size() < n, where n is small number; it will work 
with augment='vertices', but is slower.


Also, if you use augment="edges" you get graphs on exactly N vertices, 
and if you use augment="vertices" you get graphs on ≤ N vertices.


Yes, just as I wrote in message starting this thread. And it seems quite 
unlogical.


For any particular family of graphs it is likely there are faster ways 
to do it - for example we have a method of generating iso-classes of 
trees in constant time per tree. This is meant to be a useful 
general-purpose generator.


True.

--
Jori Mäntysalo