Re: [sage-support] sage-env problems - sage-6.2-x86_64-Darwin
On May 28, 2014, at 11:34 AM, Allen Hall ajh...@gmail.com wrote: Hi everyone, I have what is likely a simple problem, but am having trouble tracking it down. I'm using the binary / dmg release of Sage for osX on a 10.9.1 machine. I mistakenly launched Sage from the dmb, and that is likely the source of all my woes. Current problem (after pointing it to the executable within the .app package in macos/ folder) is the following: How did you point it to the executable in the .app package? It shouldn't be in the MacOS folder, it should be in the Resources folder. But you shouldn't have to know that since in the preferences you can set it to use the built in executable. Is that what you did? [code] Setting environment variables /Applications/Sage-6.2.app/Contents/Resources/sage/src/mac-app/build/Debug/Sage.app/Contents/Resources/start-sage.sh: line 43: spkg/bin/sage-env: No such file or directory /Applications/Sage-6.2.app/Contents/Resources/sage/src/mac-app/build/Debug/Sage.app/Contents/Resources/start-sage.sh: line 43: local/bin/sage-env: No such file or directory [/code] Is there a configuration file that I can edit to fix these things? Where are these files supposedly located in the .app release of Sage? Anyway to start from ground-zero and reinstall with the app again? [i.e., where are all written files in the .dmg release located.] You can delete ~/Library/Preferences/org.sagemath.Sage.plist This info would be nice to have in the .readme file along with a don't click me in the .dmg text touched file in the release as a warning to future sage-newbs. I've been meaning to fix it so that it won't even start up, it will just warn you about moving it. But I just haven't gotten around to it yet. I hope to put some time into it soon though. Thanks for any and all help! -Allen I hope it helps. ps- I have other python installations on the same machine, already selected for cli work- will this program alter the python selected to be used by the CLI? (my worry) It shouldn't though I'm not sure what you mean by that. It doesn't add anything to your PATH if that's what you mean. -Ivan -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Bivariate polynomial Euclid's division algorithm support
Hi, Does sage have an implementation of Bivariate polynomial Euclid's division algorithm? In particular, I want to divide f(x) = x^p - 1 by g(x,y) = (x-y)^2 - c. Here, p is a large prime. The division occur in F[y] / (y^7 - 1) where F is a finite field(Z mod p).That is while applying division I don't want to allow the power of y to increse beyond 7. I am new to sage. Any help would be great. Thanks, Kundan -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: sage 6.2
I cannot open sage-6.2 from virtual box for second time. I can open it the first time. But ever since then, it goes into the loading screen. then it just when it is starting, it stays in the black screen and then the window just closes. How to fix this problem? On Monday, May 19, 2014 11:59:24 AM UTC-7, leif wrote: nt.a@gmail.com javascript: wrote: Hi Is this software version 6.2 for Windows exist? Yes, and it's brand new! http://boxen.math.washington.edu/home/sagemath/sage-mirror/win/sage-6.2.ova If you don't know yet how to use / install the virtual machine image, see http://sagemath.org/doc/installation/binary.html#microsoft-windows which further indirectly points you to http://wiki.sagemath.org/SageAppliance (and http://www.sagemath.org/download-windows.html but the mirrors haven't synced yet, so wait a while or take the fresh 6.2 ova pointed to at the top of this message). -leif -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: Bivariate polynomial Euclid's division algorithm support
Hi! On 2014-05-30, kundan kumar kundankumar2...@gmail.com wrote: Does sage have an implementation of Bivariate polynomial Euclid's division algorithm? Yes, that's known as normal form computation in commutative algebra. In particular, I want to divide f(x) = x^p - 1 by g(x,y) = (x-y)^2 - c. Here, p is a large prime. The division occur in F[y] / (y^7 - 1) where F is a finite field(Z mod p).That is while applying division I don't want to allow the power of y to increse beyond 7. First of all, let us define a polynomial ring. Note that it is a common mistake for new users of Sage to try to define a polynomial *without* creating a polynomial ring. For example, this should not be done when you want to work with g as a polynomial: sage: g(x,y) = (x-y)^2-5 sage: type(x) type 'sage.symbolic.expression.Expression' The result, as you can see, is a symbolic expression. Its purpose is very much different from what we need here. So, let us properly define a multi-variate polynomial ring, and as you say the coefficients are in some finite field (let us consider p=19): sage: P.x,y = GF(19)[] sage: g = (x-y)^2-5 sage: g x^2 - 2*x*y + y^2 - 5 sage: type(g) type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' But you actually want to do computations modulo y^7-1. So, let us define the quotient ring. Note that we have variables x and y, so, we live in F[x,y]/(y^7-1), not in F[y]/(y^7-1). sage: Q = P.quo(y^7-1) sage: Q Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) We have defined g as an element of P---let's check: sage: g.parent() is P True Hence, we should convert it to an element of the quotient ring: sage: gQ = Q(g) sage: gQ.parent() is Q True Next, let us define f as an element of the quotient ring Q. We have two possibilities: Either we rename x and y, so that they correspont to the generators of Q, or we directly define f in terms of the generators of Q, not of x,y. I assume that the two primes you are talking about are equal, since you both denote them by p. So, stick with p=19: sage: f = Q.0^19-1 sage: f xbar^19 - 1 As you can see, when defining the quotient, the variable names have been automatically changed, to distinguish elements of P from elements of Q. Back to your question: You want to divide f by gQ. If you naively do the division f/gQ, you'll get an error. However, what we want is a representative for the coset f+(gQ*Q). So, let us give a name to the ideal gQ*Q: sage: I = gQ*Q sage: I Ideal (xbar^2 - 2*xbar*ybar + ybar^2 - 5) of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) Polynomial ideals provide a method .reduce(), that reduces a given element by the Gröbner basis of the ideal---that's exactly what we need. Thus, the last step is sage: I.reduce(f) ybar^5 + xbar - ybar - 1 Actually, if you want, you could lift the result back to the non-quotiented ring P: sage: I.reduce(f).lift() y^5 + x - y - 1 Best regards, Simon -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: sage 6.2
It works for me. My guess would be that you somehow damaged the virtual disk image. Can you delete it in virtualbox and import the ova again? On Friday, May 30, 2014 7:37:15 AM UTC+1, Henry Leung wrote: I cannot open sage-6.2 from virtual box for second time. I can open it the first time. But ever since then, it goes into the loading screen. then it just when it is starting, it stays in the black screen and then the window just closes. How to fix this problem? On Monday, May 19, 2014 11:59:24 AM UTC-7, leif wrote: nt.a@gmail.com wrote: Hi Is this software version 6.2 for Windows exist? Yes, and it's brand new! http://boxen.math.washington.edu/home/sagemath/sage-mirror/win/sage-6.2.ova If you don't know yet how to use / install the virtual machine image, see http://sagemath.org/doc/installation/binary.html#microsoft-windows which further indirectly points you to http://wiki.sagemath.org/SageAppliance (and http://www.sagemath.org/download-windows.html but the mirrors haven't synced yet, so wait a while or take the fresh 6.2 ova pointed to at the top of this message). -leif -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: Bivariate polynomial Euclid's division algorithm support
On 30 May 2014 12:37, Simon King simon.k...@uni-jena.de wrote: Hi! On 2014-05-30, kundan kumar kundankumar2...@gmail.com wrote: Does sage have an implementation of Bivariate polynomial Euclid's division algorithm? Yes, that's known as normal form computation in commutative algebra. In particular, I want to divide f(x) = x^p - 1 by g(x,y) = (x-y)^2 - c. Here, p is a large prime. The division occur in F[y] / (y^7 - 1) where F is a finite field(Z mod p).That is while applying division I don't want to allow the power of y to increse beyond 7. First of all, let us define a polynomial ring. Note that it is a common mistake for new users of Sage to try to define a polynomial *without* creating a polynomial ring. For example, this should not be done when you want to work with g as a polynomial: sage: g(x,y) = (x-y)^2-5 sage: type(x) type 'sage.symbolic.expression.Expression' The result, as you can see, is a symbolic expression. Its purpose is very much different from what we need here. So, let us properly define a multi-variate polynomial ring, and as you say the coefficients are in some finite field (let us consider p=19): sage: P.x,y = GF(19)[] sage: g = (x-y)^2-5 sage: g x^2 - 2*x*y + y^2 - 5 sage: type(g) type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' But you actually want to do computations modulo y^7-1. So, let us define the quotient ring. Note that we have variables x and y, so, we live in F[x,y]/(y^7-1), not in F[y]/(y^7-1). sage: Q = P.quo(y^7-1) sage: Q Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) We have defined g as an element of P---let's check: sage: g.parent() is P True Hence, we should convert it to an element of the quotient ring: sage: gQ = Q(g) sage: gQ.parent() is Q True Next, let us define f as an element of the quotient ring Q. We have two possibilities: Either we rename x and y, so that they correspont to the generators of Q, or we directly define f in terms of the generators of Q, not of x,y. I assume that the two primes you are talking about are equal, since you both denote them by p. So, stick with p=19: sage: f = Q.0^19-1 sage: f xbar^19 - 1 As you can see, when defining the quotient, the variable names have been automatically changed, to distinguish elements of P from elements of Q. Back to your question: You want to divide f by gQ. If you naively do the division f/gQ, you'll get an error. However, what we want is a representative for the coset f+(gQ*Q). So, let us give a name to the ideal gQ*Q: sage: I = gQ*Q sage: I Ideal (xbar^2 - 2*xbar*ybar + ybar^2 - 5) of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) Polynomial ideals provide a method .reduce(), that reduces a given element by the Gröbner basis of the ideal---that's exactly what we need. Thus, the last step is sage: I.reduce(f) ybar^5 + xbar - ybar - 1 Actually, if you want, you could lift the result back to the non-quotiented ring P: sage: I.reduce(f).lift() y^5 + x - y - 1 Best regards, Simon Simon, that is a fantastic mini-tutorial and should be kept somewhere for posterity! (assuming the the original questioner likes it too, of course). John -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: Bivariate polynomial Euclid's division algorithm support
+1 for fantastic mini-tutorial -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: How do you convert a string reprsentation of a polynomial back to a polynomial in a polynomial ring
Kannappan Sampath wrote: On Fri, May 30, 2014 at 12:17 AM, William Stein wst...@gmail.com mailto:wst...@gmail.com wrote: Simon -- great answer -- like my second one but even better. This seems like the sort of thing our FAQ should have. Believe it or not, we have a Sage FAQ: http://sagemath.org/doc/faq/ I doubt it has been touched in years, and I doubt anybody even knows how to change it... $ git log src/doc/en/faq/ | grep '^Date:' | head -20 Date: Sat Feb 22 21:59:36 2014 +0100 Date: Tue May 21 00:54:32 2013 +0300 Date: Thu Apr 4 10:42:44 2013 -0700 Date: Tue Feb 14 00:12:31 2012 +0100 Date: Sat Jun 11 09:48:38 2011 +0200 Date: Thu Sep 27 11:08:34 2012 -0700 Date: Sun Aug 26 17:32:18 2012 +0200 Date: Fri Sep 21 16:03:42 2012 +0200 Date: Sun Oct 10 20:58:48 2010 +0200 Date: Mon Jun 28 09:43:00 2010 -0700 Date: Sun May 16 22:28:00 2010 -0700 Date: Sun Apr 4 16:47:15 2010 +0200 Date: Wed Mar 10 15:39:58 2010 -0800 Date: Mon Mar 8 14:09:13 2010 -0800 So at least a few developers are aware of it. -leif And, this one still mentions Mercurial for the development among other things!!! I have opened a ticket to change this (now, I will have to figure how to do that but still...): http://trac.sagemath.org/ticket/16412 -- Kannappan. -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: Bivariate polynomial Euclid's division algorithm support
John Cremona wrote: On 30 May 2014 12:37, Simon King simon.k...@uni-jena.de wrote: Hi! On 2014-05-30, kundan kumar kundankumar2...@gmail.com wrote: Does sage have an implementation of Bivariate polynomial Euclid's division algorithm? Yes, that's known as normal form computation in commutative algebra. In particular, I want to divide f(x) = x^p - 1 by g(x,y) = (x-y)^2 - c. Here, p is a large prime. The division occur in F[y] / (y^7 - 1) where F is a finite field(Z mod p).That is while applying division I don't want to allow the power of y to increse beyond 7. First of all, let us define a polynomial ring. Note that it is a common mistake for new users of Sage to try to define a polynomial *without* creating a polynomial ring. For example, this should not be done when you want to work with g as a polynomial: sage: g(x,y) = (x-y)^2-5 sage: type(x) type 'sage.symbolic.expression.Expression' The result, as you can see, is a symbolic expression. Its purpose is very much different from what we need here. So, let us properly define a multi-variate polynomial ring, and as you say the coefficients are in some finite field (let us consider p=19): sage: P.x,y = GF(19)[] sage: g = (x-y)^2-5 sage: g x^2 - 2*x*y + y^2 - 5 sage: type(g) type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' But you actually want to do computations modulo y^7-1. So, let us define the quotient ring. Note that we have variables x and y, so, we live in F[x,y]/(y^7-1), not in F[y]/(y^7-1). sage: Q = P.quo(y^7-1) sage: Q Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) We have defined g as an element of P---let's check: sage: g.parent() is P True Hence, we should convert it to an element of the quotient ring: sage: gQ = Q(g) sage: gQ.parent() is Q True Next, let us define f as an element of the quotient ring Q. We have two possibilities: Either we rename x and y, so that they correspont to the generators of Q, or we directly define f in terms of the generators of Q, not of x,y. I assume that the two primes you are talking about are equal, since you both denote them by p. So, stick with p=19: sage: f = Q.0^19-1 sage: f xbar^19 - 1 As you can see, when defining the quotient, the variable names have been automatically changed, to distinguish elements of P from elements of Q. Back to your question: You want to divide f by gQ. If you naively do the division f/gQ, you'll get an error. However, what we want is a representative for the coset f+(gQ*Q). So, let us give a name to the ideal gQ*Q: sage: I = gQ*Q sage: I Ideal (xbar^2 - 2*xbar*ybar + ybar^2 - 5) of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 19 by the ideal (y^7 - 1) Polynomial ideals provide a method .reduce(), that reduces a given element by the Gröbner basis of the ideal---that's exactly what we need. Thus, the last step is sage: I.reduce(f) ybar^5 + xbar - ybar - 1 Actually, if you want, you could lift the result back to the non-quotiented ring P: sage: I.reduce(f).lift() y^5 + x - y - 1 Best regards, Simon Simon, that is a fantastic mini-tutorial and should be kept somewhere for posterity! (assuming the the original questioner likes it too, of course). Yes, indeed (and it's just one of a couple). http://ask-simon.sagemath.org/ ? -leif -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Construction of point on elliptic curve fails
The lines sage: k.n = FunctionField(QQ) sage: R.X = k[] sage: l.x = k.extension(X^3+n-1) sage: E = EllipticCurve(l,[0,n]) sage: print 1 == x^3+n True show that the point (x,1) lies on the elliptic curve E, which is defined over l too. However, E(x,1) fails with an intimidating traceback, with the last line being AttributeError: 'FunctionField_polymod_with_category' object has no attribute 'parent' Am I doing something wrong, or is there a bug in a very basic function? -- Peter Mueller -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: Construction of point on elliptic curve fails
On Friday, May 30, 2014 7:57:34 AM UTC-7, Peter Mueller wrote: However, E(x,1) fails with an intimidating traceback, with the last line being (Intimidating but extremely informative) AttributeError: 'FunctionField_polymod_with_category' object has no attribute 'parent' Am I doing something wrong, or is there a bug in a very basic function? I'd say a bug in an untested, not-so-basic combination of functionalities. It's a bug nonetheless, so thanks for reporting! It's a sad reality, but you should expect these things to happen when you're trying out new things in computer algebra systems. You should report the bug on trac (see http://trac.sagemath.org/) otherwise it will get lost. If you can't or don't want to please indicate it here. Hopefully someone else steps in to report it for you. It may be a while until someone gets to fixing it (you could try yourself, but it looks to me this one's pretty deep down in the implementation of function fields). In the mean time, you can get around the problem by building your field a bit differently: P.X,n=QQ[] R.x,n=P.quo(X^3+n-1) K=R.fraction_field() E=EllipticCurve(K,[0,K(n)]) E([x,1]) -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Construction of point on elliptic curve fails
On 30 May 2014 15:57, Peter Mueller ypf...@googlemail.com wrote: The lines sage: k.n = FunctionField(QQ) sage: R.X = k[] sage: l.x = k.extension(X^3+n-1) sage: E = EllipticCurve(l,[0,n]) sage: print 1 == x^3+n True show that the point (x,1) lies on the elliptic curve E, which is defined over l too. However, E(x,1) fails with an intimidating traceback, with the last line being AttributeError: 'FunctionField_polymod_with_category' object has no attribute 'parent' Am I doing something wrong, or is there a bug in a very basic function? You are not doing anything wrong, but I would call it more of a NotImplementedError than a bug. We don't have good support for function fields yet, or for elliptic curves over function fields. But still, that error message is bad. While typing I see that Nils has also answered, probably more usefully than me! John Cremona -- Peter Mueller -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: How do you convert a string reprsentation of a polynomial back to a polynomial in a polynomial ring
I'm trying to become cognizant of your caveats about conversion. What I've tried to write is a recursive function to convert polynomials (statements) in the Free BooleanPolynomialRing() to corresponding probability polynomials (statements) over QQ. I haven't convinced myself that it's correct, but it checks out with some examples and also for basic forms however what I've just discovered is that as in below EX7.P,Q,R,S,V,W = BooleanPolynomialRing(6,order='lex') Prob(P + Q + R + S).ring() #yields an error message -- it doesn't seem to know that it's parent ring should be ProbRing Traceback (most recent call last): File /projects/5511fe15-8085-4d1d-bdc7-c6bf6c99e693/.sagemathcloud/sage_server.py, line 733, in execute exec compile(block+'\n', '', 'single') in namespace, locals File , line 1, in module File element.pyx, line 344, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:4022) File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1775) AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' object has no attribute 'ring' #code def ProbRecurse(myBP,BPR,ProbRing): MyString = str(myBP) if MyString == '1': return 1 elif MyString == '0': return 0 elif MyString.find(' 1') != -1: return 1 - ProbRecurse(myBP + 1,BPR,ProbRing) elif MyString.find('+') == -1: return ProbRing(MyString.lower()) else: kk = MyString.find(' + ') myPoly1 = BPR(MyString[:kk]) myPoly2 = BPR(MyString[kk+3:]) return ProbRecurse(myPoly1,BPR,ProbRing) + ProbRecurse(myPoly2,BPR,ProbRing) - 2*ProbRecurse(myPoly1*myPoly2,BPR,ProbRing) def Prob(myBP): MyString = str(myBP) if MyString == '1': return 1 if MyString == '0': return 0 BPR = myBP.ring() # seems to know it's parent ring NewGens = str(BPR.gens()).lower() NewGens=NewGens[1:len(NewGens) - 1] ProbRing = PolynomialRing(QQ, len(myBP.args()) , NewGens.replace(', ',','), order=BPR.term_order()) # Create parent ProbRing -- inherit term-order and change gens case to lower return ProbRecurse(myBP,BPR,ProbRing) Prob(0) Prob(1) Prob(P*Q*R) # P and Q and R Prob(P*Q + P + Q) # P or Q Prob(P*Q + P + 1) # if P then Q Prob(P + Q) # P xor Q Prob(P + Q + R) # P xor Q xor R Prob(P + Q + R + S) # etc Prob(P*Q*R + P + Q*R) # premise 1 of exercise 7 Prob(Q*R*V*W + Q*R*V + 1) # premise 2 of exercise 7 Prob(P*S + P + S*W + S + 1) # premise 3 of exercise 7 Prob(W + 1) # not but also premise 4 of exercise 7 0 1 p*q*r # these look like polynomials base_ring() identifies as QQ -p*q + p + q p*q - p + 1 -2*p*q + p + q 4*p*q*r - 2*p*q - 2*p*r + p - 2*q*r + q + r # not convinced yet -8*p*q*r*s + 4*p*q*r + 4*p*q*s - 2*p*q + 4*p*r*s - 2*p*r - 2*p*s + p + 4*q*r*s - 2*q*r - 2*q*s + q - 2*r*s + r + s # not convinced yet -p*q*r + p + q*r q*r*v*w - q*r*v + 1 p*s - p + s*w - s + 1 -w + 1 #Then do stuff like this in EX7 = P.ring() Pr1 = (P + R + P*R)*(P + Q + P*Q) # premises of argument exercise 7 Pr2 = 1 + Q*R + Q*R*(1 + V + V*W) Pr3 = 1 + P + P*S + (1 + P + P*S)*(S + S*W) Pr4 = 1 + W Concl = 1 + V + V*S Idl = ideal(Pr1 + 1, Pr2 + 1, Pr3 + 1, Pr4 + 1, Concl + 0) # assume conclusion false for indirect proof proof = Idl.groebner_basis() proof [1] # this mean 1 = 0 i.e. inconsistent therefore indirect proof ideal(Pr1 + 1,Pr2 + 1, Pr3 + 1, Pr4 + 1).groebner_basis() [P, Q + 1, R + 1, S, V, W] # a unique set of truth values [P,Q,R,S,V,W]=[0,1,1,0,0,0] #and generalize to probabilities with ProbRing = PolynomialRing(QQ, len(Prob(P).args()) , Prob(P).args(), order=BPR.term_order()) # have to create the parent outside function PRI=(Prob(P*Q*R + P + Q*R) - 7/10, Prob(Q*R*V*W + Q*R*V + 1) - 1/2, Prob(P*S + P + S*W + S + 1) - 1/3, Prob(W + 1) - 1/2)*ProbRing PRI.groebner_basis() [p*q*r - p - q*r + 7/10, p*s - p - 1/2*s + 2/3, p*v - p - 7/10*v + 1, q*r*s - 2/3*q*r - 2/5*s + 1/15, q*r*v - 1, s*v - 5/2*s - 1/6*v + 5/3, w - 1/2] # of course solving a system may result in values unacceptable as probabilities outside interval [0,1] On 5/29/2014 2:47 PM, William Stein wrote:
Re: [sage-support] Construction of point on elliptic curve fails
On Fri, May 30, 2014 at 9:14 AM, John Cremona john.crem...@gmail.com wrote: On 30 May 2014 15:57, Peter Mueller ypf...@googlemail.com wrote: The lines sage: k.n = FunctionField(QQ) sage: R.X = k[] sage: l.x = k.extension(X^3+n-1) sage: E = EllipticCurve(l,[0,n]) sage: print 1 == x^3+n True show that the point (x,1) lies on the elliptic curve E, which is defined over l too. However, E(x,1) fails with an intimidating traceback, with the last line being AttributeError: 'FunctionField_polymod_with_category' object has no attribute 'parent' Am I doing something wrong, or is there a bug in a very basic function? You are not doing anything wrong, but I would call it more of a NotImplementedError than a bug. We don't have good support for function fields yet, or for elliptic curves over function fields. But still, that error message is bad. My recollection is that the sum total of work on function fields in Sage was a few days that Robert Bradshaw and I spent coding up some extremely basic functionality, probably about 5 years ago. That's it. Don't expect much. I've hired Andrew Ohana to rewrite function fields this summer, and add more interesting functionality (e.g., implement Hess's algorithm). Let's encourage him. -- William John Cremona -- Peter Mueller -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Runtime Error: Gap Tables of Marks Library not installed
host: Windows 8.1 VirtualBox 4.3.12 guest: Ubuntu 14.04 LTS Sage 6.2 Release Date 2014-05-06 Statements that gave rise to the error: A5 = AlternatingGroup(5) A5_sgs = A5.subgroups() len(A5_sgs) = ... RuntimeError: Gap produced error output Error, sorry, the GAP Tables of Marks Library is not installed executing ConjugacyClassesSubgroups($sage 2) -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Runtime Error: Gap Tables of Marks Library not installed
On Fri, May 30, 2014 at 10:01 AM, Robert Godfroid robert.godfr...@gmail.com wrote: host: Windows 8.1 VirtualBox 4.3.12 guest: Ubuntu 14.04 LTS Sage 6.2 Release Date 2014-05-06 Statements that gave rise to the error: A5 = AlternatingGroup(5) A5_sgs = A5.subgroups() len(A5_sgs) = ... RuntimeError: Gap produced error output Error, sorry, the GAP Tables of Marks Library is not installed executing ConjugacyClassesSubgroups($sage 2) This should be provied by the tomlib package, which is I think part of the Sage optional package gap_packages-4.6.4.p1 or maybe database_gap-4.6.4. If you install those packages, you'll have a directory local/gap/latest/pkg/tomlib. However, tomlib still doesn't work: salvus@compute1dc2:/usr/local/sage/sage-6.2.rc0/local/gap/latest/pkg$ sage -gap ┌───┐ GAP, Version 4.7.4 of 20-Feb-2014 (free software, GPL) │ GAP │ http://www.gap-system.org └───┘ Architecture: x86_64-unknown-linux-gnu-gcc-default64 Libs used: gmp, readline Loading the library and packages ... TableOfMarks( CharacterTable( A5 ) ) Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 Packages: Alnuth 3.0.0, AutPGrp 1.6, CTblLib 1.2.2, FactInt 1.5.3, GAPDoc 1.5.1, LAGUNA 3.6.4, Polycyclic 2.11 Try '?help' for help. See also '?copyright' and '?authors' gap TableOfMarks( CharacterTable( A5 ) ); fail I also tried downloading the latest version of tomlib from http://www.gap-system.org/Packages/tomlib.html and manually placing it there, and it also doesn't work. Hopefully a GAP expert can say more. -- William -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: How do you convert a string reprsentation of a polynomial back to a polynomial in a polynomial ring
Stephen Kauffman wrote: I'm trying to become cognizant of your caveats about conversion. What I've tried to write is a recursive function to convert polynomials (statements) in the Free BooleanPolynomialRing() to corresponding probability polynomials (statements) over QQ. I haven't convinced myself that it's correct, but it checks out with some examples and also for basic forms however what I've just discovered is that as in below EX7.P,Q,R,S,V,W = BooleanPolynomialRing(6,order='lex') Prob(P + Q + R + S).ring() #yields an error message -- it doesn't seem to know that it's parent ring should be ProbRing Traceback (most recent call last): File /projects/5511fe15-8085-4d1d-bdc7-c6bf6c99e693/.sagemathcloud/sage_server.py, line 733, in execute exec compile(block+'\n', '', 'single') in namespace, locals File , line 1, in module File element.pyx, line 344, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:4022) File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1775) AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' object has no attribute 'ring' [BIG SNIP] You can use foo.parent() or parent(foo) instead. -leif -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: How do you convert a string reprsentation of a polynomial back to a polynomial in a polynomial ring
leif wrote: Stephen Kauffman wrote: I'm trying to become cognizant of your caveats about conversion. What I've tried to write is a recursive function to convert polynomials (statements) in the Free BooleanPolynomialRing() to corresponding probability polynomials (statements) over QQ. I haven't convinced myself that it's correct, but it checks out with some examples and also for basic forms however what I've just discovered is that as in below EX7.P,Q,R,S,V,W = BooleanPolynomialRing(6,order='lex') Prob(P + Q + R + S).ring() #yields an error message -- it doesn't seem to know that it's parent ring should be ProbRing Traceback (most recent call last): File /projects/5511fe15-8085-4d1d-bdc7-c6bf6c99e693/.sagemathcloud/sage_server.py, line 733, in execute exec compile(block+'\n', '', 'single') in namespace, locals File , line 1, in module File element.pyx, line 344, in sage.structure.element.Element.__getattr__ (sage/structure/element.c:4022) File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1775) AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' object has no attribute 'ring' [BIG SNIP] You can use foo.parent() or parent(foo) instead. P.S.: sage: FOO.P,Q,R,S,V,W = BooleanPolynomialRing(6,order='lex') sage: FOO.gens() (P, Q, R, S, V, W) sage: bar_gens_str = ','.join([ str(g).lower() for g in FOO.gens() ]) sage: BAR = PolynomialRing(QQ, bar_gens_str) sage: BAR Multivariate Polynomial Ring in p, q, r, s, v, w over Rational Field sage: FOO('P + Q').parent() # of course works without quotes as well Boolean PolynomialRing in P, Q, R, S, V, W sage: BAR('p + q').parent() Multivariate Polynomial Ring in p, q, r, s, v, w over Rational Field -leif -- () The ASCII Ribbon Campaign /\ Help Cure HTML E-Mail -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: Runtime Error: Gap Tables of Marks Library not installed
On 2014-05-30, William Stein wst...@gmail.com wrote: On Fri, May 30, 2014 at 10:01 AM, Robert Godfroid robert.godfr...@gmail.com wrote: host: Windows 8.1 VirtualBox 4.3.12 guest: Ubuntu 14.04 LTS Sage 6.2 Release Date 2014-05-06 Statements that gave rise to the error: A5 = AlternatingGroup(5) A5_sgs = A5.subgroups() len(A5_sgs) = ... RuntimeError: Gap produced error output Error, sorry, the GAP Tables of Marks Library is not installed executing ConjugacyClassesSubgroups($sage 2) This should be provied by the tomlib package, which is I think part of the Sage optional package gap_packages-4.6.4.p1 or maybe database_gap-4.6.4. If you install those packages, you'll have a it is meanwihile 4.7.4. (However, one can just do sage -i database_gap to install the latest one) directory local/gap/latest/pkg/tomlib. However, tomlib still doesn't work: indeed! It turns out that nowadays Tomlib depends upon another GAP package, AtlasRep, which Sage is not providing. While we deal with fixing this, one can manually install atlasrep into local/gap/latest/pkg/ which is just unpacking the tar file from http://www.gap-system.org/Packages/atlasrep.html After this: gap LoadPackage( tomlib ); true gap TableOfMarks( CharacterTable( A5 ) ); TableOfMarks( A5 ) gap t:=TableOfMarks( CharacterTable( A5 ) ); TableOfMarks( A5 ) gap Display(t); 1: 60 2: 30 2 3: 20 . 2 4: 15 3 . 3 5: 12 . . . 2 6: 10 2 1 . . 1 7: 6 2 . . 1 . 1 8: 5 1 2 1 . . . 1 9: 1 1 1 1 1 1 1 1 1 gap --- Note that one needs to load this package explicitly: gap LoadPackage(tomplib); (or in Sage one does gap.load_package(tomlib)) (in order to check that AtlasRep is installed, one can try gap LoadPackage( tomlib ); and see that it prints true Note that AtlasRep will be autoloaded by TomLib. salvus@compute1dc2:/usr/local/sage/sage-6.2.rc0/local/gap/latest/pkg$ sage -gap ┌───┐ GAP, Version 4.7.4 of 20-Feb-2014 (free software, GPL) │ GAP │ http://www.gap-system.org └───┘ Architecture: x86_64-unknown-linux-gnu-gcc-default64 Libs used: gmp, readline Loading the library and packages ... TableOfMarks( CharacterTable( A5 ) ) Components: trans 1.0, prim 2.1, small* 1.0, id* 1.0 Packages: Alnuth 3.0.0, AutPGrp 1.6, CTblLib 1.2.2, FactInt 1.5.3, GAPDoc 1.5.1, LAGUNA 3.6.4, Polycyclic 2.11 Try '?help' for help. See also '?copyright' and '?authors' gap TableOfMarks( CharacterTable( A5 ) ); fail I also tried downloading the latest version of tomlib from http://www.gap-system.org/Packages/tomlib.html and manually placing it there, and it also doesn't work. Hopefully a GAP expert can say more. http://trac.sagemath.org/ticket/16416 Dima -- William -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.