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

Some more fixes #4142

Merged
merged 58 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
accc8e1
Speed up simplification of complexes.
HechtiDerLachs Sep 24, 2024
93c4575
Make radical computation actually work over extensions of QQ.
HechtiDerLachs Sep 24, 2024
981ed63
Set the default hash to zero for ideals.
HechtiDerLachs Sep 24, 2024
b07ff91
Update src/Rings/mpoly-ideals.jl
HechtiDerLachs Sep 24, 2024
4a085a1
Revert "Set the default hash to zero for ideals."
HechtiDerLachs Sep 24, 2024
843a1dc
Revert the use of unique./start-tor-browser.desktop
HechtiDerLachs Sep 24, 2024
34ac7ef
Fix internals of radical.
HechtiDerLachs Sep 24, 2024
223c836
Add is_known_to_be_radical.
HechtiDerLachs Sep 24, 2024
1c19d7f
Roll back to the convention that radical returns few generators.
HechtiDerLachs Sep 24, 2024
6082101
Fix up hashing.
HechtiDerLachs Sep 24, 2024
320002a
Some improvements on elliptic surfaces.
HechtiDerLachs Sep 25, 2024
783684d
Fix.
HechtiDerLachs Sep 25, 2024
2e9b228
Fix up assertions.
HechtiDerLachs Sep 25, 2024
c02dca0
Put the gens in the correct position.
HechtiDerLachs Sep 25, 2024
211dc5c
Implement base change for divisors.
HechtiDerLachs Sep 25, 2024
2c94fb8
Some fixes and assertions about base changes.
HechtiDerLachs Sep 25, 2024
7d2622f
Avoid factorization where it is apparently expensive.
HechtiDerLachs Sep 25, 2024
8866d53
Extract types for resolutions of singularities to its own file.
HechtiDerLachs Sep 26, 2024
59e12e1
Attempt to re-enable simultaneous blowup.
HechtiDerLachs Sep 26, 2024
e37061c
Fix up performance for simultaneous blowup.
HechtiDerLachs Sep 26, 2024
b69ce30
Fix up restrition to closed embeddings.
HechtiDerLachs Sep 26, 2024
f8645db
Make elimination an option in radical computation and update docstring.
HechtiDerLachs Sep 26, 2024
cfd8e63
Speed up arithmetic in localized rings.
HechtiDerLachs Sep 27, 2024
c2bea04
Speed up restriction of maps by introducing _images_of_generators.
HechtiDerLachs Sep 27, 2024
6545b39
Make radical accept keyword arguments for quotient rings.
HechtiDerLachs Sep 27, 2024
c7f921c
Disable internal checks.
HechtiDerLachs Sep 27, 2024
e8cf31d
Polish method for simultaneous blowups.
HechtiDerLachs Sep 27, 2024
5052fa1
Avoid hashing of types for ideals.
HechtiDerLachs Sep 27, 2024
a467cd6
Adapt to the blowdown->blowup story.
HechtiDerLachs Sep 27, 2024
7c5e63b
Merge branch 'master' into some_more_fixes
HechtiDerLachs Sep 27, 2024
7807c56
Remove duplicate type declarations.
HechtiDerLachs Sep 27, 2024
4173626
Move the other type as well.
HechtiDerLachs Sep 27, 2024
1a5e0e3
Re-establish some compositions.
HechtiDerLachs Sep 30, 2024
06ad700
Merge branch 'master' into some_more_fixes
HechtiDerLachs Sep 30, 2024
6a10434
Fix up compositions.
HechtiDerLachs Sep 30, 2024
32b5883
Take out inferred from the tests where we can't guarantee for anythin…
HechtiDerLachs Sep 30, 2024
fff3d65
Fix tests.
HechtiDerLachs Sep 30, 2024
afd68e1
Fix up mapping.
HechtiDerLachs Sep 30, 2024
67c4d72
Fix up some more composition.
HechtiDerLachs Sep 30, 2024
fac1013
Overhaul composition once again.
HechtiDerLachs Oct 1, 2024
37bd37a
Put type declarations outside and extend composition methods slightly.
HechtiDerLachs Oct 1, 2024
71503c8
Disable new methods for the moment.
HechtiDerLachs Oct 1, 2024
67265a0
Pass on the check flag in some more cases.
HechtiDerLachs Oct 1, 2024
05e5518
Hopefully fix up tests.
HechtiDerLachs Oct 1, 2024
1e4fb10
Fix up composition.
HechtiDerLachs Oct 1, 2024
ca8ea64
Fix up tests.
HechtiDerLachs Oct 1, 2024
6429108
Fix doctests in AG.
HechtiDerLachs Oct 1, 2024
dd08681
Allow slightly more flexibility in the strict transform of closed emb…
HechtiDerLachs Oct 1, 2024
ebacd2e
Catch an important special case in is_refinement.
HechtiDerLachs Oct 1, 2024
8fe421c
Fix doctests in mpoly-ideals.
HechtiDerLachs Oct 1, 2024
183ecf4
Fix doctests in FTheoryTools.
HechtiDerLachs Oct 1, 2024
4d7f64e
Fix doctests in AlgebraicStatistics.
HechtiDerLachs Oct 1, 2024
d93df25
Disable isomorphism_on_open_subset.
HechtiDerLachs Oct 1, 2024
cace0ba
Merge branch 'master' into some_more_fixes
HechtiDerLachs Oct 1, 2024
63c1e3f
Revert "Fix doctests in AlgebraicStatistics."
HechtiDerLachs Oct 2, 2024
8ec2a8d
Revert "Fix doctests in FTheoryTools."
HechtiDerLachs Oct 2, 2024
cc4a956
Actually remove isomorphism_on_open_subset.
HechtiDerLachs Oct 2, 2024
a03191c
Remove duplicated code for compositions.
HechtiDerLachs Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,22 @@ function _simplify_matrix!(A::SMat; find_pivot=nothing)
end

