[sage-support] Re: (William Stein) "my top priority right now is to **make a lot of money**"

2016-08-26 Thread Nathann Cohen

>
> An unenlightened taxpayer actually might prefer this scheme, as currently 
> most of Sagemath development is funded by taxpayers, and they might not see 
> much
> value in it.
>

Other taxpayers (possibly french) could tell you that their government has 
invested millions of euros in this free software (through grants and 
manpower), that this software would not exist as it is without those 
subsidies, and that it is being turned by SageMath Inc. into good old 
corporate money.

Without paying too much taxes of course, because, well, that's what 
Delaware is for.

Nathann

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


[sage-support] Re: (William Stein) "my top priority right now is to **make a lot of money**"

2016-08-26 Thread Nathann Cohen

>
> No, you are just not seeing the obvious here.
> William views SMC as a part of activities associated to Sagemath 
> development, and it's hard to argue against this point of view.
>

It's true, it is "associated". One important side of SageMath-the-software 
is that it is "led' by a community, while William's "associated" activities 
are led by him and only him. He takes decisions, his company earns the 
money with Sage-associated activities and he spends it (on him or on Sage) 
as only him decides.
 

> (as e.g. SMC is a popular platform to run courses that use Sagemath, and 
> this is obviously important.)
>

Yes, it does play a role in Sage's future.
 

> Thus SMC  may fund William's food etc., as part of activities associated 
> with Sagemath development.
> (In general, when one *funds* something it normally is via payment of 
> money.)
>

Then accept that I see it as rather misleading when William say that his 
objective to make **a lot of money** to "fund Sage development", and that 
by that he includes "earn himself money". His message hinted at a kind of 
noble selflessness which you tell me isn't there. SageMath Inc.'s goal is 
to promote/develop Sage AND to pay his bills.

Nathann

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


[sage-support] Re: (William Stein) "my top priority right now is to **make a lot of money**"

2016-08-26 Thread Nathann Cohen
The *very* least you can do if you answer my messages publicly is to
let them appear on the forum.

On 24 August 2016 at 22:12, Nathann Cohen <nathann.co...@gmail.com> wrote:
> Quote from William Stein, CEO of SageMath Inc (private for-profit
> Delaware company) [1]
>
> So there is no confusion, my top priority right now is to **make a lot
> of money** by building a profitable company on open source software
> (Latex, Linux, Sage, Octave, R, etc.)
>
> (full post)
> https://groups.google.com/d/msg/sage-devel/B3WnJr6S1bw/JQ_jvOITBAAJ
>
> This post being entirely factual, I shouldn't be held responsible for
> its content.
>
> Nathann
>
> [1] 
> http://www.edgarcompany.sec.gov/servlet/CompanyDBSearch?page=detailed=0001634867_back=23

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


[sage-support] Re: (William Stein) "my top priority right now is to **make a lot of money**"

2016-08-26 Thread Nathann Cohen

>
> Nathan does give the link to the original post, but he is quoting out of 
> context. Here is the full post:
>

Still, it would be incomplete to claim, as in the original post, that the 
only aim of SageMath Inc. is to fund Sage development and associated 
activities. Take it as a proof that William announced that the development 
of SageMath Inc. was now his only professional activity, and you can safely 
guess that he will pay himself for that.

Consequently, by making "a lot of money" through SageMath Inc. it is clear 
that William also aims at making money for himself (food, rent, whatever). 
Missing that, his presentation was certainly not exhaustive.

Nathann

Note to the moderator: this email only contains facts, and is of general 
interest to the community of developers of Sage, whose name is represented 
by the company SageMath Inc (owner of the trademark).

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


[sage-support] (William Stein) "my top priority right now is to **make a lot of money**"

2016-08-24 Thread Nathann Cohen
Quote from William Stein, CEO of SageMath Inc (private for-profit
Delaware company) [1]

So there is no confusion, my top priority right now is to **make a lot
of money** by building a profitable company on open source software
(Latex, Linux, Sage, Octave, R, etc.)

(full post)
https://groups.google.com/d/msg/sage-devel/B3WnJr6S1bw/JQ_jvOITBAAJ

This post being entirely factual, I shouldn't be held responsible for
its content.

Nathann

[1] 
http://www.edgarcompany.sec.gov/servlet/CompanyDBSearch?page=detailed=0001634867_back=23

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


[sage-support] Re: how to user a external program to plot graphic?

2016-02-07 Thread Nathann Cohen
If you are just wondering how to change the viewer used to display the 
pictures produced by Sage, the answer is right there:

http://doc.sagemath.org/html/en/reference/misc/sage/misc/viewer.html

Nathann

On Saturday, February 6, 2016 at 11:11:57 PM UTC+1, jmarcell...@ufpi.edu.br 
wrote:
>
> how to user a external program to plot graphic? ex: gnuplot, xmaxima, 
> mgnuplot
>

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


[sage-support] Re: All hamiltonian cycles in graphs

2016-02-06 Thread Nathann Cohen

>
> there is subgraph_search_iterator()
> which might not be optimized for cycles too much, but does the job, I 
> guess:
>

+1. That's the easiest way to get them. If performance is a problem you may 
want to work a bit more on the exploration algorithm, but if you do so do 
not overestimate what speed you could gain this way: there is no magical 
way to compute a TSP, and no magical way to get them all either.

Just be careful when using the subgraph_search_iterator() function, as you 
will get every cycle on 'n' vertices for a total of 2n times.

Nathann

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


Re: Cliquer (was Re: [sage-support] Re: Sage 7.0 crashes)

2016-01-26 Thread Nathann Cohen

>
> contributions.  E.g., they won't even consider a new component be 
> added to Python unless somebody clearly commits to supporting the 
> contribution for "five years".  And of course the people making that 
> commitment have to be reputable.We should do the same for Sage -- 
>


Don't you think we should start by doing the same for Sage's own source 
code? Anybody who proposes a patch should agree to do the 
debugging/maintenance of what (s)he added for the next 5 years? Looks weird 
to only have this high level of expectation for third-party code only, and 
not for our own.


In Sage, we are at a level where some files don't have a clear "regular 
maintainer". We would need to be 10x more developpers to enforce such rules.

For 'cliquer' in particular, maybe we could propose upstream a autotoolized 
build system, and see how it goes? We did it for 'planarity' not so long 
ago (and perhaps with others?). Our spkg-install file indeed contains 
several platform-specific instructions.

Nathann

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


Re: Cliquer (was Re: [sage-support] Re: Sage 7.0 crashes)

2016-01-26 Thread Nathann Cohen
> Hey I was just reporting on a conversation with Guido about what they
> *already* do with Python.

It ended with "we should do the same in Sage"

> Huge +1.  I'm all for Sage devs contributing upstream :-)

Are you one of them?

Nathann

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


Re: Cliquer (was Re: [sage-support] Re: Sage 7.0 crashes)

2016-01-26 Thread Nathann Cohen
>> Are you one of them?
>
> Rolls eyes...

I can't help but notice that you say "we" when you say what should be
done, and you say "you" when there is actual work ahead.

You reported this problem concerning cliquer, and you are "all for
Sage developpers contributing upstream". Will you help?

Or will you wait for Sage developpers to do it?

Nathann

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


Re: Cliquer (was Re: [sage-support] Re: Sage 7.0 crashes)

2016-01-26 Thread Nathann Cohen
> Wouldn't be possible to make a cliquer package ?

There is one already, installed in Sage by default.

This package is a copy of the cliquer tarball that you can download
from its official website. It contains a 'minimal' build system, which
does not work on all platforms that Sage supports. For this reason,
Sage adds a few instructions in order to make it work, but that's not
the 'clean way of doing things' for us.

The "clean way of doing things" would be for the original tarball to
compile properly on all platforms, without a need for additional
instructions.

Nathann

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


Re: Cliquer (was Re: [sage-support] Re: Sage 7.0 crashes)

2016-01-26 Thread Nathann Cohen
> Nathann:

William,

I'm sorry to say that the situation is not as simple as "You suggest,
and you are happy to see people doing it for you".

Sometimes, people do stuff because nobody would do it otherwise. They
feel responsible as members of the community, and so give it a try. I
swear: trust me. And by merely "suggesting stuff and waiting for
others to (happily) do it" the truth is that you sometimes *use* those
people.

Once, on a trac ticket, I saw something like that: "Of course this
implementation is unnecessarily slow, but someday somebody will see it
and improve it". For somebody like me, it comes very close to forcing
me to improve it: because I do not accept to see a very obviously slow
algorithm in Sage when I see a clear way to improve it: we deserve
better (*).

I can only pray that not too many people will grow this "much bigger
picture longterm strategic view of things" that you mentionned.
Because each time it happens (you cite Nicolas Thierry as an example)
we lose a developer and those they take with them.

And there is work to be done. Work which will only be done by those
who remain. Some key people who, like you, are hardly repleacable: how
many persons do you think have what it takes to change Sage's build
system?

I'd say three: Volker, Jeroen and you. Perhaps there are others: I
don't even know enough to give the full list.

But you cannot expect this to be done by one person, it takes a *lot*
of time and skill, and we are not enough.

So please, now that you have seen the "much bigger picture longterm
strategic view of things", come down here and get your hands dirty. We
can't do the job if those who know how to do it think that they are
above it.

