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 |
| 7/10 |
| 1 |
| 2 |
| 1/2 |
| 1 |
| 6/5 |
| 1/2 |
| 2 |
| 4 |
10 1
o9 : Matrix R <--- R
|
i10 : h = homomorphism(f * rand)
o10 = | 2x2y2+2xy3+7/10x2yz+1/2xy2z+x2z2+xyz2+6/5xz3+1/2y3+2y2z+4yz2
-----------------------------------------------------------------------
1/2x2y2+2xy3+2y4+2x2yz+7/10xy2z+1/2y3z+4x2z2+xyz2+y2z2+6/5yz3 |
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
|