How to load and use a PARI/GP script in Sage notebook?

i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

Take for example the script http://math.stanford.edu/~stange/scripts/tate_via_nets.gp What I do is copying the script to a txt file and name it tatepairing.gp. Then I go to my sage notebook and choose above the option 'gp'. In the first block I write "\r filename" where filename is the whole path of the file tatepairing.gp (so C:....\tatepairing.gp) and evaluate it. If you go to the link you see a function tate_pairing_alg with input an elliptic curve, two points on it and an integer. Therefore I define (over $\mathbb{F}_5$) e = ellinit([0,0,0,4,0]*Mod(1,5)) P1= [2,4] P2=[1,0]

Now I do tate_pairing_alg(e, P1, P2, 4), the answer is

* at top-level: tatepairing.tate_pairing_alg(e,P ^-------------------- ** not a function in function call

If you see me doing things wrongly please let me know it :-) Thanks

asked Mar 17 '12

Nadori gravatar image Nadori
13 3

2 Answers:

i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel) Nadori has selected this answer as correct

Do

  gp.read(get_remote_file('http://math.stanford.edu/~stange/scripts/tate_via_nets.gp'))

as illustrated here.

link

posted Mar 18 '12

William Stein gravatar image William Stein
1205 5 17 40
http://wstein.org/
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

Hi

This works for me in sage4.8

I put this in one cell and choose gp at the top of the worksheet:

\r /home/jan/Downloads/tate_via_nets.gp e = ellinit([0,0,0,4,0]*Mod(1,5)) P1= [2,4] P2=[1,0] tate_pairing_alg(e, P1, P2, 4)

The answer is

Mod(4, 5)

link

posted Mar 18 '12

pipedream gravatar image pipedream
1

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Tags:

Stats:

Asked: Mar 17 '12

Seen: 148 times

Last updated: Mar 18 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.