Ticket #2171: extcode-trac2171-part2.patch

File extcode-trac2171-part2.patch, 1.7 KB (added by William Stein, 15 years ago)
  • magma/sage/basic.m

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1203069116 28800
    # Node ID 812520431ceee4cbe9774212548c01961b364fb8
    # Parent  ad5d8bd802bc4a04661f55bf699bb9f3fefd197d
    Add some documentation.
    
    diff -r ad5d8bd802bc -r 812520431cee magma/sage/basic.m
    a b end function; 
    66end function;
    77
    88intrinsic Sage(X::.) -> MonStgElt
    9 {}
     9{Default way to convert a Magma object to Sage if we haven't
     10written anything better.}
    1011    return Sprintf("%o", X), true;
    1112end intrinsic;
    1213
    1314intrinsic Sage(X::SetEnum) -> MonStgElt
    14 {}
     15{Convert an enumerated set to Sage.}
    1516    Y := [Sage(z) : z in X];
    1617    return Sprintf("Set(%o)", Y), true;
    1718end intrinsic;
    1819
    1920intrinsic Sage(X::SetIndx) -> MonStgElt
    20 {WARNING: Sage does not have an analogue of indexed sets.}
    21     Y := [z : z in X];
     21{Convert an indexed set to Sage. 
     22 WARNING: Sage does not have an analogue of indexed sets (yet!),
     23 so we just return a Python list.}
     24    Y := [Sage(z) : z in X];
    2225    return Sprintf("%o", Y), true;
    2326end intrinsic;
    2427
    2528intrinsic Sage(X::SetMulti) -> MonStgElt, BoolElt
    26 {WARNING: Sage does not have an analogue of multisets.}
    27     Y := [z : z in X];
     29{Convert a multiset to Sage.
     30 WARNING: Sage does not have an analogue of multisets yet, so we return a Python list.}
     31    Y := [Sage(z) : z in X];
    2832    return Sprintf("%o", Y), true;
    2933end intrinsic;
    3034
    3135intrinsic Sage(X::RngInt) -> MonStgElt, BoolElt
    32 {}
     36{Conver the ring of integers to Sage.}
    3337    return "ZZ", false;
    3438end intrinsic;
    3539
    intrinsic Sage(X::ModMatRngElt) -> MonSt 
    6165    pp := PreparseElts(BaseRing(X));
    6266    return convert_matrix(X, pp), pp;
    6367end intrinsic;
     68
     69/* Elltiptic Curve */