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$.
|
|
|
|
|
|
|
One important application of this function is to find an isomorphism of the canonical module of $R = S/I$ with an ideal $J \subset R$, up to a degree twist. See doubling for a function which uses this method.
|
|
|
|
|
|
|
|
|
|
|
The object randomHomomorphism is a method function.