diff -r 54342f65c59c sage/libs/singular/function.pxd
|
a
|
b
|
|
| 24 | 24 | |
| 25 | 25 | cdef class Resolution: |
| 26 | 26 | cdef syStrategy *_resolution |
| 27 | | cdef MPolynomialRing_libsingular base_ring |
| | 27 | cdef object base_ring |
| 28 | 28 | |
| 29 | 29 | cdef class Converter(SageObject): |
| 30 | 30 | cdef leftv *args |
| … |
… |
|
| 44 | 44 | cdef leftv * append_intvec(self, v) except NULL |
| 45 | 45 | cdef leftv * append_list(self, l) except NULL |
| 46 | 46 | cdef leftv * append_matrix(self, a) except NULL |
| 47 | | cdef leftv * append_ring(self, MPolynomialRing_libsingular r) except NULL |
| | 47 | cdef leftv * append_ring(self, r) except NULL |
| 48 | 48 | cdef leftv * append_module(self, m) except NULL |
| 49 | 49 | cdef to_sage_integer_matrix(self, intvec *mat) |
| 50 | 50 | cdef object to_sage_module_element_sequence_destructive(self, ideal *i) |
| … |
… |
|
| 70 | 70 | |
| 71 | 71 | cdef BaseCallHandler get_call_handler(self) |
| 72 | 72 | cdef bint function_exists(self) |
| 73 | | cdef MPolynomialRing_libsingular common_ring(self, tuple args, ring=?) |
| | 73 | cdef common_ring(self, tuple args, ring=?) |
| 74 | 74 | |
| 75 | 75 | cdef class SingularLibraryFunction(SingularFunction): |
| 76 | 76 | pass |
diff -r 54342f65c59c sage/libs/singular/function.pyx
|
a
|
b
|
|
| 13 | 13 | - Martin Albrecht (2009-07): clean up, enhancements, etc. |
| 14 | 14 | - Michael Brickenstein (2009-10): extension to more Singular types |
| 15 | 15 | - Martin Albrecht (2010-01): clean up, support for attributes |
| | 16 | - Burcin Erocal (2010-7): plural support |
| 16 | 17 | |
| 17 | 18 | EXAMPLES: |
| 18 | 19 | |
| … |
… |
|
| 81 | 82 | from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular |
| 82 | 83 | |
| 83 | 84 | from sage.rings.polynomial.plural cimport NCPolynomialRing_plural, \ |
| 84 | | NCPolynomial_plural |
| | 85 | NCPolynomial_plural, new_NCP |
| 85 | 86 | from sage.rings.polynomial.multi_polynomial_ideal import NCPolynomialIdeal |
| 86 | 87 | |
| 87 | 88 | from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal |
| … |
… |
|
| 122 | 123 | |
| 123 | 124 | for (i, p) in enumerate(v): |
| 124 | 125 | component = <int>i+1 |
| 125 | | poly_component = p_Copy( |
| 126 | | (<MPolynomial_libsingular>p)._poly, r) |
| | 126 | poly_component = copy_sage_polynomial_into_singular_poly(p) |
| 127 | 127 | p_iter = poly_component |
| 128 | 128 | while p_iter!=NULL: |
| 129 | 129 | p_SetComp(p_iter, component, r) |
| … |
… |
|
| 132 | 132 | res=p_Add_q(res, poly_component, r) |
| 133 | 133 | return res |
| 134 | 134 | |
| | 135 | |
| 135 | 136 | cdef class RingWrap: |
| 136 | 137 | """ |
| 137 | 138 | A simple wrapper around Singular's rings. |
| … |
… |
|
| 170 | 171 | sage: M = syz(I) |
| 171 | 172 | sage: resolution = mres(M, 0) |
| 172 | 173 | """ |
| 173 | | assert PY_TYPE_CHECK(base_ring, MPolynomialRing_libsingular) |
| 174 | | self.base_ring = <MPolynomialRing_libsingular> base_ring |
| | 174 | #FIXME: still not working noncommutative |
| | 175 | assert is_sage_wrapper_for_singular_ring(base_ring) |
| | 176 | self.base_ring = base_ring |
| 175 | 177 | def __repr__(self): |
| 176 | 178 | """ |
| 177 | 179 | EXAMPLE:: |
| … |
… |
|
| 229 | 231 | args.CleanUp() |
| 230 | 232 | omFreeBin(args, sleftv_bin) |
| 231 | 233 | |
| | 234 | # ===================================== |
| | 235 | # = Singular/Plural Abstraction Layer = |
| | 236 | # ===================================== |
| | 237 | |
| | 238 | def is_sage_wrapper_for_singular_ring(ring): |
| | 239 | if PY_TYPE_CHECK(ring, MPolynomialRing_libsingular): |
| | 240 | return True |
| | 241 | if PY_TYPE_CHECK(ring, NCPolynomialRing_plural): |
| | 242 | return True |
| | 243 | return False |
| | 244 | |
| | 245 | cdef new_sage_polynomial(ring, poly *p): |
| | 246 | if PY_TYPE_CHECK(ring, MPolynomialRing_libsingular): |
| | 247 | return new_MP(ring, p) |
| | 248 | else: |
| | 249 | if PY_TYPE_CHECK(ring, NCPolynomialRing_plural): |
| | 250 | return new_NCP(ring, p) |
| | 251 | raise ValueError("not a singular or plural ring") |
| | 252 | |
| | 253 | def is_polynomial(p): |
| | 254 | return PY_TYPE_CHECK(p, MPolynomial_libsingular) or PY_TYPE_CHECK(p, NCPolynomial_plural) |
| 232 | 255 | |
| 233 | 256 | def all_polynomials(s): |
| 234 | 257 | """ |
| … |
… |
|
| 245 | 268 | False |
| 246 | 269 | """ |
| 247 | 270 | for p in s: |
| 248 | | if not isinstance(p, MPolynomial_libsingular): |
| | 271 | if not is_polynomial(p): |
| 249 | 272 | return False |
| 250 | 273 | return True |
| 251 | 274 | |
| | 275 | cdef poly* access_singular_poly(p) except <poly*> -1: |
| | 276 | if PY_TYPE_CHECK(p, MPolynomial_libsingular): |
| | 277 | return (<MPolynomial_libsingular> p)._poly |
| | 278 | else: |
| | 279 | if PY_TYPE_CHECK(p, NCPolynomial_plural): |
| | 280 | return (<NCPolynomial_plural> p)._poly |
| | 281 | raise ValueError("not a singular polynomial wrapper") |
| | 282 | |
| | 283 | cdef ring* access_singular_ring(r) except <ring*> -1: |
| | 284 | if PY_TYPE_CHECK(r, MPolynomialRing_libsingular): |
| | 285 | return (<MPolynomialRing_libsingular> r )._ring |
| | 286 | if PY_TYPE_CHECK(r, NCPolynomialRing_plural): |
| | 287 | return (<NCPolynomialRing_plural> r )._ring |
| | 288 | raise ValueError("not a singular polynomial ring wrapper") |
| | 289 | |
| | 290 | cdef poly* copy_sage_polynomial_into_singular_poly(p): |
| | 291 | return p_Copy(access_singular_poly(p), access_singular_ring(p.parent())) |
| | 292 | |
| 252 | 293 | def all_vectors(s): |
| 253 | 294 | """ |
| 254 | 295 | Checks if a sequence ``s`` consists of free module |
| … |
… |
|
| 269 | 310 | False |
| 270 | 311 | """ |
| 271 | 312 | for p in s: |
| 272 | | if not (isinstance(p, FreeModuleElement_generic_dense)\ |
| 273 | | and isinstance(p.parent().base_ring(), MPolynomialRing_libsingular)): |
| | 313 | if not (PY_TYPE_CHECK(p, FreeModuleElement_generic_dense)\ |
| | 314 | and is_sage_wrapper_for_singular_ring(p.parent().base_ring())): |
| 274 | 315 | return False |
| 275 | 316 | return True |
| 276 | 317 | |
| 277 | 318 | |
| | 319 | cdef ring* sage_ring_to_singular_ring(ring) except <ring* > -1: |
| | 320 | if PY_TYPE_CHECK(ring, MPolynomialRing_libsingular): |
| | 321 | return (<MPolynomialRing_libsingular>ring)._ring |
| | 322 | elif PY_TYPE_CHECK(ring, NCPolynomialRing_plural): |
| | 323 | return (<NCPolynomialRing_plural>ring)._ring |
| | 324 | raise ValueError, "no singular ring found" |
| | 325 | |
| | 326 | |
| | 327 | |
| | 328 | |
| | 329 | |
| 278 | 330 | |
| 279 | 331 | cdef class Converter(SageObject): |
| 280 | 332 | """ |
| … |
… |
|
| 305 | 357 | cdef leftv *v |
| 306 | 358 | self.args = NULL |
| 307 | 359 | self._sage_ring = ring |
| 308 | | if PY_TYPE_CHECK(ring, MPolynomialRing_libsingular): |
| 309 | | self._singular_ring = (<MPolynomialRing_libsingular>ring)._ring |
| 310 | | elif PY_TYPE_CHECK(ring, NCPolynomialRing_plural): |
| 311 | | self._singular_ring = (<NCPolynomialRing_plural>ring)._ring |
| | 360 | if ring is not None: |
| | 361 | self._singular_ring = sage_ring_to_singular_ring(ring) |
| 312 | 362 | |
| 313 | 363 | from sage.matrix.matrix_mpolynomial_dense import Matrix_mpolynomial_dense |
| 314 | 364 | from sage.matrix.matrix_integer_dense import Matrix_integer_dense |
| 315 | 365 | for a in args: |
| 316 | | if PY_TYPE_CHECK(a, MPolynomial_libsingular) or \ |
| 317 | | PY_TYPE_CHECK(a, NCPolynomial_plural): |
| | 366 | if is_polynomial(a): |
| 318 | 367 | v = self.append_polynomial(a) |
| 319 | 368 | |
| 320 | | elif PY_TYPE_CHECK(a, MPolynomialRing_libsingular) or \ |
| 321 | | PY_TYPE_CHECK(a, NCPolynomialRing_plural): |
| | 369 | elif is_sage_wrapper_for_singular_ring(a): |
| 322 | 370 | v = self.append_ring(a) |
| 323 | 371 | |
| 324 | 372 | elif PY_TYPE_CHECK(a, MPolynomialIdeal) or \ |
| … |
… |
|
| 341 | 389 | v = self.append_resolution(a) |
| 342 | 390 | |
| 343 | 391 | elif PY_TYPE_CHECK(a, FreeModuleElement_generic_dense)\ |
| 344 | | and isinstance( |
| 345 | | a.parent().base_ring(), |
| 346 | | MPolynomialRing_libsingular): |
| | 392 | and is_sage_wrapper_for_singular_ring( |
| | 393 | a.parent().base_ring()): |
| 347 | 394 | v = self.append_vector(a) |
| 348 | 395 | |
| 349 | 396 | # as output ideals get converted to sequences |
| … |
… |
|
| 480 | 527 | ncols = mat.ncols |
| 481 | 528 | nrows = mat.nrows |
| 482 | 529 | result = Matrix(self._sage_ring, nrows, ncols) |
| 483 | | #FIXME: NCPolynomial |
| 484 | | cdef MPolynomial_libsingular p |
| 485 | 530 | for i in xrange(nrows): |
| 486 | 531 | for j in xrange(ncols): |
| 487 | | p = MPolynomial_libsingular(self._sage_ring) |
| 488 | | p._poly = mat.m[i*ncols+j] |
| | 532 | p = new_sage_polynomial(self._sage_ring, mat.m[i*ncols+j]) |
| 489 | 533 | mat.m[i*ncols+j]=NULL |
| 490 | 534 | result[i,j] = p |
| 491 | 535 | return result |
| … |
… |
|
| 527 | 571 | else: |
| 528 | 572 | previous = p_iter |
| 529 | 573 | p_iter = pNext(p_iter) |
| 530 | | result.append(new_MP(self._sage_ring, first)) |
| | 574 | |
| | 575 | result.append(new_sage_polynomial(self._sage_ring, first)) |
| 531 | 576 | return free_module(result) |
| 532 | 577 | |
| 533 | 578 | cdef object to_sage_module_element_sequence_destructive( self, ideal *i): |
| … |
… |
|
| 544 | 589 | #cdef MPolynomialRing_libsingular sage_ring = self._ring |
| 545 | 590 | cdef int j |
| 546 | 591 | cdef int rank=i.rank |
| 547 | | free_module = self._sage_ring**rank |
| | 592 | free_module = self._sage_ring ** rank |
| 548 | 593 | l = [] |
| 549 | 594 | |
| 550 | 595 | for j from 0 <= j < IDELEMS(i): |
| … |
… |
|
| 578 | 623 | Append the polynomial ``p`` to the list. |
| 579 | 624 | """ |
| 580 | 625 | cdef poly* _p |
| 581 | | if PY_TYPE_CHECK(p, MPolynomial_libsingular): |
| 582 | | _p = p_Copy((<MPolynomial_libsingular>p)._poly, <ring*>((<MPolynomial_libsingular>p)._parent)._ring) |
| 583 | | elif PY_TYPE_CHECK(p, NCPolynomial_plural): |
| 584 | | _p = p_Copy((<NCPolynomial_plural>p)._poly, <ring*>((<NCPolynomial_plural>p)._parent)._ring) |
| | 626 | _p = copy_sage_polynomial_into_singular_poly(p) |
| | 627 | |
| 585 | 628 | return self._append(_p, POLY_CMD) |
| 586 | 629 | |
| 587 | 630 | cdef leftv *append_ideal(self, i) except NULL: |
| … |
… |
|
| 617 | 660 | cdef number *_n = sa2si(n, self._singular_ring) |
| 618 | 661 | return self._append(<void *>_n, NUMBER_CMD) |
| 619 | 662 | |
| 620 | | cdef leftv *append_ring(self, MPolynomialRing_libsingular r) except NULL: |
| | 663 | cdef leftv *append_ring(self, r) except NULL: |
| 621 | 664 | """ |
| 622 | 665 | Append the ring ``r`` to the list. |
| 623 | 666 | """ |
| 624 | | #FIXME |
| 625 | | cdef ring *_r = <ring*> r._ring |
| | 667 | cdef ring *_r = access_singular_ring(r) |
| 626 | 668 | _r.ref+=1 |
| 627 | 669 | return self._append(<void *>_r, RING_CMD) |
| 628 | 670 | |
| … |
… |
|
| 1078 | 1120 | |
| 1079 | 1121 | return prefix + get_docstring(self._name) |
| 1080 | 1122 | |
| 1081 | | cdef MPolynomialRing_libsingular common_ring(self, tuple args, ring=None): |
| | 1123 | cdef common_ring(self, tuple args, ring=None): |
| 1082 | 1124 | """ |
| 1083 | 1125 | Return the common ring for the argument list ``args``. |
| 1084 | 1126 | |
| … |
… |
|
| 1099 | 1141 | if PY_TYPE_CHECK(a, MPolynomialIdeal) or \ |
| 1100 | 1142 | PY_TYPE_CHECK(a, NCPolynomialIdeal): |
| 1101 | 1143 | ring2 = a.ring() |
| 1102 | | elif PY_TYPE_CHECK(a, MPolynomial_libsingular) or \ |
| 1103 | | PY_TYPE_CHECK(a, NCPolynomial_plural): |
| | 1144 | elif is_polynomial(a): |
| 1104 | 1145 | ring2 = a.parent() |
| 1105 | | elif PY_TYPE_CHECK(a, MPolynomialRing_libsingular) or \ |
| 1106 | | PY_TYPE_CHECK(a, NCPolynomialRing_plural): |
| | 1146 | elif is_sage_wrapper_for_singular_ring(a): |
| 1107 | 1147 | ring2 = a |
| 1108 | | elif PY_TYPE_CHECK(a, int) or PY_TYPE_CHECK(a, long) or PY_TYPE_CHECK(a, basestring): |
| | 1148 | elif PY_TYPE_CHECK(a, int) or\ |
| | 1149 | PY_TYPE_CHECK(a, long) or\ |
| | 1150 | PY_TYPE_CHECK(a, basestring): |
| 1109 | 1151 | continue |
| 1110 | 1152 | elif PY_TYPE_CHECK(a, Matrix_integer_dense): |
| 1111 | 1153 | continue |
| … |
… |
|
| 1118 | 1160 | elif PY_TYPE_CHECK(a, Resolution): |
| 1119 | 1161 | ring2 = (<Resolution> a).base_ring |
| 1120 | 1162 | elif PY_TYPE_CHECK(a, FreeModuleElement_generic_dense)\ |
| 1121 | | and PY_TYPE_CHECK( |
| 1122 | | a.parent().base_ring(), |
| 1123 | | MPolynomialRing_libsingular): |
| | 1163 | and is_sage_wrapper_for_singular_ring( |
| | 1164 | a.parent().base_ring()): |
| 1124 | 1165 | ring2 = a.parent().base_ring() |
| 1125 | 1166 | elif ring is not None: |
| 1126 | 1167 | a.parent() is ring |
| … |
… |
|
| 1132 | 1173 | raise ValueError("Rings do not match up.") |
| 1133 | 1174 | if ring is None: |
| 1134 | 1175 | raise ValueError("Could not detect ring.") |
| 1135 | | return <MPolynomialRing_libsingular>ring |
| | 1176 | return ring |
| 1136 | 1177 | |
| 1137 | 1178 | def __reduce__(self): |
| 1138 | 1179 | """ |
| … |
… |
|
| 1168 | 1209 | global errorreported |
| 1169 | 1210 | |
| 1170 | 1211 | cdef ring *si_ring |
| 1171 | | if isinstance(R, MPolynomialRing_libsingular): |
| | 1212 | if PY_TYPE_CHECK(R, MPolynomialRing_libsingular): |
| 1172 | 1213 | si_ring = (<MPolynomialRing_libsingular>R)._ring |
| 1173 | 1214 | else: |
| 1174 | 1215 | si_ring = (<NCPolynomialRing_plural>R)._ring |
| … |
… |
|
| 1399 | 1440 | <Resolution> |
| 1400 | 1441 | sage: singular_list(resolution) |
| 1401 | 1442 | [[(-2*y, 2, y + 1, 0), (0, -2, x - 1, 0), (x*y - y, -y + 1, 1, -y), (x^2 + 1, -x - 1, -1, -x)], [(-x - 1, y - 1, 2*x, -2*y)], [(0)]] |
| 1402 | | |
| 1403 | | |
| | 1443 | sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural |
| | 1444 | sage: from sage.matrix.constructor import Matrix |
| | 1445 | sage: c=Matrix(2) |
| | 1446 | sage: c[0,1]=-1 |
| | 1447 | sage: P = NCPolynomialRing_plural(QQ, 2, 'x,y', c=c, d=Matrix(2)) |
| | 1448 | sage: (x,y)=[P.gen(i) for i in xrange(2)] |
| | 1449 | sage: I= Sequence([x*y,x+y], check=False, immutable=True)#P.ideal(x*y,x+y) |
| | 1450 | sage: twostd = singular_function("twostd") |
| | 1451 | sage: twostd(I) |
| | 1452 | [x + y, y^2] |
| | 1453 | sage: M=syz(I) |
| | 1454 | doctest... |
| | 1455 | sage: M |
| | 1456 | [(x + y, x*y)] |
| | 1457 | sage: syz(M, ring=P) |
| | 1458 | [(0)] |
| | 1459 | sage: mres(I, 0) |
| | 1460 | <Resolution> |
| | 1461 | sage: M=P**3 |
| | 1462 | sage: v=M((100*x,5*y,10*y*x*y)) |
| | 1463 | sage: leadcoef(v) |
| | 1464 | -10 |
| | 1465 | sage: v = M([x+y,x*y+y**3,x]) |
| | 1466 | sage: lead(v) |
| | 1467 | (0, y^3) |
| | 1468 | sage: jet(v, 2) |
| | 1469 | (x + y, x*y, x) |
| 1404 | 1470 | """ |
| 1405 | 1471 | |
| 1406 | 1472 | cdef SingularFunction fnc |
diff -r 54342f65c59c sage/modules/free_module.py
|
a
|
b
|
|
| 182 | 182 | from sage.structure.parent_gens import ParentWithGens |
| 183 | 183 | from sage.misc.cachefunc import cached_method |
| 184 | 184 | |
| | 185 | from warnings import warn |
| | 186 | |
| 185 | 187 | ############################################################################### |
| 186 | 188 | # |
| 187 | 189 | # Constructor functions |
| … |
… |
|
| 345 | 347 | if not isinstance(sparse,bool): |
| 346 | 348 | raise TypeError, "Argument sparse (= %s) must be True or False" % sparse |
| 347 | 349 | |
| | 350 | |
| | 351 | # We should have two sided, left sided and right sided ideals, |
| | 352 | # but that's another story .... |
| | 353 | # |
| 348 | 354 | if not base_ring.is_commutative(): |
| 349 | | raise TypeError, "The base_ring must be a commutative ring." |
| | 355 | |
| | 356 | warn("""You are constructing a free module |
| | 357 | over a noncommutative ring. Sage does |
| | 358 | not have a concept of left/right |
| | 359 | and both sided modules be careful. It's also |
| | 360 | not guarantied that all multiplications |
| | 361 | are done from the right side.""") |
| | 362 | |
| | 363 | # raise TypeError, "The base_ring must be a commutative ring." |
| | 364 | |
| 350 | 365 | |
| 351 | 366 | if not sparse and isinstance(base_ring,sage.rings.real_double.RealDoubleField_class): |
| 352 | 367 | return RealDoubleVectorSpace_class(rank) |
| … |
… |
|
| 558 | 573 | Category of modules with basis over Integer Ring |
| 559 | 574 | |
| 560 | 575 | """ |
| 561 | | if not isinstance(base_ring, commutative_ring.CommutativeRing): |
| 562 | | raise TypeError, "base_ring (=%s) must be a commutative ring"%base_ring |
| | 576 | if not base_ring.is_commutative(): |
| | 577 | warn("""You are constructing a free module over a noncommutative ring. Sage does not have a concept of left/right and both sided modules be careful. It's also not guarantied that all multiplications are done from the right side.""") |
| | 578 | #raise TypeError, "base_ring (=%s) must be a commutative ring"%base_ring |
| | 579 | |
| 563 | 580 | rank = sage.rings.integer.Integer(rank) |
| 564 | 581 | if rank < 0: |
| 565 | 582 | raise ValueError, "rank (=%s) must be nonnegative"%rank |
diff -r 54342f65c59c sage/rings/polynomial/plural.pyx
|
a
|
b
|
|
| 13 | 13 | from sage.libs.singular.polynomial cimport singular_polynomial_deg, singular_polynomial_str_with_changed_varnames, singular_polynomial_latex, singular_polynomial_str, singular_polynomial_div_coeff |
| 14 | 14 | |
| 15 | 15 | from sage.libs.singular.singular cimport si2sa, sa2si, overflow_check |
| 16 | | |
| | 16 | from sage.rings.integer_ring import ZZ |
| 17 | 17 | from term_order import TermOrder |
| 18 | 18 | |
| 19 | 19 | cdef class NCPolynomialRing_plural(Ring): |
| … |
… |
|
| 45 | 45 | |
| 46 | 46 | self.__ngens = n |
| 47 | 47 | ParentWithGens.__init__(self, base_ring, names) |
| | 48 | self._populate_coercion_lists_() |
| | 49 | |
| 48 | 50 | #MPolynomialRing_generic.__init__(self, base_ring, n, names, order) |
| 49 | 51 | #self._has_singular = True |
| 50 | 52 | assert(n == len(self._names)) |
| 51 | 53 | |
| 52 | 54 | self._one_element = new_NCP(self,p_ISet(1, self._ring)) |
| 53 | 55 | self._zero_element = new_NCP(self,NULL) |
| | 56 | |
| | 57 | |
| | 58 | def _element_constructor_(self, x): |
| | 59 | """ |
| | 60 | Make sure x is a valid member of self, and return the constructed element. |
| | 61 | """ |
| | 62 | if x==0: |
| | 63 | return self._zero_element |
| | 64 | raise NotImplementedError("not able to constructor "+repr(x)) |
| | 65 | |
| | 66 | def _coerce_map_from_(self, S): |
| | 67 | """ |
| | 68 | The only things that coerce into this ring are: |
| | 69 | - the integer ring |
| | 70 | - other localizations away from fewer primes |
| | 71 | """ |
| | 72 | if S is ZZ: |
| | 73 | return True |
| | 74 | |
| | 75 | def __pow__(self, n, _): |
| | 76 | """ |
| | 77 | Return the free module of rank `n` over this ring. |
| 54 | 78 | |
| | 79 | EXAMPLES:: |
| | 80 | |
| | 81 | """ |
| | 82 | import sage.modules.all |
| | 83 | return sage.modules.all.FreeModule(self, n) |
| | 84 | |
| | 85 | |
| | 86 | |
| 55 | 87 | def term_order(self): |
| 56 | 88 | return self.__term_order |
| 57 | 89 | |
| | 90 | |
| | 91 | def is_commutative(self): |
| | 92 | return False |
| | 93 | |
| | 94 | def is_field(self): |
| | 95 | return False |
| | 96 | |
| 58 | 97 | def _repr_(self): |
| 59 | 98 | """ |
| 60 | 99 | EXAMPLE: |