next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Divisor :: moduleToIdeal

moduleToIdeal -- Turn a module to an ideal of a ring

Synopsis

Description

Tries to embed the module as an ideal in R. It will make several automatic tries followed by MTries=>n (the default n value is 10). If IsGraded is set to true, then it returns a list, the first entry denoting the ideal, the second denoting the degree shift (the default value for the option IsGraded is false). Parts of this function were based on code originally written in the Macaulay2 Divisor tutorial and also based on code by Mordechai Katzman, see the canonicalIdeal function in http://katzman.staff.shef.ac.uk/FSplitting/ParameterTestIdeals.m2

i1 : R = QQ[x,y]

o1 = R

o1 : PolynomialRing
i2 : M = (ideal(x^2,x*y))*R^1

o2 = image | x2 xy |

                             1
o2 : R-module, submodule of R
i3 : moduleToIdeal(M)

o3 = ideal (y, x)

o3 : Ideal of R

It also works for non-domains

i4 : R = QQ[x,y]/ideal(x*y);
i5 : M = (ideal(x^3, y^5))*R^1;
i6 : moduleToIdeal(M)

o6 = ideal (y, x)

o6 : Ideal of R
i7 : N = (ideal(x,y))*R^1;
i8 : moduleToIdeal(N)

o8 = ideal (y, x)

o8 : Ideal of R

Note that the answer is right even if you don’t recognize it at first. Next, consider the IsGraded option. If this is set to true, then the system returns the degree as well (as you can see in the example below).

i9 : R = QQ[x,y];
i10 : M = R^{-3};
i11 : moduleToIdeal(M, IsGraded=>true)

o11 = {ideal 1, {-3}}

o11 : List

In conclusion, we consider the ReturnMap option. What this does is also return the map from M to R1 of which the map is based upon. Note that if both IsGraded and ReturnMap are enabled, then the map comes after the degree.

i12 : R = QQ[x,y];
i13 : M = ideal(x^2, x*y)*R^1;
i14 : L = moduleToIdeal(M, ReturnMap=>true)

o14 = {ideal (y, x), | x y |}

o14 : List
i15 : target L#1

       1
o15 = R

o15 : R-module, free
i16 : source L#1

o16 = image | x2 xy |

                              1
o16 : R-module, submodule of R

See also

Ways to use moduleToIdeal :