Skip to content

Commit

Permalink
[ToricVarieties] Tabs to white space characters
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAround committed Sep 9, 2023
1 parent 6cde293 commit 7ef9e4d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 47 deletions.
18 changes: 11 additions & 7 deletions src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ function _proj_and_total_space(is_proj::Bool, E::Vector{T}) where T <: Union{Tor

@req all(i -> toric_variety(E[i]) == v, eachindex(E)) "The divisors are defined on different toric varieties."

PF_Pr = normal_fan(simplex(length(E) - 1))
l = rays(PF_Pr)
if is_proj
PF_fiber = normal_fan(simplex(length(E) - 1))
else
PF_fiber = polyhedral_fan(positive_hull(identity_matrix(ZZ, length(E))))
end
l = rays(PF_fiber)

modified_ray_gens = Dict{RayVector{QQFieldElem}, RayVector{QQFieldElem}}()

Expand All @@ -63,8 +67,8 @@ function _proj_and_total_space(is_proj::Bool, E::Vector{T}) where T <: Union{Tor

for a in 1:n_maximal_cones(v)
first = [row(ray_indices(maximal_cones(v)), a)...]
for b in eachindex(E)
second = [row(ray_indices(maximal_cones(PF_Pr)), b)...] .+ nrays(v)
for b in 1:n_maximal_cones(PF_fiber)
second = [row(ray_indices(maximal_cones(PF_fiber)), b)...] .+ nrays(v)
new_maximal_cones[index] = vcat(first, second)
index += 1
end
Expand Down Expand Up @@ -128,13 +132,13 @@ julia> degree(canonical_bundle(Y))
```
"""
function total_space(E::ToricLineBundle...)
return _proj_and_total_space(false, [E...])
return _proj_and_total_space(false, [E...])
end

function total_space(E::ToricDivisor...)
return _proj_and_total_space(false, [E...])
return _proj_and_total_space(false, [E...])
end

function total_space()
@req false "The direct sum is empty."
@req false "The direct sum is empty."
end
78 changes: 38 additions & 40 deletions test/AlgebraicGeometry/ToricVarieties/proj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,48 +76,46 @@ end

@testset "Total space of direct sum of line bundles on toric space (set_attributes = $set_attributes)" for set_attributes in [true, false]

@testset "Test that some vb on P1 are Calabi-Yau" begin
P1 = projective_space(NormalToricVariety, 1; set_attributes)
for a in 0:5
for b in 0:5
la = toric_line_bundle(P1, [a])
lb = toric_line_bundle(P1, [-b])
X = total_space(la, lb)
@test is_smooth(X) == true
@test !is_fano(X)
@test !is_complete(X)
@test rank(picard_group(X)) == 1
@test dim(X) == 3
@test (degree(canonical_bundle(X)) == 0) == (a - b == -2)
end
end
end
@testset "Test that some vb on P1 are Calabi-Yau" begin
P1 = projective_space(NormalToricVariety, 1; set_attributes)
for a in 0:5, b in 0:5
la = toric_line_bundle(P1, [a])
lb = toric_line_bundle(P1, [-b])
X = total_space(la, lb)
@test is_smooth(X) == true
@test !is_fano(X)
@test !is_complete(X)
@test rank(picard_group(X)) == 1
@test dim(X) == 3
@test (degree(canonical_bundle(X)) == 0) == (a - b == -2)
end
end

@testset "Test that omega_S is Calabi-Yau for any S smooth surface" begin
@testset "S is Hirzebruch" begin
for a in 0:10
S = hirzebruch_surface(NormalToricVariety, a; set_attributes)
X = total_space(canonical_bundle(S))
@test is_smooth(X) == true
@test !is_fano(X)
@testset "Test that omega_S is Calabi-Yau for any S smooth surface" begin
@testset "S is Hirzebruch" begin
for a in 0:10
S = hirzebruch_surface(NormalToricVariety, a; set_attributes)
X = total_space(canonical_bundle(S))
@test is_smooth(X) == true
@test !is_fano(X)
@test !is_complete(X)
@test rank(picard_group(X)) == rank(picard_group(S))
@test dim(X) == 3
@test degree(canonical_bundle(X)) == 0
end
end
@test rank(picard_group(X)) == rank(picard_group(S))
@test dim(X) == 3
@test degree(canonical_bundle(X)) == 0
end
end

@testset "S is del Pezzo" begin
for a in 0:3
S = del_pezzo_surface(NormalToricVariety, a; set_attributes)
X = total_space(canonical_divisor(S))
@test is_smooth(X) == true
@test !is_fano(X)
@test rank(picard_group(X)) == rank(picard_group(S))
@test dim(X) == 3
@test degree(canonical_bundle(X)) == 0
end
end
end
@testset "S is del Pezzo" begin
for a in 0:3
S = del_pezzo_surface(NormalToricVariety, a; set_attributes)
X = total_space(canonical_divisor(S))
@test is_smooth(X) == true
@test !is_fano(X)
@test rank(picard_group(X)) == rank(picard_group(S))
@test dim(X) == 3
@test degree(canonical_bundle(X)) == 0
end
end
end

end

0 comments on commit 7ef9e4d

Please sign in to comment.