Skip to content

Commit adb3a14

Browse files
committed
fixed bug in compute_controlled_matrix
1 parent 0c2cf92 commit adb3a14

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

src/FindMonomialBasis.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ function compute_basis_matrix(f, l, m, R, PR, termorder)
5959
return M
6060
end
6161

62-
# Given $f, m, l$, over the ring $\texttt{PR} = R[x_0, \dots, x_n]$, and the set $S\subseteq \{0, ..., n\}$, computes
63-
# the matrix for the map
64-
# $$(\mu_0, \dots, \mu_n) \mapsto \sum_{i\in S} \mu_i \partial_i f + \sum_{i\not\in S} \mu_i x_i \partial_i f$$
65-
# where $\mu_i$ for $0\leq i < |S|$ are of degree $l - (d - 1)$ and $\mu_i$ for
66-
# $|S| \leq i \leq n$ are of degree $l - d$.
67-
#
62+
6863
"""
6964
compute_controlled_matrix(f, l, S, R, PR, params)
7065
71-
what does this do again?
66+
Given f, m, l, over the ring PR = R[x_0, ..., x_n], and the set S subseteq {0, ..., n}, computes
67+
the matrix for the map
68+
(mu_0, ..., mu_n) |--> sum_{i in S} mu_i partial_i f + sum_{i notin S} mu_i x_i partial_i f
69+
where mu_i for 0<= i < |S| are of degree l - (d - 1) and mu_i for
70+
|S| <= i <= n are of degree l - d.
71+
7272
"""
7373
function compute_controlled_matrix(f, l, S, R, PR, params)
7474
n = nvars(parent(f)) - 1
@@ -103,7 +103,7 @@ function compute_controlled_matrix(f, l, S, R, PR, params)
103103
partials = reverse(partials) # one needs to be quite careful with the ordering of partials
104104
notS = reverse(notS)
105105
end
106-
106+
107107
for i in 1:len_S
108108
var = S[i]
109109
for monomial in eachindex(in_set_mons)
@@ -112,14 +112,16 @@ function compute_controlled_matrix(f, l, S, R, PR, params)
112112
end
113113
end
114114

115+
ind_S = in_set_section * len_S
116+
115117
for i in (len_S+1):n+1
116118
var = notS[i-len_S]
117119
for monomial in eachindex(not_in_set_mons)
118-
M[:, not_in_set_section * (i-1) + monomial] = polynomial_to_vector(not_in_set_mons[monomial] * vars[var+1] * partials[i-len_S], n+1, R, PR, params.termorder)
120+
M[:, ind_S + not_in_set_section * (i-len_S-1) + monomial] = polynomial_to_vector(not_in_set_mons[monomial] * vars[var+1] * partials[i-len_S], n+1, R, PR, params.termorder)
119121
#M[:, not_in_set_section * (i-1) + monomial] = polynomial_to_vector(not_in_set_mons[monomial] * vars[i] * partials[i], n+1, R, PR, params.termorder)
120122
end
121123
end
122-
println(rank(M))
124+
123125
return M
124126
end
125127

src/ZetaFunction.jl

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -294,20 +294,6 @@ function zeta_function(f; S=[-1], verbose=false, givefrobmat=false, algorithm=:c
294294
(9 < verbose) && println("Basis of cohomology is $Basis")
295295

296296
(hodge_polygon, r_m, N_m, M) = precision_information(f,Basis,verbose)
297-
#print(find_Ssmooth_model(f, M, S, params))
298-
#hodge_polygon = hodgepolygon(Basis, n)
299-
#hodge_numbers = hodge_polygon.slopelengths
300-
#(9 < verbose) && println("Hodge numbers = $hodge_numbers")
301-
302-
#k = sum(hodge_numbers) # dimension of H^n
303-
#(9 < verbose) && println("There are $k basis elements in H^$n")
304-
305-
#r_m = calculate_relative_precision(hodge_polygon, n-1, p)
306-
##r_m = relative_precision(k, p)
307-
##N_m = series_precision(r_m, p, n) # series precision
308-
##M = algorithm_precision(r_m, N_m, p)
309-
#N_m = series_precision(p,n,d,r_m)
310-
#M = algorithm_precision(p,n,d,r_m,N_m)
311297

312298
(9 < verbose) && println("We work modulo $p^$M, and compute up to the $N_m-th term of the Frobenius power series")
313299
(0 < verbose) && println("algorithm precision: $M, series precision: $N_m")
@@ -325,6 +311,14 @@ function zeta_function(f; S=[-1], verbose=false, givefrobmat=false, algorithm=:c
325311
S = collect(0:n)
326312
end
327313

314+
if (0 < verbose)
315+
println("Starting linear algebra problem")
316+
@time f, pseudo_inverse_mat_new = find_Ssmooth_model(f, M, S, params)
317+
else
318+
#pseudo_inverse_mat_new = pseudo_inverse_controlled_lifted(f,S,l,M,params)
319+
f, pseudo_inverse_mat_new = find_Ssmooth_model(f, M, S, params)
320+
end
321+
328322
#=
329323
BasisTLift = []
330324
for i in basis
@@ -369,12 +363,6 @@ function zeta_function(f; S=[-1], verbose=false, givefrobmat=false, algorithm=:c
369363
#end
370364
l = d * n - n + d - length(S)
371365

372-
if (0 < verbose)
373-
println("Starting linear algebra problem")
374-
@time pseudo_inverse_mat_new = pseudo_inverse_controlled_lifted(f,S,l,M,params)
375-
else
376-
pseudo_inverse_mat_new = pseudo_inverse_controlled_lifted(f,S,l,M,params)
377-
end
378366

379367
MS = matrix_space(precisionring, nrows(pseudo_inverse_mat_new), ncols(pseudo_inverse_mat_new))
380368
pseudo_inverse_mat = MS()

0 commit comments

Comments
 (0)