Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Magma coercion equivalent in Sage?

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?