[sage-support] Re: Is it possible to replace the list built-in type in Sage?

2009-08-03 Thread Pierre

 not supported in pure Python. However, it could add a lot of readability and
 programming easiness to Sage because a common task as a scientist is to
 manipulate and transform a lot of data and (I think) the most basic
 container to do that is a list.

IMHO, an expression like 1 + [2,3,4,5] is utterly confusing. Among all
the possible meanings it could have, [3,4,5,6] is the last that comes
to mind; if SAGE started to use such a syntax, you'd hear me and i
think many other users on this forum asking for a way to disable the
mechanism.

Just a thought : x + [a, b, c] and [a,b,c] + x should both be [x+a, x
+b, x+c] ?  but that's not even commutative, ergo impossible :
[1] + [12, 13] should be [ 1 + [12,13] ] = [ [13,14] ]
but it should also be [ [1] + 12, [1] + 13] = [[13], [14]]
and that ain't the same.

You could reply that the syntax should only apply to numbers, but
that would be re-inventing the idea of the vector class, and i
thought re-inventing the wheel was against sage's philosophy.

On the other hand, [ 1 + x for x in [2,3,4,5]] appeals to both
mathematicians and geeks.

yours,
Pierre





--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] request for help

2009-08-03 Thread noufal

i have tried the binary version of sage 4.1 in mandriva 2008 spring
version but it is not possible to install please help me

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] question

2009-08-03 Thread noufal

Is it possible to install sage 4.1 online
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: request for help

2009-08-03 Thread Minh Nguyen

Hi,

On Mon, Aug 3, 2009 at 10:01 PM, noufalnoufalasha...@gmail.com wrote:

 i have tried the binary version of sage 4.1 in mandriva 2008 spring
 version but it is not possible to install please help me

What's the error message you received? What's your CPU architecture?
Which binary did you use? Was it the 32-bit or the 64-bit for
Mandriva? We need more information in order to determine why you had
trouble installing the Mandriva binary of Sage.

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: question

2009-08-03 Thread Minh Nguyen

Hi,

On Mon, Aug 3, 2009 at 10:06 PM, noufalnoufalasha...@gmail.com wrote:

 Is it possible to install sage 4.1 online

I don't quite understand your question. Can you please elaborate
further on how you want to install Sage?

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: request for help

2009-08-03 Thread Dr. David Kirkby

noufal wrote:
 i have tried the binary version of sage 4.1 in mandriva 2008 spring
 version but it is not possible to install please help me
 
I'm unlikely personally to be able to help you, but I would suggest you 
give as much information as possible. Like your computer, CPU, memory, 
exact operating system.

And of course, people need to know what the installation problems is. 
Without further information, I doubt anyone can help you.

Dave

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: accessing sage notebook with android phone

2009-08-03 Thread Pierre

I was thinking about buying an android phone, and getting SAGE to work
was one of the questions, so can I take this opportunity to pick your
brains ?

first, how fast is SAGE on sagenb.org if you're not close to a wiki
spot and use a telephone connection of some kind ? (i know in france
they call it 3G or whatever, don't know if that's universal)

also, now that android supports python, is it possible to install
numpy, or parts of SAGE, directly? anyone has tried that ?

thanks!
pierre

On Aug 3, 3:25 am, Dan Christensen j...@uwo.ca wrote:
 Dan Christensen j...@uwo.ca writes:
  When I try to log in to sagenb.org or a sage notebook on a personal
  machine using the browser on my android phone, after entering username
  and password I end up at an empty page whose title is Error | Sage
  Notebook and whose URL ishttp://sagenb.org/login

  I can view published worksheets without logging in, but can't get past
  the login screen.  And I've checked that using the same user/password
  works from firefox on my desktop machine.

  I've got cookies and javascript enabled in the android browser.

  Any ideas what could be going on?

 On a whim, I decided to try this again today by going tohttp://sagenb.orgon 
 my Android browser, and I found myself logged into
 my testingxyz account, viewing my test worksheets, without entering a
 username or password!  I logged out, then tried logging in as
 jdchristensen, and got an error page (see below) but simply hitting
 refresh on that error page gets me correctly logged into my
 jdchristensen account.  To see if this was repeatable, I tried to log
 out, but the Log Out link leaves me logged in, viewing my worksheets.  
 After clearing my cookies, I was able to log out.

 I entered my jdchristensen username and password, got the error page,
 refreshed it, and was logged in correctly.  And again I have to clear my
 cookies to log out.

 So in practice I can now use sage from my phone.  There are also a few
 minor UI glitches (e.g. TAB-completion and Shift-Enter don't work), but
 nothing that prevents usage.

 I don't think this is a very important platform to support, but it is
 cool being able to show off sage while waiting for a bus with someone,
 or being able to do a quick calculation while in a talk.

 Dan

 The error page I get now says:

   Method Not Allowed  

   The requested method POST is not supported by /home/jdchristensen/.

 and the title is

   sagenb.org: 405 Method Not Allowed
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: accessing sage notebook with android phone

2009-08-03 Thread Simon King

Hi Pierre,

On Aug 3, 2:17 pm, Pierre pierre.guil...@gmail.com wrote:
 also, now that android supports python, is it possible to install
 numpy, or parts of SAGE, directly? anyone has tried that ?

I think this post is related:
http://groups.google.com/group/sage-devel/browse_thread/thread/243dfd4ab25a2779

Cheers,
  Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Is it possible to replace the list built-in type in Sage?

2009-08-03 Thread Jason Grout

William Stein wrote:
 On Sun, Aug 2, 2009 at 9:13 AM, Robert Dodierrobert.dod...@gmail.com wrote:
 Robert Bradshaw wrote:

 Sage lists are Python lists, which are very different than
 Mathematica lists.
 You say that as if it's a fact of geography which can't be changed.

 to change all lists would be a massive (backwards-
 incompatible) change, as well as another step away from Python.
 Not exactly. At present something like 1 + [2, 3, 4, 5] causes Python
 to cough up an error, right? So extending arithmetic operators to
 lists wouldn't change the behavior of any existing Python program.
 (I'm not worried that someone might have written a program which
 requires an error to be triggered when number + list is encountered.)
 
 Unfortunately for your suggestion, arithmetic operators are methods of
 the objects.  To make 1 + [2,3,4,5] and [2,3,4,5] + 1 not raise an
 exception would require changing the Python interpreter itself, at the
 C level.


Maybe for python ints, but surely we can make Sage Integers work without 
raising exceptions, as illustrated on the top portion of 
http://sagenb.org/home/pub/699/ ?  (Of course, keeping in mind that the 
1 in the examples above is likely to be a Sage Integer, not a python 
int, so we could add (if desired) functions to add/radd the Integer to a 
list.)

Personally, I much prefer list comprehension for a case like this.  In 
fact, I just finished writing an entire reply and example on the 
assumption that [1,2,3]+4 would yield [1,2,3,4], as that was what I 
expected from the current python behavior of [1,2,3]+[4] (i.e., list 
addition is list concatenation!)  Then I realized the proposal was 
something different, so I had to change everything.

