Ask Your Question

G-Sage's profile - activity

2022-08-18 06:19:07 +0200 received badge  Famous Question (source)
2022-04-11 01:23:53 +0200 received badge  Famous Question (source)
2021-12-11 21:05:44 +0200 received badge  Popular Question (source)
2021-08-27 19:13:37 +0200 received badge  Notable Question (source)
2021-08-27 19:13:37 +0200 received badge  Popular Question (source)
2021-08-10 15:36:20 +0200 received badge  Famous Question (source)
2020-11-21 11:10:05 +0200 received badge  Notable Question (source)
2020-06-03 07:44:06 +0200 received badge  Famous Question (source)
2020-01-04 14:58:19 +0200 received badge  Notable Question (source)
2019-06-11 02:49:09 +0200 received badge  Popular Question (source)
2019-06-09 14:18:26 +0200 received badge  Famous Question (source)
2019-06-09 14:18:25 +0200 received badge  Notable Question (source)
2019-01-08 20:22:21 +0200 received badge  Notable Question (source)
2018-04-12 16:07:01 +0200 received badge  Nice Question (source)
2018-03-14 17:16:56 +0200 received badge  Notable Question (source)
2018-01-21 17:24:55 +0200 received badge  Notable Question (source)
2017-10-19 09:50:13 +0200 received badge  Nice Question (source)
2017-08-05 21:44:12 +0200 received badge  Notable Question (source)
2017-06-10 16:04:05 +0200 received badge  Famous Question (source)
2017-05-22 21:16:50 +0200 received badge  Famous Question (source)
2016-07-20 11:09:29 +0200 marked best answer Learning Python for Sage

Hi, I'm no expert in Python or Sage, but I want to learn Python specifically to help with Sage. I bought a book on Python programming and I'm trying out some of the stuff in Sage. But, some of it doesn't seem to work. So, I'm wondering... is this because Sage doesn't use Python 3 yet, or are there just some things with Python that don't work in Sage? If it's the second one, how can I know what's going to work and what's not? For example, in the book I have it says I should be able to do:

print("stuff stuff", end = " ")
print("stuff stuff")

and the effect is that instead of ending the print statement with "\n", it ends with a space so the second print statement prints on the same line. But, doing this in Sage 4.7 results in a syntax error, and it appears to not like the =.

Thanks

2016-07-20 11:02:45 +0200 received badge  Nice Question (source)
2016-07-20 09:48:12 +0200 received badge  Famous Question (source)
2016-07-20 09:48:12 +0200 received badge  Notable Question (source)
2016-07-20 09:47:56 +0200 received badge  Popular Question (source)
2016-07-20 09:47:53 +0200 received badge  Popular Question (source)
2016-07-20 09:47:49 +0200 received badge  Famous Question (source)
2016-07-20 09:46:05 +0200 received badge  Nice Question (source)
2016-07-20 09:37:28 +0200 received badge  Popular Question (source)
2016-07-20 09:36:06 +0200 received badge  Famous Question (source)
2016-07-20 09:31:12 +0200 received badge  Notable Question (source)
2016-07-20 09:31:12 +0200 received badge  Popular Question (source)
2016-06-26 18:27:01 +0200 received badge  Popular Question (source)
2016-06-23 17:15:00 +0200 received badge  Popular Question (source)
2016-06-01 21:39:02 +0200 received badge  Popular Question (source)
2016-05-31 00:05:20 +0200 received badge  Nice Question (source)
2016-05-31 00:05:16 +0200 marked best answer Editing entries of matrix

I'm looking at a matrix, say adjacency matrix of a graph, g.am(). I want to change some of the entries now. I am told it's a vector and it's immutable. What can I do?

One thought I had is adding some other matrix to it with only one nonblank entry. But, is there some easy way to do that?

Another thought I had was turning it into a list, list(g.am()). Maybe that's acceptable. I'm not 100% sure yet for what I'm working on. If I go that way, is there a way to print it in a matrix form again, i.e., entries print in a square shape.

Thanks for any help

2016-05-03 01:52:39 +0200 received badge  Famous Question (source)
2016-03-13 10:54:23 +0200 received badge  Notable Question (source)
2016-02-24 13:40:20 +0200 received badge  Famous Question (source)
2016-01-04 17:41:17 +0200 received badge  Notable Question (source)
2015-12-30 02:57:03 +0200 received badge  Famous Question (source)
2015-12-01 15:40:35 +0200 received badge  Notable Question (source)
2015-11-04 07:33:17 +0200 received badge  Famous Question (source)
2015-07-03 15:29:12 +0200 received badge  Notable Question (source)
2015-06-21 20:25:46 +0200 received badge  Famous Question (source)
2015-04-01 21:10:39 +0200 received badge  Popular Question (source)
2015-03-27 04:12:18 +0200 marked best answer Printing in different colors in notebook

That's it. Instead of

print "Hello world"

and getting the output in the standard blue (in the notebook), I want to have a different color sometime. Is this possible? Much love.

2015-03-27 04:12:15 +0200 marked best answer Strategies for drawing good graphs (graph theory)

Okay, if I want to have a nice drawing of a 5-cycle, it's built in. If I do

g = graphs.CycleGraph(5)
g.show()

it automatically draws it in a nice way. But, if I am looking at some random graph of order 11 that I want a nice picture of, for my dissertation, how am I supposed to get a nice picture? According to my question here, kcrisman says the graph editor is broken. That would have been a nice tool. My current strategy is to repeatedly have it show the graph and save it as a pdf until it gets into the format I want, i.e., run the following code over and over.

graph_plot = g.plot(vertex_colors={'white'})
graph_plot.show()
graph_plot.save('graph.pdf')

But, this doesn't always end up with the picture I really want. And, occasionally I want to do something like delete a vertex and draw the graph again, but now all of the sudden the plot behaves completely differently and it never looks anything like the previous drawing minus one vertex.

So, what are some ways to get around this?

2015-03-27 04:12:07 +0200 marked best answer Memory blowup 2

This code in Sage 4.8 (with CPlex installed if that matters) uses a lot of memory. After around 36 million graphs, it is using around 21 Gigs:

for g in graphs.nauty_geng("11"):
    ind_set = g.independent_set()