# divisor arithmetic -- perform arithmetic on toric divisors

## Synopsis

• Usage:
D1 + D2
D1 - D2
- D2
m * D1
• Inputs:
• Outputs:
• , that is obtained via the specific operation

The set of torus-invariant Weil divisors forms an abelian group under addition. The basic operations arising from this structure, including addition, subtraction, negation, and scalar multiplication by integers, are available.

We illustrate a few of the possibilities on one variety.

 i1 : X = normalToricVariety(id_(ZZ^3) | -id_(ZZ^3)); i2 : # rays X o2 = 8 i3 : D = toricDivisor({2,-7,3,0,7,5,8,-8}, X) 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 : K = toricDivisor X o4 = - X - X - X - X - X - X - X - X 0 1 2 3 4 5 6 7 o4 : ToricDivisor on X i5 : D + K o5 = X - 8*X + 2*X - X + 6*X + 4*X + 7*X - 9*X 0 1 2 3 4 5 6 7 o5 : ToricDivisor on X i6 : assert(D + K == K + D) i7 : D - K o7 = 3*X - 6*X + 4*X + X + 8*X + 6*X + 9*X - 7*X 0 1 2 3 4 5 6 7 o7 : ToricDivisor on X i8 : assert(D - K == -(K-D)) i9 : - K o9 = X + X + X + X + X + X + X + X 0 1 2 3 4 5 6 7 o9 : ToricDivisor on X i10 : assert(-K == (-1)*K) i11 : 7*D o11 = 14*X - 49*X + 21*X + 49*X + 35*X + 56*X - 56*X 0 1 2 4 5 6 7 o11 : ToricDivisor on X i12 : assert(7*D == (3+4)*D) i13 : assert(7*D == 3*D + 4*D) i14 : -3*D + 7*K o14 = - 13*X + 14*X - 16*X - 7*X - 28*X - 22*X - 31*X + 17*X 0 1 2 3 4 5 6 7 o14 : ToricDivisor on X i15 : assert(-3*D+7*K == (-2*D+8*K) + (-D-K))