Skip to content

Commit

Permalink
Trac #25640: converting back Zmod(n) from magma to sage
Browse files Browse the repository at this point in the history
from ticket #4896

URL: https://trac.sagemath.org/25640
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Jun 24, 2018
2 parents d837c6d + 895c9b3 commit 94e5823
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ext/magma/sage/basic.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ intrinsic Sage(X::FldFinElt) -> MonStgElt, BoolElt
end if;
end intrinsic;

/* Finite quotients of ZZ */

intrinsic Sage(X::RngIntRes) -> MonStgElt, BoolElt
{}
return Sprintf("Zmod(%o)", Characteristic(X)), false;
end intrinsic;

/* Approximate fields */

intrinsic Sage(X::FldRe) -> MonStgElt, BoolElt
Expand Down
5 changes: 5 additions & 0 deletions src/sage/interfaces/magma.py
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,11 @@ def _sage_(self):
...
NameError: name 'K' is not defined
Finite quotients of ZZ::
sage: R = Zmod(137)
sage: magma(R).sage() # optional - magma
Ring of integers modulo 137
"""
z, preparse = self.Sage(nvals=2)
s = str(z)
Expand Down

0 comments on commit 94e5823

Please sign in to comment.