[sage-support] Re: Graph canonical form directly on matrices

2018-03-07 Thread Christian Stump
Dear Simon and Dima, I moved this to https://trac.sagemath.org/ticket/24924 for better traceability and to show you some code snippets... Cheers, Christian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and

[sage-support] Re: Graph canonical form directly on matrices

2018-03-07 Thread Christian Stump
Dear Simon, Anyway, looking at sage/graphs/bliss.pyx, it seems easy to modify your > code to directly create a bliss graph. > Help there is highly appreciated :-), I don't know how to do that appropriately... Christian -- You received this message because you are subscribed to the Google

[sage-support] Re: Graph canonical form directly on matrices

2018-03-07 Thread Christian Stump
Dear Dima, Ultimately, the classical canonical form/isomorphism implementations run on > (di)graphs represented by 0-1 matrices, often > with bit entries. So that's how bliss_digraph is represented too. > Thanks for this info clarifying that it seems impossible to feed the algorithm any other

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Hi Simon, Thanks for trying! I was actually hoping for a way to completely avoid creating this sage DiGraph. But either to get the matrix directly into the algorithm (which currently seems impossible), or at least to directly construct some internal graph data structure. Looking at the code

Re: [sage-support] Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Dear Johan, > The most inefficient part of _matrix_to_digraph seems to be the > following line: > > > x = edge_labels.index((a,b)) > you are totally right, thanks for this suggestion! (Unfortunately, this will not change anything in practice, because the list

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Let me add that the situations I care about are n,m <= 20, the entries are <=5 and the matrices are sparsely filled. An random and typical example is sage: M = matrix([(0, -1, 0, 0, 0, 0, 0, 1), : (1, 0, 1, 0, 0, 0, 0, 0), : (0, -1, 0, 0, 1, 0, 0, 0), : (0, 0, 0, 0, 0, 1, 0, 0),

[sage-support] Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
(This question is about speed improvements of an existing approach, not about finding a first toy solution.) Let A, B be two ( (n+m) x n ) integer matrices. Say that these are isomorphic if they coincide up to *simultaneous* row and column permutations of the indices 0,...,n-1. Example:

Re: [sage-support] Random connected poset on n elements

2017-11-30 Thread Christian Stump
> There is a code for generating posets, see attachment at > https://trac.sagemath.org/ticket/14110 , but unfortunately it has not > been > integrated to Sage. I just tested and it takes about 2,2 seconds to > generate 11-element posets (there are 46749427 of those) and 38 seconds > for

Re: [sage-support] Random connected poset on n elements

2017-11-30 Thread Christian Stump
> How big is your n? > not very big, I aim for the biggest n for which I can loop through all permutations of n and compute some numbers. I expect this to be between 10 and 14. > "Almost all" finite posets are connected, so uniform distribution of all > posets would work too for bigger

[sage-support] Re: Random connected poset on n elements

2017-11-30 Thread Christian Stump
> > 0) take a connected random graph (call graphs.RandomGNP in a loop, until > you get something connected) > 1) take a random ordering of vertices, say v1,v2,...,vn. > 2) orient each edge (vi,vj) in the direction j>i. > This last step is actually a good idea, I didn't think of this way of

[sage-support] Random connected poset on n elements

2017-11-30 Thread Christian Stump
Is there a way to obtain a random connected poset on n unlabelled elements in sage? Random preferably means uniformly at random, but other randomness might be okay if it is not too far away from uniform. Generating all posets, checking for connectedness and picking is way too slow.

[sage-support] Generation of graphs where all maximal cliques have the same size

2017-10-19 Thread Christian Stump
Hi, how can I generate, in a fast enough way, connected graphs for which the clique complex is pure, ie, for which all containmentwise maximal cliques are of the same size ? Fast enough here means that I can produce examples of such graphs with 20 vertices, edge degrees between 10 and 14 (an

Re: [sage-support] How to run Macaulay2 code through Sage interface

2016-05-29 Thread Christian Stump
> I spent most of the last week at a Macaulay2 workshop, and actually playing with M2<->Sage interface :-) > here you are: Awesome, thanks! -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving

Re: [sage-support] How to run Macaulay2 code through Sage interface

2016-05-27 Thread Christian Stump
> YES. thanks, that's the first step -- I did actually mean so that I get the output as Sage objects. Sorry for not saying that explicitly... -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving

[sage-support] Word problem in finite permutation groups as monoids

