Re: [sage-support] Re: Write Sage in Pycharm

2015-02-28 Thread Tom Boothby
Perhaps Pegah wants syntax highlighting specific for sage? On Sat, Feb 28, 2015 at 9:36 AM, Ralf Stephan wrote: > What exactly is the problem? Are you on OSX? Do you want to use Sage > as interpreter in PyCharm? > > -- > You received this message because you are subscribed to the Google Groups >

Re: [sage-support] Re: Only dash some edges in a graph?

2014-06-01 Thread Tom Boothby
7;}, edge_style='dashed', vertex_labels=False,vertex_size=0) p+= h.plot(color_by_label={0:'blue', 1:'green'}, vertex_labels=False,vertex_size=0) p+= k.plot(color_by_label={0:'brown', 1:'black'}, edge_style='dotted') p.show(axes=False) On

Re: [sage-support] Re: Only dash some edges in a graph?

2014-06-01 Thread Tom Boothby
If you partition the edges into several graphs, you can sum their plots. Just remember axes=false when you show(). On Sat, May 31, 2014 at 8:07 AM, Ursula Whitcher wrote: > On 5/30/2014 11:47 PM, P Purkayastha wrote: >> >> Perhaps you can try using different colors instead of different line >> s

Re: [sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Tom Boothby
Christa, The problem is not with the code, but your expectations of it (which may be valid, but that would be a feature request and not a bug). You expect the code to look at your planar position dictionary, and gin up an embedding from that. That is not a bad idea, and possibly a good feature t

Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-05 Thread Tom Boothby
> On 2014-03-04, Tom Boothby wrote: >> They do implement the same basic algorithm. However, Robert worked >> from McKay's paper describing the algorithm, which was approximately >> state-of-the-art when he wrote the paper (but of course, the community >> tends to

Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-04 Thread Tom Boothby
They do implement the same basic algorithm. However, Robert worked from McKay's paper describing the algorithm, which was approximately state-of-the-art when he wrote the paper (but of course, the community tends to eschew optimizations as superfluous to the math, so...). Also, nauty has some pret

Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-03 Thread Tom Boothby
Once the graph is constructed, is_isomorphic throws away the vertex labels and just works with pointers to ints. Constructing the graph itself happens in a blink. Sadly, the bulk of the time is spent in is_isomorphic. The answer to Aleksandr's question is: Yes, this is a known issue -- nauty has

Re: [sage-support] Re: checking if two matrices are permutation similar

2014-02-27 Thread Tom Boothby
Keivan, I'm not sure if this is the best way to do this (e.g. if there's a naive approach we teach in undergrad linear algebra, it escapes me at the moment), but I'm a graph theorist so it's the approach that readily comes to mind, and easy to implement. Treat your graphs as incidence matrices of

Re: [sage-support] sum? inconsistent to sum??

2013-10-24 Thread Tom Boothby
EM, Would you post some offending code? My guess would be that you may have used a variable named 'sum', and clobbered the built-in function out of the namespace... but it's strange that you're getting different results for ? and ??. On Thu, Oct 24, 2013 at 1:25 PM, eggartmumie wrote: > Hi, > >

Re: [sage-support] single cell vs multi cell option in notebook?

2013-10-02 Thread Tom Boothby
In multicell mode, when you evaluate a cell, it jumps to the next. That can be quite annoying if you've got large cells or large output (I typically have many of both). Also, see the arrows & progress bar at the top? You can use the notebook to give a talk, and it's like a slideshow rather than s

Re: [sage-support] Latex in interact?

2013-09-12 Thread Tom Boothby
You can't just put that second argument into html -- the following works for me: var('x') f(x)=x^4-2*x^2 @interact def _(f=input_box(x^4-2*x^2, width=15, label="$f(x)=$"),a=input_box(-2, width=5, label="$a=$"),b=input_box(2, width=5, label="$b=$")): Cf=plot(f,x,-2,2,color='blue', thickness=3)

Re: [sage-support] Re: Notebook running out of memory

2013-08-27 Thread Tom Boothby
, 2013 at 1:49 PM, Tom Boothby wrote: > There's 10G resident, 13G virtual > > On Tue, Aug 27, 2013 at 1:46 PM, Volker Braun wrote: >> So you actually have 20GB RSS memory usage? Non-virtual? >> >> >> On Tuesday, August 27, 2013 9:35:49 PM UTC+1, Tom Boothby wr

