


![[top]](top.gif)
toDual(d,f) -- given a 1 by n matrix f over a polynomial ring R and an integer d such that the d-th power of each variable is in the image of f, computes Hom(R/image f, E), where E is the injective envelope of the coefficient field of R.
This function mimics the script <l_to_dual of Macaulay, and is probably going to be changed substantially.
See also:
Code:
-- ../../../Macaulay2/m2/duals.m2:15-21
toDual = (d, f) -> (
R := ring f;
g := product apply(generators R, v -> v^d);
box := matrix table (1, numgens R, (i,j) -> R_j^(d+1));
contract(
transpose mingens image (generators (image box : image f) % box),
matrix{{g}}))



![[top]](top.gif)