Ask Your Question

sagequstions's profile - activity

2021-06-17 06:47:23 +0200 received badge  Popular Question (source)
2021-01-11 13:49:58 +0200 received badge  Popular Question (source)
2021-01-08 21:47:59 +0200 received badge  Notable Question (source)
2019-09-12 11:02:15 +0200 received badge  Popular Question (source)
2019-03-26 10:45:26 +0200 asked a question Finding distributive lattices up to an identification

I want for a given natural number n obtain all distributive lattices on n points where two such distributive lattices $L_1$ and $L_2$ get identified in case they are isomorphic as posets or $L_1$ is isomorphic to the opposite of $L_2$.

I know how to obtain the distributive lattices as follows in sage:


posets = [p for p in Posets(n) if p.has_bottom() and p.has_top() and p.is_lattice()]

lattices = [p for p in posets if LatticePoset(p).is_distributive()]

But I am not sure how to add the further condition as stated above.

So for n=5 the result should for example be that there are 2 distributive lattices up to the above identification.

2018-12-27 11:45:43 +0200 asked a question Finding special posets with sage

A poset P is called dissective in case the MacNeille complection of P is a distributive lattice, see for example theorem 7 of . My question is whether there is a good/quick way using SAGE to obtain all connected posets with n elements with a gobal maximum and a global minimum that are dissective and are NOT lattices. One idea might be to filter from all posets but it would be good when the program works quickly until n=8 or 9 at least. Maybe there are also table of such posets somewhere on the internet? Thanks for any help

2018-12-23 19:00:43 +0200 commented answer Obtaining all connected simply laced graphs with Sage for GAP