Re: [sage-support] Re: Notebook running out of memory

2013-08-27 Thread Tom Boothby
There's 10G resident, 13G virtual On Tue, Aug 27, 2013 at 1:46 PM, Volker Braun wrote: > So you actually have 20GB RSS memory usage? Non-virtual? > > > On Tuesday, August 27, 2013 9:35:49 PM UTC+1, Tom Boothby wrote: >> >> This is a weird one. I'm runnin

[sage-support] Notebook running out of memory

2013-08-27 Thread Tom Boothby
This is a weird one. I'm running a notebook, the notebook process itself is taking ~20 gigabytes of memory, and the worker processes are only using small amounts of memory. My assumption is that some worker process is just dumping crazy amounts of output... I occasionally am guilty of that myself

Re: [sage-support] c++'s "map" equivalent in sage/python

2013-07-03 Thread Tom Boothby
Ugh. My mistake. That only supports int keys. On Wed, Jul 3, 2013 at 5:48 PM, Tom Boothby wrote: > I wrote a binary tree implementation a few million years ago, that > does the job, but doesn't support nice syntax. > > http://www.sagenb.org/src/misc/binary_tree.pyx > &g

Re: [sage-support] c++'s "map" equivalent in sage/python

2013-07-03 Thread Tom Boothby
I wrote a binary tree implementation a few million years ago, that does the job, but doesn't support nice syntax. http://www.sagenb.org/src/misc/binary_tree.pyx B = BinaryTree() D = {1.1:1,1.5:2,0.9:3} for k,v in D.items(): B.insert(k,v) B.get_min() returns 3. Looking back at the source, th

Re: [sage-support] Fwd: Memory

2013-04-22 Thread Tom Boothby
To work around this, I tried storing only sparse6_strings. The original code failed (just appending the same graph 100k times), and the following worked on my machine. If more list functionality is necessary, I'd be happy to provide. There will be some slowdown in creating the graphs extra times

Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-22 Thread Tom Boothby
That might not have been terribly clear -- the point is, "incidence" of edges and vertices is a binary relation. One needs to make a choice to orient the matrix to make the linear algebra coincidence work out. On Mon, Apr 22, 2013 at 8:51 AM, Tom Boothby wrote: >> Yes it does,

Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-22 Thread Tom Boothby
> Yes it does, in a way. If you want to construct the Laplacian matrix L of the > graph from the incidence matrix E just by using matrix multiplication, > you need to pick up an orientation for each edge, i.e. assigning +1 to > one end, and -1 to the other. Then, bingo, you have L=E.T*E I've alway

Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-17 Thread Tom Boothby
Dima, Rows correspond to vertices and columns correspond to edges. This matrix represents an undirected triangle with a double edge. I don't understand why the graph __init__ requires a +1 and a -1 in each column -- that describes a directed incidence matrix, and has no place in undirected graph

Re: [sage-support] Re: Generating variables using indexing

2013-03-29 Thread Tom Boothby
oops, didn't read carefully enough... that third line just doesn't make much sense. On Fri, Mar 29, 2013 at 4:49 PM, Tom Boothby wrote: > Gary, > > The third line > > for a[ii] in range(0,d): > > should read > > for ii in range(0,d): > > On Fri, Mar

Re: [sage-support] Re: Generating variables using indexing

2013-03-29 Thread Tom Boothby
Gary, The third line for a[ii] in range(0,d): should read for ii in range(0,d): On Fri, Mar 29, 2013 at 4:38 PM, GaryMak wrote: > Hi guys > > apologies as usual for how dumb this question's going to sound ... but how > do I actually use the variables a[1] etc? What I was hoping to do was to u

Re: [sage-support] matchings bipartite graphs

2013-03-20 Thread Tom Boothby
Note that that code only works for graphs whose vertices are labeled [0...n]. On Wed, Mar 20, 2013 at 1:03 PM, Tom Boothby wrote: > I use the following to iterate over all matchings and perfect matchings. > > def matchings(G): > edges = G.edges(labels = False) > verts =

Re: [sage-support] matchings bipartite graphs

