First time here? Check out the FAQ!

Ask Your Question
0

Magma coercion equivalent in Sage?

asked 7 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

slelievre gravatar image

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

Preview: (hide)
link

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: 7 years ago

Seen: 365 times

Last updated: Nov 14 '17