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