2013-03-20 Thread Tom Boothby
I use the following to iterate over all matchings and perfect matchings. def matchings(G): edges = G.edges(labels = False) verts = [[v] for v in G] m = len(edges) for match in DLXCPP(edges+verts): yield [edges[t] for t in match if t < m] def perfect_matchings(G): edges

Re: [sage-support] Short cut

2013-02-07 Thread Tom Boothby
Marco, my point was that there's another keyboard shortcut you aren't using -- ctrl> and ctrl< On Thu, Feb 7, 2013 at 2:06 AM, Marco Boretto wrote: > Ok! how i can find his contanct? Where i have to search? Sorry but i'm new! > > > On 6 February 2013 19:04, Tom

Re: [sage-support] Short cut

2013-02-06 Thread Tom Boothby
IIRC, some emacs user (William?) complained until they got ctrl> and ctrl< in. On Mon, Feb 4, 2013 at 2:02 AM, Marco Boretto wrote: > Hello, > i try to comment uncomment block of code on the sage notebook, but the > schortcut are similar to some shortcut of firefox. > for example: > clrt-: doesn

Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Tom Boothby
On Thu, Sep 27, 2012 at 11:58 AM, Geoffrey Irving wrote: > On Thu, Sep 27, 2012 at 11:50 AM, Johannes wrote: >> Hi, >> as far as I understand the GPL, I would say you can release the output >> of your script under every license you want to, as long as Sage is not >> necessary to _compile_ or _run

Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Tom Boothby
On Thu, Sep 27, 2012 at 12:55 AM, Robert Bradshaw wrote: > I would be extremely > surprised if any Sage developer morally objects to you licensing this > output as you wish (though opinions may vary widely as to its > legality). Then let me surprise you. We must have no say over what a user can

Re: [sage-support] Re: funny Cayley graph

2012-03-13 Thread Tom Boothby
ng on with the picture though... if one cannot "rely on the > picture", then it pretty much defeats the purpose when it comes to > Cayley graphs, doesn't it? > > and i mean, there *is* a double arrow on some edges. > > thanks again, > pierre > > On 13 ma

Re: [sage-support] funny Cayley graph

2012-03-13 Thread Tom Boothby
Pierre, Don't rely on the picture! sage: U = set(gr.edges()) sage: V = set(gr.reverse().edges()) sage: U.intersection(V) #for me, this is the empty set On Tue, Mar 13, 2012 at 3:26 AM, Pierre wrote: > Hi, > > I've been playing with Cayley graphs in Sage (thanks to whoever > implemented this!)

Re: [sage-support] Re: Unexplained doctest error

2012-01-31 Thread Tom Boothby
This may be a problem with your install. It works fine on uw.sagenb.org: http://uw.sagenb.org/home/pub/102 On Tue, Jan 31, 2012 at 6:03 PM, Starx wrote: > Oops, well for those who don't want to download the attachment here's > the pastebin link: http://pastebin.com/z1x00AEa > > -Jim > > On Tue,

Re: [sage-support] Saving position dictionary of a graph plot

2011-12-16 Thread Tom Boothby
Execute the following until you're happy with the result: G.set_pos(None) G.plot(save_pos=True).show() On Fri, Dec 16, 2011 at 3:13 PM, akm wrote: > Is there a way to determine the position dictionary of a plotted graph > that Sage laid out itself?  I'm making animations of activity in a > graph

Re: [sage-support] Re: Creating a callable matrix with functions.

2011-11-23 Thread Tom Boothby
This is a little on the terse side, but it works quite generally. def MatrixCallable(M): N = Matrix(SR,M) def m(*a,**k): return Matrix([[e(*a,**k) for e in row] for row in N]) return m sage: x = var('x') sage: M = [[sin(x),cos(x),0],[cos(x),sin(x),x^3]] sage: N = MatrixCallabl

[sage-support] integrating indicator functions

2011-10-27 Thread Tom Boothby
I'd like to integrate a symbolically defined indicator function: W(x,y) = t < abs(x-y) < 1-t though it seems our symbolic objects don't work with chained inequalities, so I'd be happy with W(x,y) = (t < abs(x-y)) * (abs(x-y) < 1-t) Even the following doesn't work: sage: x,y,t = var('x,y,t') sa