# Adjust Sinv_transp
inc_row = sum(a*Sinv_transp[i] for (i, a) in a_col_del; init=sparse_row(R))
#inc_row = sum(a*Sinv_transp[i] for (i, a) in a_col_del; init=sparse_row(R))
inc_row = sparse_row(R)
for (i, a) in a_col_del
#is_zero(Sinv_transp[i]) && continue # can not be true since S is invertible
Hecke.add_scaled_row!(Sinv_transp[i], inc_row, a)
end
Hecke.add_scaled_row!(inc_row, Sinv_transp[p], uinv)

# Adjust T
#T[q] = T[q] + sum(uinv*a*T[i] for (i, a) in a_row_del; init=sparse_row(R))
Hecke.add_scaled_row!(sum(a*T[i] for (i, a) in a_row_del if !iszero(T[i]); init=sparse_row(R)), T[q], uinv)
inc_row = sparse_row(R)
for (i, a) in a_row_del
# is_zero(T[i]) && continue # can not be true since T is invertible
Hecke.add_scaled_row!(T[i], inc_row, a)
end
Hecke.add_scaled_row!(inc_row, T[q], uinv)

# Adjust Tinv_transp
v = deepcopy(Tinv_transp[q])
Expand Down
36 changes: 27 additions & 9 deletions src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,19 @@ Ideal generated by
3*a*b*c
```
"""
@attr T function radical(I::T) where {T <: MPolyIdeal}
@attr MPolyIdeal{T} function radical(I::MPolyIdeal{T}) where {T <: MPolyRingElem}
# Calling `elimpart` (within `simplify`) turns out to significantly speed things up in many cases.
R = base_ring(I)
Q, pr = quo(R, I)
S, iso, iso_inv = simplify(Q)
J = modulus(S)
pre_res = _compute_radical(J)
res = ideal(R, elem_type(R)[lift(iso_inv(S(g))) for g in gens(pre_res)]) + I
set_attribute!(res, :is_radical=>true)
return res
end

function _compute_radical(I::T) where {T <: MPolyIdeal}
R = base_ring(I)
if isa(base_ring(R), NumField) && !isa(base_ring(R), AbsSimpleNumField)
A, mA = absolute_simple_field(base_ring(R))
Expand Down Expand Up @@ -629,7 +641,7 @@ end

function map_coefficients(mp, I::MPolyIdeal; parent = nothing)
if parent === nothing
parent = Oscar.parent(map_coefficients(mp, gen(I, 1)))
parent = Oscar.parent(map_coefficients(mp, zero(base_ring(I))))
end
return ideal(parent, [map_coefficients(mp, g, parent = parent) for g = gens(I)])
end
Expand All @@ -642,12 +654,10 @@ Return whether `I` is a radical ideal.
Computes the radical.
"""
@attr Bool function is_radical(I::MPolyIdeal)
if has_attribute(I, :is_prime) && is_prime(I)
return true
end

return I == radical(I)
has_attribute(I, :is_prime) && is_prime(I) && return true
return is_subset(radical(I), I)
end

#######################################################
@doc raw"""
primary_decomposition(I::MPolyIdeal; algorithm = :GTZ, cache=true)
Expand Down Expand Up @@ -1150,6 +1160,7 @@ function minimal_primes(
J = K
end
result = unique!(filter!(!is_one, vcat([minimal_primes(j; algorithm, factor_generators=false) for j in J]...)))

# The list might not consist of minimal primes only. We have to discard the embedded ones
final_list = typeof(I)[]
for p in result
Expand Down Expand Up @@ -1209,7 +1220,7 @@ julia> L = equidimensional_decomposition_weak(I)
Ideal with 1 generator
```
"""
@attr Any function equidimensional_decomposition_weak(I::MPolyIdeal)
@attr Vector{typeof(I)} function equidimensional_decomposition_weak(I::MPolyIdeal)
R = base_ring(I)
iszero(I) && return [I]
@req coefficient_ring(R) isa AbstractAlgebra.Field "The coefficient ring must be a field"
Expand All @@ -1235,7 +1246,7 @@ julia> L = equidimensional_decomposition_weak(I)
return V
end

@attr Any function equidimensional_decomposition_weak(
@attr Vector{typeof(I)} function equidimensional_decomposition_weak(
I::MPolyIdeal{T}
) where {U<:Union{AbsSimpleNumFieldElem, <:Hecke.RelSimpleNumFieldElem}, T<:MPolyRingElem{U}}
R = base_ring(I)
Expand Down Expand Up @@ -2249,3 +2260,10 @@ function flag_pluecker_ideal(ring::MPolyRing{<: FieldElem}, dimensions::Vector{I
isReduced=true,
isGB=true))
end

# Since most ideals implement `==`, they have to implement the hash function.
# See issue #4143 for problems entailed. This should fix it.
function hash(I::Ideal, c::UInt)
return UInt(0)
end
HechtiDerLachs marked this conversation as resolved.
Show resolved Hide resolved
HechtiDerLachs marked this conversation as resolved.
Show resolved Hide resolved

Loading