[sage-support] Re: Number theory/group of units: Are
Excellent. It should be cross-referenced from the docstring to complex_embeddings(), real_embeddings() and also possibly embeddings(). I also notice that places() gives maps to RIF, CIF while {real,complex}_embeddings give maps to RealField, ComplexField. I don't have a feel for which is better since I have never used RIF and CIF, but it might be better to be consistent. John 2008/9/6 Craig Citro [EMAIL PROTECTED]: * K.complex_embeddings() gives all the embeddings of K into CC (the complex numbers). You would need to eliminate one of ecah conjugate pair of embeddings. TODO: implement a flag to complex_embeddings() which only gives one of each pair. Actually, this code already exists: sage: x = polygen(QQ); K.a = NumberField(x^3-2) sage: K.places() [Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Real Field with 106 bits of precision Defn: a |-- 1.259921049894873164767210607278, Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Complex Field with 53 bits of precision Defn: a |-- -0.629960524947437 + 1.09112363597172*I] sage: K.places(prec=53) [Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Real Double Field Defn: a |-- 1.25992104989, Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Complex Double Field Defn: a |-- -0.629960524947 + 1.09112363597*I] It doesn't do anything remarkably clever, and makes the choice to always take the embedding with positive imaginary part. One could easily add a flag to make this more customizable ... -cc --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: efficient determinant of matrix over polynomial ring
On Friday 05 September 2008, phil wrote: I have a matrix that is composed of multivariant polynomial entries. I want to compute its determinant. The problem is that it is very slow or runs out of memory. For example, R.x,y = QQ[] C = random_matrix(R,10,10) Cdet = C.determinant() # this line takes a long time If you have more variables, it will run out of memory instead (on a 32 bit installation). Is there a more efficient way to do this? Would using symbolic expressions then coercing back to the polynomial ring be better? One thing that really puzzles me is that Magma doesn't seem to scale well w.r.t. to this particular benchmark. sage: R.x,y = QQ[] sage: C = random_matrix(R,10,10) sage: %time d = C.determinant() # going to be in 3.1.2 CPU times: user 0.34 s, sys: 0.00 s, total: 0.34 s Wall time: 0.34 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 0.59998 sage: C = random_matrix(R,14,14) sage: %time d = C.determinant() CPU times: user 2.58 s, sys: 0.00 s, total: 2.58 s Wall time: 2.60 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 27.84 # note that Magma also eats lots and lots of memory sage: C = random_matrix(R,15,15) sage: %time d = C.determinant() CPU times: user 4.49 s, sys: 0.00 s, total: 4.49 s Wall time: 4.55 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 68.593 sage: C = random_matrix(R,16,16) sage: %time d = C.determinant() CPU times: user 6.98 s, sys: 0.00 s, total: 6.98 s Wall time: 7.00 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 168.41 sage: magma(d) == d2 True sage: R.x,y = GF(32003)[] sage: C = random_matrix(R,16,16) sage: %time d = C.determinant() CPU times: user 0.78 s, sys: 0.00 s, total: 0.78 s Wall time: 0.92 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 64.922 sage: magma(d) == d2 True So I wonder if Singular's implementations are just really good or if Magma is just particularly bad for this particular benchmark. I have no feeling how fast these things should be. Thoughts? Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Tutorial examples for 3d plots don't work on OS X 10.5 or 10.4
I just get a black (blank) jmol applet. Is this a known problem? --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Tutorial examples for 3d plots don't work on OS X 10.5 or 10.4
This is a known problem. Unfortunately there is several new bugs in the current Notebook, and this is one of them. We are working on a testing protocol for the Notebook so future releases don't have new bugs in the Notebook. On Sat, Sep 6, 2008 at 11:59 AM, seb [EMAIL PROTECTED] wrote: I just get a black (blank) jmol applet. Is this a known problem? --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: problem with range, int, Integer and division in a loop
Tnx! srange does the tric. Maybe srange (instead of range) should be promoted far more for this reason! Roland On 6 sep, 00:52, Timothy Clemans [EMAIL PROTECTED] wrote: srange gives a list of Sage integers and follows the syntax of range. On Fri, Sep 5, 2008 at 5:41 PM, Harald Schilly [EMAIL PROTECTED] wrote: hello roland I cross posted this on the sage-support mailing list http://groups.google.com/group/sage-support regarding your bugreport: http://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA In loop /' operand incorrect Hi. Please view worksheet which is publicly viewable athttp://75.75.6.176:80/home/pub/0 In a loop, and only then, suddenly 583/2 becomes 291 ...? Roland, sage 3.1.1 on Windows/VMWare the problem is, that range is a native python command and all this happens because it is python only. if you just enter numbers, sage preparses them as Integer(n) .. then they are more complex objects. there is not much to do about this, either convert to sage integers or well, someone has to break python - but that's extremely dangerous. so, as long as i understood your lengthy example correct, here are two commands, run in pure python to clarify: for i in range(1,6): print i/2 ... 0 1 1 2 2 for i in range(1,6): print float(i)/2 ... 0.5 1.0 1.5 2.0 2.5 - in sage sage: preparse(for i in range(1,6): print i/2) 'for i in range(Integer(1),Integer(6)): print i/Integer(2)' above, division by an integer! sage: for i in range(1,6): print i/2 : 1/2 1 3/2 2 5/2 also, you can use the type command to get the objects type. native integers are int and sage's Integer h --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: How do I share a notebook with collaborators?
I would like to talk to our computer admin people and ask them if they could install Sage on our network. Could you point me to some more instructions on how to do this? It won't be until in two weeks, so there is no rush right now, but I think it could help spreading Sage tremendously if there was an easy way of installing it on a network. Ours is a linux network. Cheers Stan Jason Grout wrote: If you just want to start a Sage server for personal use, after you've installed sage, you can just start sage and type: notebook() That will start sage on the local computer so that it can only be used on the local computer. If you want to install sage for lots of people to use on a network, it's a bit harder, but not too much. Personally, I like running the VMWare image of Sage for that, since I don't have to worry so much about security issues. Thanks, Jason -- --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: How do I share a notebook with collaborators?
Oops, sorry, I responded by email without reading all messages first. I will search the sage forums and try to make a summary for our IT people. If it turns out to be useful, I will post it here, too. Or if I have more questions... Thanks for your help! Stan On Sep 6, 10:07 pm, Stan Schymanski [EMAIL PROTECTED] wrote: I would like to talk to our computer admin people and ask them if they could install Sage on our network. Could you point me to some more instructions on how to do this? It won't be until in two weeks, so there is no rush right now, but I think it could help spreading Sage tremendously if there was an easy way of installing it on a network. Ours is a linux network. Cheers Stan Jason Grout wrote: If you just want to start a Sage server for personal use, after you've installed sage, you can just start sage and type: notebook() That will start sage on the local computer so that it can only be used on the local computer. If you want to install sage for lots of people to use on a network, it's a bit harder, but not too much. Personally, I like running the VMWare image of Sage for that, since I don't have to worry so much about security issues. Thanks, Jason -- --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Difference between a vector and a 1 by n matrix
Is there a simple way to think of the difference between a vector with n elements, and a 1 by n matrix in Sage. When would I want to use one instead of the other? sage: m = matrix([1,2,3,4,5]) sage: parent(m) Full MatrixSpace of 1 by 5 dense matrices over Integer Ring sage: v = vector([1,2,3,4,5]) sage: parent(v) Ambient free module of rank 5 over the principal ideal domain Integer Ring m seems to have many more methods than v, but looking at matrix? and vector? didn't make things perfectly clear. Regards, JM --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Difference between a vector and a 1 by n matrix
On Sep 6, 7:26 pm, Jason Merrill [EMAIL PROTECTED] wrote: Is there a simple way to think of the difference between a vector with n elements, and a 1 by n matrix in Sage. When would I want to use one instead of the other? sage: m = matrix([1,2,3,4,5]) sage: parent(m) Full MatrixSpace of 1 by 5 dense matrices over Integer Ring sage: v = vector([1,2,3,4,5]) sage: parent(v) Ambient free module of rank 5 over the principal ideal domain Integer Ring m seems to have many more methods than v, but looking at matrix? and vector? didn't make things perfectly clear. mhansen caught up with me on IRC and cleared things up a bit. I thought I'd paste in the conversation for the benefit of any others who are wondering. [9:22pm] mhansen: jwmerrill: I don't know if I understand your question about matrices and vectors. What are you trying to do? [9:22pm] mhansen: Vectors in Sage are elements of a free module / vector space. [9:23pm] mhansen: One usually thinks about matrices as representing homomorphisms between such spaces. [10:01pm] jwmerrill: mhansen: re vectors/matrices, I'm not trying to do anything too specific [10:01pm] jwmerrill: just trying to fit my head around sage [10:02pm] mhansen: Well, they're very different mathematical objects that just happened to have 5 numbers associated with them. [10:04pm] jwmerrill: fair enough [10:05pm] mhansen: Addition is defined component-wise for both of them and they both support scalar multiplication. [10:05pm] jwmerrill: can you right multiply either of them by an appropriately sized matrix? [10:06pm] mhansen: Yep. [10:06pm] mhansen: Vectors have no notion of being a row vector or column vector. [10:06pm] jwmerrill: oh, that's interesting [10:07pm] mhansen: So, if you have a vector of size n, you can act on it on either side with an nxn matrix. [10:08pm] jwmerrill: ok [10:08pm] mhansen: Multiplying two vectors is a shortcut for the inner product on that space (typically the standard dot product). [10:09pm] jwmerrill: got it [10:09pm] jwmerrill: one of the things I was wondering about was what kind of sage object should represent the type of thing that ode solvers would want as the jacobian [10:11pm] jwmerrill: in practice, it has to be a function that returns a collection of numbers [10:11pm] jwmerrill: when evaluated at some point [10:11pm] jwmerrill: is that more like a vector, or a matrix? [10:12pm] jwmerrill: Hubbard and Hubbard makes a point of making the distinction that the gradient is a vector, but the jacobian is a row matrix [10:13pm] jwmerrill: but I didn't really get what the point was, other than that the gradient can change if you have a different inner product rule, but the jacobian doesn't need any inner product at all [10:15pm] mhansen: Yes, I would do the Jacobian as a matrix. [10:15pm] mhansen: You can evaluate matrices over the symbolic ring in Sage. [10:15pm] mhansen: sage: m = matrix(SR, [[x, x+1],[2*x,0]]); m [10:15pm] mhansen: [x x + 1] [10:15pm] mhansen: [ 2*x0] [10:15pm] mhansen: sage: m(2) [10:15pm] mhansen: [2 3] [10:16pm] mhansen: [4 0] [10:16pm] jwmerrill: ok, cool JM --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---