[sage-support] Re: Arbitrary precision linear programming

2014-10-27 Thread Dima Pasechnik
On 2014-10-24, Mike  wrote:
> This was a "demonstration problem" - my actual application will involve 
> arbitrary-precision reals with lots of constraints.
>
> It appears that PPL not only supports rationals, but insists on them.  It 
> seems to set the base_ring to QQ, as the output from the following code is 
> "Rational Field", but I can find no way to alter base_ring.  Any 
no, you can't do this. PPL is a C++ library that only works with rationals.

Do you mean to say that your "abritrary precision reals" are irrational?
If not, then why don't you just work with rationals?

> suggestions on how I might accomplish that?  (For glpk the base_ring is 
> "Real Double Field", and I can't find a way to alter that either.)
the arbitrary precision part of glpk does not have a Sage interface, 
nobody got around to dig it up.

 
>
> from sage.numerical.backends.generic_backend import get_solver
> p = get_solver(solver = "PPL")
> print p.base_ring()
>

-- 
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] How to handle file in Sage

2014-10-27 Thread William Stein
On Mon, Oct 27, 2014 at 1:24 PM, slelievre  wrote:
> 'load' is expecting filenames with extension among
>
>  .py, .sage, .sobj
>
> and maybe a few others.
>
> If the file name does not have an extension in that short list,
> 'load' will add the extension .sobj.
>

Yes, use Python's builtin open command:

  A1 = open("./Documents/program21.txt").read()

>
> Le lundi 27 octobre 2014 15:12:17 UTC+1, Santanu a écrit :
>>
>> Thanks a lot. But I am getting these errors:
>>
>> A1=load("./Documents/program21.txt")
>>
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "_sage_input_4.py", line 10, in 
>> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
>> -*-\\n" +
>> _support_.preparse_worksheet_cell(base64.b64decode("QTE9bG9hZCgiLi9Eb2N1bWVudHMvcHJvZ3JhbTIxLnR4dCIp"),globals())+"\\n");
>> execfile(os.path.abspath("___code___.py"))
>>   File "", line 1, in 
>>
>>   File "/tmp/tmpYQU78_/___code___.py", line 2, in 
>> exec compile(u'A1=load("./Documents/program21.txt")
>>   File "", line 1, in 
>>
>>   File "sage_object.pyx", line 862, in sage.structure.sage_object.load
>> (sage/structure/sage_object.c:9317)
>> IOError: [Errno 2] No such file or directory:
>> './Documents/program21.txt.sobj'
>>
>>
>>
>> --
>>
>>
>> exec preparse(open('/Documents/program21.txt').read())
>>
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "_sage_input_5.py", line 10, in 
>> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
>> -*-\\n" +
>> _support_.preparse_worksheet_cell(base64.b64decode("ZXhlYyBwcmVwYXJzZShvcGVuKCcvRG9jdW1lbnRzL3Byb2dyYW0yMS50eHQnKS5yZWFkKCkp"),globals())+"\\n");
>> execfile(os.path.abspath("___code___.py"))
>>   File "", line 1, in 
>>
>>   File "/tmp/tmpqrNaPI/___code___.py", line 2, in 
>> exec compile(u"exec preparse(open('/Documents/program21.txt').read())"
>> + '\n', '', 'single')
>>   File "", line 1, in 
>>
>> IOError: [Errno 2] No such file or directory: '/Documents/program21.txt'
>>
>>
>> On 22 October 2014 05:56, William Stein  wrote:
>>>
>>> On Tue, Oct 21, 2014 at 5:19 PM, kcrisman  wrote:
>>> >> > differently)
>>> >>
>>> >> Thanks - I meant %runfile not %execfile.  I find it hard to remember,
>>> >> which is yet another reason I am against removal of the more memorable
>>> >> %load
>>> >> that we had for years.
>>> >>
>>> >> >
>>> >>
>>> >
>>> > Agreed, but this was semi-unavoidable because of the Ipython upgrade a
>>> > while
>>> > back, though, right?
>>>
>>> It was definitely not unavoidable.
>>>
>>> -- 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...@googlegroups.com.
>>> > To post to this group, send email to sage-s...@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...@googlegroups.com.
>>> To post to this group, send email to sage-s...@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.


