Ask Your Question

boumol's profile - activity

2023-04-11 12:46:18 +0200 received badge  Famous Question (source)
2021-10-19 19:08:36 +0200 received badge  Famous Question (source)
2021-08-16 16:06:08 +0200 received badge  Notable Question (source)
2018-06-07 02:50:42 +0200 received badge  Popular Question (source)
2017-03-08 12:09:42 +0200 received badge  Notable Question (source)
2016-08-19 15:17:10 +0200 received badge  Popular Question (source)
2016-01-07 17:38:15 +0200 commented answer Introducing a finite monoid by giving its "multiplication" table

I guess there is a problem with one line of the current code "assert 0 <= data < len(self._table):". The last symbol of such line must be deleted.

2016-01-05 11:17:38 +0200 commented answer Introducing a finite monoid by giving its "multiplication" table

Thanks a lot. I will check whether this method allows using the issues already implemented for monoids (direct products, quotients, homomomorphisms, etc) without having to code anything else. Indeed, this reason was the motivation behind my question. By the way, do you already know the answer?

2016-01-05 01:48:00 +0200 asked a question Introducing a finite monoid by giving its "multiplication" table

I am interested in working with some finite monoids. Looking at http://doc.sagemath.org/html/en/refer... I have not found anything about how to define a finite monoid by simply providing its (binary) "multiplication" table.

Is there some way to do so?

2015-03-27 04:28:31 +0200 received badge  Nice Question (source)
2015-03-25 15:13:49 +0200 commented answer 3D grid like the one in the picture

Thanks, it is exactly what I wanted. Do you know whether it is easy to write numbers (like a kind of labels) to each one of the balls (in such a way that we can later search for the ball with number 1, for the ball with number 2, etc)

2015-03-25 12:27:02 +0200 asked a question 3D grid like the one in the picture

I am interested on drawing with Sage something like the following picture

image description

The code that appears in the picture uses Wolfram Language (and I got the picture from this link)

Moreover, what I am interested is to have some function that creates such a picture from a list of points (where by a point I refer to an element of $\mathbb{Z}^3$). Does anybody know how to do this with Sage?

2014-06-29 11:09:58 +0200 received badge  Famous Question (source)
2014-06-29 11:09:58 +0200 received badge  Popular Question (source)
2014-06-29 11:09:58 +0200 received badge  Notable Question (source)
2014-02-03 04:07:02 +0200 commented answer Nice display of a list of "matrices"

Thanks. Is there some easy way to get the output in pdf format (or in png, jpg)? I ask this because later I want to use this output inside a paper I am writing using LaTeX.

2014-01-31 18:52:36 +0200 marked best answer Nice display of a list of "matrices"

You could define a function to produce a latex array (or tabular):

def matrix_array(L,ncols):
    nl = '\n'
    s = nl + r'\begin{array}{' + ('c' * ncols) + r'}' + nl
    for k in xrange(len(L)):
        if k%ncols != 0: s += '&' + nl
        s += str(latex(L[k])) + nl
        if ((k+1)%ncols == 0) or (k == len(L)):
            s += r'\\' + nl
    s += r'\end{array}' + nl
    return LatexExpr(s)

and then view it:

sage: L = [MatrixSpace(ZZ,3).random_element() for i in [0..8]]
sage: view(matrix_array(L,ncols=3))
2014-01-31 11:20:28 +0200 commented answer Nice display of a list of "matrices"

Thanks. Your answer has really helped me.

2014-01-30 11:28:02 +0200 received badge  Student (source)
2014-01-30 08:04:58 +0200 asked a question Nice display of a list of "matrices"

In the context of graphs I have seen that it is possible to display in a very nice picture of all graphs in a certain list using for instance the following code:

sage: G = GraphQuery(display_cols=['graph6'], num_vertices=7, diameter=5)
sage: L = G.get_graphs_list()
sage: graphs_list.show_graphs(L)

The output one gets is the picture image description

I would like to get the same output display but this time using a diferent kind of objects (instead of graphs), namely matrices for the sake of this question. So, here is the question: suppose you have a list L of matrices, for example the one defined by

sage: L=[ MatrixSpace(ZZ,3).random_element() for i in [0..8]]

Is there some way to obtain a picture of the same kind than before except for replacing the graphs with the display of each one of the matrices in L?

2013-04-19 14:29:48 +0200 received badge  Scholar (source)
2013-04-19 14:29:48 +0200 marked best answer Showing options after writing "." when you choose an element of a list

c[i] is just shorthand for c.__getitem__(i). The __getitem__ is of course fast for lists but could be arbitrarily slow and/or have side effects for custom objects. Since Python is not statically typed, there is no way of knowing the output of __getitem__ without actually calling it.

2013-04-18 11:15:22 +0200 commented answer Showing options after writing "." when you choose an element of a list

Thanks for your answer. Then, I imagine that this should be something to add to the "to do list" for the sage notebook, since in the notebook this would make sense (first evaluate "c[0]" and then show the list of options for this evaluation). Do you think this suggestion makes sense?

2013-04-18 07:16:02 +0200 received badge  Supporter (source)
2013-04-18 07:16:00 +0200 commented answer Showing options after writing "." when you choose an element of a list

So, there is no way to run some sage command that tells that the list c I have just created is a list of graphs (in this particular case)? I guess that if we could do this, then it might be the case that later it works the completion for "c[0]".

2013-04-18 06:38:14 +0200 asked a question Showing options after writing "." when you choose an element of a list

Let me illustrate my question with a particular (naive) example of a list.

sage: a=graphs.CompleteGraph(3)
sage: b=graphs.CompleteGraph(4)
sage: c=[a,b]

In this situation if in a new line one writes down "a." and press "Tab", then one gets a list of all options to be used for the object a (for example "a.category", "a.center", etc.).

On the other hand, if in a new line one writes down "c[0]." and press "Tab", then one does not get the right feedback. Is there some way to make this work like in the previous paragraph (and display the options for the object "c[0]"?