I = embedAsIdeal(R, M, MTries=>n, IsGraded=>false)
L = embedAsIdeal(R, M, MTries=>n, IsGraded=>true)
L = embedAsIdeal(R, M, MTries=>n, ReturnMap=>true)
L = embedAsIdeal(R, M, MTries=>n, ReturnMap=>true, IsGraded=>true)
Tries to embed the module $M$ as an ideal in $R$. It will make several automatic tries followed by MTries => n attempts (the default n value is 10). 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
|
|
|
It also works for non-domains
|
|
|
|
|
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). The default value for the option IsGraded is false.
|
|
|
Next consider the ReturnMap option. What this does is also return the map from M to R^1 of which the map is based upon. Note that if both IsGraded and ReturnMap are enabled, then the map comes after the degree.
|
|
|
|
|
Alternately, instead of passing an ideal you can pass embedAsIdeal a Matrix, where the source is a free module of rank one and the target is the module you wish to embed. (This can also be accomplished by passing the same matrix via the Section option). In this case, the first output will be a ring element corresponding to the section.
|
|
|
|
|
The object embedAsIdeal is a method function with options.