diff --git a/Project.toml b/Project.toml index ff89d27f55f9..692a83c70938 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Oscar" uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" authors = ["The OSCAR Team "] -version = "1.2.1" +version = "1.2.2" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" diff --git a/README.md b/README.md index 912401b4c4c6..818220c9670c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ julia> using Oscar / _ \ / ___| / ___| / \ | _ \ | Combining ANTIC, GAP, Polymake, Singular | | | |\___ \| | / _ \ | |_) | | Type "?Oscar" for more information | |_| | ___) | |___ / ___ \| _ < | Manual: https://docs.oscar-system.org - \___/ |____/ \____/_/ \_\_| \_\ | Version 1.2.1 + \___/ |____/ \____/_/ \_\_| \_\ | Version 1.2.2 julia> k, a = quadratic_field(-5) (Imaginary quadratic field defined by x^2 + 5, sqrt(-5)) @@ -114,7 +114,7 @@ pm::Array > If you have used OSCAR in the preparation of a paper please cite it as described below: [OSCAR] - OSCAR -- Open Source Computer Algebra Research system, Version 1.2.1, + OSCAR -- Open Source Computer Algebra Research system, Version 1.2.2, The OSCAR Team, 2024. (https://www.oscar-system.org) [OSCAR-book] Wolfram Decker, Christian Eder, Claus Fieker, Max Horn, Michael Joswig, eds. @@ -127,7 +127,7 @@ If you are using BibTeX, you can use the following BibTeX entries: key = {OSCAR}, organization = {The OSCAR Team}, title = {OSCAR -- Open Source Computer Algebra Research system, - Version 1.2.1}, + Version 1.2.2}, year = {2024}, url = {https://www.oscar-system.org}, } diff --git a/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md b/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md index f8816d400e42..0b77aa96d75b 100644 --- a/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md +++ b/docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md @@ -30,26 +30,30 @@ the variety in question. For complete and simplicial toric varieties, many things are known about the Chow ring and algebraic cycles (cf. section 12.5 in [CLS11](@cite): -* By therorem 12.5.3 of [CLS11](@cite), there is an isomorphism -among the Chow ring and the cohomology ring. Note that the -cohomology ring is naturally graded (cf. last paragraph -on page 593 in [CLS11](@cite)). However, the Chow ring -is usually considered as a non-graded ring. To match this general -convention, and in particular the implementation of the Chow ring -for matroids in OSCAR, the toric Chow ring is constructed as a -non-graded ring. -* By therorem 12.5.3 of [CLS11](@cite), the Chow ring is isomorphic -to the quotient of the non-graded Cox ring and a certain ideal. -Specifically, the ideal in question is the sum of the ideal of -linear relations and the Stanley-Reisner ideal. -* It is worth noting that the ideal of linear relations is not -homogeneous with respect to the class group grading of the Cox ring. -In order to construct the cohomology ring, one can introduce a -$\mathbb{Z}$-grading on the Cox ring such that the ideal of linear -relations and the Stanley-Reißner ideal are homogeneous. -* Finally, by lemma 12.5.1 of [CLS11](@cite), generators of the -rational equivalence classes of algebraic cycles are one-to-one to -the cones in the fan of the toric variety. + + * By therorem 12.5.3 of [CLS11](@cite), there is an isomorphism + among the Chow ring and the cohomology ring. Note that the + cohomology ring is naturally graded (cf. last paragraph + on page 593 in [CLS11](@cite)). However, the Chow ring + is usually considered as a non-graded ring. To match this general + convention, and in particular the implementation of the Chow ring + for matroids in OSCAR, the toric Chow ring is constructed as a + non-graded ring. + + * By therorem 12.5.3 of [CLS11](@cite), the Chow ring is isomorphic + to the quotient of the non-graded Cox ring and a certain ideal. + Specifically, the ideal in question is the sum of the ideal of + linear relations and the Stanley-Reisner ideal. + + * It is worth noting that the ideal of linear relations is not + homogeneous with respect to the class group grading of the Cox ring. + In order to construct the cohomology ring, one can introduce a + $\mathbb{Z}$-grading on the Cox ring such that the ideal of linear + relations and the Stanley-Reißner ideal are homogeneous. + + * Finally, by lemma 12.5.1 of [CLS11](@cite), generators of the + rational equivalence classes of algebraic cycles are one-to-one to + the cones in the fan of the toric variety. ## Constructors diff --git a/docs/src/DeveloperDocumentation/documentation.md b/docs/src/DeveloperDocumentation/documentation.md index dc7f5fdbc7c5..833ec6e5a904 100644 --- a/docs/src/DeveloperDocumentation/documentation.md +++ b/docs/src/DeveloperDocumentation/documentation.md @@ -131,6 +131,13 @@ changes in the bibliography. If so, this test fails and indicates that the is not required that this test is passed. Still, please feel encouraged to fix this failure by running `bibtool` locally as explained above. +!!! note "bibtool produces changes in unrelated parts of oscar_references.bib" + Sometimes `bibtool` will produce many changes when run locally. This can be + caused by a version difference. The version used in our github actions is + 2.68. Check your version by running `bibtool -V`. When running this + command, please also pay attention whether any "Special configuration + options" are set. + Please follow the additional guidelines below, that are not checked by bibtool: - Do not escape special characters like umlauts or accented characters. Instead, use the unicode character directly. diff --git a/gap/OscarInterface/PackageInfo.g b/gap/OscarInterface/PackageInfo.g index 70ccf1e30b3d..bbf24617744d 100644 --- a/gap/OscarInterface/PackageInfo.g +++ b/gap/OscarInterface/PackageInfo.g @@ -10,8 +10,8 @@ SetPackageInfo( rec( PackageName := "OscarInterface", Subtitle := "GAP interface to OSCAR", -Version := "1.2.1", -Date := "20/11/2024", # dd/mm/yyyy format +Version := "1.2.2", +Date := "11/12/2024", # dd/mm/yyyy format License := "GPL-2.0-or-later", Persons := [ diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl index 507d2c082daf..35676184f290 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl @@ -66,8 +66,7 @@ end normal_toric_variety(max_cones::IncidenceMatrix, rays::AbstractCollection[RayVector]; non_redundant::Bool = false) Construct a normal toric variety $X$ by providing the rays and maximal cones -as vector of vectors. By default, this method assumes that the input is not -non-redundant (e.g. that a ray was entered twice by accident). If the user +as vector of vectors. By default, this method allows redundancies in the input, e.g. duplicate rays and non-maximal cones. If the user is certain that no redundancy exists in the entered information, one can pass `non_redundant = true` as third argument. This will bypass these consistency checks. In addition, this will ensure that the order of the rays is not diff --git a/src/NumberTheory/GaloisGrp/GaloisGrp.jl b/src/NumberTheory/GaloisGrp/GaloisGrp.jl index 8e3ef37c81ac..c1ca55e4c4f8 100644 --- a/src/NumberTheory/GaloisGrp/GaloisGrp.jl +++ b/src/NumberTheory/GaloisGrp/GaloisGrp.jl @@ -2667,6 +2667,10 @@ function Hecke.absolute_minpoly(a::Oscar.NfNSGenElem{QQFieldElem, QQMPolyRingEle end function blow_up(G::PermGroup, C::GaloisCtx, lf::Vector, con::PermGroupElem=one(G)) + #TODO: currently con is useless here, the cluster detection and the reduce + # tree is re-arranging the factors in lf randomly + # one would need to trace the re-arranged lf as well + # Since we don't, we have to compute roots and evaluate if all(x->x[2] == 1, lf) return G, C @@ -2678,28 +2682,53 @@ function blow_up(G::PermGroup, C::GaloisCtx, lf::Vector, con::PermGroupElem=one( icon = inv(con) - gs = map(Vector{Int}, gens(G)) + rr = roots(C, 2; raw = true) + renum = Int[] for (g, k) = lf + l = findall(iszero, map(g, rr)) + append!(renum, l) + end + re = inv(symmetric_group(degree(G))(renum)) + + gs = map(Vector{Int}, gens(G)) + + # G is a sub group of prod G_i <= prod sym(n_i) the galois groups + # of the factors + # con describes the current ordering of the roots in so G^con <= prod G_i + #for the factors with multiplicity > 1, we need to append more factors + H = [G] + mps = [gens(G)] + n = degree(G) + for (g,k) = lf + if k == 1 + st += degree(g) + continue + end + S = symmetric_group(degree(g)) + #need proj G -> G_i, so need a subset of the points (st+1:st+deg(g)) + # moved by re, then mapped to 1:deg(g) + h = [S([(i+st)^(gg^re)-st for i=1:degree(g)]) for gg = gens(G)] for j=2:k - for i=1:degree(g) - mp[n+i] = (st+i)^con - end - for h = gs - for i=1:degree(g) - push!(h, h[(st+i)^con]^icon-st+n) - end + S = symmetric_group(degree(g)) + push!(H, S) + push!(mps, h) + for i = 1:degree(g) + mp[n+i] = (st+i)^icon end n += degree(g) end st += degree(g) end + D, emb, pro = inner_direct_product(H; morphisms = true) + h = hom(G, D, [prod(emb[i](mps[i][j]) for i=1:length(H)) for j=1:ngens(G)]) + C.rt_num = mp - S = symmetric_group(n) - GG, _ = sub(S, map(S, gs)) + GG, _ = image(h) h = hom(G, GG, gens(G), gens(GG)) @assert is_injective(h) && is_surjective(h) + C.G = GG return GG, C end @@ -2825,6 +2854,7 @@ function galois_group(f::PolyRingElem{<:FieldElem}; prime=0, pStart::Int = 2*deg @vprint :GaloisGroup 1 "found $(length(cl)) connected components\n" res = Vector{Tuple{typeof(C[1]), PermGroupElem}}() + llf = Int[] function setup(C::Vector{<:GaloisCtx}) G, emb, pro = inner_direct_product([x.G for x = C], morphisms = true) g = prod(x.f for x = C) diff --git a/src/PolyhedralGeometry/PolyhedralFan/properties.jl b/src/PolyhedralGeometry/PolyhedralFan/properties.jl index 2b157f65c563..9a319a4b2f27 100644 --- a/src/PolyhedralGeometry/PolyhedralFan/properties.jl +++ b/src/PolyhedralGeometry/PolyhedralFan/properties.jl @@ -212,8 +212,21 @@ julia> cones(PF, 2) """ function cones(PF::_FanLikeType, cone_dim::Int) l = cone_dim - length(lineality_space(PF)) - l < 1 && return nothing - return SubObjectIterator{Cone{_get_scalar_type(PF)}}( + t = Cone{_get_scalar_type(PF)} + (l < 0 || dim(PF) == -1) && return _empty_subobjectiterator(t, PF) + + if l == 0 + return SubObjectIterator{t}( + PF, + (_, _, _) -> positive_hull( + coefficient_field(PF), zeros(Int, ambient_dim(PF)), lineality_space(PF) + ), + 1, + NamedTuple(), + ) + end + + return SubObjectIterator{t}( PF, _cone_of_dim, size(Polymake.fan.cones_of_dim(pm_object(PF), l), 1), (c_dim=l,) ) end diff --git a/src/PolyhedralGeometry/iterators.jl b/src/PolyhedralGeometry/iterators.jl index d7b56e325448..f2f643924d9c 100644 --- a/src/PolyhedralGeometry/iterators.jl +++ b/src/PolyhedralGeometry/iterators.jl @@ -106,6 +106,10 @@ Base.:(==)(::PointVector, ::RayVector) = Base.:(==)(::RayVector, ::PointVector) = throw(ArgumentError("Cannot compare PointVector to RayVector")) +Base.isequal(x::RayVector, y::RayVector) = x == y + +Base.hash(x::RayVector, h::UInt) = hash(collect(sign.(x)), hash(coefficient_field(x), h)) + ################################################################################ ######## Halfspaces and Hyperplanes ################################################################################ diff --git a/src/Rings/localization_interface.jl b/src/Rings/localization_interface.jl index a33b91ac012b..dfdb91427002 100644 --- a/src/Rings/localization_interface.jl +++ b/src/Rings/localization_interface.jl @@ -399,7 +399,15 @@ zero(W::AbsLocalizedRing) = W(zero(base_ring(W))) canonical_unit(f::LocRingElemType) where {LocRingElemType<:AbsLocalizedRingElem} = one(parent(f)) -characteristic(W::AbsLocalizedRing) = characteristic(base_ring(W)) +function characteristic(W::AbsLocalizedRing) + # It might happen that localization collapses the ring. + is_zero(one(W)) && return 1 + # If the characteristic is prime, then it is preserved. + c = characteristic(base_ring(W)) + (is_zero(c) || is_prime(c)) && return c + # All other cases have to be overwritten manually. + error("computation of characteristic not implemented") +end function Base.show(io::IO, ::MIME"text/plain", W::AbsLocalizedRing) io = pretty(io) diff --git a/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl b/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl index 6c2de2508ff0..3e6e0504813c 100644 --- a/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl +++ b/test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl @@ -68,7 +68,8 @@ @test !issubset(pbJ_str, ideal_sheaf(E)) end - I = ideal(S, [S[1], S[2]]) + # Select variables corresponding to rays [1,0] and [0,1] + I = ideal(S, gens(S)[findall(v->v[1]>=0&&v[2]>=0, rays(P2))]) bl2 = blow_up(P2, I) II = IdealSheaf(P2, I) diff --git a/test/NumberTheory/galthy.jl b/test/NumberTheory/galthy.jl index c776f5384e97..fb8e9a78f97e 100644 --- a/test/NumberTheory/galthy.jl +++ b/test/NumberTheory/galthy.jl @@ -10,7 +10,7 @@ @test degree(L) == order(G) @test length(roots(L, k.pol)) == 5 - R, x = polynomial_ring(QQ, :x) + R, x = polynomial_ring(QQ, :x; cached = false) pol = x^6 - 366*x^4 - 878*x^3 + 4329*x^2 + 14874*x + 10471 g, C = galois_group(pol) @test order(g) == 18 @@ -24,7 +24,7 @@ G, C = galois_group((1//13)*x^2+2) @test order(G) == 2 - K, a = number_field(x^4-2) + K, a = number_field(x^4-2; cached = false) G, C = galois_group(K) Gc, Cc = galois_group(K, algorithm = :Complex) Gs, Cs = galois_group(K, algorithm = :Symbolic) @@ -46,6 +46,17 @@ G, C = galois_group((2*x+1)^2) @test order(G) == 1 @test degree(G) == 2 + + #from errors: + G, C = galois_group((x^4 + 1)^3 * x^2 * (x^2 - 4*x + 1)^5) + @test order(G) == 8 + @test degree(G) == 24 + k = fixed_field(C, sub(G, [one(G)])[1]) + @test degree(k) == 8 + + G, C = galois_group((x^3-2)^2*(x^3-5)^2*(x^2-6)) + @test order(G) == 36 + @test degree(G) == 14 end import Oscar.GaloisGrp: primitive_by_shape, an_sn_by_shape, cycle_structures diff --git a/test/PolyhedralGeometry/cone.jl b/test/PolyhedralGeometry/cone.jl index 8adcfc125b94..80f50d4eb566 100644 --- a/test/PolyhedralGeometry/cone.jl +++ b/test/PolyhedralGeometry/cone.jl @@ -28,7 +28,7 @@ if T == QQFieldElem @test hilbert_basis(Cone1) isa SubObjectIterator{PointVector{ZZRingElem}} @test length(hilbert_basis(Cone1)) == 2 - @test issetequal(hilbert_basis(Cone1), ray_vector.(Ref(ZZ), [[1, 0], [0, 1]])) + @test issetequal(hilbert_basis(Cone1), point_vector.(Ref(ZZ), [[1, 0], [0, 1]])) @test generator_matrix(hilbert_basis(Cone1)) == _oscar_matrix_from_property(ZZ, hilbert_basis(Cone1)) end @test n_rays(Cone1) == 2 diff --git a/test/PolyhedralGeometry/linear_program.jl b/test/PolyhedralGeometry/linear_program.jl index 427b73a7d7de..f36f5892d54c 100644 --- a/test/PolyhedralGeometry/linear_program.jl +++ b/test/PolyhedralGeometry/linear_program.jl @@ -7,12 +7,7 @@ C1 = cube(f, 2, 0, 1) Pos = polyhedron(f, [-1 0 0; 0 -1 0; 0 0 -1], [0, 0, 0]) L = polyhedron(f, [-1 0 0; 0 -1 0], [0, 0]) - point = convex_hull(f, [0 1 0]) empty = polyhedron(f, [1 0 0; -1 0 0], [0, -1]) - # this is to make sure the order of some matrices below doesn't change - Polymake.prefer("beneath_beyond") do - affine_hull(point) - end s = simplex(f, 2) rsquare = cube(f, 2, QQFieldElem(-3, 2), QQFieldElem(3, 2)) diff --git a/test/PolyhedralGeometry/polyhedral_fan.jl b/test/PolyhedralGeometry/polyhedral_fan.jl index 133ba92b6a59..30aa437e5bb6 100644 --- a/test/PolyhedralGeometry/polyhedral_fan.jl +++ b/test/PolyhedralGeometry/polyhedral_fan.jl @@ -58,11 +58,18 @@ @test size(cones(F2, 2)) == (2,) @test lineality_space(cones(F2, 2)[1]) == [[0, 1, 0]] @test rays.(cones(F2, 2)) == [[], []] - @test isnothing(cones(F2, 1)) @test _check_im_perm_rows(ray_indices(cones(F1, 2)), incidence1) @test _check_im_perm_rows(incidence_matrix(cones(F1, 2)), incidence1) @test _check_im_perm_rows(cones(IncidenceMatrix, F1, 2), incidence1) + A3 = affine_space(NormalToricVariety, 3) + @test length(cones(A3, 1)) == 3 + @test length(cones(A3, 0)) == 1 + @test length(cones(A3, -1)) == 0 + @test cones(A3, 1) isa SubObjectIterator{Cone{QQFieldElem}} + @test cones(A3, 0) isa SubObjectIterator{Cone{QQFieldElem}} + @test cones(A3, -1) isa SubObjectIterator{Cone{QQFieldElem}} + II = ray_indices(maximal_cones(NFsquare)) NF0 = polyhedral_fan(II, rays(NFsquare)) @test n_rays(NF0) == 4 diff --git a/test/PolyhedralGeometry/polyhedron.jl b/test/PolyhedralGeometry/polyhedron.jl index 3556449f31dd..94d4e480f68c 100644 --- a/test/PolyhedralGeometry/polyhedron.jl +++ b/test/PolyhedralGeometry/polyhedron.jl @@ -13,10 +13,6 @@ L = polyhedron(f, [-1 0 0; 0 -1 0], [0, 0]) full = polyhedron(f, zero_matrix(f, 0, 3), []) point = convex_hull(f, [0 1 0]) - # this is to make sure the order of some matrices below doesn't change - Polymake.prefer("beneath_beyond") do - affine_hull(point) - end s = simplex(f, 2) R, x = polynomial_ring(QQ, :x) v = T[f(1), f(1)] diff --git a/test/PolyhedralGeometry/types.jl b/test/PolyhedralGeometry/types.jl index d079c17df422..eebea2fbefc6 100644 --- a/test/PolyhedralGeometry/types.jl +++ b/test/PolyhedralGeometry/types.jl @@ -109,6 +109,9 @@ end end end + if T == RayVector + @test length(Set(ray_vector.(Ref(f), [[1,2,3],[2,4,6],[-1,-2,-3]]))) == 2 + end end end