# ToricDivisor == ToricDivisor -- equality of toric divisors

## Synopsis

• Operator: ==
• Usage:
D1 == D2
• Inputs:
• D1, ,
• D2, ,
• Outputs:
• , that is true if the underlying varieties are equal and lists of coefficients are equal

## Description

Two torus-invariant Weil divisors are equal when their underlying normal toric varieties are equal and, for each irreducible torus-invariant divisor, the corresponding coefficients are equal.

 i1 : X = normalToricVariety(id_(ZZ^3) | -id_(ZZ^3)); i2 : D1 = toricDivisor({2,-7,3,0,7,5,8,-8}, X) o2 = 2*X - 7*X + 3*X + 7*X + 5*X + 8*X - 8*X 0 1 2 4 5 6 7 o2 : ToricDivisor on X i3 : D2 = 2 * X_0 - 7 * X_1 + 3 * X_2 + 7 * X_4 + 5 * X_5 + 8 * X_6 - 8 * X_7 o3 = 2*X - 7*X + 3*X + 7*X + 5*X + 8*X - 8*X 0 1 2 4 5 6 7 o3 : ToricDivisor on X i4 : D1 == D2 o4 = true i5 : D1 == - D2 o5 = false i6 : assert (D1 == D2 and D2 == D1 and D1 =!= - D2)

Since the group of torus-equivariant Weil divisors form an abelian group, it also makes sense to compare a toric divisor with the zero integer (which we identify with the toric divisor whose coefficients are equal to zero).

 i7 : D1 == 0 o7 = false i8 : 0*D1 == 0 o8 = true i9 : assert (D1 =!= 0 and 0*D1 == 0 and 0 == 0*D2)