Also, someone could define a +eadd+ operator that would be like the +. 
operator in Matlab.  With the code from 
http://trac.sagemath.org/sage_trac/ticket/6245 (appropriately modified 
for + precedence), you could do something like the bottom half of 
http://sagenb.org/home/pub/699/, which gives:

sage: [1,2,3] +eadd+ 4
[5, 6, 7]
sage: 1 +eadd+ [2,3,4]
[3, 4, 5]

Thanks,

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: accessing sage notebook with android phone

2009-08-03 Thread Dan Christensen

Pierre pierre.guil...@gmail.com writes:

 I was thinking about buying an android phone, and getting SAGE to work
 was one of the questions, [...]

 also, now that android supports python, is it possible to install
 numpy, or parts of SAGE, directly? anyone has tried that ?

Pierre,

As Simon pointed out, you can run sage directly on the phone, but I
don't think that's a practical way to proceed.  Using the notebook is
more reasonable, but I did find it quite slow and fairly awkward.

In general, while many people say that web apps are the future, things
tend to work much better on a phone with a custom app to provide the
interface in a way that takes advantage of the touch screen while
limiting the effect of the small keyboard by providing smart
completions/corrections/pop-ups, etc.

So I wouldn't buy a phone with sage being the goal, but being able to
use sage when necessary is a nice side benefit.

Dan


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: accessing sage notebook with android phone

2009-08-03 Thread Pierre

hi simon and dan,

thanks for your answers. The thing is though, i don't intend to run
sage, the full sage, on a phone (!!), but i was hoping that these
state-of-the-art telephones that people seem to love could perhaps be
used as conveniently as the hand-calculators we had 15 years ago. Say,
you want to plot x -- x^2*sin(1/x) on your android phone, what do you
do ? when i was a teenager i could do this in a couple of seconds on
an HP 48 something (nostalgic sob).

i was thinking that numpy + matplotlib could be used, and perhaps some
of the lightest features of sage too, say the ones written in pure
python (as oppposed to relying on singular or maxima etc) Well, i
guess just having python is already quite cool for quick
computations...

pierre

On 3 août, 16:50, Dan Christensen j...@uwo.ca wrote:
 Pierre pierre.guil...@gmail.com writes:
  I was thinking about buying an android phone, and getting SAGE to work
  was one of the questions, [...]

  also, now that android supports python, is it possible to install
  numpy, or parts of SAGE, directly? anyone has tried that ?

 Pierre,

 As Simon pointed out, you can run sage directly on the phone, but I
 don't think that's a practical way to proceed.  Using the notebook is
 more reasonable, but I did find it quite slow and fairly awkward.

 In general, while many people say that web apps are the future, things
 tend to work much better on a phone with a custom app to provide the
 interface in a way that takes advantage of the touch screen while
 limiting the effect of the small keyboard by providing smart
 completions/corrections/pop-ups, etc.

 So I wouldn't buy a phone with sage being the goal, but being able to
 use sage when necessary is a nice side benefit.

 Dan
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] error loading the sage libraries (setting up public Sage server) notebook directory outside of .sage don't work

2009-08-03 Thread Serge A. Salamanka

Dear support,

I'm having a bit of a problem with setting up Sage public server with
several pool accounts.

Everything is done according to recommendations on
http://wiki.sagemath.org/DanDrake/JustEnoughSageServer
except that I have to set up 750 permission for the group of sageusers
on /home/sageadm (chmod 750 /home/sageadm )
Otherwise the notebook cells show error Permission denied

So I have created dir /home/sageadm/sagenbfiles for notebook server and
setup 2775 permission.

The server is run by the user sageadm with pool accounts of several
others with no password by ssh.

I can sign up on the server and the interface but I can't execute simple
code 2-1 or anything other in the notebook cell.
It says:
 Traceback (most recent call last): 2-1
NameError: name 'os' is not defined
There was an error loading the sage libraries. Try starting from the
command line to see what the error is.

well, you can check out yourself at
https://sagenb.sageworldmath.org:8000/

The point is when I run server with default dir in .sage and no pool
accounts, it works good.
But when I point to the dir outside of the /home/sageadm/.sage it shows
error.

Any ideas ?

I use Sage-4.1 (latest download) and Scientific Linux 5.3

# Serge

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: error loading the sage libraries (setting up public Sage server) notebook directory outside of .sage don't work

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 9:26 AM, Serge A. Salamankasalsa-...@tut.by wrote:

 Dear support,

 I'm having a bit of a problem with setting up Sage public server with
 several pool accounts.

 Everything is done according to recommendations on
 http://wiki.sagemath.org/DanDrake/JustEnoughSageServer
 except that I have to set up 750 permission for the group of sageusers
 on /home/sageadm (chmod 750 /home/sageadm )
 Otherwise the notebook cells show error Permission denied

 So I have created dir /home/sageadm/sagenbfiles for notebook server and
 setup 2775 permission.

 The server is run by the user sageadm with pool accounts of several
 others with no password by ssh.

 I can sign up on the server and the interface but I can't execute simple
 code 2-1 or anything other in the notebook cell.
 It says:
  Traceback (most recent call last): 2-1
 NameError: name 'os' is not defined
 There was an error loading the sage libraries. Try starting from the
 command line to see what the error is.

Can you manually ssh to the pool accounts and type sage to run Sage?
 The pool accounts *must* be able to run Sage by just typing sage.

William


 well, you can check out yourself at
 https://sagenb.sageworldmath.org:8000/

 The point is when I run server with default dir in .sage and no pool
 accounts, it works good.
 But when I point to the dir outside of the /home/sageadm/.sage it shows
 error.

 Any ideas ?

 I use Sage-4.1 (latest download) and Scientific Linux 5.3

 # Serge

 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Solving multivariate polynomial systems over GF(2)

2009-08-03 Thread Martin Albrecht