Re: [sage-support] How to handle file in Sage

2014-10-27 Thread slelievre
'load' is expecting filenames with extension among

 .py, .sage, .sobj

and maybe a few others.

If the file name does not have an extension in that short list,
'load' will add the extension .sobj.



Le lundi 27 octobre 2014 15:12:17 UTC+1, Santanu a écrit :
>
> Thanks a lot. But I am getting these errors: 
>
> A1=load("./Documents/program21.txt")
>
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "_sage_input_4.py", line 10, in 
> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> -*-\\n" + 
> _support_.preparse_worksheet_cell(base64.b64decode("QTE9bG9hZCgiLi9Eb2N1bWVudHMvcHJvZ3JhbTIxLnR4dCIp"),globals())+"\\n");
>  
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in 
> 
>   File "/tmp/tmpYQU78_/___code___.py", line 2, in 
> exec compile(u'A1=load("./Documents/program21.txt")
>   File "", line 1, in 
> 
>   File "sage_object.pyx", line 862, in sage.structure.sage_object.load 
> (sage/structure/sage_object.c:9317)
> IOError: [Errno 2] No such file or directory: 
> './Documents/program21.txt.sobj'
>
>
>
> --
>
>
> exec preparse(open('/Documents/program21.txt').read())
>
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "_sage_input_5.py", line 10, in 
> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
> -*-\\n" + 
> _support_.preparse_worksheet_cell(base64.b64decode("ZXhlYyBwcmVwYXJzZShvcGVuKCcvRG9jdW1lbnRzL3Byb2dyYW0yMS50eHQnKS5yZWFkKCkp"),globals())+"\\n");
>  
> execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in 
> 
>   File "/tmp/tmpqrNaPI/___code___.py", line 2, in 
> exec compile(u"exec preparse(open('/Documents/program21.txt').read())" 
> + '\n', '', 'single')
>   File "", line 1, in 
> 
> IOError: [Errno 2] No such file or directory: '/Documents/program21.txt'
>
>
> On 22 October 2014 05:56, William Stein > 
> wrote:
>
>> On Tue, Oct 21, 2014 at 5:19 PM, kcrisman > > wrote:
>> >> > differently)
>> >>
>> >> Thanks - I meant %runfile not %execfile.  I find it hard to remember,
>> >> which is yet another reason I am against removal of the more memorable 
>> %load
>> >> that we had for years.
>> >>
>> >> >
>> >>
>> >
>> > Agreed, but this was semi-unavoidable because of the Ipython upgrade a 
>> while
>> > back, though, right?
>>
>> It was definitely not unavoidable.
>>
>> -- 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...@googlegroups.com .
>> > To post to this group, send email to sage-s...@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...@googlegroups.com .
>> To post to this group, send email to sage-s...@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] Secure connection fails using Firefox 33

2014-10-27 Thread Daniel Krenn
Am 2014-10-27 um 19:08 schrieb mjs:
> With the recent release of Firefox 33 (now shipped to Fedora, coming
> soon to an OS near you), I can no longer connect to my Sage 6.3 server. 
> The error I get is:
> 
> An error occurred during a connection to sage.math.clemson.edu:34567.
> The key does not support the requested operation. (Error code:
> sec_error_invalid_key)
> 
> The page you are trying to view cannot be shown because the
> authenticity of the received data could not be verified.
> Please contact the website owners to inform them of this problem.
> 
> This is apparently due to Firefox removing support for SSL other than
> that provided by libPKIX. There seem to be a few different possible
> issues with the key that is generated when Sage is built that might
> cause this, e.g., key not long enough (Firefox now requires keys to be
> 1024 bits or more).  Has anyone else seen this?  

Yes, I have the same problem.

Daniel

-- 
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] Secure connection fails using Firefox 33

2014-10-27 Thread mjs
With the recent release of Firefox 33 (now shipped to Fedora, coming soon 
to an OS near you), I can no longer connect to my Sage 6.3 server.  The 
error I get is:

