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

Linear solving for p-adic residue rings #1533

Merged
merged 5 commits into from
Jun 4, 2024
Merged

Conversation

joschmitt
Copy link
Collaborator

Use the Howell form for linear solving over the new LocalFieldValuationRingResidueRings.

The kernel method is copied from the zzModMatrix version in Nemo. I have no idea whether this is correct; it seems to work.

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 98.73418% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.58%. Comparing base (7a5bac9) to head (1d6498d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1533      +/-   ##
==========================================
+ Coverage   75.50%   75.58%   +0.08%     
==========================================
  Files         355      355              
  Lines      113184   113320     +136     
==========================================
+ Hits        85464    85658     +194     
+ Misses      27720    27662      -58     
Files Coverage Δ
src/LocalField/ResidueRing.jl 99.44% <100.00%> (+4.80%) ⬆️
src/LocalField/Ring.jl 75.59% <100.00%> (+2.57%) ⬆️
src/NumFieldOrd/NfOrd/StrongEchelonForm.jl 55.61% <98.55%> (+12.79%) ⬆️

... and 33 files with indirect coverage changes

@joschmitt
Copy link
Collaborator Author

@simonbrandhorst does this help you in #1510?

@simonbrandhorst
Copy link
Collaborator

Thanks for contributing this! When I tried it I got the following error message:

ERROR: MethodError: no method matching ^(::Hecke.LocalFieldValuationRingResidueRingElem{Hecke.LocalField{…}, Hecke.LocalFieldElem{…}}, ::QQFieldElem)

Closest candidates are:
  ^(::RealFieldElem, ::QQFieldElem)
   @ Nemo ~/.julia/packages/Nemo/my7xb/src/arb/Real.jl:788
  ^(::RealFieldElem, ::QQFieldElem, ::Int64)
   @ Nemo ~/.julia/packages/Nemo/my7xb/src/arb/Real.jl:788
  ^(::ComplexFieldElem, ::QQFieldElem)
   @ Nemo ~/.julia/packages/Nemo/my7xb/src/arb/Complex.jl:315
  ...

Stacktrace:
  [1] annihilator(a::Hecke.LocalFieldValuationRingResidueRingElem{Hecke.LocalField{…}, Hecke.LocalFieldElem{…}})
    @ Hecke ~/.julia/dev/Hecke/src/LocalField/ResidueRing.jl:302
  [2] strong_echelon_form_naive!(A::AbstractAlgebra.Solve.LazyTransposeMatElem{…})
    @ Hecke ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl:158
  [3] howell_form!(A::AbstractAlgebra.Solve.LazyTransposeMatElem{Hecke.LocalFieldValuationRingResidueRingElem{…}, AbstractAlgebra.Generic.MatSpaceElem{…}})
    @ Hecke ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl:210
  [4] _can_solve_internal_no_check(A::AbstractAlgebra.Generic.MatSpaceElem{…}, b::AbstractAlgebra.Generic.MatSpaceElem{…}, task::Symbol; side::Symbol)
    @ Hecke ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl:263
  [5] _can_solve_internal_no_check
    @ ~/.julia/dev/Hecke/src/NumFieldOrd/NfOrd/StrongEchelonForm.jl:246 [inlined]
  [6] _can_solve_internal(A::AbstractAlgebra.Generic.MatSpaceElem{…}, b::AbstractAlgebra.Generic.MatSpaceElem{…}, task::Symbol; side::Symbol)
    @ AbstractAlgebra.Solve ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:644
  [7] _can_solve_internal
    @ ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:636 [inlined]
  [8] #can_solve_with_solution#11
    @ ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:456 [inlined]
  [9] can_solve_with_solution
    @ ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:455 [inlined]
 [10] #solve#9
    @ ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:417 [inlined]
 [11] solve
    @ ~/.julia/packages/AbstractAlgebra/dLVCE/src/Solve.jl:416 [inlined]

The bug lies in ResidueRing.jl

function annihilator(a::LocalFieldValuationRingResidueRingElem)
  if is_zero(a)
    return one(parent(a))
  end
  pi = uniformizer(_valuation_ring(parent(a)))
  return parent(a)(pi)^(_exponent(parent(a)) - (valuation(data(a))))
end

the valuation seems to be a QQFieldElem

@joschmitt
Copy link
Collaborator Author

This is fixed now. I should have tested with more obscure extensions, thanks for catching it!

@joschmitt
Copy link
Collaborator Author

From my side, this is good to go. I'm even convinced for the moment that the algorithm for the kernel is correct.

@thofma thofma merged commit 94b4536 into thofma:master Jun 4, 2024
18 checks passed
@joschmitt joschmitt deleted the js/howell branch June 5, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants