[sage-support] labels on the frame of a 3d plot
Is there a way to turn off the labels on the frame in a 3d plot? I was hoping something like this might work: var('x y') plot3d(sin(x*y),(x,-2,2),(y,-2,2)).show(labels=false) I know that I can set frame=false to get rid of the frame entirely, but that is not what I am looking for. Is there something like plot.options for 3d graphic object? Dave -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Using PGL matrix groups
On Aug 18, 8:24 pm, David Joyner wrote: > On Thu, Aug 18, 2011 at 3:12 PM, John Cremona wrote: > > I wanted to work in the group PGL(2,q), and got off to a good start: > > > sage: G = PGL(2,13) > > sage: G.order().factor() > > 2^3 * 3 * 7 * 13 > > sage: G.order() == 13*(13^2-1) > > True > > > but I could not create elements of G, which seemed to think they were > > permutations! > > I believe this is the way GAP does things. > And not just Gap, Magma too: > PGL(2,13); Permutation group acting on a set of cardinality 14 Order = 2184 = 2^3 * 3 * 7 * 13 (3, 9, 10, 12, 6, 13, 4, 11, 5, 7, 8, 14) (1, 14, 2)(3, 8, 13)(4, 10, 11)(5, 6, 12) How strange. > > > > sage: G.identity() > > () > > sage: G.an_element() > > (3,14,13,12,11,10,9,8,7,6,5,4) > > sage: type(G.an_element()) > > > > > Now I am not a group theorist, but this just seems bizarre! I am in > > fact quite interested in the action of this G on P^1(GF(13)), but > > also expected to be able to work with its elements as matrices (mod > > scalars). > > > Am I doing something wrong? > > I don't think so, but perhaps your problem can be translated into > one regarding GL(2,13)? > Well that seems unnatural to me. I do want PGL(2) to act on the projective line, though I would rather have its elements labelled more sensibly than by the integers from 1 to 14. But I also want to see it as a matrix group (mod scalars). I was actually wanting to write down the subgroups (isomorphic to) A4 and A5 in PGL(2,q) (for suitable q). They do not lift up to GL(2,q) so it's a bit inconvenient to work there. Never mind. John > > > John > > > [Sage 4.7 on ubuntu, built from source] > > > -- > > To post to this group, send email to sage-support@googlegroups.com > > To unsubscribe from this group, send email to > > sage-support+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/sage-support > > URL:http://www.sagemath.org -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
Re: [sage-support] Using PGL matrix groups
On Thu, Aug 18, 2011 at 3:12 PM, John Cremona wrote: > I wanted to work in the group PGL(2,q), and got off to a good start: > > > sage: G = PGL(2,13) > sage: G.order().factor() > 2^3 * 3 * 7 * 13 > sage: G.order() == 13*(13^2-1) > True > > but I could not create elements of G, which seemed to think they were > permutations! I believe this is the way GAP does things. > > sage: G.identity() > () > sage: G.an_element() > (3,14,13,12,11,10,9,8,7,6,5,4) > sage: type(G.an_element()) > > > Now I am not a group theorist, but this just seems bizarre! I am in > fact quite interested in the action of this G on P^1(GF(13)), but > also expected to be able to work with its elements as matrices (mod > scalars). > > Am I doing something wrong? I don't think so, but perhaps your problem can be translated into one regarding GL(2,13)? > > John > > [Sage 4.7 on ubuntu, built from source] > > -- > To post to this group, send email to sage-support@googlegroups.com > To unsubscribe from this group, send email to > sage-support+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org > -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Using PGL matrix groups
I wanted to work in the group PGL(2,q), and got off to a good start: sage: G = PGL(2,13) sage: G.order().factor() 2^3 * 3 * 7 * 13 sage: G.order() == 13*(13^2-1) True but I could not create elements of G, which seemed to think they were permutations! sage: G.identity() () sage: G.an_element() (3,14,13,12,11,10,9,8,7,6,5,4) sage: type(G.an_element()) Now I am not a group theorist, but this just seems bizarre! I am in fact quite interested in the action of this G on P^1(GF(13)), but also expected to be able to work with its elements as matrices (mod scalars). Am I doing something wrong? John [Sage 4.7 on ubuntu, built from source] -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Converting Restructured Text to a SWS
That looks perfect, but I can only get one of the patches to apply. I must be missing something. (flask notebook?) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
Re: [sage-support] Re: how to a copy of a nested list?
On Thu, Aug 18, 2011 at 12:48 AM, wrote: > Hello! > > On Thu, 18 Aug 2011 00:35:21 -0700 (PDT) > Stan Schymanski wrote: > >> Dear Robert, >> >> Thanks a lot for your help, this is exactly what I wanted. I still >> don't get why it is necessary to import a special function to perform >> such a standard thing. "import copy" has the affect that suddenly I >> cannot do copy(L) any more, but I have to do copy.copy(L) instead. >> Since copy(L) does not do what I would expect anyway, I will avoid it. >> Frankly, as intuitive as Python is in other respects, this behaviour >> blows my mind. >> > Isn't "a list of lists" just a list of _pointers_ to the lists? If so, > the regular copy operation would just copy that list of pointers to a > new list. Am I right? Yep, that's one way of thinking about it. Python has reference semantics, i.e. everything is just a reference to the actual objects. sage: a = [1,2,3] sage: b = a sage: c = [1,2,3] sage: a.append(x) sage: a [1, 2, 3, x] sage: b [1, 2, 3, x] sage: c [1, 2, 3] sage: L = range(10) sage: def foo(x): x.append(100) : sage: L [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] sage: foo(L) sage: L [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100] A copy of a list is a new list with exactly the same contents, not a new list with copies of the original contents. It makes more senes if you consider other usecases such as list of (GUI) windows or a list of network connections or a list of files, I wouldn't want it to make new windows or new connections or new files when I create a copy of that list, rather I want a new list that also references the same set of objects. And, as noted, deepcopy is a lot more expensive. - Robert -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Converting Restructured Text to a SWS
See http://trac.sagemath.org/sage_trac/ticket/11459, which is waiting for review! Sebastien would love this to finally be in Sage proper, I'm quite sure. On Aug 18, 2:32 pm, David Monarres wrote: > Hello All, > > I was wondering if there were any standard ways to convert restructured text > file to Sage worksheets (sws)? I have noticed that the Sage tutorial is > included in the notebook as a live worksheet and we would like to do Though I think that the way that happens is slightly different than that ticket. > something similar. Thank you in advance for all of your help. > > David Monarres -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Converting Restructured Text to a SWS
Hello All, I was wondering if there were any standard ways to convert restructured text file to Sage worksheets (sws)? I have noticed that the Sage tutorial is included in the notebook as a live worksheet and we would like to do something similar. Thank you in advance for all of your help. David Monarres -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: [sage-marketing] Happy First Birthday to...
Wow, already 1 year, time flies by! On Thu, Aug 18, 2011 at 17:09, kcrisman wrote: > Maybe Harald has some fun b-day stats for our friend. Have fun! Unfortunately no, because there is no tracking code. Whoever maintains it, I can send you the snippets. H -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Happy First Birthday to...
...the newest member of the Sage stable of resources, ask.sagemath.org! Here is the first (sample) question, asked one year ago. http://ask.sagemath.org/question/1/sample-question-how-do-i-compute-symbolic Question 706 was asked within the last 12 hours. Maybe Harald has some fun b-day stats for our friend. Have fun! - kcrisman -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: how to a copy of a nested list?
On 8/18/11 2:35 AM, Stan Schymanski wrote: Dear Robert, Thanks a lot for your help, this is exactly what I wanted. I still don't get why it is necessary to import a special function to perform such a standard thing. "import copy" has the affect that suddenly I cannot do copy(L) any more, but I have to do copy.copy(L) instead. Since copy(L) does not do what I would expect anyway, I will avoid it. Frankly, as intuitive as Python is in other respects, this behaviour blows my mind. In a file, you could do from copy import deepcopy and then you would just have the deepcopy function, without overwriting your copy function. As Simon points out, this is already done by default in Sage, though. Thanks, Jason -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: how to a copy of a nested list?
PS: On 18 Aug., 09:35, Stan Schymanski wrote: > Thanks a lot for your help, this is exactly what I wanted. I still > don't get why it is necessary to import a special function... I just noticed that deepcopy IS already imported in Sage (so, you only need to import it explicitly if you use it in a program, but not in an interactive session): sage: L = srange(100) sage: T = copy(L) sage: T [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] sage: %timeit T = copy(L) 625 loops, best of 3: 4.01 µs per loop sage: deepcopy sage: %timeit T = deepcopy(L) 125 loops, best of 3: 3.32 ms per loop Hence, you can easily pick the copy method that is appropriate for your given problem. Cheers, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: how to a copy of a nested list?
Hi Stan, On 18 Aug., 09:35, Stan Schymanski wrote: > Thanks a lot for your help, this is exactly what I wanted. I still > don't get why it is necessary to import a special function to perform > such a standard thing. deepcopy is a lot slower than copy: sage: import copy sage: L = srange(100) sage: %timeit T = copy.copy(L) 625 loops, best of 3: 4.16 µs per loop sage: %timeit T = copy.deepcopy(L) 125 loops, best of 3: 3.33 ms per loop sage: 3330/4.16 800.480769230769 Hence, on non-nested lists, copy is faster than deepcopy by a factor of 800! So, the answer to your question is another question: Why should one use BY DEFAULT a dog-slow function for a standard task such as "copy that list of integers"? > "import copy" has the affect that suddenly I > cannot do copy(L) any more, but I have to do copy.copy(L) instead. That would not be the case if you had imported it under a different name, such as "import copy as copy_module". Starting a new session: sage: import copy as copy_module sage: L = srange(100) sage: T = copy(L) sage: T [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] > Since copy(L) does not do what I would expect anyway, I will avoid it. Given the timing above, that is probably not a wise decision! > Frankly, as intuitive as Python is in other respects, this behaviour > blows my mind. Well, if you keep in mind that a list does not contain objects, but *pointers* to objects (otherwise, lists would be almost impossible to implement, I guess), then you'll probably understand it better. Best regards, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
Re: [sage-support] Re: how to a copy of a nested list?
Hello! On Thu, 18 Aug 2011 00:35:21 -0700 (PDT) Stan Schymanski wrote: > Dear Robert, > > Thanks a lot for your help, this is exactly what I wanted. I still > don't get why it is necessary to import a special function to perform > such a standard thing. "import copy" has the affect that suddenly I > cannot do copy(L) any more, but I have to do copy.copy(L) instead. > Since copy(L) does not do what I would expect anyway, I will avoid it. > Frankly, as intuitive as Python is in other respects, this behaviour > blows my mind. > Isn't "a list of lists" just a list of _pointers_ to the lists? If so, the regular copy operation would just copy that list of pointers to a new list. Am I right? Regards, Vladimir - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: how to a copy of a nested list?
Dear Robert, Thanks a lot for your help, this is exactly what I wanted. I still don't get why it is necessary to import a special function to perform such a standard thing. "import copy" has the affect that suddenly I cannot do copy(L) any more, but I have to do copy.copy(L) instead. Since copy(L) does not do what I would expect anyway, I will avoid it. Frankly, as intuitive as Python is in other respects, this behaviour blows my mind. Cheers Stan On Aug 17, 6:19 pm, Robert Bradshaw wrote: > On Wed, Aug 17, 2011 at 9:09 AM, Stan Schymanski wrote: > > Dear all, > > > This has been driving me mad. According to the python documentation, > > you can modify a copy of a list without modifying the original using > > the following code: > > > sage: L = [] > > sage: M = L[:] # create a copy > > sage: # modify L only > > sage: L.append(1) > > sage: M > > [] > > > Now, I want to do the same with a nested list, but I do not manage to > > unlink the two. See the example below, where I also tried copy(L) to > > no avail. I hope that someone can help. Thanks already! > > A "copy" of a list is a new list containing exactly the same elements > as the original list. It sounds like what you want here is > > sage: import copy > sage: L = [range(k) for k in range(5)] > sage: M = copy.deepcopy(L) > sage: M[0].append('something') > sage: M > [['something'], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3]] > sage: L > [[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3]] > > - Robert -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org