When
H := Hom(M,N) is computed, enough information is stored in
H.cache.Hom to compute this correspondence.
i1 : R = QQ[x,y,z]/(y^2-x^3)
o1 = R
o1 : QuotientRing
|
i2 : H = Hom(ideal(x,y), R^1)
o2 = image {-1} | x y |
{-1} | y x2 |
2
o2 : R-module, submodule of R
|
i3 : g = homomorphism H_{1}
o3 = | y x2 |
o3 : Matrix
|
The homomorphism g takes x to y and y to x2. The source and target are what they should be.
i4 : source g
o4 = image | x y |
1
o4 : R-module, submodule of R
|
i5 : target g
1
o5 = R
o5 : R-module, free
|
After
pruning a Hom module, one cannot use homomorphism directly. Instead, first apply the pruning map:
i6 : H1 = prune H
o6 = cokernel | x2 -y |
| -y x |
2
o6 : R-module, quotient of R
|
i7 : homomorphism(H1.cache.pruningMap * H1_{1})
o7 = | y x2 |
o7 : Matrix
|
Sometime, one wants a random homomorphism of a given degree. Here is one method:
i8 : f = basis(3,H)
o8 = {0} | xy2 xyz xz2 y3 y2z yz2 z3 0 0 0 |
{1} | 0 0 0 0 0 0 0 y2 yz z2 |
o8 : Matrix
|
i9 : rand = random(R^(numgens source f), R^1)
o9 = | 2 |
| 1 |
| 4/9 |
| 9/7 |
| 2/9 |
| 5/8 |
| 1/6 |
| 1 |
| 5/3 |
| 5 |
10 1
o9 : Matrix R <--- R
|
i10 : h = homomorphism(f * rand)
o10 = | 2x2y2+9/7xy3+x2yz+2/9xy2z+4/9x2z2+5/8xyz2+1/6xz3+y3+5/3y2z+5yz2
-----------------------------------------------------------------------
x2y2+2xy3+9/7y4+5/3x2yz+xy2z+2/9y3z+5x2z2+4/9xyz2+5/8y2z2+1/6yz3 |
o10 : Matrix
|
i11 : source h
o11 = image | x y |
1
o11 : R-module, submodule of R
|
i12 : target h
1
o12 = R
o12 : R-module, free
|