From 493a6c953e8ebe4aa2eccc0668e3393f0cf47c86 Mon Sep 17 00:00:00 2001 From: HechtiDerLachs Date: Fri, 4 Oct 2024 13:46:50 +0200 Subject: [PATCH] Fix up decomposition_info. --- .../Schemes/Covering/Objects/Attributes.jl | 16 ++++++++++------ .../Schemes/Sheaves/CoherentSheaves.jl | 13 ------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/AlgebraicGeometry/Schemes/Covering/Objects/Attributes.jl b/src/AlgebraicGeometry/Schemes/Covering/Objects/Attributes.jl index 34fe511ed2d5..59aba4d43022 100644 --- a/src/AlgebraicGeometry/Schemes/Covering/Objects/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/Covering/Objects/Attributes.jl @@ -107,18 +107,22 @@ function inherit_decomposition_info!( for V in patches(orig_cov) # Collect the patches in `ref_cov` refining V - V_ref = [U for U in patches(ref_cov) if decomp_dict[U][1] === V] - # Collect the corresponding complement equations - comp_eqns = [decomp_dict[U][2] for U in V_ref] + V_ref = [(U, (UV, h)) for (U, (UV, h)) in decomp_dict if UV === V] + _compl(a) = sum(length(lifted_numerator(b)) + length(lifted_denominator(b)) for b in a[2][2]; init=0) + V_ref = sort!(V_ref, by=_compl) # Start out from the original decomposition info dec_inf = copy(decomposition_info(orig_cov)[V]) - for (i, U) in enumerate(V_ref) + for (i, (U, (_, h))) in enumerate(V_ref) # Cast the already made decomposition info down to U tmp = elem_type(OO(U))[OX(V, U)(i) for i in dec_inf] # help the compiler # Append the equations for the previously covered patches for j in 1:i-1 - W = V_ref[j] - surplus = OX(V, U).(decomp_dict[W][2]) + (_, (_, hh)) = V_ref[j] + if is_empty(hh) # The patch for hh already covered everything; this one can hence be discarded. + push!(tmp, one(OO(U))) + break + end + surplus = OX(V, U).(hh) push!(tmp, prod(surplus; init=one(OO(U)))) end set_decomposition_info!(ref_cov, U, tmp) diff --git a/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl b/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl index ba41a41b91b6..3cda7aa99ce2 100644 --- a/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl +++ b/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl @@ -784,19 +784,6 @@ end return C end -function inherit_decomposition_info!(C::Covering, X::AbsCoveredScheme) - D = default_covering(X) - OOX = OO(X) - if has_decomposition_info(D) - for U in patches(C) - V = __find_chart(U, D) - phi = OOX(V, U) - set_decomposition_info!(C, U, phi.(decomposition_info(D)[V])) - end - end - return C -end - @attr Covering function trivializing_covering(M::HomSheaf) X = scheme(M) OOX = OO(X)