# coefficient(Ideal,BasicDivisor) -- get the coefficient of an ideal for a fixed divisor

## Synopsis

• Function: coefficient
• Usage:
coefficient(P, D)
• Inputs:
• P, an ideal, the height one prime ideal that we want to find the coefficient of
• D, an instance of the type BasicDivisor, the divisor in question
• Outputs:

## Description

This function returns the coefficient of $D$ along the prime divisor associated to $P$.

 i1 : R = QQ[x,y,u,v]/ideal(x*y-u*v); i2 : D = divisor(x) o2 = Div(v, x) + Div(u, x) o2 : WeilDivisor on R i3 : coefficient(ideal(x,u), D) o3 = 1 i4 : E = divisor(x*u) o4 = Div(v, x) + Div(u, y) + 2*Div(u, x) o4 : WeilDivisor on R i5 : coefficient(ideal(x,u), E) o5 = 2