[sage-support] Re: solve_ineq() fails
On 12/03/2012 09:44 AM, Cary Cherng wrote: I tried using solve_ineq in the notebook in the simple way below and got an error. It seems to be related to http://trac.sagemath.org/sage_trac/ticket/11520 Is there a workaround? R.g1,g2 = PolynomialRing(QQ) solve_ineq([g1 g2],[g1,g2]) Traceback (most recent call last): File stdin, line 1, in module File _sage_input_106.py, line 10, in module exec compile(u'open(___code___.py,w).write(# -*- coding: utf-8 -*-\\n + _support_.preparse_worksheet_cell(base64.b64decode(c29sdmVfaW5lcShbZzEgPiBnMl0sW2cxLGcyXSk=),globals())+\\n); execfile(os.path.abspath(___code___.py)) File , line 1, in module File /tmp/tmpwFoZvN/___code___.py, line 2, in module exec compile(u'solve_ineq([g1 g2],[g1,g2]) File , line 1, in module File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1204, in solve_ineq return(solve_ineq_fourier(ineq, vars)) File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1115, in solve_ineq_fourier ineq0 = [i._maxima_() for i in ineq] AttributeError: 'bool' object has no attribute '_maxima_' I think it is more related to this ticket: http://trac.sagemath.org/sage_trac/ticket/13645 As soon as you write g1 g2, the expression is evaluated and you get a boolean as a result. solve() or solve_ineq() clearly can't solve a boolean. This inequality is not evaluated if you have normal symbolic variables (declared using var()). #11520 will be solved by the patch in #13645. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq() fails
The patch in the ticket seemed to only address making the error messages better. Is there some mechanism to convert p1 and p2 to symbolic based polynomials in the below code R.g1,g2 = PolynomialRing(QQ) ... # long sequence of calculations to compute polynomials p1 and p2 ... solve_ineq([p1 0, p2 0],[g1,g2]) On Monday, December 3, 2012 12:49:19 AM UTC-8, P Purkayastha wrote: On 12/03/2012 09:44 AM, Cary Cherng wrote: I tried using solve_ineq in the notebook in the simple way below and got an error. It seems to be related to http://trac.sagemath.org/sage_trac/ticket/11520 Is there a workaround? R.g1,g2 = PolynomialRing(QQ) solve_ineq([g1 g2],[g1,g2]) Traceback (most recent call last): File stdin, line 1, in module File _sage_input_106.py, line 10, in module exec compile(u'open(___code___.py,w).write(# -*- coding: utf-8 -*-\\n + _support_.preparse_worksheet_cell(base64.b64decode(c29sdmVfaW5lcShbZzEgPiBnMl0sW2cxLGcyXSk=),globals())+\\n); execfile(os.path.abspath(___code___.py)) File , line 1, in module File /tmp/tmpwFoZvN/___code___.py, line 2, in module exec compile(u'solve_ineq([g1 g2],[g1,g2]) File , line 1, in module File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1204, in solve_ineq return(solve_ineq_fourier(ineq, vars)) File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1115, in solve_ineq_fourier ineq0 = [i._maxima_() for i in ineq] AttributeError: 'bool' object has no attribute '_maxima_' I think it is more related to this ticket: http://trac.sagemath.org/sage_trac/ticket/13645 As soon as you write g1 g2, the expression is evaluated and you get a boolean as a result. solve() or solve_ineq() clearly can't solve a boolean. This inequality is not evaluated if you have normal symbolic variables (declared using var()). #11520 will be solved by the patch in #13645. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq() fails
I don't know of any nice way of converting the variables to symbolic variables. Even if you did compute the polynomials p1 and p2, and even if you did manage to put it in the solve_* expressions after converting the variables, the answer that you will get as the solution will not belong to the QQ field in general. So, it is pointless to even do this conversion to start with. On 12/03/2012 05:19 PM, Cary Cherng wrote: The patch in the ticket seemed to only address making the error messages better. Is there some mechanism to convert p1 and p2 to symbolic based polynomials in the below code R.g1,g2 = PolynomialRing(QQ) ... # long sequence of calculations to compute polynomials p1 and p2 ... solve_ineq([p1 0, p2 0],[g1,g2]) On Monday, December 3, 2012 12:49:19 AM UTC-8, P Purkayastha wrote: On 12/03/2012 09:44 AM, Cary Cherng wrote: I tried using solve_ineq in the notebook in the simple way below and got an error. It seems to be related to http://trac.sagemath.org/sage_trac/ticket/11520 http://trac.sagemath.org/sage_trac/ticket/11520 Is there a workaround? R.g1,g2 = PolynomialRing(QQ) solve_ineq([g1 g2],[g1,g2]) Traceback (most recent call last): File stdin, line 1, in module File _sage_input_106.py, line 10, in module exec compile(u'open(___code___.py,w).write(# -*- coding: utf-8 -*-\\n + _support_.preparse_worksheet_cell(base64.b64decode(c29sdmVfaW5lcShbZzEgPiBnMl0sW2cxLGcyXSk=),globals())+\\n); execfile(os.path.abspath(___code___.py)) File , line 1, in module File /tmp/tmpwFoZvN/___code___.py, line 2, in module exec compile(u'solve_ineq([g1 g2],[g1,g2]) File , line 1, in module File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1204, in solve_ineq return(solve_ineq_fourier(ineq, vars)) File /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py, line 1115, in solve_ineq_fourier ineq0 = [i._maxima_() for i in ineq] AttributeError: 'bool' object has no attribute '_maxima_' I think it is more related to this ticket: http://trac.sagemath.org/sage_trac/ticket/13645 http://trac.sagemath.org/sage_trac/ticket/13645 As soon as you write g1 g2, the expression is evaluated and you get a boolean as a result. solve() or solve_ineq() clearly can't solve a boolean. This inequality is not evaluated if you have normal symbolic variables (declared using var()). #11520 will be solved by the patch in #13645. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq() fails
On Monday, December 3, 2012 6:19:18 AM UTC-5, P Purkayastha wrote: I don't know of any nice way of converting the variables to symbolic variables. For the record, you can just cast to SR (the symbolic ring): sage: R.g1,g2 = PolynomialRing(QQ) sage: g1 = SR(g1) sage: g2 = SR(g2) sage: solve_ineq([g1 g2],[g1,g2]) [[g2 g1]] -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq() fails
On 12/03/2012 07:42 PM, Volker Braun wrote: On Monday, December 3, 2012 6:19:18 AM UTC-5, P Purkayastha wrote: I don't know of any nice way of converting the variables to symbolic variables. For the record, you can just cast to SR (the symbolic ring): sage: R.g1,g2 = PolynomialRing(QQ) sage: g1 = SR(g1) sage: g2 = SR(g2) sage: solve_ineq([g1 g2],[g1,g2]) [[g2 g1]] I don't think that is really a solution. It doesn't ensure that the values output actually live in the original ring over which the polynomials are defined. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: SIGABRT in Graph.clique_number() and assertion in cliquer
sage: k4=graphs.CompleteGraph(4) sage: k4.complement().line_graph().complement() complement(): Graph on 0 vertices clique_number() is crashing on the empty graph, On Saturday, December 1, 2012 9:30:27 AM UTC-5, Georgi Guninski wrote: for g in graphs(4): g.complement().line_graph().complement().clique_number() cliquer file graph.c: line 31: assertion failed: (n0) Unhandled SIGABRT: An abort() occurred in Sage. This probably occurred because a *compiled* component of Sage has a bug On sagenb.org don't get any output, don't know how to interpret this. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: SIGABRT in Graph.clique_number() and assertion in cliquer
On 12/1/12 8:30 AM, Georgi Guninski wrote: On sagenb.org don't get any output, don't know how to interpret this. That happens a lot of times when there was a crash, so it's consistent with the error you saw. Thanks, Jason -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: SIGABRT in Graph.clique_number() and assertion in cliquer
http://trac.sagemath.org/sage_trac/ticket/10756 T_T Of course I only did it for clique_maximum() T_T Well, Georgi... Weren't you looking for an easy patch to write ? :-P Nathann On Monday, December 3, 2012 3:16:09 PM UTC+1, Jason Grout wrote: On 12/1/12 8:30 AM, Georgi Guninski wrote: On sagenb.org don't get any output, don't know how to interpret this. That happens a lot of times when there was a crash, so it's consistent with the error you saw. Thanks, Jason -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Constructing subsapces of vector spaces
Try mat.kernel_on(V). Also, if v is a vector in the ambient space which happens to lie in V then V.coordinates(v) will give its coordinates w.r.t. the basis of V. John Cremona On Monday, December 3, 2012 1:38:38 AM UTC, Andrew Mathas wrote: Hi All, I have been playing with some code where I want to find a submodule of a module V which is annihilated by a bunch of maps. What I want to do something like the following: V= some free submodule of rank v inside a space of rank d\ge v. mat=[[0 for col in range(w)] for row in range(v)] # fairly sparse matrix which describes the map f on bases of V and W ...compute non-zero entries of the matrix ``mat`` V = V.intersection( matrix(mat).kernel() ) where v=dim V, w=dim W where f is a map from V to W. Of course, this doesn't quite work because matrix(mat).kernel() returns a submodule of ZZ^v with respect to its standard basis whereas the space V has a very different basis in general. To get around this I found myself writing kernel=V.submodule_with_basis([V.linear_combination_of_basis(b.list()) for b in matrix(pmat).kernel().basis()]) V=V.intersection(kernel) This strikes me as being a very convoluted way of writing something is presumably quite common: writing the standard basis elements as linear combinations of another basis. My question is: is there a better way to do this? For a little while, I tried defining W=FreeModule(ZZ,w) and then constructing the map f explicitly as a homomorphism from V to W. Doing it this way does make f.kernel() into a submodule of V, but this approach just seems to create a lot of extra overhead with very little benefit as I essentially still had to construct the matrix ``mat`` above and used it to define ``f`` with respect to the bases of ``V`` and ``W``. In fact, all this really did was shift my problem above of writing the basis of the kernel in terms of the basis of V to the problem of writing the images of f in terms of the standard basis of W. (Even though I imagine that this second approach is much slower I really should have checked by doing some profiling before rewriting as above, but I didn't...) Any thoughts? Cheers, Andrew -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Sage VM: Googe Chrome should NOT run in kiosk mode
Hello Sage VM runs Chrome in kiosk mode, and refuses to get out of kiosk mode (I can press F11 to my heart's content; it doesn't change anything), therefore won't allow any changes to its settings. The settings certainly need to change for non-trivial work, as when I'd like to save a worksheet to a shared folder created through the VM, and not to /home/gui/Downloads, which is not accessible to the Windows desktop, or not easily. For some real entertainment, try clicking on Chrome's invitation to view the folder where a file was downloaded. The window comes up full screen and you can't navigate back to Chrome, or not easily. What exactly is the appeal of kiosk mode? On the user's own machine, it constrains the user and makes it hard (well nigh impossible?) to change settings or to explore. Perhaps there is some trump in kiosk's hand of which I am unaware, but IMHO it has to go. john perry PS: I also liked the old way, where the user was given an explicit option to run command-line sage or worksheet sage. I can work around the current approach (CTRL+ALT+Fsomething does the trick), but if anyone cares, it would be really nice to have the old way back. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Sage VM: Googe Chrome should NOT run in kiosk mode
Really I see the browser running inside the VM as a crutch for those that can't use their host browser because of a misconfigured firewall. I understand your frustration being stuck with kiosk mode, but I don't think that making the environment in the VM more complex is a good idea either. Not using kiosk means you have to add window manager, desktop environment, ... Ideally the notebook would have some plugin system so we can add additional settings in the notebook settings to configure keyboard and other basics. Perhaps run a web-based shell or file manager. And/or a python script running on the host that can pull files out of the VM. If you really want a full desktop environment in the VM then its not that difficult to install; go to the console, log in, yum install whatever you want. On Monday, December 3, 2012 2:05:46 PM UTC-5, john_perry_usm wrote: Hello Sage VM runs Chrome in kiosk mode, and refuses to get out of kiosk mode (I can press F11 to my heart's content; it doesn't change anything), therefore won't allow any changes to its settings. The settings certainly need to change for non-trivial work, as when I'd like to save a worksheet to a shared folder created through the VM, and not to /home/gui/Downloads, which is not accessible to the Windows desktop, or not easily. For some real entertainment, try clicking on Chrome's invitation to view the folder where a file was downloaded. The window comes up full screen and you can't navigate back to Chrome, or not easily. What exactly is the appeal of kiosk mode? On the user's own machine, it constrains the user and makes it hard (well nigh impossible?) to change settings or to explore. Perhaps there is some trump in kiosk's hand of which I am unaware, but IMHO it has to go. john perry PS: I also liked the old way, where the user was given an explicit option to run command-line sage or worksheet sage. I can work around the current approach (CTRL+ALT+Fsomething does the trick), but if anyone cares, it would be really nice to have the old way back. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Sage VM: Googe Chrome should NOT run in kiosk mode
On Monday, December 3, 2012 1:24:38 PM UTC-6, Volker Braun wrote: Really I see the browser running inside the VM as a crutch for those that can't use their host browser because of a misconfigured firewall. Pshaw. For some reason I was under the impression that this wasn't working anymore. Probably because some student had a misconfigured firewall, and I didn't see it. I'm working with another student now, and you're right, it works just fine. Thanks for pointing that out. :-) john perry -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] solve_ineq does not always return the empty set as [ ]
In the below why does solve_ineq called with the inequalities t1 = t2 , t1 t2 not return [ ], but the other invocations of solve_ineq return the empty set as [ ] ? sage: g1,g2 = var('g1,g2') sage: t1 = g1^2*g2^2 sage: t2 = g1^2*g2 sage: solve_ineq([t1 = t2 , t1 t2],[g1,g2]) [[g1 == 0, 1 g2, 0 != 0], [g1 == 0, g2 0, 0 != 0]] sage: solve_ineq([t1 t2 , t1 t2],[g1,g2]) [] sage: s1 = g2^2 sage: s2 = g2 sage: solve_ineq([s1 = s2 , s1 s2],[g1,g2]) [] -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Constructing subsapces of vector spaces
Hi John, Thanks for the reply, but you have my problem upside down as I don't need to restrict from the ambient space to the subspace but rather to extend from the subspace to the ambient space. For example, I could have: sage: V Free module of degree 4 and rank 3 over Integer Ring User basis matrix: [0 1 2 3] [2 3 1 4] [1 3 2 1] sage: mat=matrix([[1,2,3],[2,1,4],[3,3,7]]); mat.kernel() Free module of degree 3 and rank 1 over Integer Ring Echelon basis matrix: [ 1 1 -1] The problem that is V is isomorphic to Z^3, but it is represented as a subspace of Z^4, whereas the kernel is a subspace of Z^3. As I mentioned, sage: V.submodule_with_basis([V.linear_combination_of_basis(b.list()) for b in mat.kernel().basis()]) Free module of degree 4 and rank 1 over Integer Ring User basis matrix: [1 1 1 6] does give the kernel as a subspace of V. I was just wondering if there was a better way of doing this. Cheers, Andrew -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Constructing subsapces of vector spaces
On Monday, December 3, 2012 5:09:40 PM UTC-8, Andrew Mathas wrote: Hi John, Thanks for the reply, but you have my problem upside down as I don't need to restrict from the ambient space to the subspace but rather to extend from the subspace to the ambient space. For example, I could have: sage: V Free module of degree 4 and rank 3 over Integer Ring User basis matrix: [0 1 2 3] [2 3 1 4] [1 3 2 1] sage: mat=matrix([[1,2,3],[2,1,4],[3,3,7]]); mat.kernel() Free module of degree 3 and rank 1 over Integer Ring Echelon basis matrix: [ 1 1 -1] The problem that is V is isomorphic to Z^3, but it is represented as a subspace of Z^4, whereas the kernel is a subspace of Z^3. As I mentioned, So, when you're computing the kernel, you should tell the system that you want a kernel of a homomorphism on V; not on abstract Z^3: sage: A=ZZ^4 sage: V=A.submodule_with_basis([[0,1,2,3],[2,3,1,4],[1,3,2,1]]) sage: phi=V.hom([(ZZ^3)(v) for v in [[1,2,3],[2,1,4],[3,3,7]]]) sage: phi.kernel() Free module of degree 4 and rank 1 over Integer Ring Echelon basis matrix: [1 1 1 6] -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq does not always return the empty set as [ ]
On 12/04/2012 08:51 AM, Cary Cherng wrote: In the below why does solve_ineq called with the inequalities t1 = t2 , t1 t2 not return [ ], but the other invocations of solve_ineq return the empty set as [ ] ? sage: g1,g2 = var('g1,g2') sage: t1 = g1^2*g2^2 sage: t2 = g1^2*g2 sage: solve_ineq([t1 = t2 , t1 t2],[g1,g2]) [[g1 == 0, 1 g2, 0 != 0], [g1 == 0, g2 0, 0 != 0]] sage: solve_ineq([t1 t2 , t1 t2],[g1,g2]) [] sage: s1 = g2^2 sage: s2 = g2 sage: solve_ineq([s1 = s2 , s1 s2],[g1,g2]) [] You have to consider what is in the output. Both the answers contain 0 != 0, so essentially none of the answers are feasible since 0 != 0 is always false. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: solve_ineq does not always return the empty set as [ ]
I recognize that it is the empty set described in a different way. Is there a reason why it can't always describe the empty set as [ ] ? The question I am having is how do I tell if it is the empty set for more complicated inputs? For example, consider setting t1 and t2 to large polynomials computed somehow. Then the following can give an output that is quite large and it is impossible to tell if it is the empty set. Here we know it should be the empty set because of the trivial inequalities given as inputs. But what if the inputs are something meaningful and realistic? sage: g1,g2 = var('g1,g2') sage: t1 = large polynomial sage: t2 = large polynomial sage: solve_ineq([t1 = t2 , t1 t2],[g1,g2]) # output that is large and impossible to tell visually that it is the empty set On Monday, December 3, 2012 9:05:57 PM UTC-8, P Purkayastha wrote: On 12/04/2012 08:51 AM, Cary Cherng wrote: In the below why does solve_ineq called with the inequalities t1 = t2 , t1 t2 not return [ ], but the other invocations of solve_ineq return the empty set as [ ] ? sage: g1,g2 = var('g1,g2') sage: t1 = g1^2*g2^2 sage: t2 = g1^2*g2 sage: solve_ineq([t1 = t2 , t1 t2],[g1,g2]) [[g1 == 0, 1 g2, 0 != 0], [g1 == 0, g2 0, 0 != 0]] sage: solve_ineq([t1 t2 , t1 t2],[g1,g2]) [] sage: s1 = g2^2 sage: s2 = g2 sage: solve_ineq([s1 = s2 , s1 s2],[g1,g2]) [] You have to consider what is in the output. Both the answers contain 0 != 0, so essentially none of the answers are feasible since 0 != 0 is always false. -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.