An error occurred during a connection to sage.math.clemson.edu:34567. The 
key does not support the requested operation. (Error code: 
sec_error_invalid_key)

The page you are trying to view cannot be shown because the 
authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

This is apparently due to Firefox removing support for SSL other than that 
provided by libPKIX. There seem to be a few different possible issues with 
the key that is generated when Sage is built that might cause this, e.g., 
key not long enough (Firefox now requires keys to be 1024 bits or more).  
Has anyone else seen this?  Is there a workaround--recreate keys or rebuild 
Sage with some option?

TIA.

-- 
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] How to handle file in Sage

2014-10-27 Thread Santanu Sarkar
Thanks a lot. But I am getting these errors:

A1=load("./Documents/program21.txt")


Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_4.py", line 10, in 
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("QTE9bG9hZCgiLi9Eb2N1bWVudHMvcHJvZ3JhbTIxLnR4dCIp"),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in 

  File "/tmp/tmpYQU78_/___code___.py", line 2, in 
exec compile(u'A1=load("./Documents/program21.txt")
  File "", line 1, in 

  File "sage_object.pyx", line 862, in sage.structure.sage_object.load
(sage/structure/sage_object.c:9317)
IOError: [Errno 2] No such file or directory:
'./Documents/program21.txt.sobj'



--


exec preparse(open('/Documents/program21.txt').read())


Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_5.py", line 10, in 
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("ZXhlYyBwcmVwYXJzZShvcGVuKCcvRG9jdW1lbnRzL3Byb2dyYW0yMS50eHQnKS5yZWFkKCkp"),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in 

  File "/tmp/tmpqrNaPI/___code___.py", line 2, in 
exec compile(u"exec preparse(open('/Documents/program21.txt').read())"
+ '\n', '', 'single')
  File "", line 1, in 

IOError: [Errno 2] No such file or directory: '/Documents/program21.txt'


On 22 October 2014 05:56, William Stein  wrote:

> On Tue, Oct 21, 2014 at 5:19 PM, kcrisman  wrote:
> >> > differently)
> >>
> >> Thanks - I meant %runfile not %execfile.  I find it hard to remember,
> >> which is yet another reason I am against removal of the more memorable
> %load
> >> that we had for years.
> >>
> >> >
> >>
> >
> > Agreed, but this was semi-unavoidable because of the Ipython upgrade a
> while
> > back, though, right?
>
> It was definitely not unavoidable.
>
> -- 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.
>

-- 
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] gfan, reduced bases, and weight vectors

2014-10-27 Thread john_perry_usm
Hello!

Try this sequence of commands:

sage: R = PolynomialRing(GF(32003), 'x', 4)
> sage: I = sage.rings.ideal.Cyclic(R,4).homogenize()
> sage: GF = I.groebner_fan()
> sage: GBs = GF.reduced_groebner_bases()
> sage: [g.lm() for g in GBs[0]]
>  [x2^2*x3^6, x2^3*x3^2, x1*x3^4, x2^2*x3^4, x1*x2*x3^2, x1*x2^2, x1^2, 
> x0]


You would be forgiven for thinking that the leading monomials are listed 
there; they aren't. In fact, if you try reducing the S-polynomials of 
GBs[0], they won't reduce to 0. Moreover, if you try reducing the input 
polynomials over GBs[0], they won't always reduce to 0.

sage: F = I.gens()
> sage: for f in F: print f.reduce(GBs[10])
>  0
>  0
>  -x1*x2^2 - x2^2*x3 + x1*x3^2 + x3^3
>  -x1*x2^2*x3 + x1*x2*x3^2 + x2*x3^3 - h^4


The following indicates why:

sage: TOs = GF.weight_vectors()
> sage: TOs[0]
>  (9, 8, 3, 2, 1)

sage: GBs[0][0].parent().term_order() 

 Degree reverse lexicographic term order 

sage: {G[0].parent().term_order() for G in GBs}

 {Degree reverse lexicographic term order}


In short, the Gröbner fan knows the correct ordering (in terms of a weight 
vector) but Sage's output presents the basis with a different ordering. 
This caused me no small amount of confusion. Is this a feature, or a bug?

thanks
john perry

-- 
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.