Nathann

(*) On this ticket, they *knew* what was wrong. They just did not care
enough to spend the time.

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


[sage-support] Re: Using graphic object as a sub-figure

2015-12-21 Thread Nathann Cohen

>
> Is it possible to use a plot of some object as a subfigure in given 
> position? 
>
> Suppose for example that g is a graph. What if I want to plot g, an arrow, 
> and g with some edge deleted? There is graphic_array, but it is not quite 
> flexible. I would like to have something like 
>

If you are plotting graphs, you already have a way to do that.

sage: g = graphs.RandomGNP(10,.3)
sage: g.show(save_pos=True)
sage: g.delete_edges(g.edge_boundary([0,1,2,3]))
sage: g.show()

If you have another graph h defined on the same set of vertices, you can 
also do:

sage: h.set_pos(g.get_pos())

To use the same layout for both.

Nathann
 

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


Re: [sage-support] Re: view(g) where g is graph: does not respect colors

2015-12-01 Thread Nathann Cohen
Just completing the answers here, in case somebody needs it:

'view(g)' has a different behaviour in Sage and in SMC. In Sage it uses 
LaTeX, while in SMC it is more or less equivalent to g.show(method='js') 
(which relies on javascript/d3js, hence no latex whatsoever).

Currently, there is no way to specify a color for the vertices in 
g.show(method='js'). It is not hard to add if somebody needs it. I wrote 
this code and thus only added there what I needed. What I needed was a way 
to 'differentiate' vertices, and I do not mind what the colors are as long 
as they are different.

sage: g = graphs.PetersenGraph()
sage: g.show(method='js', vertex_partition=[g.independent_set()])

(I know, the vertex partition is not a vertex partition as not all vertices 
appear. The partition is automatically completed if necessary)

Let me also add that perhaps the colors are not so different from each 
other in this picture (I would guess dark blue/light blue) on your screens. 
I fixed that in #19591 (needs_review) and the result is blue/orange, which 
is much better.

Have fun,

Nathann

-- 
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: text3d and latex

2015-11-26 Thread Nathann Cohen

>
> P.S.: I checked the docs and couldn't find anything but this thread. On 
> the other hand, I cannot believe that such a basic thing hasn't been 
> implemented after many years.
>

Maybe those who need it are all waiting for "somebody else" to implement it?

Nathann 

-- 
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] Re: Behavior modulo float

2015-11-24 Thread Nathann Cohen
> The sage behaviour follows  mpfr_remainder (which it uses);

Is it wise to *not* follow python for something like that?

Nathann

-- 
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: help plotting graphs

2015-11-19 Thread Nathann Cohen
Hello John,

Here is a way to force your result:

sage: EllipticCurve('11a1').isogeny_graph().show(aspect_ratio=.1)

Graph.plot and Graph.show take a *LOT* of parameters:

1) Options specific to the plotting of graphs
2) Options specific to Graphics.plot()
3) Options specific to Graphics.show()

A long time ago I tried to make it a bit clearer by writing a doc which 
explains that, and lists all parameters accepted by the graph-specific 
functions:


http://doc.sagemath.org/html/en/reference/plotting/sage/graphs/graph_plot.html

As it was hardly the place to document Graphics.show() and Graphics.plot(), 
I added to the top of the 'Plot options' section two links toward the 
documentation of those two functions. The second of which, Graphics.show(), 
lists the keyword I used to produce the result you were looking for.

Of course that is rather unpractical, as you have to specify it yourself. I 
do not know [how/how easily] it could be made automatic. That may be a one 
liner, for somebody who is used to such code ^^;

Nathann

-- 
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] help plotting graphs

2015-11-19 Thread Nathann Cohen

>
> Thanks -- I was half-expecting Nathann to be the first to reply!


It was one of my 'no computer at work' day, sorry :-P
 

>  I don't (or rather, did not)  know what D3 is...
>

It is a javascript library for visualisation. If I remember correctly, the 
guy who wrote it (used to?) work for the New York times, and wrote a "Data 
Drivent Document" library meant to display 'nicely' the data provided by 
journalists.

The result is this crazy collection of scripts that display very elegantly 
in a browser whatever you may ever think of representing on a computer:

https://github.com/mbostock/d3/wiki/Gallery

They actually have ways to build a graph (add edges/vertices) in the 
browser, but having that in Sage would require some communication back from 
the browser to Sage. May be possible in William's cloud, but would be 
harder in 'bare sage'. The way it works at the moment for us is: 1) write a 
.html file 2) open it.

Nathann

-- 
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] help plotting graphs

2015-11-19 Thread Nathann Cohen
Hellooo,

Note that the renderer here evidently doesn't have edge labels implemented. 
> But using D3 (or something built on it) is the future for showing 
> "networks" in a webpage.  There's many javascript libraries that 
> attempt to solve this problem these days. 
>

Well, there is if you ask for them explicitly:

sage: graphs.PetersenGraph().show(method='js',edge_labels=True)

The same sense of civic duty led me to deal with the absurdly complicated 
cases of "Edge-labelled directed Multigraph with Loops":

sage: 
digraphs.GeneralizedDeBruijn(5,2).show(method='js',edge_labels=True,link_distance=150,link_strength=10)

By the way, there is a very very useful patch in needs_review just there:

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

It provides a zoom+translate feature to the d3js interface, which is 
mandatory to work with large networks.

I visualize graphs on thousands of nodes these days (really need to), and 
that would be totally impossible without this.

Nathann

 

-- 
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: Cutting, merging and visualizing trees

2015-11-07 Thread Nathann Cohen
Hello Rodrigo,

Sage has a Graph class that might help you in what you plan, but from your 
message I was not able to guess if you needed 'more' than just a graph 
class.

Turns out that we are many here to deal with graph/trees, but we do so in 
different ways. My trees are not rooted and not ordered, while 
combinatorialists here may have something closer to what you need. Have you 
taken a look at those pages?

http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/enumerated_sets.html#trees
http://doc.sagemath.org/html/en/reference/graphs/index.html#sage-graphs

Maybe they will tell you where exactly yuo need to look in order to 
translate your code into Sage code.

Have fuun,

Nathann

On Sunday, November 8, 2015 at 4:27:46 AM UTC+1, Rodrigo wrote:
>
> Hi. I would like to implement an algorithm that clips (rooted, ordered) 
> trees at certain points and then reconnect them at different points. I have 
> done it already using python alone, but I was hoping to do it in Sage to 
> make the visualization and debugging easier. Perhaps I should even redo the 
> whole thing using Sage tools from the beginning to avoid reinventing the 
> wheel going forward :) Could anyone please point me to the most appropriate 
> tools? Thanks!
>
>
>

-- 
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] RealSet Problem

2015-10-23 Thread Nathann Cohen

>
> As long as symbolics gets ignored by most devs such errors will persist.
>

You should try adding stopgap. That helps people notice. 

Nathann

-- 
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] Re: Planar graph drawing

2015-10-19 Thread Nathann Cohen
Hellooo,

> You are right in that the drawings output by sage do not correspond to the
> planar embedding. The get_embedding method says vertices are ordered in
> clockwise order whereas the drawing output by sage displays them in
> counter-clockwise order.

Oh. So you say that we should change the doc ? Would you know what
exactly is wrong in there ? I have to admit that I barely know that
code: I only touch it to fix bugs from time to time.

Nathann

-- 
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: Planar graph drawing

2015-10-18 Thread Nathann Cohen


Hell Dominique,

I read your email several times and was not able to find an obvious contadiction
anywhere in what you said, as you seem to understand well what is going on. This
being said, I cannot shake off the impression that you may expect the labels
(names) of your vertices to be taken into consideration when computing a
drawing. It *may* have an impact on the drawing indeed, but none you can predict
easily:

- Below, somewhere inside of the Graph class, your vertices are labelled as
  integers. This is the labelling that matters, and we just "pick any" that we
  find.

- This integer labelling will probably change, depending on the machine on which
  you run the code (and the weather, Sage's mood, etc.)

Thus, do not expect that a triangle ABC will appear in some specific way,
just because the vertices are named 'ABC'.

When you run your `layout(...)` instruction, Sage computes a position for the
vertices as well as a combinatorial embedding. Both should agree: the
combinatorial embedding tell you, for every vertex v, the list of its neighbors
(in clockwise order). This is the order that you should see when plotting the
graph with this layout.

If you are interested by the faces, you can easily get the list of them. Each of
them will be given [in clockwise order] by the following command:

 sage: Graph_1.faces()

Note that this command uses the layout/embedding that was previously computed
(because of 'save_pos=True').

>From the output of this command (or with .get_embedding) you can easily figure
out how the triangle ABC appears in the layout and, if this ordering does not
satisfy, "reverse" the layout, for instance with the following command (replaces
y with -y):

sage: Graph_1.set_pos({v:(x,-y) for v,(x,y) in Graph_1.get_pos().items()})

Calling .show() or .plot() will reflect (no pun intended) the changes.

Okayyy.. That was to help you "fix your problem" if it was blocking you
somehow. Now, perhaps you think that the solution should be easier, or that some
more documentation is needed, or that some functions may be changed, that some
may be added, that some should be rewritten.

If you see anything in this open-source software which you think should be done
differently to simplify your life's or other people's, then do not hestate to
state it here and, if you feel like it, to change Sage's source code to improve
it yourself (we will help whenever we can). This software is nothing but a
shared folder of code that we all use. We must change it whenever something
"could be better".

Have fun,

Nathann

-- 
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] Re: Planar graph drawing

