# Divisors

A divisor $D$ on a Mori dream space $X$ is modeled by the integral vector $a=(a_1, \dots, a_r)$ such that $D = a_1 D^1_X + ... + a_r D^r_X$, where $D^i_X$ are the restrictions of the torus invariant prime divisors of the canonical toric ambient variety. For divisors on $\mathbb{C}^*$-surfaces, double index notation can be used for the coefficients.

## Constuctors

CStarSurfaces.mori_dream_space_divisorMethod
mori_dream_space_divisor(X :: T, coeffs :: Vector{S})

Construct a divisor on a Mori Dream Space as a linear combination of the (restrictions of) the torus invariant prime divisors of the canonical toric ambient variety.

Example

julia> X = cstar_surface([[3, 1], [3], [2]], [[2, 1], [1], [1]], :ee)
C-star surface of type (e-e)

julia> D = cstar_surface_divisor(X, [0, 1, -1, 3])
CStarSurfaceDivisor{EE}(C-star surface of type (e-e), [0, 1, -1, 3], #undef)

julia> coefficients(D)
4-element Vector{Int64}:
0
1
-1
3
CStarSurfaces.cstar_surface_divisorMethod
cstar_surface_divisor(X :: CStarSurface{EE}, coeffs :: DoubleVector{<:IntegerUnion})

Construct a divisor on a $\mathbb{C}^*$-surface of type (e-e) as a linear combination of the invariant prime divisors $D^{ij}_X$. The coefficients are given in double index notation.

CStarSurfaces.cstar_surface_divisorMethod
cstar_surface_divisor(X :: CStarSurface{PE}, coeffs :: DoubleVector{T}, coeff_plus :: T) where {T <: IntegerUnion}

Construct a divisor on a $\mathbb{C}^*$-surface of type (p-e) as a linear combination of the invariant prime divisors $D^{ij}_X$ and $D^+_X$. The coefficients are given in double index notation.

CStarSurfaces.cstar_surface_divisorMethod
cstar_surface_divisor(X :: CStarSurface{EP}, coeffs :: DoubleVector{T}, coeff_minus :: T) where {T <: IntegerUnion}

Construct a divisor on a $\mathbb{C}^*$-surface of type (e-p) as a linear combination of the invariant prime divisors $D^{ij}_X$ and $D^-_X$. The coefficients are given in double index notation.

CStarSurfaces.cstar_surface_divisorMethod
cstar_surface_divisor(X :: CStarSurface{PP}, coeffs :: DoubleVector{T}, coeff_plus :: T, coeff_minus :: T) where {T <: IntegerUnion}

Construct a divisor on a $\mathbb{C}^*$-surface of type (p-p) as a linear combination of the invariant prime divisors $D^{ij}_X$ and $D^+_X, D^-_X$. The coefficients are given in double index notation.

CStarSurfaces.D_plusFunction
D_plus(X :: CStarSurface{<:Union{PE,PP}})

Return the parabolic fixed point curve $D^+$ of a $\mathbb{C}^*$-surface of type (p-e) or (p-p).

CStarSurfaces.D_minusFunction
D_minus(X :: CStarSurface{<:Union{EP,PP}})

Return the parabolic fixed point curve $D^-$ of a $\mathbb{C}^*$-surface of type (e-p) or (p-p).

CStarSurfaces.toric_surface_divisorMethod
toric_surface_divisor(X :: ToricSurface, coeffs :: Vector{S}) where {S <: IntegerUnion}

Construct a divisor on a toric surface as a linear combination of the the torus invariant prime divisors.

Example

julia> X = toric_surface([[1,0], [0,1], [-1,-5], [0,-1]])
Normal toric surface

julia> D = toric_surface_divisor(X, [1, 2, -1, 5])
ToricSurfaceDivisor(Normal toric surface, [1, 2, -1, 5], #undef)

julia> coefficients(D)
4-element Vector{Int64}:
1
2
-1
5

## (Anti)canonical divisor

Hecke.canonical_divisorMethod
canonical_divisor(X :: MoriDreamSpace)

Return the canonical divisor of a Mori Dream Space.

Example

julia> X = cstar_surface([[1, 1], [2], [2]], [[0, -2], [1], [1]], :ee)
C-star surface of type (e-e)

julia> coefficients(canonical_divisor(X))
4-element Vector{Int64}:
0
0
-1
-1
Oscar.anticanonical_divisorMethod
anticanonical_divisor(X :: MoriDreamSpace)

Return the anticanonical divisor of a Mori Dream Space.

Example

julia> X = cstar_surface([[1, 1], [2], [2]], [[0, -2], [1], [1]], :ee)
C-star surface of type (e-e)

julia> coefficients(anticanonical_divisor(X))
4-element Vector{Int64}:
0
0
1
1
Oscar.canonical_divisor_classMethod
canonical_divisor_class(X :: MoriDreamSpace)

Return the canonical divisor class of a Mori Dream Space.

Example

julia> X = cstar_surface([[1, 1], [2], [2]], [[0, -2], [1], [1]], :ee)
C-star surface of type (e-e)

julia> divisor_class(canonical_divisor_class(X))
Element of
GrpAb: Z/4 x Z
with components [0 -2]
Oscar.anticanonical_divisor_classMethod
anticanonical_divisor_class(X :: MoriDreamSpace)

Return the anticanonical divisor class of a Mori Dream Space.

Example

julia> X = cstar_surface([[1, 1], [2], [2]], [[0, -2], [1], [1]], :ee)
C-star surface of type (e-e)

julia> divisor_class(anticanonical_divisor_class(X))
Element of
GrpAb: Z/4 x Z
with components [0 2]

## Attributes

Oscar.coefficientsMethod
coefficients(d :: MoriDreamSpaceDivisor)

Return the coefficients of a divisor on a Mori Dream Space.

Oscar.toric_divisorMethod
toric_divisor(d :: MoriDreamSpaceDivisor)

Return the toric divisor on the canonical toric ambient variety associated to a divisor on a Mori Dream Space.

Nemo.is_primeMethod
is_prime(d :: MoriDreamSpaceDivisor{T}) where {T <: MoriDreamSpace}

Check whether a given divisor is a prime divisor.

Example

julia> X = cstar_surface([[3, 1], [3], [2]], [[-2, -1], [1], [1]], :ee)
C-star surface of type (e-e)

julia> is_prime(invariant_divisor(X, 0, 1))
true

## Intersection numbers

Base.:*Method
Base.:*(d1 :: SurfaceWithTorusActionDivisor, d2 :: SurfaceWithTorusActionDivisor)

Return the intersection number of two divisors on a surface with torus action. The divisors have to be defined on the same variety.

Example

julia> X = cstar_surface([[3, 1], [3], [2]], [[-2, -1], [1], [1]], :ee)
C-star surface of type (e-e)

julia> D = cstar_surface_divisor(X, [1, 0, 2, -1])
CStarSurfaceDivisor{EE}(C-star surface of type (e-e), [1, 0, 2, -1], #undef)

julia> D * D
4//3

## Contraction

CStarSurfaces.contract_prime_divisorMethod
contract_prime_divisor(d :: CStarSurfaceDivisor{T}) where {T <: CStarSurfaceCase}

Contract the given prime divisor and return the resulting $\mathbb{C}^*$-surface. This amounts to deleting the associated ray from the generator matrix.

Example

julia> X = cstar_surface([[3, 1], [3], [2]], [[-2, -1], [1], [1]], :ep)
C-star surface of type (e-p)

julia> contract_prime_divisor(D_minus(X))
C-star surface of type (e-e)