diff -r 6a696ae732ab sage/rings/polynomial/multi_polynomial_ideal.py
|
a
|
b
|
|
| 604 | 604 | return S |
| 605 | 605 | |
| 606 | 606 | |
| 607 | | class MPolynomialIdeal_singular_commutative_repr( |
| | 607 | class MPolynomialIdeal_singular_repr( |
| 608 | 608 | MPolynomialIdeal_singular_base_repr): |
| 609 | 609 | """ |
| 610 | 610 | An ideal in a multivariate polynomial ring, which has an |
| … |
… |
|
| 1349 | 1349 | False |
| 1350 | 1350 | """ |
| 1351 | 1351 | R = self.ring() |
| | 1352 | |
| 1352 | 1353 | if not isinstance(other, MPolynomialIdeal_singular_repr) or other.ring() != R: |
| 1353 | 1354 | raise ValueError, "other must be an ideal in the ring of self, but it isn't." |
| 1354 | 1355 | |
| … |
… |
|
| 2274 | 2275 | R = self.ring() |
| 2275 | 2276 | return R(k) |
| 2276 | 2277 | |
| 2277 | | class NCPolynomialIdeal(MPolynomialIdeal_singular_base_repr, Ideal_generic): |
| | 2278 | class NCPolynomialIdeal(MPolynomialIdeal_singular_repr, Ideal_generic): |
| 2278 | 2279 | def __init__(self, ring, gens, coerce=True): |
| | 2280 | r""" |
| | 2281 | Computes a non-commutative ideal. |
| | 2282 | |
| | 2283 | EXAMPLES:: |
| | 2284 | |
| | 2285 | sage: A.<x,y,z> = FreeAlgebra(QQ, 3) |
| | 2286 | sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) |
| | 2287 | sage: H.inject_variables() |
| | 2288 | Defining x, y, z |
| | 2289 | |
| | 2290 | sage: I = H.ideal([y^2, x^2, z^2-H.one_element()],coerce=False) # indirect doctest |
| | 2291 | """ |
| 2279 | 2292 | Ideal_generic.__init__(self, ring, gens, coerce=coerce) |
| 2280 | 2293 | |
| 2281 | 2294 | def __call_singular(self, cmd, arg = None): |
| … |
… |
|
| 2290 | 2303 | r""" |
| 2291 | 2304 | Computes a left GB of the ideal. |
| 2292 | 2305 | |
| 2293 | | EXAMPLE:: |
| | 2306 | EXAMPLES:: |
| 2294 | 2307 | |
| 2295 | 2308 | sage: A.<x,y,z> = FreeAlgebra(QQ, 3) |
| 2296 | 2309 | sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) |
| 2297 | 2310 | sage: H.inject_variables() |
| | 2311 | Defining x, y, z |
| 2298 | 2312 | sage: I = H.ideal([y^2, x^2, z^2-H.one_element()],coerce=False) |
| 2299 | 2313 | sage: I.std() |
| 2300 | 2314 | Ideal (z^2 - 1, y*z - y, x*z + x, y^2, 2*x*y - z - 1, x^2) of Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field... |
| … |
… |
|
| 2308 | 2322 | r""" |
| 2309 | 2323 | Computes a two-sided GB of the ideal. |
| 2310 | 2324 | |
| 2311 | | EXAMPLE:: |
| | 2325 | EXAMPLES:: |
| 2312 | 2326 | |
| 2313 | 2327 | sage: A.<x,y,z> = FreeAlgebra(QQ, 3) |
| 2314 | 2328 | sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) |
| 2315 | 2329 | sage: H.inject_variables() |
| | 2330 | Defining x, y, z |
| 2316 | 2331 | sage: I = H.ideal([y^2, x^2, z^2-H.one_element()],coerce=False) |
| 2317 | 2332 | sage: I.twostd() |
| 2318 | 2333 | Ideal (z^2 - 1, y*z - y, x*z + x, y^2, 2*x*y - z - 1, x^2) of Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field... |
| … |
… |
|
| 2336 | 2351 | sage: A.<x,y,z> = FreeAlgebra(QQ, 3) |
| 2337 | 2352 | sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) |
| 2338 | 2353 | sage: H.inject_variables() |
| | 2354 | Defining x, y, z |
| 2339 | 2355 | sage: I = H.ideal([y^2, x^2, z^2-H.one_element()],coerce=False) |
| 2340 | | sage: G = vector(I.gens()); G |
| 2341 | | ... |
| | 2356 | sage: G = vector(I.gens()); G |
| | 2357 | doctest:357: UserWarning: You are constructing a free module over a noncommutative ring. Sage does |
| | 2358 | not have a concept of left/right and both sided modules be careful. It's also |
| | 2359 | not guarantied that all multiplications are done from the right side. |
| | 2360 | doctest:573: UserWarning: 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. |
| 2342 | 2361 | (y^2, x^2, z^2 - 1) |
| 2343 | 2362 | sage: M = I.syzygy_module(); M |
| 2344 | | ... |
| 2345 | | sage: (G.transpose() * M.transpose()).transpose() |
| 2346 | | (0, 0) |
| | 2363 | [ -z^2 - 8*z - 15 0 y^2] |
| | 2364 | [ 0 -z^2 + 8*z - 15 x^2] |
| | 2365 | [ x^2*z^2 + 8*x^2*z + 15*x^2 -y^2*z^2 + 8*y^2*z - 15*y^2 -4*x*y*z + 2*z^2 + 2*z] |
| | 2366 | [ x^2*y*z^2 + 9*x^2*y*z - 6*x*z^3 + 20*x^2*y - 72*x*z^2 - 282*x*z - 360*x -y^3*z^2 + 7*y^3*z - 12*y^3 6*y*z^2] |
| | 2367 | [ x^3*z^2 + 7*x^3*z + 12*x^3 -x*y^2*z^2 + 9*x*y^2*z - 4*y*z^3 - 20*x*y^2 + 52*y*z^2 - 224*y*z + 320*y -6*x*z^2] |
| | 2368 | [ x^2*y^2*z + 4*x^2*y^2 - 8*x*y*z^2 - 48*x*y*z + 12*z^3 - 64*x*y + 108*z^2 + 312*z + 288 -y^4*z + 4*y^4 0] |
| | 2369 | [ 2*x^3*y*z + 8*x^3*y + 9*x^2*z + 27*x^2 -2*x*y^3*z + 8*x*y^3 - 12*y^2*z^2 + 99*y^2*z - 195*y^2 -36*x*y*z + 24*z^2 + 18*z] |
| | 2370 | [ 2*x^3*y*z + 8*x^3*y + 9*x^2*z + 27*x^2 -2*x*y^3*z + 8*x*y^3 - 12*y^2*z^2 + 99*y^2*z - 195*y^2 -36*x*y*z + 24*z^2 + 18*z] |
| | 2371 | [ x^4*z + 4*x^4 -x^2*y^2*z + 4*x^2*y^2 - 4*x*y*z^2 + 32*x*y*z - 6*z^3 - 64*x*y + 66*z^2 - 240*z + 288 0] |
| | 2372 | [x^3*y^2*z + 4*x^3*y^2 + 18*x^2*y*z - 36*x*z^3 + 66*x^2*y - 432*x*z^2 - 1656*x*z - 2052*x -x*y^4*z + 4*x*y^4 - 8*y^3*z^2 + 62*y^3*z - 114*y^3 48*y*z^2 - 36*y*z] |
| | 2373 | |
| | 2374 | sage: M*G |
| | 2375 | (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) |
| 2347 | 2376 | |
| 2348 | 2377 | ALGORITHM: Uses Singular's syz command |
| 2349 | 2378 | """ |
| … |
… |
|
| 2360 | 2389 | return self.__call_singular('res', length) |
| 2361 | 2390 | |
| 2362 | 2391 | |
| 2363 | | class MPolynomialIdeal( MPolynomialIdeal_singular_commutative_repr, \ |
| | 2392 | class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \ |
| 2364 | 2393 | MPolynomialIdeal_macaulay2_repr, \ |
| 2365 | 2394 | MPolynomialIdeal_magma_repr, \ |
| 2366 | 2395 | Ideal_generic ): |