2015-10-18 Thread Nathann Cohen
> I tried faces() but faces() is deduced from the "embedding" which is
> right... while subsequent plot is wrong (if you accept to see that in the
> planar plot BDF triangle neigbour vertices of 'B' are read clockwise
> ['F','D'] while in embedding it is ['D','F'])

Are you saying that on some instances the result of .get_embedding()
told you that ABC was in clockwise order while it was not so in a plot
of the graph itself ?

I am afraid that I do not see what troubles you, otherwise.

Nathann

-- 
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: Is this a bug in Polyhedron class (RDF vs AA)?

2015-10-12 Thread Nathann Cohen
Hellooo,

Is the following behavior normal:
>

Well... In the first case you work on an exact ring, and in the second case 
you compare the output of >= and > on an inexact ring.

I do not know if there is something wrong somewhere, but I do not expect 
float computations to be exact either, so I do not know...

Nathann

-- 
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] Is there any "up" link of the doc of combinat/ ? (i.e. link toward the parent page)

2015-09-24 Thread Nathann Cohen
Hello everybody,

I very often meet this problem when working on the doc of
combinat/designs/, i.e.:

- There is a link from page of "Graph Constructors" [1] to the general
the general "Graph Theory" page [2] (it appears at the top-left
corner, to the right of Sage's logo).

On the other hand, in combinat/ I cannot always find a link toward the
"parent" page, e.g.:

- There is *no* link from the "Catalog of combinatorial designs" [3]
toward the general page on "Combinatorial Designs" [4].

All that is available is a link toward the "Comprehensive module list"
which is, let's say, "not as practical".

It seems related to the "special management" of doc in the
combinatorial folder [5]. Is that missing link to be found somewhere?
Is there any way to add it?

Currently, I end up browsing from the reference manual's root page in
order to go from the "collection of combinatorial designs" to the main
"designs" page...

Thanks,

Nathann

[1] 
http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/graph_generators.html
[2] http://doc.sagemath.org/html/en/reference/graphs/index.html
[3] 
http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/designs/design_catalog.html#sage-combinat-designs-design-catalog
[4] 
http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/designs/__init__.html#sage-combinat-designs
[5] 
http://doc.sagemath.org/html/en/developer/sage_manuals.html#adding-a-new-file

-- 
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] Re: List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
Hello !

> There is no significantly faster method than trying all possibilities.
> Finding the minimum-weight codewords of a linear code is a hard problem.
> Since your code is not too big, the naive method takes only a few seconds.

Thanks for your answer. As it takes something like 40s and that it is
meant to become a Sage function, I hardcoded the result as compacty as
possible. We will have two versions of that code, the hardcoded one
(default) and the one that builds it from scratch (very long..) if we
need to check, or if the running time ever improves.

The ticket is http://trac.sagemath.org/ticket/19180.

> There are clever algorithms (still exponential) for computing the weight of
> the minimal weight codewords (the minimum distance of the code). I'm unaware
> whether these might be (or have been) modified to provide all minimum weight
> codewords, which could result in a practically significant speedup over the
> naive method.

HMmm... The odd thing is that %prun does not say much about what the
bottleneck is in those computations. It seems that GAP works in the
background, but I do not see it there ...

Nathann

-- 
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] Re: List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
> Seriously? At first, it crashed Sage with an error message asking me to
> install some package---which my OS did not know. Volker eventually told
> me that I have to install -devel...

But I know that I have all the packages, for it worked in the past.

> Anyway, if it crashes, I think you should report on sage-devel, and/or
> open a ticket.

I know Simon, I know that I must do reports, create tickets, work on a
fix and everything. I was working on a patch, and noticed that I
needed to add another thing first. So now I am doing that. And to do
that I must read GAP documentation to see how it works.

I cannot interupt and interruption of an interruption in order to do
this right now.

Nathann

-- 
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] List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
Hell everybody,

I am trying to build an interesting 2-design from the following code:

sage: c=codes.ExtendedQuadraticResidueCode(47,GF(2))
sage: c
Linear code of length 48, dimension 24 over Finite Field of size 2

This is to be done by listing all codewords of minimum weight (here
the weight is 12), but the *total* number of codewords is big. Is
there a faster way to obtain  only the list of light codewords?

THanks!

Nathann

-- 
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] Re: List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
> Perhaps %crun helps?

Ahahaa. Well I gave it a try and it crashed Sage every time without
any error message. Didn't feel like debugging this now ^^;

"perf top" does not say much either.

Nathann

-- 
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] Re: List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
Helloo again,

With this other code cleared, and I went back to this problem. You
were indeed right, I was missing the executable -_-

For some reason it was not here anymore, well. I installed it, and it
did its job. Most of the time seems to be spend on free module
elements, which is "expected", even though it probably wastes most of
the cycles.

It is still relatively easy to make this %crun crash, though:

sage: %crun -s cumlative BIBD_45_9_8(True)
/home/ncohen/.Sage//sage: line 134:  3174 Profiling timer expired
"$SAGE_ROOT/src/bin/sage" "$@"
~$

Nathann

-- 
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] Re: List the codewords of minimum weight

2015-09-10 Thread Nathann Cohen
>> sage: %crun -s cumlative BIBD_45_9_8(True)
>> /home/ncohen/.Sage//sage: line 134:  3174 Profiling timer expired
>> "$SAGE_ROOT/src/bin/sage" "$@"
>
> I got a similar error from time to time. I have no idea how it is
> triggered.

Ticket 19185 apparently fixes it. And I hope that it will also fix all
crashes due to this function.

Sorry for earlier, Simon. I really have a *lot* of things to do this
week, and when some thing triggers another which triggers another
which triggers another, I just see my mental todo-list go beyond what
I can manage and I switch to "survival mode", where I *must* finish
things so that the stack decreases.

I am on a more optimistic slope, now. Even though I still can't type
with my right index because of yesterday's "cooking" :-P

Have fun,

Nathann

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

-- 
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] Re: Linear Programming - loading LP or MPS file?

2015-09-02 Thread Nathann Cohen
> isn't it a bit too much code to have this for each backend, rather than just
> something that communicates with the
> frontend only?

Indeed. Were you thinking of something like that?

1) Use GLPK to load a LP/MPS from a file
2) Read the MILP at Python-level
3) Use the info to create a new MILP object, and return it along with
the MIPVariable

Nathann

-- 
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] Re: Linear Programming - loading LP or MPS file?

2015-09-01 Thread Nathann Cohen
> How would it solve the issue of communicating with the frontend?

For this I expect that we should be able to write a function
LP_from_file that returns both a MixedIntegerLinearProgram object and
a MIPVariable object, and that we will have to hack the MIPVariable
object a bit so that it matches the right variables in the MILP
object. Should not be much more involved than just force the integer
ID associated with a label.

Nathann

-- 
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: Conversion from HRepresentation to Vrepresentation

2015-07-16 Thread Nathann Cohen
Sorry for asking, but from your question I am note sure that you have 
noticed the Vrepresentation and Hrepresentation to be found in the 
Polyhedron class?..

http://doc.sagemath.org/html/en/reference/geometry/sage/geometry/polyhedron/base.html#sage.geometry.polyhedron.base.Polyhedron_base.Vrepresentation
http://doc.sagemath.org/html/en/reference/geometry/sage/geometry/polyhedron/base.html#sage.geometry.polyhedron.base.Polyhedron_base.Hrepresentation

Or are you looking for something else?

Nathann

On Friday, July 17, 2015 at 2:58:30 AM UTC+2, Anamika wrote:

 I am working NNC_Polyhedrons. It needs to be reprented by 
 HRepresentations. But, for visualisation and some computation purposes, I 
 need to get the VRepresentation from the Hrepresentation of an 
 NNC_Polyhedron.
 Is there anything already implemented like that?


-- 
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: bug in == operator?

2015-07-13 Thread Nathann Cohen


 This is in SageMath Version 6.6, Release Date: 2015-04-14 running on a 
 MacBook.  The following lines print 'equal', even though m and m1 do not 
 appear equal to me!


It seems that this equality is an equality over 'double' floats. So not all 
digits of your numbers are taken into account.

Is there a way to force a more exact equality test?

Nathann
 

-- 
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] Re: bug in == operator?

2015-07-13 Thread Nathann Cohen
 Is there a way to force a more exact equality test?

It works as intended over QQbar:

sage: QQbar(m) == QQbar(m1)
False

Nathann

-- 
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] Re: bug in == operator?

2015-07-13 Thread Nathann Cohen
 PS Testing over QQbar certainly does give False, as it would for m*sqrt(1/2)
 and n for any pair of integers (m,n) not (0,0), since sqrt(2) is irrational!

Wouldn't it be better to compare 'exact types' in an exact ring? Here
we compare two exact types in a non-exact field.

Nathann

-- 
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] Re: Where is the modular_decomposition spkg?