It would also be ok in case for n=3 (as an example), the output is just [ [[1,2,"a1"],[2,3,"a2"]] ,[ [1,2,"a1"],[2,3,"a2"],[1,3,"a3"]] ] (which is a list of two elements for GAP), since I can add the rest (Quiver(3,....) myself with GAP afterwards.

2018-12-23 18:59:14 +0200 commented answer Obtaining all connected simply laced graphs with Sage for GAP

Thank you very much. In order for GAP to read it, the output should look as follows for example for n=3: [Quiver(3,[[1,2,"a1"],[2,3,"a2"]]),Quiver(3,[[1,2,"a1"],[2,3,"a2"],[1,3,"a3"]])]; So there are two problems. Namely SAGE enumeratres the vertices from 0 to n-1 instead of 1 to n (which is important for GAP). The other problem is that instead of "a1", SAGE uses 'a_1' (I think the underline after the a gives no problem but the ' instead of the " is a problem). Do you know an easy fix so that after writing n=3 at the beginning, the program gives the desired output? I tried some things but SAGE gives me some errors.

2018-12-22 22:19:11 +0200 received badge  Famous Question (source)
2018-12-22 22:08:20 +0200 asked a question Obtaining all connected simply laced graphs with Sage for GAP

I work with GAP and have not much experience with Sage. I wonder whether there is an easy way to obtain a program with Sage that gives as output a list of all directed simply laced acyclic connected graphs on n points up to equivalence that is readable for GAP (via the GAP-package QPA). I know that Sage can generate the list of such combinatorial collections in an easy way but I do not know how to present it in the needed output and how to obtain all restrictions on the graphs. With acyclic I mean acyclic as an directed graph (but in case this makes problems, you can also assume acyclic as undirected graphs).

Here a more detailed description of what the program should do:

Input: A natural number n >= 2.

Output: The list of directed simply laced acyclic connected graphs on n points up to equivalence. Here we call two such graphs equivalent in case they have the same underlying undirected graph (in case it is a problem to do it up to equivalence, we can first look at the problem without up to equivalence). It is not important what the concrete orientation of the arrows of a representative in an equivalence class is.

Note that graphs are also often called quivers. GAP reads those graphs as Quiver(n, [[p1, p2, "a1"], ...,[pm, pn, "ar"]]) where we name the points pi and the arrows between them as aj for some index sets i and j. (I hope it will be clear with the following examples). Here how to output should look in the first 2 cases for n <= 3 so that it is readable for GAP:

n=2: [Quiver(2,[[1,2,"a1"]])];

n=3: [Quiver(3,[[1,2,"a1"],[2,3,"a2"]]),Quiver(3,[[1,2,"a1"],[2,3,"a2"],[1,3,"a3"]])]; (note for example here here that the quiver Quiver(3,[[1,2,"a1"],[2,3,"a2"]]) is equivalent to the quiver Quiver(3,[[1,2,"a1"],[3,2,"a2"]]) since they are equal when looking at their undirected graphs)

So for n=2 there is one equivalence class, while for n=3 there are two (so that for n=3 the output is a list of two elements readable by GAP).

2018-08-23 10:18:42 +0200 asked a question Searching for special permutations in SAGE

Is there a way using SAGE to find nice subsets (that appeared in some article and enumerate nice things) of the set of permutations on n symbols that have $2^n$ elements? (I am happy to hear about such subsets also in answers if you like)

Using oeis, I just found the following: a(n) is the number of permutations of length n avoiding both 231 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees.

Is there a way to obtain all permutations of length n avoiding both 231 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees using SAGE? So the input should be n and the output all such permutations. Thank you for help!

2018-08-13 08:06:19 +0200 received badge  Enthusiast
2018-08-10 20:13:45 +0200 commented question Putting two acyclic quivers together

Thanks for your comment. Im not really sure at what places you mean that I should use it, since this is no actual SAGE code but probably just is viewed as a sequence of strings by sage (and is actualy GAP code). So using ' seems to not working here, for example : '[ (Z(3)^0) * a1 * a2]' .

2018-08-10 11:08:19 +0200 edited question Putting two acyclic quivers together

I usually program in GAP and have not much experience in SAGE. Im interested to see whether one can solve this problem in SAGE in a nice way. I offer a 15 Euro bounty for a working solution of this problem, which produces the correct ouput.

Given two connected quiver algebras kQ1/I1 and kQ2/I2 with connected acyclic quiver Q1 and Q2 and admissible relations I1 and I2 together with a choosen point x in Q1 such that no arrow starts in x and point y in Q2 such that no arrow ends in y.

Here two examples how the input looks like:

Q1=Quiver( ["v1","v2","v3","v4","v5","v6","v7","v8"], [["v1","v3","a1"],["v2","v3","a2"],["v3","v8","a3"],["v4","v6","a4"],["v5","v6","a5"],["v6","v7","a6"],["v8","v4","a7"],["v8","v5","a8"]] )

I1=[ (Z(3)) * a7 * a4+(Z(3)^0) * a8 * a5, (Z(3)^0) * a1 * a3 * a8, (Z(3)^0) * a2 * a3 * a7, (Z(3)^0) * a1 * a3 * a7 * a4, (Z(3)^0) * a3 * a7 * a4 * a6 ]


Q2=Quiver( ["v1","v2","v3"], [["v1","v2","a1"],["v2","v3","a2"]] )

I2=[ (Z(3)^0) * a1 * a2 ]


Some explanation: The quiver are always given of the form as above, thus the points are named v1,...,vn for some n and the arrows are named a1,...,ai and the list ["v1","v2","a1"] means that a1 is an arrow starting at v1 and ending at v2. The relations are taken with coefficients in the field with 3 elements so that Z(3)^0 is the unit 1 in the field and Z(3)^1 corresponds to -1 (Z(3)^i is how GAP names them).

Now the quiver algebra kQ3/I3 obtained by gllueeing together the quiver algebras kQ1/I1 and kQ2/I2 at the points x and y should look as follows in this example:

Q3=Quiver( ["v1","v2","v3","v4","v5","v6","v1n","v8","v2n","v3n"], [["v1","v3","a1"],["v2","v3","a2"],["v3","v8","a3"],["v4","v6","a4"],["v5","v6","a5"],["v6","v1n","a6"],["v8","v4","a7"],["v8","v5","a8"],["v1n","v2n","a1n"],["v2n","v3n","a2n"]] )

I3=[ (Z(3)) * a7 * a4+(Z(3)^0) * a8 * a5, (Z(3)^0) * a1 * a3 * a8, (Z(3)^0) * a2 * a3 * a7, (Z(3)^0) * a1 * a3 * a7 * a4, (Z(3)^0) * a3 * a7 * a4 * a6,(Z(3)^0) * a1n * a2n ]

The output should always be of this form so that GAP can regocnize it.

This there are three problems:

  1. The points and arrows of Q2 inside Q3 have to be renamed to avoid a collision with names of Q1 (I used v1n,v2n,v3n and a1n, a2n where the n stands for "new").

  2. the points x and y have to get identified in the new quiver Q3 so that in this example I identified v7=v1 and called this point v1n in the new quiver Q3.

  3. It shoud be possible to have as input also quivers that have vertices not of the form v1,v2,... but also for example v1n and the same with arrows. The reason is that one might want to use the output of this program as an input for other examples.

As this is a little complicated problem and I want to use it to do some tests I offer 15 Euros for a solution (only to one person with the quickest and working solution) that works so that GAP can recognize the output. I hope I was able to explain the problem good enough but I am happy to give more explanation or other examples. Thanks for any kinds of help!

edit: I just saw that on this site using the multiplication dot gets censored in the site. For example in [(Z(3)^0)a1a2] one does not see the multiplication dot (but I wrote it down here, it is jsut not visible in the sagemath forum output) when it is close to a1 and a2 but one has to use spaces like that: [ (Z(3)^0) * a1 * a2]. So I had to use spaces between the multiplication dots and other symbols in the relations so that they are correctly displayed in this sagemath forum. Note that in the input it should be possible that the multiplication dot is still close to symbols (as this is also possible in GAP).