Re: [sage-support] fill between

2011-10-10 Thread Tom Boothby
Add a plot of one filled curve to another, whose color is set to white. On Mon, Oct 10, 2011 at 4:32 PM, Dan Aldrich wrote: > Been trying to set up my graphs so I can select fill areas of a distribution > curve. So far all I've been able to do is fill the entire curve.  Any > suggestions? > > Tha

Re: [sage-support] Position of vertices in tree graph

2011-10-08 Thread Tom Boothby
This is a bug. Thank you for reporting it. On Sat, Oct 8, 2011 at 11:19 AM, Zheng wrote: > Hi, > I created a simple graph by commanding: > > a=Graph({0:[1,2],2:[3,4],1:[5,6]}) > > and plot it in tree layout: > > a.plot(layout='tree',tree_root=0,tree_orientation='down') > > However, the tree plot

Re: [sage-support] Re: Downtime for *.sagenb.org

2011-09-19 Thread Tom Boothby
same with flask.sagenb.org On Sun, Sep 18, 2011 at 7:18 PM, MichTex wrote: > William-- > > There is still some sort of problem. Off and on all day long I have > gotten the message: > >   Internal Server Error >   An error occurred rendering the requested page. More information is > available in t

Re: [sage-support] Binary array to integer

2011-08-23 Thread Tom Boothby
Martin Albrecht points out that my stringification is a waste: ZZ(A,2) works fine. On Tue, Aug 23, 2011 at 12:29 PM, Tom Boothby wrote: > Treat it as a binary number: > > s = ''.join(str(i) for i in A) > ZZ(s, base=2) > > On Tue, Aug 23, 2011 at 12:08 PM, Santa

Re: [sage-support] Binary array to integer

2011-08-23 Thread Tom Boothby
Treat it as a binary number: s = ''.join(str(i) for i in A) ZZ(s, base=2) On Tue, Aug 23, 2011 at 12:08 PM, Santanu Sarkar wrote: > Let A=(1,1,0,0,0,1) be an binary array. How efficiently can we calculate the > corresponding integer? > > -- > To post to this group, send email to sage-support@goo

Re: [sage-support] Howto split text cell

2011-08-03 Thread Tom Boothby
te cell do not work. Is there any way to do that? > > Unfortunately, this is not implemented in the graphical interface.  I > think splitting code cells was implemented long ago (by Tom Boothby) > before text cells were editable. > > You can click on "Edit" in the

Re: [sage-support] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Sorry, I didn't read carefully; you do seem to know about the timeseries code. I'm assuming that the xmax is the midpoint of the rightmost bin + half the bin width; are you doing something else? It's hard to guess at what's going wrong if you don't post code. FWIW, I'd prefer that "plot_histogram

Re: [sage-support] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Try the following: TimeSeries(s).plot_histogram() On Wed, Jul 13, 2011 at 3:29 PM, David Monarres wrote: > Hello all, > Today I was working on a top-level histogram plotting function by exposing > matplotlib's hist as a Graphics object and I ran into something that has > stumped me. This is no

Re: [sage-support] Element in Finite Field

2011-06-18 Thread Tom Boothby
= -1  for any x,c > and this b is not in G.list() ! > How can get b in G.list? Is there any function for example > "G.iner(f(x+c)-f(x))" that doing that mind ? > > Thx, > > > On Sat, Jun 18, 2011 at 8:36 AM, Tom Boothby > wrote: >> >> Looks t

Re: [sage-support] Element in Finite Field

2011-06-18 Thread Tom Boothby
Looks to me like you haven't explicitly defined a, so it's implicitly defined as in var('a'). Instead, sage: f(x) = x sage: G = GF(4,'a') sage: a = G.gen() sage: f(a) - f(a+1) 1 On Sat, Jun 18, 2011 at 8:07 AM, Yaser Abbasi wrote: > Hi, > > According to this function, Is there any function in s

[sage-support] Request for Comments (graph genus)

2010-04-29 Thread Tom Boothby
I've been working on a new implementation of an algorithm to compute the genus of graphs. Throughout the process, I've been bound by the chains of backwards compatibility. As I've attempted to finish off the patch, I've found some deeply unsettling details in the current implementation. I'd like