2015-07-13 Thread Nathann Cohen
 I would nevertheless like to try and see if I can get this sage package on
 my machine---if only just to see the bug in action myself. Do you know what
 might be causing the error I'm getting with sage -i?

No sorry, I really cannot guess what is happening :-/

Nathann

-- 
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: Where is the modular_decomposition spkg?

2015-07-13 Thread Nathann Cohen
Hello! 
 

 (with the bug fixed?).


No, the bug has not been fixed despite having been reported regularly (with 
reminders) to the authors. If you like this feature, please consider 
writing to the authors to tell them so, and ask them to solve this problem:
https://groups.google.com/d/msg/sage-support/Iha5__c_h44/ZGRgZQRnsnkJ

I think of this code from time to time, and I was about to create a ticket 
to remove it from Sage two weeks ago. The feature is nice, but the code 
returns wrong results and is apparently unmaintained. We cannot host it 
forever in this state.

Nathann

-- 
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] bug in == operator?

2015-07-13 Thread Nathann Cohen
 Despite what other people are saying in this thread, I definitely 100%
 consider the above a bug.

Despite what you say about what other said, I also believe that it is
a bug and that others in this thread agree with you.

But what about *two* bugs?
1) SR says that two unequal things are equal, and it should not say so
unless it can *prove* it (and here it cannot)

2) Why should an_integer * sqrt(1/2) belong to SR? Why isn't it
turned into an algebraic number immediately? If it did, the problem,
would be solved too, for:

sage: QQbar(m) == m1
False

Nathann

-- 
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] bug in == operator?

2015-07-13 Thread Nathann Cohen
 2) Why should an_integer * sqrt(1/2) belong to SR? Why isn't it
 turned into an algebraic number immediately? If it did, the problem,

 Nils answered 2 already and I agree with Nils.

I do not think that he did. The __repr__ function of algebraic numbers
is bad indeed, but if we can have this:

sage: QQbar(sqrt(2))
sqrt(2)

Then I believe that an_integer*sqrt(2) should be a member of QQbar,
and not rely on SymbolicRing.

I just created a thread about this __repr__ issue:
https://groups.google.com/forum/#!topic/sage-devel/dB-E7VjEFr4

Nathann

-- 
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: plot a 3d polyhedron with transparent background?

2015-07-07 Thread Nathann Cohen


 When I do the same for a 3d polyhedron, the background is white.


Given that p3.show(whatever=15) does not raise an exception, I would say 
that 'transparent' is not supported for 3d plots and that your argument is 
ignored.

Nathann 

-- 
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: git from trac.sagemath.org out of order ?

2015-06-12 Thread Nathann Cohen
Desperately trying to push something, the function hangs.  I also cannot 
get to load the ticket I want to update [1] :-P

Nathann

[1] http://trac.sagemath.org/ticket/18681

-- 
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] Re: git from trac.sagemath.org out of order ?

2015-06-12 Thread Nathann Cohen
Yo !

 1) Go to google, type in level3, click on search tools - past hour

Come on man, how do you 'guess' level3?

 2) https://en.wikipedia.org/wiki/Tier_1_network

I was doing that, but again how do you guess that name? Is there
some book explaining all this?

Nathann

-- 
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] Re: git from trac.sagemath.org out of order ?

2015-06-12 Thread Nathann Cohen
 And of course

 $ traceroute trac.sagemath.org

Yeah. Well at that time mine involved different operators. Cogentco or
something.

Nathann

-- 
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] Re: git from trac.sagemath.org out of order ?

2015-06-12 Thread Nathann Cohen
 Apparently Telekom Malaysia
 (https://twitter.com/TMCorp/status/609167065300271104) broke the internet
 for a short while until the Tier 1 providers cut them off...

Hey man, can you share the wisdom!?

1) How did you figure that out?
2) How do you learn about internet's organization (Tier 1, Level 3, Telia?...)

Nathann

-- 
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] Re: git from trac.sagemath.org out of order ?

2015-06-12 Thread Nathann Cohen
 Should we sacrifice a goat ? (Or a manager...)

Things seems normal again here. If you don't think that you will eat
that whole goat by yourself, you can count me in.

Nathann

-- 
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] Re: How to extract mutually disjoint perfect matchings?

2015-06-09 Thread Nathann Cohen
 Didn't get you. Can you explain a bit more?

A partition of the edges of a graph into disjoint matchings is called
an edge-coloring. With the function I gave you, you can compute an
edge-coloring of your graph which, because that graph is a K_{n,n},
will be a collection of disjoint perfect matchings.

Note that it may be a bit slow. You have a faster way to obtain what
you desire with:

sage: n=5;designs.transversal_design(2,n,resolvable=True)._classes
[[[0, 5], [1, 6], [2, 7], [3, 8], [4, 9]],
 [[0, 6], [1, 7], [2, 8], [3, 9], [4, 5]],
 [[0, 7], [1, 8], [2, 9], [3, 5], [4, 6]],
 [[0, 8], [1, 9], [2, 5], [3, 6], [4, 7]],
 [[0, 9], [1, 5], [2, 6], [3, 7], [4, 8]]]

What you see is a list of [list of pairs], and each [list of pairs] is
a perfect matching in graphs.CompleteBipartiteGraph(n,n). They are all
disjoint.

Nathann

-- 
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: How to extract mutually disjoint perfect matchings?

2015-06-09 Thread Nathann Cohen


 Say I have a K_{n,n} and from it I want to extract d mutually disjoint 
 perfect matchings. 

 How can this be done? 


http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/graph_coloring.html#sage.graphs.graph_coloring.edge_coloring
 

-- 
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: List of values for vertex_shape

2015-05-29 Thread Nathann Cohen
I just looked at the code and it seems that vertex_shape is an alias for 
the marker parameter from matplotlib.

Thus, the possible shapes are there:
http://matplotlib.org/api/markers_api.html

We should add this information in the documentation of graph plot options 
(http://doc.sagemath.org/html/en/reference/plotting/sage/graphs/graph_plot.html)

Nathann

On Thursday, May 28, 2015 at 2:52:44 PM UTC+2, jori.ma...@uta.fi wrote:

 Plotting a graph has option vertex_shape. Where is the list of possible 
 values? 

 -- 
 Jori Mäntysalo 


-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-08 Thread Nathann Cohen
Small update on the 'modular decomposition story'.

Today I ran valgrind on the code, and ended up finding where the error
comes from. Around line 972 of dm.c, one can find:

for(v = n-1; v=0; v--)
  if(ds[v-1] != -1){
  L2[v]=v;
  while( pile[sommet]  ds[v-1])
L2[pile[sommet--]]=v;
}

Now, because v can be equal to 0 in the loop, ds[v-1] is actually
ds[-1] and leads, unsurprisingly, to a wrong area of the memory.
Valgrind reports it like that:

==23980== 1 errors in context 3 of 4:
==23980== Invalid read of size 4
==23980==at 0x40269D: algo2 (dm.c:972)

Thus it is rather obvious where the error comes from (there are some
other occurrences of the same problem). I was about to write an email
to the authors, when I noticed that. I had already sent an email
with the very same information, i.e. line number+explanation+short
tutorial on valgrind, and that was... one year ago. On the 6th of
April 2014, to be specific.

So that is not a problem of having to debug under mac OS X.

Nathann

-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-08 Thread Nathann Cohen
 Was it about the same version of their code?

I cannot swear that they have not changed a single character of their
code in the meantime. What I can tell for sure is that the same error
still exists at the same line of their file, on the copy I downloaded
this morning.

 Maybe we should tell the code authors that we will have to remove it from
 Sage if they will not fix the bug?
 (and not have certainly wrong code in Sage?)

Maybe ... Just thinking that they might ignore that email too... _

Nathann

-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-08 Thread Nathann Cohen
 I trust that you know the proper order of these powerful French words
 starting from p and m better than me.  ;-)

I sent them an email asking if anything had been done about this bug,
and saying that we would remove the code otherwise.

Nathann

-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-08 Thread Nathann Cohen
 maybe we should just keep posting strong-worded statements about quality of
 that code,
 perhaps in French ;-)

I prefer your technique. You are waiting for me to do something about it, right?

Nathann

-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-03 Thread Nathann Cohen
Hello !

 Thank you very much. With your help I was able to compile the library from
 the new sources and it is working properly now, although just for me of
 course.

Good :-P

 I understand your disappointment because of not being able to solve
 the issue for everybody.

 I am willing to write to the author of the C code but I do not know what
 exactly to ask him to do. The main problem is that the code works right in
 some architectures (at least in ours and in the one of the author I guess).

Well... Probably that it would be cool if they could try to test and
debug it under Mac OS X (seems like it aways fails on this
architecture), for there are known bugs and that their code returns
wrong results on this platform. I don't exactly know how to make them
understand that this is important O_o

 So what is needed the most is active involvement from some other Sage user
 interested in having the modular_decomposition package to work in a
 different architecture so as detect what should be modified in the C code to
 make it work in that architecture too. Is there someone out there?

Someone with a mac. Someone who preferably knows french, as the all
comments are in french.

 I really appreciate your effort to make modular decomposition available in
 Sage because for some of us this is very useful. I think that keeping
 modular_decomposition as an optional package should be useful for testing
 purposes in different architectures until the portability problem with the
 source code is identified and solved.