On Saturday 01 August 2009, Simon King wrote:
 Hi Martin,

 On Aug 1, 4:09 pm, Martin Albrecht m...@informatik.uni-bremen.de

 wrote:
  sage: R.a111,a112,a121,a122,b111,b112,b211,b212,c111,c112 =
  BooleanPolynomialRing(order='lex')
  sage: I=(a111 * b111 * c111 + a112 * b112 * c112 - 1 , a111 * b211 * c111
  + : a112 * b212 * c112 - 0 , a121 * b111 * c111 + a122 * b112 * c112
  , : a121 * b211 * c111 + a122 * b212 * c112 - 1)*R
 
  sage: I.groebner_basis()
  [a111 + b212, a112 + b211, a121 + b112, a122 + b111, c111 + 1, c112 + 1]

 Why do I get a different result? Bug in PolyBoRi, a changed
 interpretation of the meaning of lex (I use sage 4.1, and you?), or
 a misprint on my side (but so far I can't see any)?

I am using PolyBoRi 0.6.3 and this indeed seems to be a bug either in PolyBoRi 
0.6.3 or in our Sage wrapper (most likely). I've CCed the PolyBoRi list.

Thanks for pointing this out!

Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.de



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Solving multivariate polynomial systems over GF(2)

2009-08-03 Thread Martin Albrecht

 The problem in my case is really one of scale. I have put a larger
 example at the bottom of this message.  When I try to find the
 groebner basis in sage 4.1 (which seems to use polybori-0.5rc.p8) the
 memory usage goes over 1.6GB and then sage crashes.  It is possible
 that it just isn't realistic to solve it using Groebner Bases.
 However, I should say that when reformulated as a SAT solving problem,
 the standard off the shelf minisat 2.0 code can solve it in 0.04
 seconds.  This is despite the fact that minisat only takes CNF as the
 input which means that all the structure of the problem has been
 removed before it sees it.

Hi Raphael,

note that Gröbner basis methods will always return a complete algebraic 
description of the solution set while SAT solving approaches terminate once 
*one* solution is found. Thus if there are many solutions they have an 
advantage. You can try to guess some variables in order to improve the 
efficiency of the Gröbner basis based methods.

Cheers,
Martin


-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.de



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Solving multivariate polynomial systems over GF(2)

2009-08-03 Thread lesshaste

Hi,

On Aug 3, 7:39 pm, Martin Albrecht m...@informatik.uni-bremen.de
wrote:
  The problem in my case is really one of scale. I have put a larger
  example at the bottom of this message.  When I try to find the
  groebner basis in sage 4.1 (which seems to use polybori-0.5rc.p8) the
  memory usage goes over 1.6GB and then sage crashes.  It is possible
  that it just isn't realistic to solve it using Groebner Bases.
  However, I should say that when reformulated as a SAT solving problem,
  the standard off the shelf minisat 2.0 code can solve it in 0.04
  seconds.  This is despite the fact that minisat only takes CNF as the
  input which means that all the structure of the problem has been
  removed before it sees it.

 Hi Raphael,

 note that Gröbner basis methods will always return a complete algebraic
 description of the solution set while SAT solving approaches terminate once
 *one* solution is found. Thus if there are many solutions they have an
 advantage. You can try to guess some variables in order to improve the
 efficiency of the Gröbner basis based methods.

You are quite right of course. My example wasn't fair as in this case
there are in fact a really large number of solutions.

However ( :) ) attached below is another slightly smaller example
where there is in fact no solution, making it a fairer comparison I
hope.  It takes minisat 2 mins 22 seconds on my computer to work that
out.  Using polybori in sage as above takes 700-800MB of RAM and
doesn't terminate in the hour or so I gave it.  I only mention this in
case anyone working on polybori is interested in specific examples.

Raphael

 attached system of polys with no solution ---
R.a111,a112,a113,a114,a115,a116,a121,a122,a123,a124,a125,a126,a211,a212,a213,a214,a215,a216,a221,a222,a223,a224,a225,a226,b111,b112,b113,b114,b115,b116,b121,b122,b123,b124,b125,b126,b211,b212,b213,b214,b215,b216,b221,b222,b223,b224,b225,b226,c111,c112,c113,c114,c115,c116,c121,c122,c123,c124,c125,c126,c211,c212,c213,c214,c215,c216,c221,c222,c223,c224,c225,c226
 = BooleanPolynomialRing(order='lex')

