Skip to content

Commit

Permalink
feat: try to make padic regulator faster
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Jan 16, 2024
1 parent 693610a commit 6441c36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions examples/NFDB.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ end
#
################################################################################

function _p_adic_regulator(K, p)
function _p_adic_regulator(K, p, fast::Bool = false)
if !is_normal(K)
return _padic_regulator_non_normal(K, p)
end
Expand All @@ -1173,9 +1173,18 @@ function _p_adic_regulator(K, p)
if prec > 2^15
error("Precision >= 2^15, something is wrong")
end
C, mC = completion(K, P, prec)
local C, mC
if fast
try
C, mC = completion_easy(K, P)
catch
C, mC = completion(K, P)
end
else
C, mC = completion(K, P)
end
Rmat = zero_matrix(C, r, r)
D = Dict{nf_elem, LocalFieldElem{qadic, EisensteinLocalField}}()
D = Dict{nf_elem, elem_type(C)}()
for i in 1:r
for j in 1:r
Rmat[i, j] = _evaluate_log_of_fac_elem(mC, P, mA(A[i])(mU(U[j + 1])), D) # j + 1, because the fundamental units correspond to U[2],..,U[r + 1]
Expand Down
2 changes: 1 addition & 1 deletion src/LocalField/Conjugates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ function regulator_iwasawa(u::Vector{T}, C::qAdicConj, n::Int = 10) where {T<: U
@assert is_totally_real(k)
c = map(x -> conjugates_log(x, C, n, all = true, flat = false), u)
m = matrix(c)
m = hcat(m, matrix(base_ring(m), nrows(m), 1, [one(base_ring(m)) for i=1:nrows(m)]))
m = vcat(m, matrix(base_ring(m), 1, ncols(m), [one(base_ring(m)) for i=1:ncols(m)]))

Check warning on line 375 in src/LocalField/Conjugates.jl

View check run for this annotation

Codecov / codecov/patch

src/LocalField/Conjugates.jl#L375

Added line #L375 was not covered by tests
return det(m)//degree(k)
end

Expand Down

0 comments on commit 6441c36

Please sign in to comment.