I have to day that I am a bit pessimistic. The code has been in Sage's
source tree for years already :-/

Nathann

-- 
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] Re: Serious bug in Graph.modular_decomposition (which propagates to Graph.is_prime)

2015-05-02 Thread Nathann Cohen
Hello !

 I would like to know if there is any workaround for solving this issue for
 version 6.6. Unfortunately, there is no dm.c and no random.c in the sage 6.6
 directory structure so as to replace them and so I do not know how to
 proceed.

Sigh... Modular decomposition. A story of many disappointments.

No, right now you will not find those two files in Sage's source code.
They are, however, contained in the optional package that is
downloaded when you run sage -i modular_decomposition, and all that
is done on them is compile them into a shared library named
libmodulardecomposition (if I remember correctly. Not of my own
computer at the moment) located in SAGE_ROOT/local/lib/. If you
compile this shared library from the new sources, there should not be
any problem. If you do not know how, open the archive and look at
spkg-install, it contains the lines that do that.

I feel a bit guilty telling you how to make it work on your computer;
for we have a REAL problem with this package. What we need is to get
the original authors to solve it.

1) The old version of the sources (those that we ship) returns wrong
results. For instance on yours, as you were the one who reported it
first.

2) The new version of the sources apparently returns correct results
on your architecture (and on mine), but  not on all of them. Look
at this ticket I opened when you first reported it:
http://trac.sagemath.org/ticket/13744

As you can see, the new version still triggers segfaults or wrong
results on some machines that we use to test Sage. Thus, my attempts
at upgrading Sage's version of the code were (rather legitimately)
refused.

I am stuck with those files, and I do not like this situation (at
all). We ship something which returns wrong results, the problem is
fixed by updating to a new version which returns wrong results too or
even segfaults, and of course I get absolutely no answer from the
authors, whom I reminded regularly of the problem.

To be honest, I feel like removing this from Sage. That was part of
the reason behind that more recent change, which made it an optional
package.

Really, the best you could do to help us is send an email to the
authors. Tell them about your problem, and how cool it would be if it
worked, as this situation is bad advertisement for everybody.
Computing modular decompositions is cool and everything, but we can't
just keep buggy code in Sage, even if we raise a warning whenever it
is used :-/

Nathann

-- 
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] Re: How can I search and count all induced subgraphs in a directed graph with edge labels?

2015-04-30 Thread Nathann Cohen
Hello,

I am not sure that I understood your message very well. Are you saying
that one way to achieve what you do would be to call the current
subgraph_search methods, and to *filter* among its results those
which are actually *equal* (considering edge labels) to the graph you
are looking for?

If so, it works. It is just.. Well, ugly in the backscene. But if you
only deal with very small instances, then the following does what you
like:

g = DiGraph({0: {1: 'a'}, 1: {2: 'b'}})
s = DiGraph({0: {1: 'a'}})

def subgraphs_with_labels(G,H):
r
An iterator over all subgraphs of G isomorphic to H (edge labels are taken
into account)

G = G.copy()
H = H.copy()
G.weighted(True)
H.weighted(True)
Hverts = H.vertices()
for g in G.subgraph_search_iterator(H):
gg = G.subgraph(vertices=g)
gg_rel = gg.relabel(dict(zip(g,Hverts)),inplace=False)
if H == gg_rel:
yield gg

sage: list(subgraphs_with_labels(g,s))
[Subgraph of (): Digraph on 2 vertices]

Nathann

-- 
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: How can I search and count all induced subgraphs in a directed graph with edge labels?

2015-04-25 Thread Nathann Cohen
I created ticket #18296 to try to make it clearer.

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

Nathann

On Thursday, April 23, 2015 at 2:46:01 PM UTC+2, Nathann Cohen wrote:

 By the way: in Sage, you do not need to create the vertices before 
 creating the edges. Adding the edges will also add the vertices.

 Nathann


-- 
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: How can I search and count all induced subgraphs in a directed graph with edge labels?

2015-04-23 Thread Nathann Cohen
Hello,

These functions do not take edge labels into account. When the 
documentation says that it counts/enumerates/find 'labeled' copies of a 
graph, it means precisely that the number of copies of a graph G in itself 
is equal to the size of Aut(G), the automorphism group of G.

It is the same terminology used here, for instance:
http://oeis.org/A001187

In this terminology, an unlabeled graph is a graph up to isomorphism.

Nathann

-- 
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: How can I search and count all induced subgraphs in a directed graph with edge labels?

2015-04-23 Thread Nathann Cohen
By the way: in Sage, you do not need to create the vertices before creating 
the edges. Adding the edges will also add the vertices.

Nathann

-- 
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] Re: bug in graph embedding?

2015-01-21 Thread Nathann Cohen
Hello again!!!

 You're riight.  After looking carefully at my definition of cy (the cyclic
 order of the non zero group elements that give the cyclic order of the edges
 around each vertext) I noticed that instead of A*C^-1 I had AC^1. Once I
 corrected that everything works.

Cool. Mystery solved.

 However shouldn't _check_embedding_validity detect that something was wrong
 with my dictionary? I did give

 k12._check_embedding_validity()

 and sage returned True.

This is totally right. For this reason, I created a new trac ticket
[1] which contains some new code for Sage: it will be able to catch
the bug you encountered, and will raise much more meaningful messages
than 'True/False' when something does not occur as expected. In your
case, the code would break at this moment:

sage: k12.set_embedding(imb)
...
ValueError: The list associated with vertex A contains 1 occurrences of: [C]

Now here is the deal: new code, when it is written, must be reviewed.
Consequently, it will not be merged into Sage before somebody comes,
reads it and checks that it all works, then sets the ticket to
positive_review. This is a lot of work and things to learn when you do
not know Sage's workflow, but on the other hand nobody can add
anything into Sage unless somebody volunteers to do that job. If you
were willing to give it a try it would definitely help get this patch
reviewed+merged quickly. Some documentation to start the
sage-development-adventure can be found there:
http://www.sagemath.org/doc/developer/

 Anyway sorry for my silly mistake and thanks a lot for your help.

Look at what happened: you found Sage misbehaving somewhere, asked a
question, and as a result Sage is being patched and will not make the
same mistake again. That's how free software works, and if nobody
reports the problems they just stay as they are.

Thanks for the report, and thanks for your help and time if you have
some to spare for Sage.

Good evening,

Nathann

[1] http://trac.sagemath.org/ticket/17656

-- 
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: bug in graph embedding?

2015-01-21 Thread Nathann Cohen
Hello,

I'm looking at embeddings of complete gaphs and I think I've found a bug: I 
 defined the complete graph k12 as a (sort of) Cayley graph of the group 
 Z₂²× Z₃ as follows: 


First, it seems that the Python code you copy/pasted in your message lost 
its indentation. Thus, I have no way to make sure that the identation I 
used is the one that you used.

This being said, it seems that the problem comes from your dictionary 
'imb': it should associated, to each vertex v of your graph, the list of 
its neighbors in some cyclic ordering. What Sage seems to say, however, is 
that while A*C appear in the list associated to 1, it is unable to find 1 
in the list associated to A*C.

I will try to make the error message more helpful.

Nathann

-- 
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: Permutation actions on vectors

2015-01-13 Thread Nathann Cohen


 It would be more natural ro convert it to a matrix group, and then use 
 the natural action of this group. 


This is related:

http://www.sagemath.org/doc/reference/combinat/sage/combinat/integer_vectors_mod_permgroup.html

Nathann 

-- 
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] Finite, connected digraphs returning infinite diameter

2015-01-11 Thread Nathann Cohen
Hello !

 (it seems like is_connected should really only be used for undirected 
 graphs).


It is useful from time to time in digraphs too. Sometimes you cannot split 
a DiGraph problem into one sub-problem for each strongly connected 
component, yet it is possible if you consider independently the 'connected 
components of the underlying graph'.

This being said, if you think that it could confuse other persons you could 
add some [note/longer explanation] in the documentation of 
GenericGraph.is_connected. This could clearly be made clearer, with a 
pointer toward `is_strongly_connected` for instance.

Nathann

-- 
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: 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 bm.transpose() instead of bm. You tanspose bm when you
use it in the first loop, and you transpose bm() again in
vec2int[j].transpose().

Also, given that the profiling does not say much of where 99% of the
computations is going, try to run your code without the .write() calls
(and their internal str() calls). Make it run without storing anything
and see how it goes. Perhaps you should store the results directly as
Sage objects using save and not as strings... No idea, you need to
test things ^^;

Nathann

