From 4f43fa456953a914db7cbf882b3969b6e3a67870 Mon Sep 17 00:00:00 2001 From: Martin Bies Date: Fri, 24 Dec 2021 00:39:24 +0100 Subject: [PATCH] Fix bug "cannot assign value to Oscar variable rays" Rename "rays" to "fan_rays" --- .../NormalToricVarieties/attributes.jl | 10 ++++---- .../NormalToricVarieties/constructors.jl | 12 +++++----- test/ToricVarieties/runtests.jl | 24 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ToricVarieties/NormalToricVarieties/attributes.jl b/src/ToricVarieties/NormalToricVarieties/attributes.jl index f5a38b4b4b03..d77a04bcda8e 100644 --- a/src/ToricVarieties/NormalToricVarieties/attributes.jl +++ b/src/ToricVarieties/NormalToricVarieties/attributes.jl @@ -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 @@ -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 @@ -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 diff --git a/src/ToricVarieties/NormalToricVarieties/constructors.jl b/src/ToricVarieties/NormalToricVarieties/constructors.jl index 4e65301fc344..97e81e7f3394 100644 --- a/src/ToricVarieties/NormalToricVarieties/constructors.jl +++ b/src/ToricVarieties/NormalToricVarieties/constructors.jl @@ -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) @@ -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) diff --git a/test/ToricVarieties/runtests.jl b/test/ToricVarieties/runtests.jl index cbab7608611e..54c01786cc25 100644 --- a/test/ToricVarieties/runtests.jl +++ b/test/ToricVarieties/runtests.jl @@ -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 @@ -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)