Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backports 1.2.2 #4397

Merged
merged 10 commits into from
Dec 13, 2024
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Oscar"
uuid = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
authors = ["The OSCAR Team <oscar@oscar-system.org>"]
version = "1.2.1"
version = "1.2.2"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -114,7 +114,7 @@ pm::Array<topaz::HomologyGroup<pm::Integer> >
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.
Expand All @@ -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},
}
Expand Down
44 changes: 24 additions & 20 deletions docs/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/src/DeveloperDocumentation/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions gap/OscarInterface/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -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 := [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 40 additions & 10 deletions src/NumberTheory/GaloisGrp/GaloisGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down
17 changes: 15 additions & 2 deletions src/PolyhedralGeometry/PolyhedralFan/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/PolyhedralGeometry/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
10 changes: 9 additions & 1 deletion src/Rings/localization_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,15 @@

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")

Check warning on line 409 in src/Rings/localization_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/Rings/localization_interface.jl#L409

Added line #L409 was not covered by tests
end

function Base.show(io::IO, ::MIME"text/plain", W::AbsLocalizedRing)
io = pretty(io)
Expand Down
3 changes: 2 additions & 1 deletion test/AlgebraicGeometry/ToricVarieties/toric_blowups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
15 changes: 13 additions & 2 deletions test/NumberTheory/galthy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/PolyhedralGeometry/cone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions test/PolyhedralGeometry/linear_program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
9 changes: 8 additions & 1 deletion test/PolyhedralGeometry/polyhedral_fan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions test/PolyhedralGeometry/polyhedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 3 additions & 0 deletions test/PolyhedralGeometry/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading