diff --git a/Project.toml b/Project.toml index 62644e446997..e02df96a9029 100644 --- a/Project.toml +++ b/Project.toml @@ -31,7 +31,7 @@ AlgebraicSolving = "0.4.11" Distributed = "1.6" DocStringExtensions = "0.8, 0.9" GAP = "0.10.2" -Hecke = "0.29.0" +Hecke = "0.30.0" JSON = "^0.20, ^0.21" JSON3 = "1.13.2" LazyArtifacts = "1.6" diff --git a/experimental/FTheoryTools/src/auxiliary.jl b/experimental/FTheoryTools/src/auxiliary.jl index a11ee072b3a9..127c3601715a 100644 --- a/experimental/FTheoryTools/src/auxiliary.jl +++ b/experimental/FTheoryTools/src/auxiliary.jl @@ -35,10 +35,10 @@ function _ambient_space(base::NormalToricVariety, fiber_amb_space::NormalToricVa # Compute divisor group and the class group of a_space a_space_divisor_group = free_abelian_group(nrows(a_rays)) - a_space_class_group = free_abelian_group(ncols(b_grades) + rank(class_group(fiber_amb_space))) + a_space_class_group = free_abelian_group(ncols(b_grades) + torsion_free_rank(class_group(fiber_amb_space))) # Compute grading of Cox ring of a_space - a_space_grading = zero_matrix(ZZ, rank(a_space_divisor_group), rank(a_space_class_group)) + a_space_grading = zero_matrix(ZZ, torsion_free_rank(a_space_divisor_group), torsion_free_rank(a_space_class_group)) a_space_grading[1:nrows(b_grades), 1:ncols(b_grades)] = b_grades a_space_grading[1+nrows(b_rays):nrows(b_rays) + nrows(f_grades), 1+ncols(b_grades):ncols(b_grades) + ncols(f_grades)] = f_grades a_space_grading[1+nrows(b_rays), 1:ncols(D1_coeffs)] = D1_coeffs diff --git a/experimental/GModule/Cohomology.jl b/experimental/GModule/Cohomology.jl index 183f4d1b6707..5111d967f340 100644 --- a/experimental/GModule/Cohomology.jl +++ b/experimental/GModule/Cohomology.jl @@ -474,7 +474,10 @@ export action, cohomology_group, extension, pc_group_with_isomorphism export induce, is_consistent, istwo_cocycle, all_extensions export split_extension, extension_with_abelian_kernel -Oscar.dim(C::GModule) = rank(C.M) +_rank(M::FinGenAbGroup) = torsion_free_rank(M) +_rank(M) = rank(M) + +Oscar.dim(C::GModule) = _rank(C.M) Oscar.base_ring(C::GModule) = base_ring(C.M) Oscar.group(C::GModule) = C.G diff --git a/experimental/GModule/GaloisCohomology.jl b/experimental/GModule/GaloisCohomology.jl index 7a8e8e928798..13d5891c181e 100644 --- a/experimental/GModule/GaloisCohomology.jl +++ b/experimental/GModule/GaloisCohomology.jl @@ -542,7 +542,7 @@ Follows Debeerst rather closely... function debeerst(M::FinGenAbGroup, sigma::Map{FinGenAbGroup, FinGenAbGroup}) @assert domain(sigma) == codomain(sigma) == M @assert all(x->sigma(sigma(x)) == x, gens(M)) - @assert is_free(M) && rank(M) == ngens(M) + @assert is_free(M) && torsion_free_rank(M) == ngens(M) K, mK = kernel(id_hom(M)+sigma) fl, mX = has_complement(mK) @@ -557,8 +557,8 @@ function debeerst(M::FinGenAbGroup, sigma::Map{FinGenAbGroup, FinGenAbGroup}) _K, _mK = snf(K) _S, _mS = snf(S) - @assert is_trivial(_S) || rank(_S) == ngens(_S) - @assert rank(_K) == ngens(_K) + @assert is_trivial(_S) || torsion_free_rank(_S) == ngens(_S) + @assert torsion_free_rank(_K) == ngens(_K) m = matrix(FinGenAbGroupHom(_mS * mSK * inv((_mK)))) # elt in S * m = elt in K @@ -1912,7 +1912,7 @@ function shrink(C::GModule{PermGroup, FinGenAbGroup}, attempts::Int = 10) o = Oscar.orbit(q, rand(gens(q.M))) if length(o) == order(group(q)) s, ms = sub(q.M, collect(o), false) - if rank(s) == length(o) + if torsion_free_rank(s) == length(o) q, _mq = quo(q, ms, false) if first mq = _mq diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl index 515b816b5f58..f60dfe25bdf2 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl @@ -198,7 +198,7 @@ julia> coordinate_names(antv) ``` """ @attr Vector{String} function coordinate_names(v::NormalToricVarietyType) - return ["x$(i)" for i in 1:rank(torusinvariant_weil_divisor_group(v))] + return ["x$(i)" for i in 1:torsion_free_rank(torusinvariant_weil_divisor_group(v))] end @@ -679,8 +679,8 @@ julia> torusinvariant_prime_divisors(p2) @attr Vector{ToricDivisor} function torusinvariant_prime_divisors(v::NormalToricVarietyType) ti_divisors = torusinvariant_weil_divisor_group(v) prime_divisors = ToricDivisor[] - for i in 1:rank(ti_divisors) - coeffs = zeros(Int, rank(ti_divisors)) + for i in 1:torsion_free_rank(ti_divisors) + coeffs = zeros(Int, torsion_free_rank(ti_divisors)) coeffs[i] = 1 push!(prime_divisors, toric_divisor(v, coeffs)) end @@ -756,7 +756,7 @@ Map number_of_cones = size(max_cones)[1] # compute quantities needed to construct the matrices - rc = rank(character_lattice(v)) + rc = torsion_free_rank(character_lattice(v)) number_ray_is_part_of_max_cones = [length(max_cones[:, k].s) for k in 1:number_of_rays] s = sum(number_ray_is_part_of_max_cones) cones_ray_is_part_of = [filter(x -> max_cones[x, r], 1:number_of_cones) for r in 1:number_of_rays] @@ -784,7 +784,7 @@ Map end # compute the matrix for mapping to torusinvariant Weil divisors - map_to_weil_divisors = zero_matrix(ZZ, number_of_cones * rc, rank(torusinvariant_weil_divisor_group(v))) + map_to_weil_divisors = zero_matrix(ZZ, number_of_cones * rc, torsion_free_rank(torusinvariant_weil_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] = [ZZRingElem(-c) for c in fan_rays[:, i]] end diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/properties.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/properties.jl index 99582ec6ce76..5ff27f7096bc 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/properties.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/properties.jl @@ -68,7 +68,7 @@ true if is_projective(v) == false return false end - if rank(class_group(v)) > 1 + if torsion_free_rank(class_group(v)) > 1 return false end w = [[Int(x) for x in transpose(g.coeff)] for g in gens(class_group(v))] diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricDivisors/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/ToricDivisors/constructors.jl index b6f80358aa1d..1c90960f5540 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricDivisors/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricDivisors/constructors.jl @@ -68,7 +68,7 @@ Torus-invariant, non-prime divisor on a normal toric variety ``` """ function divisor_of_character(v::NormalToricVarietyType, character::Vector{T}) where {T <: IntegerUnion} - r = rank(character_lattice(v)) + r = torsion_free_rank(character_lattice(v)) @req length(character) == r "Character must consist of $r integers" f = map_from_character_lattice_to_torusinvariant_weil_divisor_group(v) char = sum(character .* gens(domain(f))) diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl index f9fcd02bec27..04694ec3b961 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/attributes.jl @@ -73,7 +73,7 @@ Map cod = codomain(tm) cod_rays = matrix(ZZ, rays(cod)) images = matrix(ZZ, rays(d)) * matrix(grid_morphism(tm)) - mapping_matrix = matrix(ZZ, zeros(ZZ, rank(torusinvariant_weil_divisor_group(cod)), 0)) + mapping_matrix = matrix(ZZ, zeros(ZZ, torsion_free_rank(torusinvariant_weil_divisor_group(cod)), 0)) for i in 1:nrows(images) v = [images[i,k] for k in 1:ncols(images)] j = findfirst(x -> x == true, [(v in maximal_cones(cod)[j]) for j in 1:n_maximal_cones(cod)]) diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/constructors.jl index b679f8db0867..d1b84870a325 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/constructors.jl @@ -109,10 +109,10 @@ function toric_morphism(domain::NormalToricVarietyType, grid_morphism::FinGenAbG @req (nrows(matrix(grid_morphism)) > 0 && ncols(matrix(grid_morphism)) > 0) "The mapping matrix must not be empty" # check for a well-defined map - @req nrows(matrix(grid_morphism)) == rank(character_lattice(domain)) "The number of rows of the mapping matrix must match the rank of the character lattice of the domain toric variety" + @req nrows(matrix(grid_morphism)) == torsion_free_rank(character_lattice(domain)) "The number of rows of the mapping matrix must match the rank of the character lattice of the domain toric variety" # compute the morphism - @req ncols(matrix(grid_morphism)) == rank(character_lattice(codomain)) "The number of columns of the mapping matrix must match the rank of the character lattice of the codomain toric variety" + @req ncols(matrix(grid_morphism)) == torsion_free_rank(character_lattice(codomain)) "The number of columns of the mapping matrix must match the rank of the character lattice of the codomain toric variety" if check codomain_cones = maximal_cones(codomain) image_cones = [positive_hull(matrix(ZZ, rays(c)) * matrix(grid_morphism)) for c in maximal_cones(domain)] @@ -144,7 +144,7 @@ Toric morphism ``` """ function toric_identity_morphism(variety::NormalToricVarietyType) - r = rank(character_lattice(variety)) + r = torsion_free_rank(character_lattice(variety)) identity_matrix = matrix(ZZ, [[if i==j 1 else 0 end for j in 1:r] for i in 1:r]) grid_morphism = hom(character_lattice(variety), character_lattice(variety), identity_matrix) return ToricMorphism(variety, grid_morphism, variety) diff --git a/src/AlgebraicGeometry/ToricVarieties/cohomCalg/VanishingSets/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/cohomCalg/VanishingSets/constructors.jl index 35fd82e0a001..5dc2de519646 100644 --- a/src/AlgebraicGeometry/ToricVarieties/cohomCalg/VanishingSets/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/cohomCalg/VanishingSets/constructors.jl @@ -7,7 +7,7 @@ ps::Vector{Polyhedron{QQFieldElem}} cis::Vector{Int} function ToricVanishingSet(toric_variety::NormalToricVarietyType, ps::Vector{Polyhedron{QQFieldElem}}, cis::Vector{Int}) - if !all(p -> ambient_dim(p) == rank(picard_group(toric_variety)), ps) + if !all(p -> ambient_dim(p) == torsion_free_rank(picard_group(toric_variety)), ps) throw(ArgumentError("The ambient dimensions of the polyhedra must match the rank as the picard group of the toric variety")) end if !all(i -> 0 <= i <= dim(toric_variety), cis) diff --git a/src/AlgebraicGeometry/ToricVarieties/cohomCalg/auxiliary.jl b/src/AlgebraicGeometry/ToricVarieties/cohomCalg/auxiliary.jl index 9e65f0d505e7..ab3efcfb6f2b 100644 --- a/src/AlgebraicGeometry/ToricVarieties/cohomCalg/auxiliary.jl +++ b/src/AlgebraicGeometry/ToricVarieties/cohomCalg/auxiliary.jl @@ -29,7 +29,7 @@ function command_string(v::NormalToricVarietyType, c::Vector{ZZRingElem}) # Join and return return join(string_list, ";") end -command_string(v::NormalToricVarietyType) = command_string(v, [ZZRingElem(0) for i in 1:rank(picard_group(v))]) +command_string(v::NormalToricVarietyType) = command_string(v, [ZZRingElem(0) for i in 1:torsion_free_rank(picard_group(v))]) diff --git a/src/Modules/ModulesGraded.jl b/src/Modules/ModulesGraded.jl index f11731edbbd0..a7d257e9eb96 100644 --- a/src/Modules/ModulesGraded.jl +++ b/src/Modules/ModulesGraded.jl @@ -3077,8 +3077,7 @@ end function _regularity_bound(M::SubquoModule) @assert is_graded(M) "module must be graded" S = base_ring(M) - G = grading_group(S) - @assert is_free(G) && isone(rank(G)) "base ring must be ZZ-graded" + @assert is_z_graded(S) "base ring must be ZZ-graded" @assert all(x->degree(Int, x; check=false) >= 0, gens(S)) "base ring variables must be non-negatively graded" res = free_resolution(M) result = maximum((x->degree(Int, x; check=false)).(gens(res[0]))) diff --git a/src/Rings/mpoly-graded.jl b/src/Rings/mpoly-graded.jl index a779894feaec..479f1d0ae0a0 100644 --- a/src/Rings/mpoly-graded.jl +++ b/src/Rings/mpoly-graded.jl @@ -231,7 +231,8 @@ is_standard_graded(::MPolyRing) = false Return `true` if `R` is $\mathbb Z$-graded, `false` otherwise. !!! note - Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z$-graded if `is_free(G) && ngens(G) == rank(G) == 1` evaluates to `true`. + Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z$-graded if + `G` is free abelian of rank `1`, and `ngens(G) == 1`. # Examples ```jldoctest @@ -245,7 +246,7 @@ true function is_z_graded(R::MPolyDecRing) is_graded(R) || return false A = grading_group(R) - return ngens(A) == 1 && rank(A) == 1 && is_free(A) + return ngens(A) == 1 && torsion_free_rank(A) == 1 && is_free(A) end is_z_graded(::MPolyRing) = false @@ -256,7 +257,8 @@ is_z_graded(::MPolyRing) = false Return `true` if `R` is $\mathbb Z^m$-graded for some $m$, `false` otherwise. !!! note - Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z^m$-graded if `is_free(G) && ngens(G) == rank(G) == m` evaluates to `true`. + Writing `G = grading_group(R)`, we say that `R` is $\mathbb Z^m$-graded + `G` is free abelian of rank `m`, and `ngens(G) == m`. # Examples ```jldoctest @@ -295,7 +297,7 @@ false function is_zm_graded(R::MPolyDecRing) is_graded(R) || return false A = grading_group(R) - return is_free(A) && ngens(A) == rank(A) + return is_free(A) && ngens(A) == torsion_free_rank(A) end is_zm_graded(::MPolyRing) = false @@ -340,7 +342,7 @@ false is_graded(R) || return false G = grading_group(R) is_free(G) || return false - if ngens(G) == rank(G) + if ngens(G) == torsion_free_rank(G) W = reduce(vcat, [x.coeff for x = R.d]) if is_positive_grading_matrix(transpose(W)) return true diff --git a/src/imports.jl b/src/imports.jl index 9c7ff7555fb8..bdb686fc6718 100644 --- a/src/imports.jl +++ b/src/imports.jl @@ -195,4 +195,10 @@ import Hecke: primitive_element, QQBar +# temporary workaround, see https://github.com/thofma/Hecke.jl/pull/1224 +if !isdefined(Hecke, :torsion_free_rank) + torsion_free_rank(A::FinGenAbGroup) = rank(A) + export torsion_free_rank +end + import cohomCalg_jll diff --git a/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl b/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl index 019216a78672..b412a3037c33 100644 --- a/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl +++ b/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl @@ -18,10 +18,10 @@ @test dim(cone(antv)) == 2 @test length(affine_open_covering(antv)) == 1 @test length(gens(toric_ideal(antv))) == 1 - @test rank(torusinvariant_weil_divisor_group(antv)) == 2 - @test rank(character_lattice(antv)) == 2 - @test rank(domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(antv))) == 2 - @test rank(codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(antv))) == 2 + @test torsion_free_rank(torusinvariant_weil_divisor_group(antv)) == 2 + @test torsion_free_rank(character_lattice(antv)) == 2 + @test torsion_free_rank(domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(antv))) == 2 + @test torsion_free_rank(codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(antv))) == 2 @test elementary_divisors(codomain(map_from_torusinvariant_weil_divisor_group_to_class_group(antv))) == [ 2 ] @test elementary_divisors(class_group(antv)) == [ 2 ] @test ngens(cox_ring(antv)) == 2 diff --git a/test/AlgebraicGeometry/ToricVarieties/del_pezzo_surfaces.jl b/test/AlgebraicGeometry/ToricVarieties/del_pezzo_surfaces.jl index 4fa34e96a80d..b51f03cbd1f2 100644 --- a/test/AlgebraicGeometry/ToricVarieties/del_pezzo_surfaces.jl +++ b/test/AlgebraicGeometry/ToricVarieties/del_pezzo_surfaces.jl @@ -23,8 +23,8 @@ @testset "Basic attributes of dP1" begin @test length(torusinvariant_prime_divisors(dP1)) == 4 - @test rank(torusinvariant_cartier_divisor_group(dP1)) == 4 - @test rank(picard_group(dP1)) == 2 + @test torsion_free_rank(torusinvariant_cartier_divisor_group(dP1)) == 4 + @test torsion_free_rank(picard_group(dP1)) == 2 @test transpose(matrix(ZZ,rays(dP1))) == matrix(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP1)) @test domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP1)) == character_lattice(dP1) @test codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP1)) == torusinvariant_weil_divisor_group(dP1) @@ -44,8 +44,8 @@ @testset "Basic attributes of dP2" begin @test length(torusinvariant_prime_divisors(dP2)) == 5 - @test rank(torusinvariant_cartier_divisor_group(dP2)) == 5 - @test rank(picard_group(dP2)) == 3 + @test torsion_free_rank(torusinvariant_cartier_divisor_group(dP2)) == 5 + @test torsion_free_rank(picard_group(dP2)) == 3 @test transpose(matrix(ZZ,rays(dP2))) == matrix(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP2)) @test domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP2)) == character_lattice(dP2) @test codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP2)) == torusinvariant_weil_divisor_group(dP2) @@ -65,8 +65,8 @@ @testset "Basic attributes of dP3" begin @test length(torusinvariant_prime_divisors(dP3)) == 6 - @test rank(torusinvariant_cartier_divisor_group(dP3)) == 6 - @test rank(picard_group(dP3)) == 4 + @test torsion_free_rank(torusinvariant_cartier_divisor_group(dP3)) == 6 + @test torsion_free_rank(picard_group(dP3)) == 4 @test transpose(matrix(ZZ,rays(dP3))) == matrix(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP3)) @test domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP3)) == character_lattice(dP3) @test codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(dP3)) == torusinvariant_weil_divisor_group(dP3) diff --git a/test/AlgebraicGeometry/ToricVarieties/hirzebruch_surfaces.jl b/test/AlgebraicGeometry/ToricVarieties/hirzebruch_surfaces.jl index 56d0675c66ae..1300caab0ab5 100644 --- a/test/AlgebraicGeometry/ToricVarieties/hirzebruch_surfaces.jl +++ b/test/AlgebraicGeometry/ToricVarieties/hirzebruch_surfaces.jl @@ -34,17 +34,17 @@ @test betti_number(F5, 4) == 1 @test length(affine_open_covering(F5)) == 4 @test dim(polyhedral_fan(F5)) == 2 - @test rank(torusinvariant_weil_divisor_group(F5)) == 4 - @test rank(character_lattice(F5)) == 2 + @test torsion_free_rank(torusinvariant_weil_divisor_group(F5)) == 4 + @test torsion_free_rank(character_lattice(F5)) == 2 @test ngens(cox_ring(F5)) == 4 @test length(stanley_reisner_ideal(F5).gens) == 2 @test length(irrelevant_ideal(F5).gens) == 4 @test dim(nef_cone(F5)) == 2 @test dim(mori_cone(F5)) == 2 - @test rank(domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5))) == 2 - @test rank(codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5))) == 4 - @test rank(class_group(F5)) == 2 - @test rank(codomain(map_from_torusinvariant_weil_divisor_group_to_class_group(F5))) == 2 + @test torsion_free_rank(domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5))) == 2 + @test torsion_free_rank(codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5))) == 4 + @test torsion_free_rank(class_group(F5)) == 2 + @test torsion_free_rank(codomain(map_from_torusinvariant_weil_divisor_group_to_class_group(F5))) == 2 @test transpose(matrix(ZZ,rays(F5))) == matrix(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5)) @test domain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5)) == character_lattice(F5) @test codomain(map_from_character_lattice_to_torusinvariant_weil_divisor_group(F5)) == torusinvariant_weil_divisor_group(F5) diff --git a/test/AlgebraicGeometry/ToricVarieties/normal_toric_varieties.jl b/test/AlgebraicGeometry/ToricVarieties/normal_toric_varieties.jl index b9472c48a085..f5de0c6d67c0 100644 --- a/test/AlgebraicGeometry/ToricVarieties/normal_toric_varieties.jl +++ b/test/AlgebraicGeometry/ToricVarieties/normal_toric_varieties.jl @@ -9,8 +9,8 @@ @testset "Basic properties" begin @test is_complete(ntv) == true @test is_projective_space(ntv) == false - @test rank(torusinvariant_cartier_divisor_group(ntv)) == 4 - @test rank(domain(map_from_torusinvariant_cartier_divisor_group_to_torusinvariant_weil_divisor_group(ntv))) == 4 + @test torsion_free_rank(torusinvariant_cartier_divisor_group(ntv)) == 4 + @test torsion_free_rank(domain(map_from_torusinvariant_cartier_divisor_group_to_torusinvariant_weil_divisor_group(ntv))) == 4 @test is_complete(ntv2) == true @test length(ntv3) == 1 @test is_projective_space(ntv3[1]) == true diff --git a/test/AlgebraicGeometry/ToricVarieties/projectivization.jl b/test/AlgebraicGeometry/ToricVarieties/projectivization.jl index 49e54cc85bcd..9191ac211eb3 100644 --- a/test/AlgebraicGeometry/ToricVarieties/projectivization.jl +++ b/test/AlgebraicGeometry/ToricVarieties/projectivization.jl @@ -7,7 +7,7 @@ X = projectivization(D0, Da) @test is_smooth(X) == true @test (a < 2) == is_fano(X) - @test rank(picard_group(X)) == 2 + @test torsion_free_rank(picard_group(X)) == 2 @test integrate(cohomology_class(anticanonical_divisor(X))^dim(X)) == integrate(cohomology_class(anticanonical_divisor(hirzebruch_surface(NormalToricVariety, a)))^2) end end @@ -24,13 +24,13 @@ D2 = toric_divisor(P2, [0,2,0]) X3_P2 = projectivization(D0, D2) @testset "Test of some Fano projective bundles of dimension 3 over P2" begin - @test rank(picard_group(X1_P2)) == 2 + @test torsion_free_rank(picard_group(X1_P2)) == 2 @test is_fano(X1_P2) == true @test integrate(cohomology_class(anticanonical_divisor(X1_P2))^dim(X1_P2)) == 54 - @test rank(picard_group(X2_P2)) == 2 + @test torsion_free_rank(picard_group(X2_P2)) == 2 @test is_fano(X2_P2) == true @test integrate(cohomology_class(anticanonical_divisor(X2_P2))^dim(X2_P2)) == 56 - @test rank(picard_group(X3_P2)) == 2 + @test torsion_free_rank(picard_group(X3_P2)) == 2 @test is_fano(X3_P2) == true @test integrate(cohomology_class(anticanonical_divisor(X3_P2))^dim(X3_P2)) == 62 end @@ -43,11 +43,11 @@ l1_F1 = toric_line_bundle(F1, [0,1]) X2_F1 = projectivization(toric_line_bundle(F1, [0,0]), l1_F1) @testset "Test of some Fano projective bundles of dimension 3 over F1" begin - @test rank(picard_group(X1_F1)) == 3 + @test torsion_free_rank(picard_group(X1_F1)) == 3 @test is_fano(X1_F1) == true @test integrate(cohomology_class(anticanonical_divisor(X1_F1))^dim(X1_F1)) == 48 @test integrate(cohomology_class(l1_F1)^2) == 1 - @test rank(picard_group(X2_F1)) == 3 + @test torsion_free_rank(picard_group(X2_F1)) == 3 @test is_fano(X2_F1) == true @test integrate(cohomology_class(anticanonical_divisor(X2_F1))^dim(X2_F1)) == 50 end @@ -61,13 +61,13 @@ X2_P1xP1 = projectivization(O10, O10) X3_P1xP1 = projectivization(O00, O11) @testset "Test of some Fano projective bundles of dimension 3 over P1 * P1" begin - @test rank(picard_group(X1_P1xP1)) == 3 + @test torsion_free_rank(picard_group(X1_P1xP1)) == 3 @test is_fano(X1_P1xP1) == true @test integrate(cohomology_class(anticanonical_divisor(X1_P1xP1))^dim(X1_P1xP1)) == 44 - @test rank(picard_group(X2_P1xP1)) == 3 + @test torsion_free_rank(picard_group(X2_P1xP1)) == 3 @test is_fano(X2_P1xP1) == true @test integrate(cohomology_class(anticanonical_divisor(X2_P1xP1))^dim(X2_P1xP1)) == 48 - @test rank(picard_group(X3_P1xP1)) == 3 + @test torsion_free_rank(picard_group(X3_P1xP1)) == 3 @test is_fano(X3_P1xP1) == true @test integrate(cohomology_class(anticanonical_divisor(X3_P1xP1))^dim(X3_P1xP1)) == 52 end diff --git a/test/AlgebraicGeometry/ToricVarieties/toric_blowdowns.jl b/test/AlgebraicGeometry/ToricVarieties/toric_blowdowns.jl index 0b56eaf9aeb1..153a8b40f01b 100644 --- a/test/AlgebraicGeometry/ToricVarieties/toric_blowdowns.jl +++ b/test/AlgebraicGeometry/ToricVarieties/toric_blowdowns.jl @@ -4,8 +4,8 @@ bl = blow_up(P2, [1, 1]) @testset "Basic tests for simple toric blowdown" begin - @test rank(domain(grid_morphism(bl))) == 2 - @test rank(codomain(grid_morphism(bl))) == 2 + @test torsion_free_rank(domain(grid_morphism(bl))) == 2 + @test torsion_free_rank(codomain(grid_morphism(bl))) == 2 @test matrix(morphism_on_torusinvariant_weil_divisor_group(bl)) == matrix(ZZ, [1 0 0; 0 1 0; 0 0 1; 1 1 0]) @test matrix(morphism_on_torusinvariant_cartier_divisor_group(bl)) == matrix(morphism_on_torusinvariant_weil_divisor_group(bl)) end diff --git a/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl b/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl index ca44960d0e88..b35169a82818 100644 --- a/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl +++ b/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl @@ -22,7 +22,7 @@ @test betti_number(BP2, 3) == 0 @test betti_number(BP2, 4) == 1 @test euler_characteristic(BP2) == 4 - @test rank(picard_group(BP2)) == 2 + @test torsion_free_rank(picard_group(BP2)) == 2 end @testset "Trigger issue of PR3006" begin diff --git a/test/AlgebraicGeometry/ToricVarieties/toric_divisor_classes.jl b/test/AlgebraicGeometry/ToricVarieties/toric_divisor_classes.jl index 8a185f7694bf..b72bc1c8d04e 100644 --- a/test/AlgebraicGeometry/ToricVarieties/toric_divisor_classes.jl +++ b/test/AlgebraicGeometry/ToricVarieties/toric_divisor_classes.jl @@ -20,7 +20,7 @@ end @testset "Basic attributes" begin - @test rank(parent(divisor_class(DC2))) == 2 + @test torsion_free_rank(parent(divisor_class(DC2))) == 2 @test dim(toric_variety(DC2)) == 2 end diff --git a/test/AlgebraicGeometry/ToricVarieties/total_space.jl b/test/AlgebraicGeometry/ToricVarieties/total_space.jl index 50bb4be053a9..0e8c110e8a10 100644 --- a/test/AlgebraicGeometry/ToricVarieties/total_space.jl +++ b/test/AlgebraicGeometry/ToricVarieties/total_space.jl @@ -9,7 +9,7 @@ @test is_smooth(X) == true @test !is_fano(X) @test !is_complete(X) - @test rank(picard_group(X)) == 1 + @test torsion_free_rank(picard_group(X)) == 1 @test dim(X) == 3 @test (degree(canonical_bundle(X)) == 0) == (a - b == -2) end @@ -23,7 +23,7 @@ @test is_smooth(X) == true @test !is_fano(X) @test !is_complete(X) - @test rank(picard_group(X)) == rank(picard_group(S)) + @test torsion_free_rank(picard_group(X)) == torsion_free_rank(picard_group(S)) @test dim(X) == 3 @test degree(canonical_bundle(X)) == 0 end @@ -35,7 +35,7 @@ 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 torsion_free_rank(picard_group(X)) == torsion_free_rank(picard_group(S)) @test dim(X) == 3 @test degree(canonical_bundle(X)) == 0 end diff --git a/test/Combinatorics/SimplicialComplexes.jl b/test/Combinatorics/SimplicialComplexes.jl index fbbb8e463632..611809b746a0 100644 --- a/test/Combinatorics/SimplicialComplexes.jl +++ b/test/Combinatorics/SimplicialComplexes.jl @@ -55,9 +55,9 @@ @test !is_trivial(H0) @test !is_trivial(H1) @test !is_trivial(H2) - @test rank(H0) == 1 - @test rank(H1) == 2 - @test rank(H2) == 1 + @test torsion_free_rank(H0) == 1 + @test torsion_free_rank(H1) == 2 + @test torsion_free_rank(H2) == 1 end @testset "is_isomorphic" begin diff --git a/test/Rings/hilbert.jl b/test/Rings/hilbert.jl index 88d2a11c2e42..01a4c82ca5b5 100644 --- a/test/Rings/hilbert.jl +++ b/test/Rings/hilbert.jl @@ -104,13 +104,13 @@ end JJ = ideal(RR, X^2 - Y^6); A, _ = quo(base_ring(JJ), JJ); (numer1, denom1), (H, iso) = multi_hilbert_series(A); - @test is_free(H) && isone(rank(H)) + @test is_free(H) && isone(torsion_free_rank(H)) S, t = laurent_polynomial_ring(ZZ, "t"); (numer2, denom2), (H, iso) = multi_hilbert_series(A; parent=S); - @test is_free(H) && isone(rank(H)) + @test is_free(H) && isone(torsion_free_rank(H)) Smult, (T,) = polynomial_ring(ZZ, ["t"]); (numer3, denom3), (H, iso) = multi_hilbert_series(A; parent=Smult); - @test is_free(H) && isone(rank(H)) + @test is_free(H) && isone(torsion_free_rank(H)) @test numer1 == evaluate(numer2, T) @test numer3 == evaluate(numer2, first(gens(parent(numer3)))) end