On 10/31/07, Paul Zimmermann <[EMAIL PROTECTED]> wrote: > I am trying to switch to Sage for my usual computations (this will help me > to better know the system for the Sage days 6). In particular I did not find > how to automatically load the following Sage function I've written (my first > one) [it does compute the factored group order of a lucky elliptic curve which
You should put the function in a file, anywhere on your system, called e.g., myfile.sage then from sage type load "myfile.sage" > found the factor p; s is the "sigma" parameter used by most ECM software]: By the way, GMP-ECM is part of Sage. sage: ecm? sage: ecm.[tab key] sage: sage: ecm.factor(next_prime(10^15)*next_prime(10^40)) [1000000000000037, 10000000000000000000000000000000000000121] There is also a function DistributedFactor that uses GMP-ECM and Bill Hart's quadratic sieve to factor integers using Sage's distributed job server: sage: help(DistributedFactor) Unfortunately, the documentation for DistributedFactor doesn't make it at all trivial to use yet, so you might not want to try it. > > def FindGroupOrder(p,s): > K = GF(p) > v = K(4*s) > u = K(s^2-5) > x = u^3 > b = 4*x*v > a = (v-u)^3*(3*u+v) > A = a/b-2 > x = x/v^3 > b = x^3 + A*x^2 + x > E = EllipticCurve(K,[0,b*A,0,b^2,0]) > return factor(E.cardinality()) > > I tried to put it in $HOME/.sagerc but it did not work. There is no .sagerc recoginized by sage. There is a file $HOME/.sage/init.sage that if it exists will be autoloaded by Sage on startup. > I noticed there is > a $HOME/.sage directory. I tried to put it in $HOME/.sage/ipy_user_conf.py, > but it did not work either. That's for ipython, which is the command-line front end used by Sage. > [Feel free to tell me if I abuse by asking you such questions. I tried to > subscribe to the sage google group, but it seems you have first to create a > google account, and I'm reluctant to do this.] You can subscribe to that list without creating a google account if somebody invites you. I'll invite you. -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---
