Given a rank 1 reflexive module M, this finds a divisor D such that O(D) is isomorphic to M. If IsGraded is true (it is false by default) this assumes we are working on the Proj of the ambient ring.
i1 : R = QQ[x,y,z]/ideal(x^2-y*z) o1 = R o1 : QuotientRing |
i2 : M = (ideal(y*x,y*z))*R^1 o2 = image | xy yz | 1 o2 : R-module, submodule of R |
i3 : moduleToDivisor(M) o3 = -1*Div(z, x) of R o3 : WDiv |
i4 : moduleToDivisor(M, IsGraded=>true) o4 = -2*Div(z, x) + -1*Div(y, x) of R o4 : WDiv |