2016-05-04 Thread Christian Stump
The method "word_problem" for a permutation group element can be found at http://doc.sagemath.org/html/en/reference/groups/sage/groups/perm_gps/permgroup_element.html#sage.groups.perm_gps.permgroup_element.PermutationGroupElement.word_problem But if the permutation group G is finite, I

[sage-support] Re: gfan, reduced bases, and weight vectors

2016-03-04 Thread Christian Stump
> > In short, the Gröbner fan knows the correct ordering (in terms of a weight > vector) but Sage's output presents the basis with a different ordering. > This caused me no small amount of confusion. Is this a feature, or a bug? > I ran into this very same issue today -- to get a functionality

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

2016-02-07 Thread Christian Stump
Many thanks, works well and fast enough! -- 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

[sage-support] All hamiltonian cycles in graphs

2016-02-05 Thread Christian Stump
Hi there, is the functionality to get *ALL* hamiltonian cycles in a graph somehow already available in Sage? (Mathematica provides that, http://reference.wolfram.com/language/Combinatorica/ref/HamiltonianCycle.html, but I would prefer not to pay for each hamiltonian cycle I am offered by my

[sage-support] parallelize for-loop with side effects

2014-08-04 Thread Christian Stump
Hi there, I wonder how to parallelize the following scenario. I have a method that initiates a (not very simple) data strucure and then runs a for-loop (of, say, length 1,000-20,000) to populate that data structure with data. The computations in each loop is not trivial, but fairly optimized

Re: [sage-support] parallelize for-loop with side effects

2014-08-04 Thread Christian Stump
Thanks, William! It absolutely will use two additional *processes*, as you might see by watching with htop, top, or using ps. Is it right that the master process is creating all the subprocesses? I'd suspect I don't quite see the other processes in action simply because they are there only for

Re: [sage-support] parallelize for-loop with side effects

2014-08-04 Thread Christian Stump
I encourage you to read the source code of this @parallel stuff -- it's only about 2 pages of actual code, which I wrote at some Sage days as my project back in maybe 2008. Will do, thanks again! -- You received this message because you are subscribed to the Google Groups sage-support

[sage-support] How can I test if two symbolic expressions coincide?

2012-09-13 Thread Christian Stump
Hello, can anyone tell me how I can use sage to check that the following two (fairly simple) expressions coincide. Some unneeded background: both come from identities in character theory for complex reflection groups, Sage was able to solve similar expressions, see below, and this is the

[sage-support] Re: How can I test if two symbolic expressions coincide?

2012-09-13 Thread Christian Stump
Okay, I got the simplification by doing sage: f.expand().simplify() while sage: f.simplify() or sage: f.simplify_full() did actually not work... -- You received this message because you are subscribed to the Google Groups sage-support group. To post to this group, send email to

[sage-support] faster computation of big sums of products of multivariate polynomials

2012-06-29 Thread Christian Stump
Hello -- I want to do some computations with multivariate polynomials in the group W of type H4 (14400 elements). I have a summand for every element w \in W, and a product of 4 polynomials in each summand: gens = [] for obj in gens_objects: p = 0 for w in W: mon_w =

[sage-support] dimension of hom space between modules over an algebra?

2012-02-09 Thread Christian Stump
Hello, we constructed some modules over the path algebra, and then the hom space using Hom. - How can we actually see that we computed the hom space over the algebra rather than as vector spaces over the base field? We tried getting out the dimension as a test, but there seems to be no way to do

[sage-support] vector space dimension of a subring of a quotient of a polynomial ring?

2010-06-10 Thread Christian Stump
of this quotient having again finite vector space dimension. In the example, the subring is generated by x1, x2, x3, x1*y1+x2*y2+x3*y3, x1^2*y1+x2^2*y2+x3^2*y3, x1^3*y1+x2^3*y2+x3^3*y3. Is there any construction solving this kind of problem? Thanks for your help, Christian Stump -- To post to this group

[sage-support] Re: Data list

2010-06-10 Thread Christian Stump
m=[0.6158, 0.5893, 0.5682, 0.51510, 0.4980, 0.4750, 0.5791, 0.5570,0.5461, 0.4970, 0.4920, 0.4358, 0.422, 0.420] m.count len(m) does the job, you should probably look into the tutorial at http://www.sagemath.org/doc/tutorial/ for this kind of questions... m.count is a function returning the