On 4 December 2014 at 03:44, Nils Bruin nbr...@sfu.ca wrote:
 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
 vec2int[j].transpose()
 to the out loop. No need to cache it.

 In any case, your profiling data indicates:

 1   85.572   85.572  113.024  113.024
 string:9(constructGraph_fast)
   3733128   10.4130.000   10.4130.000
 matrix_space.py:145(__classcall__)
   16044189.4340.000   19.9210.000 {method 'transpose' of
 'sage.matrix.matrix_dense.Matrix_dense' objects}
   16044183.1860.0004.1740.000 {method '__copy__' of
 'sage.matrix.matrix_generic_dense.Matrix_generic_dense' objects}

 so most time is spent in constructGraph_fast, which I guess is your
 program itself. The transpose is a bit noticeable but hardly constitutes the
 majority of the time. The construction for the matrix spaces is incurred
 twice: both for the transpose and for computing the product. By pulling the
 transpose to the outside loop that should roughly be cut in half (and you'd
 only have the sqrt of the number of transposes).

 It looks like most time is getting lost in basic python interpretation and
 shuffling around elements. If you make a big matrix out of cache[i] vectors,
 you can eliminate the loop over i. The only thing left would be inspecting
 the elements, for which you can then write a simple cython routine (which
 should be lightning fast).

-- 
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: Memory leaks with LP Solvers are back

2014-12-01 Thread Nathann Cohen
Just to say that this got fixed in #17320

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

Nathann

-- 
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: How to free memory used by object?

2014-11-29 Thread Nathann Cohen
Hello !

This post reminds me of

https://groups.google.com/d/topic/sage-devel/awjiHPph6f8/discussion

which in turn 
became: https://groups.google.com/d/topic/sage-devel/q5uy_lI11jg/discussion

None of which have been addressed since, I believe.

Nathann
 

-- 
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: Drawing edge colorings

2014-09-25 Thread Nathann Cohen
The edge_coloring command has a dedicated hex_colors argument::

sage: edge_coloring(graphs.CycleGraph(6),hex_colors=True)
{'#00': [(0, 5), (1, 2), (3, 4)], '#ff': [(0, 1), (2, 3), (4, 5)]}

If you want to see the edge coloring, you can do:

sage: g = graphs.PetersenGraph()  
sage: g.show(edge_colors=edge_coloring(g,hex_colors=True))

In general, always look at all options of the graph commands. They contain 
a lot of 'hidden' features. I spent many nights implementing stuff that 
ended up as an optional flag in a related function.

Nathann

On Wednesday, September 24, 2014 12:49:10 PM UTC+2, Dominique Laurain wrote:

 sorry ..: cell (not shell)





-- 
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: promote Sage on python success stories

2014-08-27 Thread Nathann Cohen


 Please consider adding on Python mainstream webpage some info about Sage 
 project. It was a great idea to choose Python as a main programming 
 language to implement Sage project. 
 So I think that python and python foundation will be proud to hear about 
 that. So I think that it will be good idea to add some notes here:
 https://www.python.org/about/success/


I am not sure that we qualify. We have an ongoing debate about whether Sage 
is a failure :-)

Nathann 

-- 
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] Re: Cartesian n-product of set for given n

2014-08-19 Thread Nathann Cohen
Yo !

 Ah, seems to be quite a compact form!

Yeah, but it only does what you want. Nothing involving more
complicated objects like category functions do.

 But after two days of wondering I don't know how to generate all lower
 triangular matrices with non-zero elements taken from, say, [0,1]. For all
 matrices it seems simple:

Try to understand how that works then:

from itertools import product
n = 3
S = [-1,1]
for m in product(*[S if i=j else [0] for i in range(n) for j in range(n)]):
m = Matrix(n,n,m)

print m.str()



 N=3; v=[0,1];
 p=product(product(v, repeat=N), repeat=N)
 print matrix(ZZ, p.next())
 print matrix(ZZ, p.next())
  . . .


 P.S. : Sage is open source: when you hate something, come and change it.


 It's not always possible. Or what_to_do to DifferentNamingStyles like
 KleinFourGroup vs. is_isomorphic?

 --
 Jori Mäntysalo


 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/OqnJVbY7NRU/unsubscribe.
 To unsubscribe from this group and all its topics, 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.

-- 
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] Re: Cartesian n-product of set for given n

2014-08-19 Thread Nathann Cohen
Yo !

 Ah, seems to be quite a compact form!

Yeah, but it only does what you want. Nothing involving more
complicated objects like category functions do.

 But after two days of wondering I don't know how to generate all lower
 triangular matrices with non-zero elements taken from, say, [0,1]. For all
 matrices it seems simple:

Try to understand how that works then:

from itertools import product
n = 3
S = [-1,1]
for m in product(*[S if i=j else [0] for i in range(n) for j in range(n)]):
m = Matrix(n,n,m)
print m.str()
print '-'*20

 P.S. : Sage is open source: when you hate something, come and change it.

 It's not always possible. Or what_to_do to DifferentNamingStyles like
 KleinFourGroup vs. is_isomorphic?

Believe me: this is the kind of stuff that frequent developpers do not
see anymore on sage-devel, and if you don't bring it up it will never
change. My answer, which is just a description of what is going on, is
that you will see upper case in functions which create a mathematical
object, i.e. a group, a graph, that sort of things, while the methods
applied to them are in lower case.

But basically I was not even conscious of that, even though I have
been applying it for years. So write to sage-devel whenever something
feels wrong.

This CartesianProduct AND cartesian_product should be removed. But
that's categories, so you never know when that will happen.

Have fn !

Nathann

-- 
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] Re: Cartesian n-product of set for given n

2014-08-17 Thread Nathann Cohen
Yo !

Uh, cartesian_product and CartesianProduct on same system. My love-hate 
 -relationship to Sage just moved slightly to hate-side. 


Please, be respectful of other people's work and focus your hate on Sage's 
categories. The rest is quite fine :-P

I only wanted to add on the same topic that you should beware of everything 
related to categories, and that unless you want something more complicated 
than just a cartesian product in order to list its elements, it is better 
and safer to use itertools.

What you asked in your first post can be done with

from itertools import product
product(range(n),repeat=n)

And if you want the product of more complicated things (with sets of 
different size) you can use the trick that was first proposed above, i.e.:

product(* [range(x) for x in [2,2,2,3,3,3,2,3]] )

Nathann

P.S. : Sage is open source: when you hate something, come and change it. 
Unless it's categories, in which case you're stuck.

-- 
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: problem with sig_on() and sig_off()

2014-08-17 Thread Nathann Cohen
That's because you need to explicitly import/define sig_on and sig_off. I 
guess that this is done automatically when the extension is .spyx.

In the file sage/graphs/cliquer.pyx it is done with the line :

include sage/ext/interrupt.pxi

Nathann

On Sunday, August 17, 2014 10:11:48 PM UTC+2, Paul Mercat wrote:

 Hi !

 I have writed some C code that I've integrated to sage using a .spyx file, 
 and it work well.
 But when I put it in the sage source code and replace the .spyx extension 
 by .pyx, the functions sig_on() and sig_off() doesn't work anymore (if I 
 avoid them, it works well).
 I get the following error :
 {{{
 sage/combinat/words/cautomata.pyx:364:14: undeclared name not builtin: 
 sig_on
 }}}
 Do you know why there is this error and how to fix it ?

 Thanks,
 Paul



-- 
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: G.relabel problem

2014-04-28 Thread Nathann Cohen
Hello !!

Using 
G.relabel( [ i+1 for i in range(G.order()) ], inplace=True )
 and repeat the same command once more causes the error below.


That is because of that (rom the doc of Graph.relabel) :

