Ask Your Question
0

Magma coercion equivalent in Sage?

asked 2017-11-13 23:23:49 +0100

anonymous user

Anonymous

I'm working on converting a code written in Magma to Sage. I have something like this in Magma:

Fp;=FiniteField(p);
if (p mod 4) eq 3 then
q:=1;
else
q:=3;
while IsSquare(-Fp!q) do
q:=q+4;
end while;
end if;

Now there is the ! operator used, which is called coercion in Magma. Is there an equivalent operator in Sage? I mean how would one conver the IsSquare(-Fp!q) part valid Sage?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-11-14 06:03:09 +0100

slelievre gravatar image

The coercion of q to Fp is just achieved by Fp(q) in Sage.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-11-13 23:23:49 +0100

Seen: 350 times

Last updated: Nov 14 '17