This function can be useful to find isomorphisms between modules (since if there is an isomorphism, a random map between them will be such an isomorphism), as well as writing the canonical module as an ideal (up to degree shift) in the ring.
We start with a simpler application: duplicating the work of the simpler function random(ZZ,Ideal). Here are two ways to get a random element of degree 4 in the ideal $I$.
i1 : S = ZZ/101[a..d]
o1 = S
o1 : PolynomialRing
|
i2 : I = monomialCurveIdeal(S, {2,5,9})
2 2 4 2 3 3 5 3 2
o2 = ideal (b c - a d, c - a*b*d , a*c - b d, b - a c )
o2 : Ideal of S
|
i3 : g = randomHomomorphism({4}, module I, S^1)
o3 = {3} | 24a-36b-30c-29d |
{4} | 19 |
{4} | 19 |
{5} | 0 |
o3 : Matrix
|
i4 : isWellDefined g
o4 = true
|
i5 : super g
o5 = | 24ab2c-36b3c-30b2c2+19ac3+19c4-24a3d+36a2bd-19b3d+30a2cd-29b2cd+29a2d2
------------------------------------------------------------------------
-19abd2 |
1 1
o5 : Matrix S <--- S
|
i6 : J = ideal image g
2 3 2 2 3 4 3 2 3
o6 = ideal(24a*b c - 36b c - 30b c + 19a*c + 19c - 24a d + 36a b*d - 19b d
------------------------------------------------------------------------
2 2 2 2 2
+ 30a c*d - 29b c*d + 29a d - 19a*b*d )
o6 : Ideal of S
|
i7 : random(4, I)
2 3 2 2 3 4 3 2 3
o7 = - 10a*b c - 29b c - 8b c - 24a*c - 29c + 10a d + 29a b*d + 24b d +
------------------------------------------------------------------------
2 2 2 2 2
8a c*d - 22b c*d + 22a d + 29a*b*d
o7 : S
|
i8 : R = S/I
o8 = R
o8 : QuotientRing
|
i9 : E = Ext^2(comodule I, S^{{-4}})
o9 = subquotient ({-1} | 0 0 0 d -c a |, {-1} | -bd -c a 0 |)
{-2} | c a 0 b2 0 0 | {-2} | -b3 a2 0 c |
{-2} | d 0 a 0 b2 0 | {-2} | -ac2 b2 0 d |
{-2} | 0 -d c 0 0 b2 | {-2} | -c3 -ad b2 0 |
4
o9 : S-module, subquotient of S
|
i10 : ER = E ** R
o10 = cokernel {-1} | 1 0 0 0 0 0 0 0 |
{-1} | 0 c a 0 0 b2 0 0 |
{-1} | 0 d 0 0 c2 0 0 b2 |
{0} | 0 0 0 0 b -a c 0 |
{0} | 0 0 1 0 0 0 d -a |
{0} | 0 0 0 1 0 0 0 0 |
6
o10 : R-module, quotient of R
|
i11 : isHomogeneous ER
o11 = true
|
i12 : f = randomHomomorphism(3, R^1, ER)
o12 = | 0 -39ad-16bd+38cd 39ac+16bc-38c2 -16c3-39b2d+38ad2 39a2d+16abd-38acd
-----------------------------------------------------------------------
0 |
o12 : Matrix
|
i13 : isWellDefined f
o13 = true
|
i14 : source f == ER
o14 = true
|
i15 : target f == R^1
o15 = true
|
i16 : degree f == {3}
o16 = true
|
i17 : ker f == 0
o17 = true
|
i18 : J = ideal image f
2 3 2
o18 = ideal (0, - 39a*d - 16b*d + 38c*d, 39a*c + 16b*c - 38c , - 16c - 39b d
-----------------------------------------------------------------------
2 2
+ 38a*d , 39a d + 16a*b*d - 38a*c*d, 0)
o18 : Ideal of R
|