If ``perm`` is a dictionary ``d``, then each vertex ``v``
(which should be a key of ``d``) is relabeled to ``d[v]``.
Similarly, if ``perm`` is a list or tuple ``l`` of length
``n``, then each vertex (which should be in `\{0,1,...,n-1\}`)
is relabeled to ``l[v]`

I agree that the error message is not clear, though.

The reason is the following : If your vertices are named 
a,r,whatever,hello and you want to relabel them with 1,2,3,4 then 
there is no way to know which vertex is theone that should be renamed to 1, 
which to 2, etc ... If your vertex set is 0,1,2,3 ... to begin with,  then 
we can assume that you want vertex 0 to be renamed to the first vertex of 
your list, vertex 1 to the second, etc ...

When you use the second syntax :
 

 But using 
G.relabel(lambda i: i+1, inplace=True)
 twice does not produce the error.


there is no such doubt, and we know which vertex should be renamed to which 
output by applying the lambda function.

I think we should change the code above, so that when you feed .relabel() 
with a list then the first vertex of g.vertices() is labeled with the 
first vertex of your list, etc, etc ... I hope that it will not create 
any confusion that I do not see at the moment.

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
Okay, thanks to this vector trick I was able to do what I wanted. Do you 
believe that the syntax should be changed so that A(vector(whatever)) has 
the same result as A(whatever) ? vector does not add a very meaningful 
information here ...

Nathann

-- 
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] How can I see GF(8,'x') x Z/3Z as an additive group ?

2014-04-28 Thread Nathann Cohen
Hello everybody !

I need to use the elements of GF(8,'x') x Z/3Z as an additive group. Is
there a way to do this with Sage ? I need that to add more combinatorial
designs :-)

Thanks !

Nathann

-- 
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: G.relabel problem

2014-04-28 Thread Nathann Cohen
The problem is now fixed by this ticket :

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

If you can review it, it will be merged faster, possibly into the next 
release :-)

Thanks for the report,

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 I think that the point is to allow creation of elements either with respect 
 to the input generators (using vector) or with respect to the simplified 
 generators (without vector).  Since both sort of input look the same (tuples 
 / lists) I am guessing that the trick of using vector is just that -- a 
 trick to be able to distinguish these.   Other ways are possible, for sure.

Hmmm... Is there any point to handle both at the same time ? Why
shouldn't this decision be made when the group is built, in order to
be able to use either
1) The tuple corresponding to how the user built the group (much more natural)
2) The tuples corresponding to the reduced form if the user asked for
it during the construction ?

My problem is that I have no idea of how to make those changes... I
looked at the code but these things are inherited from
God-knows-where...

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 Thats it.

The syntax is awful, do we agree on that ?

 -1, some method returns an abelian group and you don't know how it was
 constructed without having to dig around.

?

But when I create a group by myself which I want to be equal to Z/2Z *
Z/3Z I end up with something different, isn't that a more important
problem ?

Right now, when I create MY group by writing is as I want as a
product, I have to call __repr__ to see what it accepts as input. If a
function built the group I can do the same, can't I ?

Come on guys... Don't tell me that creating a group as a product and
not even knowing how to convert a tuple to an element of my group is
not a problem ! This vector trick is nice, but you can't expect
anybody to figure it out immediately, and clearly the default
behaviour is not the right one !

Nathann

-- 
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: add_constraint becomes slow in presence of many constraints

2014-04-28 Thread Nathann Cohen
Helloo !!!
 

 I think this is right. Allocating  copying such a huge matrix repeatedly 
 would be terrible. Perhaps we should introduce an API function to 
 add_constraints, which takes a list of lists, or a matrix? If a solver 
 doesn't support such a thing, we could fall back on the brute force method.


I am almost sure that all solvers support that. Some allocate new 
constraints function that would just be called befre creating the actual 
constraints :-)

Nathann 

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 Its always going to be somewhat confusing to have both the original
 definition and a canonical form around. Feel free to add more descriptive
 construction methods for elements. The ctor argument convention is because
 that was chosen originally and I didn't want to break code when refactoring
 it for libgap.

What do you think the implications of the following changes would be ?

-if isinstance(x, (list,tuple)):
-try:
-x = self.optimized()[0].V().linear_combination_of_basis(x)
-except ValueError as msg:
-raise TypeError(msg)
-elif isinstance(x, FGP_Element):
+if isinstance(x, FGP_Element):
 x = x.lift()
 return self.element_class(self, self._V(x))

This changes the codes that appears in :

sage: g=groups.misc.AdditiveAbelian([4,3,3,5])
sage: g._element_constructor??

The thing is that I really know nothing about groups, nothing about
their implementation in Sage, and that I have no idea what the impact
of such changes can be  :-/

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 I don't think that will work if you are relying on the error message to
 indicate the wrong length of input.  For example:

 sage: AdditiveAbelianGroup([6,2])
 Additive abelian group isomorphic to Z/2 + Z/6

 Now you will expect the element (1,0) to have order 6 but it has order 2.

No, this looks good !

sage: G=AdditiveAbelianGroup([6,2])
sage: G(vector([2,2]))
(2, 0)
sage: G(vector([1,0]))+G(vector([1,0]))
(2, 0)

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 I would think that this is incompatible with the current syntax.

Yes of course, that changes the default ! But I am not so sure that it
would break many things, as the current implementation is so
unreliable that you cannot guess what G accepts as input, unless you
made sure to define it with a reduced form already. So I am not sure
it will break a lot of things.

  If
 anything, we should add a G.linear_combination_of_gens in addition to the
 existing G.linear_combination_of_smith_form_gens and in doubt you should use
 these over just calling G().

I was more worried about performance issues. Really, I am not so sure
that it would break so much. Of course it means changing the default
behaviour, but who can use the default behaviour as it is ? I mean :
if you define the group from a reduced form already, then there will
be no change. And if you did not, well, you were in trouble already
because you had to first make sure that you gave the right things as
input.

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 Hence it can break code that people have written privately.

I believe that not so many have written such code, for the very same
reason. But indeed if we change that we will need a deprecation step.

Don't you agree that this change would make sense ?

I just did the change I mentionned above, and run the long tests on
all files. The only doctests which broke are documentation on why you
do not get what you expect when you feed a group with a tuple.

You can see which doctests break in u/ncohen/tmp (which removes them).
Of course the documentation would have to be updated, but this
behaviour is much more natural 

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 The default repr is in terms of smith form gens, so IMHO it makes more sense
 to default to a linear combination of smith form gens. Imagine some method
 returns an abelian group, how are you going to construct elements?

Well, obviously by changing repr, no ? O_o

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
I mean ... Really, nobody cares what the smith form generators are.
It's a technical problem, the user does not even have to be aware of
that !

Nathann

On 28 April 2014 17:19, Nathann Cohen nathann.co...@gmail.com wrote:
 The default repr is in terms of smith form gens, so IMHO it makes more sense
 to default to a linear combination of smith form gens. Imagine some method
 returns an abelian group, how are you going to construct elements?

 Well, obviously by changing repr, no ? O_o

 Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 Moreover, how are you going to deprecate it? When is a deprecation warning
 shown?

Ahahahah. That's an interesting question, but the current way being
bad, there is absolutely no way that it will stay like that forever
just because we don't know how to tell the users :-D

I had something a bit unpleasant in mind... Just showing a deprecation
warning in this __call__ function saying that the standard WILL
change, and doing nothing... And removing the lines we need to remove
one year from now.

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
To be honest, I would prefer to do the opposite. Changing it now while
printing a message saying that the format changed, and removing the
message one year  from now.

Nathann

On 28 April 2014 17:27, Nathann Cohen nathann.co...@gmail.com wrote:
 Moreover, how are you going to deprecate it? When is a deprecation warning
 shown?

 Ahahahah. That's an interesting question, but the current way being
 bad, there is absolutely no way that it will stay like that forever
 just because we don't know how to tell the users :-D

 I had something a bit unpleasant in mind... Just showing a deprecation
 warning in this __call__ function saying that the standard WILL
 change, and doing nothing... And removing the lines we need to remove
 one year from now.

 Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
 Showing a deprecation warning for valid input isn't ideal ;-)

Indeed, indeed. Right now it prints the following input, which I hope
will be taken seriously by those who should, and be ignored by those
who should :

sage: x = A([5]); x
doctest:1: DeprecationWarning: The default behaviour changed ! If you
*really* want a linear combination of smith generators, use
.linear_combination_of_smith_form_gens.
See http://trac.sagemath.org/16261 for details.

 How about we deprecate all list/tuple input and force the user to use
 G.linear_combination_of_smith_form_gens / G.linear_combination_of_gens.

Well... It's more proper, but it does look a bit too extreme... :-/

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
Hello guys !

I just created ticket #16261 about this and uploaded my branch. It's
funny that to make all tests pass I only had to add four
linear_combination_of_smith_form_gens...

Now the problem is that I have no idea how to change .short_name()
(which is called by __repr__), as I have no idea how to get back the
signature of the abelian group. The one which is used by the elements
^^;

If anybody can help me there, or take a technical look at this patch.
I am afraid that I really know next to nothing about all the
math/programming involved there.

Nathann

On 28 April 2014 17:36, John H Palmieri jhpalmier...@gmail.com wrote:
 Here's something I find really confusing about additive abelian groups:

 sage: H = AdditiveAbelianGroup([0,2])
 sage: H((2,0))
 (0, 0)
 sage: H(vector((2,0)))
 (2, 0)

 sage: H((1,0)).order()
 2
 sage: H(vector((1,0))).order()
 +Infinity

 This is terrible, and a symptom of what Nathann wants to fix. It should be
 fixed.

   John




 On Monday, April 28, 2014 8:27:45 AM UTC-7, Nathann Cohen wrote:

  Moreover, how are you going to deprecate it? When is a deprecation
  warning
  shown?

 Ahahahah. That's an interesting question, but the current way being
 bad, there is absolutely no way that it will stay like that forever
 just because we don't know how to tell the users :-D

 I had something a bit unpleasant in mind... Just showing a deprecation
 warning in this __call__ function saying that the standard WILL
 change, and doing nothing... And removing the lines we need to remove
 one year from now.

 Nathann

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/yexpjig9BSg/unsubscribe.
 To unsubscribe from this group and all its topics, 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.

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
Ahahaah. While writing that code, I met an infinite loop. Apparently
testing if an element of a group is equal to +infinity calls
__repr__... :-P

Nathann

On 28 April 2014 18:16, Nathann Cohen nathann.co...@gmail.com wrote:
 Showing a deprecation warning for valid input isn't ideal ;-)

 Indeed, indeed. Right now it prints the following input, which I hope
 will be taken seriously by those who should, and be ignored by those
 who should :

 sage: x = A([5]); x
 doctest:1: DeprecationWarning: The default behaviour changed ! If you
 *really* want a linear combination of smith generators, use
 .linear_combination_of_smith_form_gens.
 See http://trac.sagemath.org/16261 for details.

 How about we deprecate all list/tuple input and force the user to use
 G.linear_combination_of_smith_form_gens / G.linear_combination_of_gens.

 Well... It's more proper, but it does look a bit too extreme... :-/

 Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
The current branch passes all tests in groups/ and modules/fg_pid/ :-)

Needs review !

Nathann

On 28 April 2014 18:29, Nathann Cohen nathann.co...@gmail.com wrote:
 Ahahaah. While writing that code, I met an infinite loop. Apparently
 testing if an element of a group is equal to +infinity calls
 __repr__... :-P

 Nathann

 On 28 April 2014 18:16, Nathann Cohen nathann.co...@gmail.com wrote:
 Showing a deprecation warning for valid input isn't ideal ;-)

 Indeed, indeed. Right now it prints the following input, which I hope
 will be taken seriously by those who should, and be ignored by those
 who should :

 sage: x = A([5]); x
 doctest:1: DeprecationWarning: The default behaviour changed ! If you
 *really* want a linear combination of smith generators, use
 .linear_combination_of_smith_form_gens.
 See http://trac.sagemath.org/16261 for details.

 How about we deprecate all list/tuple input and force the user to use
 G.linear_combination_of_smith_form_gens / G.linear_combination_of_gens.

 Well... It's more proper, but it does look a bit too extreme... :-/

 Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
Hello again !

This time the branch passes all long tests in src/ except one, and I need
your advice. Here is the problem :

**
File chain_complex.py, line 738, in
sage.homology.chain_complex.ChainComplex_class.grading_group
Failed example:
C = ChainComplex(grading_group=G, degree=G([1,2]))
Expected nothing
Got:
doctest:1: DeprecationWarning: The default behaviour changed ! If you
*really* want a linear combination of smith generators, use
.linear_combination_of_smith_form_gens.
See http://trac.sagemath.org/16261 for details.
**

1) The warning is not very meaningful as the user never called G.__call__
explicitly, and has no idea what the problem could  be
2) I cannot change the code of ChainComplex to call G(vector(x)) instead of
G(x) as AdditiveAbelianGroup is not the only group that ChainComplex works
on (and wrapping does not work for all groups)

S, well... My way of doing things would be let's consider that this
G(x) has been broken all along, and because we are fixing a bug there is no
need to display a warning at all.

On the other hand, Volker would prefer to have a
.linear_combination_of_gens() function to  go with the current
.linear_combination_of_smith_form_gens() so that we could say to all
users Don't use G(x), call one of the two .linear_combination* functions
instead.

I do not like  this, because it feels like shooting at one's foot to stop
using G(x) for one year just because it had a weird syntax before.

And besides, having a new function like that would not solve the
problem above with ChainComplex.

Well, what do you think guys ?

I pushed the branch in #16261 if you want to give it a try.

Nathann

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nathann Cohen
Turns out that I am an idiot, and that the warning is triggered by the
degree=G([1,2])
part of the expression I had overlooked. The branch now passes all tests,
and is in needs_review.

The only thing that  needs to be discussed is this warning problem, and
whether we should create a new function (or just add in the warning that
the users should use G(vector(x)) instead of G(x), which removes the
warning too).

Nathann


On 28 April 2014 20:38, Nathann Cohen nathann.co...@gmail.com wrote:

 Hello again !

 This time the branch passes all long tests in src/ except one, and I need
 your advice. Here is the problem :

 **
 File chain_complex.py, line 738, in
 sage.homology.chain_complex.ChainComplex_class.grading_group
 Failed example:
 C = ChainComplex(grading_group=G, degree=G([1,2]))
 Expected nothing
 Got:

 doctest:1: DeprecationWarning: The default behaviour changed ! If you
 *really* want a linear combination of smith generators, use
 .linear_combination_of_smith_form_gens.
 See http://trac.sagemath.org/16261 for details.
 **

 1) The warning is not very meaningful as the user never called G.__call__
 explicitly, and has no idea what the problem could  be
 2) I cannot change the code of ChainComplex to call G(vector(x)) instead
 of G(x) as AdditiveAbelianGroup is not the only group that ChainComplex
 works on (and wrapping does not work for all groups)

 S, well... My way of doing things would be let's consider that this
 G(x) has been broken all along, and because we are fixing a bug there is no
 need to display a warning at all.

 On the other hand, Volker would prefer to have a
 .linear_combination_of_gens() function to  go with the current
 .linear_combination_of_smith_form_gens() so that we could say to all
 users Don't use G(x), call one of the two .linear_combination* functions
 instead.

 I do not like  this, because it feels like shooting at one's foot to stop
 using G(x) for one year just because it had a weird syntax before.

 And besides, having a new function like that would not solve the
 problem above with ChainComplex.

 Well, what do you think guys ?

 I pushed the branch in #16261 if you want to give it a try.

 Nathann


-- 
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: How can I see GF(8,'x') x Z/3Z as an additive group ?

2014-04-28 Thread Nathann Cohen
Yes I do need the multiplication too. I am implementing constructions of
MOLS and for some of them I need to do some computations on a field, then
give everything to a function that needs group elements as input... So I
need it to be a group and also to see this as a field. Can we do that in
Sage ? Nathann

On Monday, 28 April 2014, Dima Pasechnik dimp...@gmail.com wrote:

 On 2014-04-28, Nathann Cohen nathann.co...@gmail.com javascript:;
 wrote:
  Hello everybody !
 
  I need to use the elements of GF(8,'x') x Z/3Z as an additive group. Is
  there a way to do this with Sage ? I need that to add more combinatorial
  designs :-)
 Do you need multiplication in GF(8)? If not, you can just construct
 the corresponding abelian group (Z/2Z)^3 x Z/3Z directly.

 
  Thanks !
 
  Nathann
 

 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/DWfgVrFug38/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com javascript:;.
 To post to this group, send email to 
 sage-support@googlegroups.comjavascript:;
 .
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-26 Thread Nathann Cohen
Hello everybody !

I  am back again with my group problems. I need to see 4-uples as elements
of the additive group Z/3Z x Z/2Z x Z/2Z x Z/2Z, how can I do that ? My
problem is that Sage converts the group  I  want into Z/2Z x Z/2Z x Z/6Z
and I don't want that 

sage: g=groups.misc.AdditiveAbelian([2,2,2,3]); g
Additive abelian group isomorphic to Z/2 + Z/2 + Z/6
sage: g([1,1,1,1])
...
TypeError: length of v must be at most the number of rows of self

Thanks for your help !

Nathann

-- 
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: How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-26 Thread Nathann Cohen
P.S. : I need to add some of those tuples  together...

Nathann



-- 
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: How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-26 Thread Nathann Cohen
REALLY 

The group is internally 4-tuples, but it only accepts 3-uples as input. 

sage: g=groups.misc.AdditiveAbelian([2,2,2,3]); g
Additive abelian group isomorphic to Z/2 + Z/2 + Z/6
sage: print list(g)
[(0, 0, 0, 0), (0, 0, 1, 2), (0, 0, 0, 1), (0, 0, 1, 0), (0, 0, 0, 2), (0, 
0, 1, 1), (1, 0, 0, 0), (1, 0, 1, 2), (1, 0, 0, 1), (1, 0, 1, 0), (1, 0, 0, 
2), (1, 0, 1, 1), (0, 1, 0, 0), (0, 1, 1, 2), (0, 1, 0, 1), (0, 1, 1, 0), 
(0, 1, 0, 2), (0, 1, 1, 1), (1, 1, 0, 0), (1, 1, 1, 2), (1, 1, 0, 1), (1, 
1, 1, 0), (1, 1, 0, 2), (1, 1, 1, 1)]
sage: g([1,1,1,1])
...
TypeError: length of v must be at most the number of rows of self
sage: g([1,1,1])  
(1, 1, 1, 2)

Does not make any sense 

Nathann 

-- 
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] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-26 Thread Nathann Cohen
I don't know what this option actually does, but both seem to work.

sage:
groups.misc.AdditiveAbelian([2,2,2,3],remember_generators=False)(vector([1,1,1,1]))
(1, 1, 1, 1)
sage:
groups.misc.AdditiveAbelian([2,2,2,3],remember_generators=True)(vector([1,1,1,1]))
(1, 1, 1, 1)

Also, why should vector([1,1,1,1]) be recognised and not [1,1,1,1] ?

Nathann


On 26 April 2014 18:14, John Cremona john.crem...@gmail.com wrote:

 sage: A = AdditiveAbelianGroup([2,2,2,3], remember_generators=True)
 sage: A.gens()
 ((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1))
 sage: A(vector([1,1,1,1]))
 (1, 1, 1, 1)
 sage: A(vector([1,1,1,1])).order()
 6

 Read AdditiveAbelianGroup? for more.

 John



 On 26 April 2014 16:16, Nathann Cohen nathann.co...@gmail.com wrote:

 Hello everybody !

 I  am back again with my group problems. I need to see 4-uples as
 elements of the additive group Z/3Z x Z/2Z x Z/2Z x Z/2Z, how can I do that
 ? My problem is that Sage converts the group  I  want into Z/2Z x Z/2Z x
 Z/6Z and I don't want that 

 sage: g=groups.misc.AdditiveAbelian([2,2,2,3]); g
 Additive abelian group isomorphic to Z/2 + Z/2 + Z/6
 sage: g([1,1,1,1])
 ...
 TypeError: length of v must be at most the number of rows of self

 Thanks for your help !

 Nathann

 --
 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.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/yexpjig9BSg/unsubscribe.
 To unsubscribe from this group and all its topics, 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.


-- 
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.


  1   2   3   >