Skip to content

Commit

Permalink
Fix bug "cannot assign value to Oscar variable rays"
Browse files Browse the repository at this point in the history
Rename "rays" to "fan_rays"
  • Loading branch information
HereAround committed Dec 24, 2021
1 parent 77aed33 commit 4f43fa4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/ToricVarieties/NormalToricVarieties/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ function map_from_cartier_divisor_group_to_torus_invariant_divisor_group(v::Abst
throw(ArgumentError("Group of the torus-invariant Cartier divisors can only be computed if the variety has no torus factor."))
end

# identify rays and cones
rays = Polymake.common.primitive(pm_object(v).RAYS)
# identify fan_rays and cones
fan_rays = Polymake.common.primitive(pm_object(v).RAYS)
max_cones = ray_incidences(maximal_cones(fan(v)))
number_of_rays = size(rays)[1]
number_of_rays = size(fan_rays)[1]
number_of_cones = size(max_cones)[1]

# compute quantities needed to construct the matrices
Expand All @@ -384,7 +384,7 @@ function map_from_cartier_divisor_group_to_torus_invariant_divisor_group(v::Abst
col = 1
for i in 1:number_of_rays
for j in cones_ray_is_part_of[i]
map_for_scalar_products[(j-1)*rc+1:j*rc, col] = [fmpz(c) for c in rays[i,:]]
map_for_scalar_products[(j-1)*rc+1:j*rc, col] = [fmpz(c) for c in fan_rays[i,:]]
col += 1
end
end
Expand All @@ -404,7 +404,7 @@ function map_from_cartier_divisor_group_to_torus_invariant_divisor_group(v::Abst
# compute the matrix for mapping to torusinvariant Weil divisors
map_to_weil_divisors = zero_matrix(ZZ, number_of_cones * rc, rank(torusinvariant_divisor_group(v)))
for i in 1:number_of_rays
map_to_weil_divisors[(cones_ray_is_part_of[i][1]-1)*rc+1:cones_ray_is_part_of[i][1]*rc, i] = [fmpz(-c) for c in rays[i,:]]
map_to_weil_divisors[(cones_ray_is_part_of[i][1]-1)*rc+1:cones_ray_is_part_of[i][1]*rc, i] = [fmpz(-c) for c in fan_rays[i,:]]
end

# compute the total map
Expand Down
12 changes: 6 additions & 6 deletions src/ToricVarieties/NormalToricVarieties/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ A normal, non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano, 2-
"""
function hirzebruch_surface(r::Int)
# construct the variety
rays = [1 0; 0 1; -1 r; 0 -1]
fan_rays = [1 0; 0 1; -1 r; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
variety = NormalToricVariety(PolyhedralFan(rays, cones))
variety = NormalToricVariety(PolyhedralFan(fan_rays, cones))

# set properties
set_attribute!(variety, :isaffine, false)
Expand Down Expand Up @@ -316,18 +316,18 @@ function del_pezzo(b::Int)

# construct the "true" toric del Pezzo surfaces
if b == 1
rays = [1 0; 0 1; -1 0; -1 -1]
fan_rays = [1 0; 0 1; -1 0; -1 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
end
if b == 2
rays = [1 0; 0 1; -1 0; -1 -1; 0 -1]
fan_rays = [1 0; 0 1; -1 0; -1 -1; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,1]])
end
if b == 3
rays = [1 0; 1 1; 0 1; -1 0; -1 -1; 0 -1]
fan_rays = [1 0; 1 1; 0 1; -1 0; -1 -1; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]])
end
variety = NormalToricVariety(PolyhedralFan(rays, cones))
variety = NormalToricVariety(PolyhedralFan(fan_rays, cones))

# set properties
set_attribute!(variety, :isaffine, false)
Expand Down
24 changes: 12 additions & 12 deletions test/ToricVarieties/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ P2 = NormalToricVariety(normal_fan(Oscar.simplex(2)))
@test length(irrelevant_ideal(P2).gens) == 3
end

rays = [1 0; 0 1; -1 5; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
H5 = NormalToricVariety(PolyhedralFan(rays, cones))
fan_rays = [1 0; 0 1; -1 5; 0 -1]
fan_cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
H5 = NormalToricVariety(PolyhedralFan(fan_rays, fan_cones))

@testset "Hirzebruch surface" begin
@test isnormal(H5) == true
Expand Down Expand Up @@ -116,17 +116,17 @@ end

dP0 = NormalToricVariety(normal_fan(Oscar.simplex(2)))

rays = [1 0; 0 1; -1 0; -1 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
dP1 = NormalToricVariety(PolyhedralFan(rays, cones))
fan_rays = [1 0; 0 1; -1 0; -1 -1]
fan_cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,1]])
dP1 = NormalToricVariety(PolyhedralFan(fan_rays, fan_cones))

rays = [1 0; 0 1; -1 0; -1 -1; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,1]])
dP2 = NormalToricVariety(PolyhedralFan(rays, cones))
fan_rays = [1 0; 0 1; -1 0; -1 -1; 0 -1]
fan_cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,1]])
dP2 = NormalToricVariety(PolyhedralFan(fan_rays, fan_cones))

rays = [1 0; 1 1; 0 1; -1 0; -1 -1; 0 -1]
cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]])
dP3 = NormalToricVariety(PolyhedralFan(rays, cones))
fan_rays = [1 0; 1 1; 0 1; -1 0; -1 -1; 0 -1]
fan_cones = IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]])
dP3 = NormalToricVariety(PolyhedralFan(fan_rays, fan_cones))

@testset "delPezzo surfaces" begin
@test_throws ArgumentError del_pezzo(-1)
Expand Down

0 comments on commit 4f43fa4

Please sign in to comment.