I = ( a111 * b111 * c111 + a112 * b112 * c112 + a113 * b113 * c113 +
a114 * b114 * c114 + a115 * b115 * c115 + a116 * b116 * c116 -1, a111
* b111 * c121 + a112 * b112 * c122 + a113 * b113 * c123 + a114 * b114
* c124 + a115 * b115 * c125 + a116 * b116 * c126 , a111 * b111 * c211
+ a112 * b112 * c212 + a113 * b113 * c213 + a114 * b114 * c214 + a115
* b115 * c215 + a116 * b116 * c216 , a111 * b111 * c221 + a112 * b112
* c222 + a113 * b113 * c223 + a114 * b114 * c224 + a115 * b115 * c225
+ a116 * b116 * c226 , a111 * b121 * c111 + a112 * b122 * c112 + a113
* b123 * c113 + a114 * b124 * c114 + a115 * b125 * c115 + a116 * b126
* c116 , a111 * b121 * c121 + a112 * b122 * c122 + a113 * b123 * c123
+ a114 * b124 * c124 + a115 * b125 * c125 + a116 * b126 * c126 , a111
* b121 * c211 + a112 * b122 * c212 + a113 * b123 * c213 + a114 * b124
* c214 + a115 * b125 * c215 + a116 * b126 * c216 -1, a111 * b121 *
c221 + a112 * b122 * c222 + a113 * b123 * c223 + a114 * b124 * c224 +
a115 * b125 * c225 + a116 * b126 * c226 , a111 * b211 * c111 + a112 *
b212 * c112 + a113 * b213 * c113 + a114 * b214 * c114 + a115 * b215 *
c115 + a116 * b216 * c116 , a111 * b211 * c121 + a112 * b212 * c122 +
a113 * b213 * c123 + a114 * b214 * c124 + a115 * b215 * c125 + a116 *
b216 * c126 , a111 * b211 * c211 + a112 * b212 * c212 + a113 * b213 *
c213 + a114 * b214 * c214 + a115 * b215 * c215 + a116 * b216 * c216 ,
a111 * b211 * c221 + a112 * b212 * c222 + a113 * b213 * c223 + a114 *
b214 * c224 + a115 * b215 * c225 + a116 * b216 * c226 , a111 * b221 *
c111 + a112 * b222 * c112 + a113 * b223 * c113 + a114 * b224 * c114 +
a115 * b225 * c115 + a116 * b226 * c116 , a111 * b221 * c121 + a112 *
b222 * c122 + a113 * b223 * c123 + a114 * b224 * c124 + a115 * b225 *
c125 + a116 * b226 * c126 , a111 * b221 * c211 + a112 * b222 * c212 +
a113 * b223 * c213 + a114 * b224 * c214 + a115 * b225 * c215 + a116 *
b226 * c216 , a111 * b221 * c221 + a112 * b222 * c222 + a113 * b223 *
c223 + a114 * b224 * c224 + a115 * b225 * c225 + a116 * b226 * c226 ,
a121 * b111 * c111 + a122 * b112 * c112 + a123 * b113 * c113 + a124 *
b114 * c114 + a125 * b115 * c115 + a126 * b116 * c116 , a121 * b111 *
c121 + a122 * b112 * c122 + a123 * b113 * c123 + a124 * b114 * c124 +
a125 * b115 * c125 + a126 * b116 * c126 , a121 * b111 * c211 + a122 *
b112 * c212 + a123 * b113 * c213 + a124 * b114 * c214 + a125 * b115 *
c215 + a126 * b116 * c216 , a121 * b111 * c221 + a122 * b112 * c222 +
a123 * b113 * c223 + a124 * b114 * c224 + a125 * b115 * c225 + a126 *
b116 * c226 , a121 * b121 * c111 + a122 * b122 * c112 + a123 * b123 *
c113 + a124 * b124 * c114 + a125 * b125 * c115 + a126 * b126 * c116 ,
a121 * b121 * c121 + a122 * b122 * c122 + a123 * b123 * c123 + a124 *
b124 * c124 + a125 * b125 * c125 + a126 * b126 * c126 , a121 * b121 *
c211 + a122 * b122 * c212 + a123 * b123 * c213 + a124 * b124 * c214 +
a125 * b125 * c215 + a126 * b126 * c216 , a121 * 

[sage-support] Re: Solving multivariate polynomial systems over GF(2)

2009-08-03 Thread Michael Brickenstein

Hi!
I can't sleep, when fearing PolyBoRi could calculate wrong:
Actually, it's probably just about the wrapper.
My CVS, which is very much the same as 0.6.3 gives me:

l=a111,a112,a121,a122,b111,b112,b211,b212,c111,c112.split(,)

In [2]:declare_ring(l, globals())
Out[2]:polybori.dynamic.PyPolyBoRi.Ring object at 0xb02578

In [3]:ideal=[a111 * b111 * c111 + a112 * b112 * c112 + 1 , a111 *
b211 * c111 +
   ...: a112 * b212 * c112 + 0 , a121 * b111 * c111 + a122 * b112 *
c112 ,...: a121 * b211 * c111 + a122 * b212 * c112 + 1]
In [4]:grogroebner/CVS groebner/libgroebner.a   groebner/
src
groebner/doc groebner/libgroebner.so  groebner_basis

In [4]:groebner_basis(ideal)
Out[4]:
[b211*b212 + b211 + b212 + 1,
 b112*b212 + b112 + b212 + 1,
 b111*b212 + b112*b211 + 1,
 b111*b211 + b111 + b211 + 1,
 b111*b112 + b111 + b112 + 1,
 a122 + b111,
 a121 + b112,
 a112 + b211,
 a111 + b212,
 c111 + 1,
 c112 + 1]

Tomorrow, I'll have a look at the bigger system, if there are some
tweaks.
Can you send it as proper attachment it to me? What kind of
application is it?
Michael

On 3 Aug., 21:54, lesshaste drr...@gmail.com wrote:
 Hi,

 On Aug 3, 7:39 pm, Martin Albrecht m...@informatik.uni-bremen.de
 wrote:



   The problem in my case is really one of scale. I have put a larger
   example at the bottom of this message.  When I try to find the
   groebner basis in sage 4.1 (which seems to use polybori-0.5rc.p8) the
   memory usage goes over 1.6GB and then sage crashes.  It is possible
   that it just isn't realistic to solve it using Groebner Bases.
   However, I should say that when reformulated as a SAT solving problem,
   the standard off the shelf minisat 2.0 code can solve it in 0.04
   seconds.  This is despite the fact that minisat only takes CNF as the
   input which means that all the structure of the problem has been
   removed before it sees it.

  Hi Raphael,

  note that Gröbner basis methods will always return a complete algebraic
  description of the solution set while SAT solving approaches terminate once
  *one* solution is found. Thus if there are many solutions they have an
  advantage. You can try to guess some variables in order to improve the
  efficiency of the Gröbner basis based methods.

 You are quite right of course. My example wasn't fair as in this case
 there are in fact a really large number of solutions.

 However ( :) ) attached below is another slightly smaller example
 where there is in fact no solution, making it a fairer comparison I
 hope.  It takes minisat 2 mins 22 seconds on my computer to work that
 out.  Using polybori in sage as above takes 700-800MB of RAM and
 doesn't terminate in the hour or so I gave it.  I only mention this in
 case anyone working on polybori is interested in specific examples.

 Raphael

  attached system of polys with no solution ---
 R.a111,a112,a113,a114,a115,a116,a121,a122,a123,a124,a125,a126,a211,a212,a2 
 13,a214,a215,a216,a221,a222,a223,a224,a225,a226,b111,b112,b113,b114,b115,b1 
 16,b121,b122,b123,b124,b125,b126,b211,b212,b213,b214,b215,b216,b221,b222,b2 
 23,b224,b225,b226,c111,c112,c113,c114,c115,c116,c121,c122,c123,c124,c125,c1 
 26,c211,c212,c213,c214,c215,c216,c221,c222,c223,c224,c225,c226

  = BooleanPolynomialRing(order='lex')

 I = ( a111 * b111 * c111 + a112 * b112 * c112 + a113 * b113 * c113 +
 a114 * b114 * c114 + a115 * b115 * c115 + a116 * b116 * c116 -1, a111
 * b111 * c121 + a112 * b112 * c122 + a113 * b113 * c123 + a114 * b114
 * c124 + a115 * b115 * c125 + a116 * b116 * c126 , a111 * b111 * c211
 + a112 * b112 * c212 + a113 * b113 * c213 + a114 * b114 * c214 + a115
 * b115 * c215 + a116 * b116 * c216 , a111 * b111 * c221 + a112 * b112
 * c222 + a113 * b113 * c223 + a114 * b114 * c224 + a115 * b115 * c225
 + a116 * b116 * c226 , a111 * b121 * c111 + a112 * b122 * c112 + a113
 * b123 * c113 + a114 * b124 * c114 + a115 * b125 * c115 + a116 * b126
 * c116 , a111 * b121 * c121 + a112 * b122 * c122 + a113 * b123 * c123
 + a114 * b124 * c124 + a115 * b125 * c125 + a116 * b126 * c126 , a111
 * b121 * c211 + a112 * b122 * c212 + a113 * b123 * c213 + a114 * b124
 * c214 + a115 * b125 * c215 + a116 * b126 * c216 -1, a111 * b121 *
 c221 + a112 * b122 * c222 + a113 * b123 * c223 + a114 * b124 * c224 +
 a115 * b125 * c225 + a116 * b126 * c226 , a111 * b211 * c111 + a112 *
 b212 * c112 + a113 * b213 * c113 + a114 * b214 * c114 + a115 * b215 *
 c115 + a116 * b216 * c116 , a111 * b211 * c121 + a112 * b212 * c122 +
 a113 * b213 * c123 + a114 * b214 * c124 + a115 * b215 * c125 + a116 *
 b216 * c126 , a111 * b211 * c211 + a112 * b212 * c212 + a113 * b213 *
 c213 + a114 * b214 * c214 + a115 * b215 * c215 + a116 * b216 * c216 ,
 a111 * b211 * c221 + a112 * b212 * c222 + a113 * b213 * c223 + a114 *
 b214 * c224 + a115 * b215 * c225 + a116 * b216 * c226 , a111 * b221 *
 c111 + a112 * b222 * c112 + a113 * b223 * c113 + a114 * b224 * c114 +
 a115 * b225 * c115 + a116 * b226 * c116 , a111 * b221 * c121 + a112 *
 b222 * c122 + a113 

[sage-support] Re: accessing sage notebook with android phone

2009-08-03 Thread Rado

Just for the record ipod touch (which problably means iphone too) runs
sagenb.org without any problems. I must say really don't support
apple's policies and was planning on switching to android-based
solutions so hopefully those log-in glitches get fixed. Iphone has the
same problem that its onscreen keyboard has no tab key (so maybe
adding it explicitly just like evaluate might be a good idea).

Rado

On Aug 3, 10:20 am, Pierre pierre.guil...@gmail.com wrote:
 hi simon and dan,

 thanks for your answers. The thing is though, i don't intend to run
 sage, the full sage, on a phone (!!), but i was hoping that these
 state-of-the-art telephones that people seem to love could perhaps be
 used as conveniently as the hand-calculators we had 15 years ago. Say,
 you want to plot x -- x^2*sin(1/x) on your android phone, what do you
 do ? when i was a teenager i could do this in a couple of seconds on
 an HP 48 something (nostalgic sob).

 i was thinking that numpy + matplotlib could be used, and perhaps some
 of the lightest features of sage too, say the ones written in pure
 python (as oppposed to relying on singular or maxima etc) Well, i
 guess just having python is already quite cool for quick
 computations...

 pierre

 On 3 août, 16:50, Dan Christensen j...@uwo.ca wrote:

  Pierre pierre.guil...@gmail.com writes:
   I was thinking about buying an android phone, and getting SAGE to work
   was one of the questions, [...]

   also, now that android supports python, is it possible to install
   numpy, or parts of SAGE, directly? anyone has tried that ?

  Pierre,

  As Simon pointed out, you can run sage directly on the phone, but I
  don't think that's a practical way to proceed.  Using the notebook is
  more reasonable, but I did find it quite slow and fairly awkward.

  In general, while many people say that web apps are the future, things
  tend to work much better on a phone with a custom app to provide the
  interface in a way that takes advantage of the touch screen while
  limiting the effect of the small keyboard by providing smart
  completions/corrections/pop-ups, etc.

  So I wouldn't buy a phone with sage being the goal, but being able to
  use sage when necessary is a nice side benefit.

  Dan
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Strange behavior in timeit

2009-08-03 Thread VictorMiller

I was trying to find out how fast a calculation was (applying an
isogeny of degree on an elliptic curve over
a finite field).  At first I noticed that when I repeated a timeit
call with the same expression I was getting monotonically increasing
numbers, so I decided to try something more systematic. I got the
following peculiar results on sagenb.org (just now).  The average
times keep getting longer and longer.  Could this be some bug in the
way that the calls to internal timer routines are used?

 phi = E.isogeny([E(0),P,-P])
for i in xrange(20): timeit('phi(Q)')

625 loops, best of 3: 1.17 ms per loop
625 loops, best of 3: 1.75 ms per loop
125 loops, best of 3: 2.1 ms per loop
125 loops, best of 3: 2.22 ms per loop
125 loops, best of 3: 2.3 ms per loop
125 loops, best of 3: 2.4 ms per loop
125 loops, best of 3: 2.52 ms per loop
125 loops, best of 3: 2.73 ms per loop
125 loops, best of 3: 3.02 ms per loop
125 loops, best of 3: 3.32 ms per loop
125 loops, best of 3: 3.48 ms per loop
125 loops, best of 3: 3.73 ms per loop
125 loops, best of 3: 3.79 ms per loop
125 loops, best of 3: 4.21 ms per loop
125 loops, best of 3: 4.56 ms per loop
125 loops, best of 3: 5.09 ms per loop
125 loops, best of 3: 5.63 ms per loop
125 loops, best of 3: 6.23 ms per loop
125 loops, best of 3: 6.86 ms per loop
125 loops, best of 3: 7.52 ms per loop

Victor

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread VictorMiller

As far as I know Maxima isn't involved -- I don't think that isogenies
uses Maxima.

Victor

On Aug 3, 6:58 pm, Simon King simon.k...@nuigalway.ie wrote:
 On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
 ...





   phi = E.isogeny([E(0),P,-P])
  for i in xrange(20): timeit('phi(Q)')

  625 loops, best of 3: 1.17 ms per loop
  625 loops, best of 3: 1.75 ms per loop
  125 loops, best of 3: 2.1 ms per loop
  125 loops, best of 3: 2.22 ms per loop
  125 loops, best of 3: 2.3 ms per loop
  125 loops, best of 3: 2.4 ms per loop
  125 loops, best of 3: 2.52 ms per loop
  125 loops, best of 3: 2.73 ms per loop
  125 loops, best of 3: 3.02 ms per loop
  125 loops, best of 3: 3.32 ms per loop
  125 loops, best of 3: 3.48 ms per loop
  125 loops, best of 3: 3.73 ms per loop
  125 loops, best of 3: 3.79 ms per loop
  125 loops, best of 3: 4.21 ms per loop
  125 loops, best of 3: 4.56 ms per loop
  125 loops, best of 3: 5.09 ms per loop
  125 loops, best of 3: 5.63 ms per loop
  125 loops, best of 3: 6.23 ms per loop
  125 loops, best of 3: 6.86 ms per loop
  125 loops, best of 3: 7.52 ms per loop

 This reminds me the 
 threadshttp://groups.google.com/group/sage-devel/browse_thread/thread/863e59...
 orhttp://groups.google.com/group/sage-support/browse_thread/thread/abb4...

 In other words:
 Is Maxima involved in this computation?
 If yes, then it might be related with 
 tickethttp://trac.sagemath.org/sage_trac/ticket/4731
 Is someone working on this ticket?

 Cheers,
    Simon
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Minh Nguyen

Hi Victor,

On Tue, Aug 4, 2009 at 8:29 AM, VictorMillervictorsmil...@gmail.com wrote:

 I was trying to find out how fast a calculation was (applying an
 isogeny of degree on an elliptic curve over
 a finite field).  At first I noticed that when I repeated a timeit
 call with the same expression I was getting monotonically increasing
 numbers, so I decided to try something more systematic. I got the
 following peculiar results on sagenb.org (just now).  The average
 times keep getting longer and longer.  Could this be some bug in the
 way that the calls to internal timer routines are used?

  phi = E.isogeny([E(0),P,-P])

Just out of curiosity: How did you define E? I assume it's an elliptic
curve. But what were the commands you used to define it?

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Simon King



On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
...
  phi = E.isogeny([E(0),P,-P])
 for i in xrange(20): timeit('phi(Q)')

 625 loops, best of 3: 1.17 ms per loop
 625 loops, best of 3: 1.75 ms per loop
 125 loops, best of 3: 2.1 ms per loop
 125 loops, best of 3: 2.22 ms per loop
 125 loops, best of 3: 2.3 ms per loop
 125 loops, best of 3: 2.4 ms per loop
 125 loops, best of 3: 2.52 ms per loop
 125 loops, best of 3: 2.73 ms per loop
 125 loops, best of 3: 3.02 ms per loop
 125 loops, best of 3: 3.32 ms per loop
 125 loops, best of 3: 3.48 ms per loop
 125 loops, best of 3: 3.73 ms per loop
 125 loops, best of 3: 3.79 ms per loop
 125 loops, best of 3: 4.21 ms per loop
 125 loops, best of 3: 4.56 ms per loop
 125 loops, best of 3: 5.09 ms per loop
 125 loops, best of 3: 5.63 ms per loop
 125 loops, best of 3: 6.23 ms per loop
 125 loops, best of 3: 6.86 ms per loop
 125 loops, best of 3: 7.52 ms per loop

This reminds me the threads
http://groups.google.com/group/sage-devel/browse_thread/thread/863e59ba164590c5/e29c67ce1230f27d
or 
http://groups.google.com/group/sage-support/browse_thread/thread/abb492807b52973f/8737fbb78f1ed4e5

In other words:
Is Maxima involved in this computation?
If yes, then it might be related with ticket 
http://trac.sagemath.org/sage_trac/ticket/4731
Is someone working on this ticket?

Cheers,
   Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 4:37 PM, VictorMillervictorsmil...@gmail.com wrote:

 As far as I know Maxima isn't involved -- I don't think that isogenies
 uses Maxima.

You can prove Maxima isn't involved by doing the computation then
exiting sage and seeing if it says Exiting Maxima when Sage is
quiting.

William


 Victor

 On Aug 3, 6:58 pm, Simon King simon.k...@nuigalway.ie wrote:
 On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
 ...





   phi = E.isogeny([E(0),P,-P])
  for i in xrange(20): timeit('phi(Q)')

  625 loops, best of 3: 1.17 ms per loop
  625 loops, best of 3: 1.75 ms per loop
  125 loops, best of 3: 2.1 ms per loop
  125 loops, best of 3: 2.22 ms per loop
  125 loops, best of 3: 2.3 ms per loop
  125 loops, best of 3: 2.4 ms per loop
  125 loops, best of 3: 2.52 ms per loop
  125 loops, best of 3: 2.73 ms per loop
  125 loops, best of 3: 3.02 ms per loop
  125 loops, best of 3: 3.32 ms per loop
  125 loops, best of 3: 3.48 ms per loop
  125 loops, best of 3: 3.73 ms per loop
  125 loops, best of 3: 3.79 ms per loop
  125 loops, best of 3: 4.21 ms per loop
  125 loops, best of 3: 4.56 ms per loop
  125 loops, best of 3: 5.09 ms per loop
  125 loops, best of 3: 5.63 ms per loop
  125 loops, best of 3: 6.23 ms per loop
  125 loops, best of 3: 6.86 ms per loop
  125 loops, best of 3: 7.52 ms per loop

 This reminds me the 
 threadshttp://groups.google.com/group/sage-devel/browse_thread/thread/863e59...
 orhttp://groups.google.com/group/sage-support/browse_thread/thread/abb4...

 In other words:
 Is Maxima involved in this computation?
 If yes, then it might be related with 
 tickethttp://trac.sagemath.org/sage_trac/ticket/4731
 Is someone working on this ticket?

 Cheers,
    Simon
 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread VictorMiller

Here are the commands I used:

qq = [z for z in primes(10,10+100) if (z%12) == 11]
E = EllipticCurve(j=GF(qq[0])(1728))
# E has qq[0]+1 points over GF(qq[0])
factor(qq[0]+1)
P = ((qq[0]+1)//3)*E.random_element()
K = [E(0),P,-P]
phi = E.isogeny(K)
for i in xrange(20): timeit('phi(Q)')


On Aug 3, 7:41 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Victor,

 On Tue, Aug 4, 2009 at 8:29 AM, VictorMillervictorsmil...@gmail.com wrote:

  I was trying to find out how fast a calculation was (applying an
  isogeny of degree on an elliptic curve over
  a finite field).  At first I noticed that when I repeated a timeit
  call with the same expression I was getting monotonically increasing
  numbers, so I decided to try something more systematic. I got the
  following peculiar results on sagenb.org (just now).  The average
  times keep getting longer and longer.  Could this be some bug in the
  way that the calls to internal timer routines are used?

   phi = E.isogeny([E(0),P,-P])

 Just out of curiosity: How did you define E? I assume it's an elliptic
 curve. But what were the commands you used to define it?

 --
 Regards
 Minh Van Nguyen
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Simon King

Hi!

On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:
 Here are the commands I used:

 qq = [z for z in primes(10,10+100) if (z%12) == 11]
 E = EllipticCurve(j=GF(qq[0])(1728))
 # E has qq[0]+1 points over GF(qq[0])
 factor(qq[0]+1)
 P = ((qq[0]+1)//3)*E.random_element()
 K = [E(0),P,-P]
 phi = E.isogeny(K)

No Maxima up  to here (tested by quitting Sage)...

 for i in xrange(20): timeit('phi(Q)')

But also no Q. How is Q defined?

Regards,
Simon
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread VictorMiller

Sorry, here's the definition of Q:

Q = E.random_element()

Victor

On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 No Maxima up  to here (tested by quitting Sage)...

  for i in xrange(20): timeit('phi(Q)')

 But also no Q. How is Q defined?

 Regards,
 Simon
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Simon King

Hi Victor,

On 4 Aug., 03:10, VictorMiller victorsmil...@gmail.com wrote:
 Sorry, here's the definition of Q:

 Q = E.random_element()

Thanks! So, probably it is unrelated with the ticket I mentioned.

Also note that the computation time does not increase monotonely:
sage: for i in xrange(20): timeit('phi(Q)')
:
625 loops, best of 3: 612 µs per loop
625 loops, best of 3: 1.12 ms per loop
625 loops, best of 3: 1.78 ms per loop
125 loops, best of 3: 2.8 ms per loop
125 loops, best of 3: 2.13 ms per loop
125 loops, best of 3: 2.19 ms per loop
125 loops, best of 3: 2.3 ms per loop
25 loops, best of 3: 9.26 ms per loop
25 loops, best of 3: 8.69 ms per loop
25 loops, best of 3: 8.8 ms per loop
25 loops, best of 3: 10.2 ms per loop
25 loops, best of 3: 2.55 ms per loop
125 loops, best of 3: 2.75 ms per loop
25 loops, best of 3: 9.93 ms per loop
25 loops, best of 3: 2.92 ms per loop
125 loops, best of 3: 5.31 ms per loop
125 loops, best of 3: 4.19 ms per loop
125 loops, best of 3: 8.45 ms per loop
25 loops, best of 3: 8.83 ms per loop
25 loops, best of 3: 5.13 ms per loop

This might be explainable with randomized algorithms, which wouldn't
be a bug, even though the discrepancy between 10ms and 0.6ms is
impressive, and even though timeit should not be much affected by
random noise, since it does many loops.

Cheers,
   Simon
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Unrecognized linestyle

2009-08-03 Thread Rado

try using 'dashed' instead of '--'. Works for me.

I have no idea why '--' works for plotting lines but not vectors
(which are arrows) ...

Rado

On Aug 3, 3:46 pm, cesarnda cesar...@gmail.com wrote:
 what is wrong with the following:

 sage: v1 = vector([1,2])
 sage: v2 = vector([2,1])
 sage: p1 = plot(v1, rgbcolor=(1,0,0))
 sage: p2 = plot(v2, rgbcolor=(0,1,0))
 sage: t1 = text(V1, (1,2.1), rgbcolor=(1,0,0))
 sage: t2 = text(V2, (2,1.1), rgbcolor=(0,1,0))
 sage: p3 = plot(v1 + v2, rgbcolor=(0,0,1))
 sage: t3 = text(V1 + V2, v1+v2 + vector([0,0.1]), rgbcolor=(0,0,1))
 sage: p4 = plot(vector([3,3]), rgbcolor=(1,1,1), linestyle='--')
 sage: show(p1 + p2 + p3 + p4 + t1 + t2 + t3, xmin=-0.5, xmax=3.5,
 ymin=-0.5, ymax=3.5)
 Traceback (most recent call last):
   File stdin, line 1, in module
   File /Users/cesarnda/.sage/sage_notebook/worksheets/admin/9/code/
 120.py, line 7, in module
     show(p1 + p2 + p3 + p4 + t1 + t2 + t3, xmin=-_sage_const_0p5 ,
 xmax=_sage_const_3p5 , ymin=-_sage_const_0p5 , ymax=_sage_const_3p5 )
   File , line 1, in module

   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/sage/misc/functional.py, line 952, in show
     return x.show(*args, **kwds)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/sage/plot/plot.py, line 1302, in show
     hgridlinesstyle=hgridlinesstyle)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/sage/plot/plot.py, line 1627, in save
     canvas.print_figure(filename, dpi=dpi)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/backend_bases.py, line 1453, in print_figure
     **kwargs)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/backends/backend_agg.py, line 326, in print_png
     FigureCanvasAgg.draw(self)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/backends/backend_agg.py, line 282, in draw
     self.figure.draw(self.renderer)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/figure.py, line 773, in draw
     for a in self.axes: a.draw(renderer)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/axes.py, line 1668, in draw
     a.draw(renderer)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/patches.py, line 3588, in draw
     gc.set_linestyle(self._linestyle)
   File /Users/cesarnda/Software/sage/local/lib/python2.6/site-
 packages/matplotlib/backend_bases.py, line 650, in set_linestyle
     raise ValueError('Unrecognized linestyle: %s' % style)
 ValueError: Unrecognized linestyle: --

 Why does it say that the linestyle='--' is not recognized?
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

There appears to be a memory leak -- or some sort of caching (!) -- in
the code to evaluate phi.  This is likely impacting the complexity of
the some code that is run during the computation of phi(P).  The log
below shows that memory usage increases upon evaluation of phi(P):

sage: get_memory_usage()
210.109375
sage: timeit('phi(P)')
125 loops, best of 3: 7.13 ms per loop
sage: get_memory_usage()
210.609375
sage: timeit('phi(P)')
125 loops, best of 3: 7.3 ms per loop
sage: get_memory_usage()
211.109375
sage: timeit('phi(P)')
125 loops, best of 3: 7.49 ms per loop
sage: get_memory_usage()
211.609375
sage: timeit('phi(P)')
125 loops, best of 3: 7.69 ms per loop
sage: get_memory_usage()
212.109375

Now I looked at the source code for the function phi(P) =
phi.__call__(P) and bisected by putting early returns in.  If you
change

else:
outP = self.__E2(outP)

to

else:
return outP
outP = self.__E2(outP)

in that function in ell_curve_isogeny.py (around line 875), then the
leak and slowdown vanishes.

Thus the real problem is in the trivial line self.__E2(outP),
which by the way takes even in good cases like 10 times as long as the
rest of the whole function put together.  Indeed, coercing a point
into a curve is a horrendous disaster (this is the real problem,
forget the isogeny stuff):

sage: get_memory_usage()
195.81640625
sage: timeit('E(P)')
625 loops, best of 3: 4.24 ms per loop
sage: get_memory_usage()
201.31640625

In fact, the function E.point is to blame, evidently:

sage: timeit('E.point(P)')
125 loops, best of 3: 4.13 ms per loop
sage: get_memory_usage()
202.08984375
sage: timeit('E.point(P)')
125 loops, best of 3: 4.4 ms per loop
sage: get_memory_usage()
203.08984375

... but *ONLY* with check=True (the default):

sage: timeit('E.point(P,check=False)')
625 loops, best of 3: 8.26 µs per loop
sage: get_memory_usage()
203.08984375
sage: timeit('E.point(P,check=False)')
625 loops, best of 3: 7.29 µs per loop
sage: get_memory_usage()
203.08984375

I.e., we get a speedup of a factor of nearly 1000 by using
check=False, plus the leak goes away.So in the check -- which
involves arithmetic -- maybe the coercion model is surely being
invoked at some point (I guess), and that is perhaps caching
information, thus memory usage goes up and performance goes down.  I
don't know, I'm not looking further.

Going back to your original problem, if I change in ell_curve_isogeny.py

else:
outP = self.__E2(outP)

to

else:
outP = self.__E2.point(outP,check=False)

then we have the following, which is exactly what you would hope for
(things are fast,  no slowdown).

sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
sage: E = EllipticCurve(j=GF(qq[0])(1728))
sage: # E has qq[0]+1 points over GF(qq[0])
sage: factor(qq[0]+1)
2^2 * 3 * 5 * 1667
sage: P = ((qq[0]+1)//3)*E.random_element()
sage: K = [E(0),P,-P]
sage: phi = E.isogeny(K)
sage: get_memory_usage()
190.56640625
sage: timeit('phi(P)')
625 loops, best of 3: 69.8 µs per loop
sage: for i in xrange(20): timeit('phi(P)')

:
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 69.6 µs per loop
625 loops, best of 3: 69.9 µs per loop
625 loops, best of 3: 69.8 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 71.2 µs per loop
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 70.8 µs per loop
625 loops, best of 3: 69.2 µs per loop
625 loops, best of 3: 70.2 µs per loop
625 loops, best of 3: 70.7 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 71 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 70.2 µs per loop
625 loops, best of 3: 70.1 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 70.1 µs per loop
625 loops, best of 3: 70.1 µs per loop

The above change is very sensible, since we know that outP is on
self.__E2, so should directly create a point on E2 and not check again
that our point is really on E2 (which is very expensive).

I hope the above is helpful and that somebody opens a trac ticket and
submits a patch.I have to get back to what I was doing...   I also
hope the above email provides some ideas as to how to quickly get to
the bottom of questions like this.  Note that I did all this in  10
minutes by using ?? to see where relevant source code is, putting in
some 

[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Dan Shumow

 The above change is very sensible, since we know that outP is on
 self.__E2, so should directly create a point on E2 and not check again
 that our point is really on E2 (which is very expensive).

I agree that we should make the change:

   else:
   outP = self.__E2(outP)

to

   else:
   outP = self.__E2.point(outP,check=False)


When I originally wrote the code I did not know that this problem
existed.  I just wanted to map a pair of elements on a field to the
elliptic curve point object associated to those coordinates.

I created the ticket:
http://trac.sagemath.org/sage_trac/ticket/6672

and will fix this when I get home tonight (I'm at work right now.)
The fix is very easy, if someone else wants to grab it for now, that
is fine.  But just be sure to set check = false in the other point
coercion call as well (in the if block associated with this else
block.)

Thanks,
Dan



On Mon, Aug 3, 2009 at 7:00 PM, William Steinwst...@gmail.com wrote:
 On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 There appears to be a memory leak -- or some sort of caching (!) -- in
 the code to evaluate phi.  This is likely impacting the complexity of
 the some code that is run during the computation of phi(P).  The log
 below shows that memory usage increases upon evaluation of phi(P):

 sage: get_memory_usage()
 210.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.13 ms per loop
 sage: get_memory_usage()
 210.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.3 ms per loop
 sage: get_memory_usage()
 211.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.49 ms per loop
 sage: get_memory_usage()
 211.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.69 ms per loop
 sage: get_memory_usage()
 212.109375

 Now I looked at the source code for the function phi(P) =
 phi.__call__(P) and bisected by putting early returns in.  If you
 change

        else:
            outP = self.__E2(outP)

 to

        else:
            return outP
            outP = self.__E2(outP)

 in that function in ell_curve_isogeny.py (around line 875), then the
 leak and slowdown vanishes.

 Thus the real problem is in the trivial line self.__E2(outP),
 which by the way takes even in good cases like 10 times as long as the
 rest of the whole function put together.  Indeed, coercing a point
 into a curve is a horrendous disaster (this is the real problem,
 forget the isogeny stuff):

 sage: get_memory_usage()
 195.81640625
 sage: timeit('E(P)')
 625 loops, best of 3: 4.24 ms per loop
 sage: get_memory_usage()
 201.31640625

 In fact, the function E.point is to blame, evidently:

 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.13 ms per loop
 sage: get_memory_usage()
 202.08984375
 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.4 ms per loop
 sage: get_memory_usage()
 203.08984375

 ... but *ONLY* with check=True (the default):

 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 8.26 µs per loop
 sage: get_memory_usage()
 203.08984375
 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 7.29 µs per loop
 sage: get_memory_usage()
 203.08984375

 I.e., we get a speedup of a factor of nearly 1000 by using
 check=False, plus the leak goes away.    So in the check -- which
 involves arithmetic -- maybe the coercion model is surely being
 invoked at some point (I guess), and that is perhaps caching
 information, thus memory usage goes up and performance goes down.  I
 don't know, I'm not looking further.

 Going back to your original problem, if I change in ell_curve_isogeny.py

        else:
            outP = self.__E2(outP)

 to

        else:
            outP = self.__E2.point(outP,check=False)

 then we have the following, which is exactly what you would hope for
 (things are fast,  no slowdown).

 sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
 sage: E = EllipticCurve(j=GF(qq[0])(1728))
 sage: # E has qq[0]+1 points over GF(qq[0])
 sage: factor(qq[0]+1)
 2^2 * 3 * 5 * 1667
 sage: P = ((qq[0]+1)//3)*E.random_element()
 sage: K = [E(0),P,-P]
 sage: phi = E.isogeny(K)
 sage: get_memory_usage()
 190.56640625
 sage: timeit('phi(P)')
 625 loops, best of 3: 69.8 µs per loop
 sage: for i in xrange(20): timeit('phi(P)')

 :
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.6 µs per loop
 625 loops, best of 3: 69.9 µs per loop
 625 loops, best of 3: 69.8 µs per loop
 625 loops, best of 3: 70 µs per loop
 625 loops, 

[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 7:23 PM, Dan Shumowshu...@gmail.com wrote:
 The above change is very sensible, since we know that outP is on
 self.__E2, so should directly create a point on E2 and not check again
 that our point is really on E2 (which is very expensive).

 I agree that we should make the change:

       else:
           outP = self.__E2(outP)

 to

       else:
           outP = self.__E2.point(outP,check=False)


 When I originally wrote the code I did not know that this problem
 existed.

And I didn't know about it until a half hour ago :-).

William

 I just wanted to map a pair of elements on a field to the
 elliptic curve point object associated to those coordinates.

 I created the ticket:
 http://trac.sagemath.org/sage_trac/ticket/6672

 and will fix this when I get home tonight (I'm at work right now.)

Thanks!!

 The fix is very easy, if someone else wants to grab it for now, that
 is fine.  But just be sure to set check = false in the other point
 coercion call as well (in the if block associated with this else
 block.)

 Thanks,
 Dan



 On Mon, Aug 3, 2009 at 7:00 PM, William Steinwst...@gmail.com wrote:
 On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 There appears to be a memory leak -- or some sort of caching (!) -- in
 the code to evaluate phi.  This is likely impacting the complexity of
 the some code that is run during the computation of phi(P).  The log
 below shows that memory usage increases upon evaluation of phi(P):

 sage: get_memory_usage()
 210.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.13 ms per loop
 sage: get_memory_usage()
 210.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.3 ms per loop
 sage: get_memory_usage()
 211.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.49 ms per loop
 sage: get_memory_usage()
 211.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.69 ms per loop
 sage: get_memory_usage()
 212.109375

 Now I looked at the source code for the function phi(P) =
 phi.__call__(P) and bisected by putting early returns in.  If you
 change

        else:
            outP = self.__E2(outP)

 to

        else:
            return outP
            outP = self.__E2(outP)

 in that function in ell_curve_isogeny.py (around line 875), then the
 leak and slowdown vanishes.

 Thus the real problem is in the trivial line self.__E2(outP),
 which by the way takes even in good cases like 10 times as long as the
 rest of the whole function put together.  Indeed, coercing a point
 into a curve is a horrendous disaster (this is the real problem,
 forget the isogeny stuff):

 sage: get_memory_usage()
 195.81640625
 sage: timeit('E(P)')
 625 loops, best of 3: 4.24 ms per loop
 sage: get_memory_usage()
 201.31640625

 In fact, the function E.point is to blame, evidently:

 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.13 ms per loop
 sage: get_memory_usage()
 202.08984375
 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.4 ms per loop
 sage: get_memory_usage()
 203.08984375

 ... but *ONLY* with check=True (the default):

 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 8.26 µs per loop
 sage: get_memory_usage()
 203.08984375
 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 7.29 µs per loop
 sage: get_memory_usage()
 203.08984375

 I.e., we get a speedup of a factor of nearly 1000 by using
 check=False, plus the leak goes away.    So in the check -- which
 involves arithmetic -- maybe the coercion model is surely being
 invoked at some point (I guess), and that is perhaps caching
 information, thus memory usage goes up and performance goes down.  I
 don't know, I'm not looking further.

 Going back to your original problem, if I change in ell_curve_isogeny.py

        else:
            outP = self.__E2(outP)

 to

        else:
            outP = self.__E2.point(outP,check=False)

 then we have the following, which is exactly what you would hope for
 (things are fast,  no slowdown).

 sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
 sage: E = EllipticCurve(j=GF(qq[0])(1728))
 sage: # E has qq[0]+1 points over GF(qq[0])
 sage: factor(qq[0]+1)
 2^2 * 3 * 5 * 1667
 sage: P = ((qq[0]+1)//3)*E.random_element()
 sage: K = [E(0),P,-P]
 sage: phi = E.isogeny(K)
 sage: get_memory_usage()
 190.56640625
 sage: timeit('phi(P)')
 625 loops, best of 3: 69.8 µs per loop
 sage: for i in xrange(20): timeit('phi(P)')

 :
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.3 µs per loop
 625 loops, 

[sage-support] jsmath in sage-4.1

2009-08-03 Thread Elizabeth Yip

Hello,

The line

jsmath(cos(2\phi)+latex(1/x))

in the sage-4.1 notebook produces different result from the sage-3.4
notebook.  The result in sage-3.4 is what I want.

Thank you for your help!

Elizabeth Yip
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: jsmath in sage-4.1

2009-08-03 Thread John H Palmieri

On Aug 3, 9:39 pm, Elizabeth Yip el...@comcast.net wrote:
 Hello,

 The line

 jsmath(cos(2\phi)+latex(1/x))

 in the sage-4.1 notebook produces different result from the sage-3.4
 notebook.  The result in sage-3.4 is what I want.

Okay, in the latest version, I see

cos(2\phi)\frac{1}{x}

I don't have a copy of Sage 3.4 on my computer, so what happened
there?

  John

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---