@@ -3,6 +3,7 @@ function HermiteReduce(f::AbstractAlgebra.ResFieldElem{P}, DE::AlgebraicExtensio
3
3
{T<: FieldElement , P<: PolyElem{T} }
4
4
# "Lazy" Hermite reduction, see Section 2.1 of:
5
5
# Manuel Bronstein. Symbolic integration tutorial. ISSAC’98, 1998.
6
+ # http://www-sop.inria.fr/cafe/Manuel.Bronstein/publications/issac98.pdf
6
7
iscompatible (f, DE) || error (" rational function f must be in the domain of derivation D" )
7
8
8
9
E = parent (f)
@@ -136,15 +137,15 @@ end
136
137
function IntegralBasis (E:: AbstractAlgebra.ResField{P} ) where {T<: FieldElement , P<: PolyElem{T} }
137
138
# Trager's algorithm, see Chapter 2 of
138
139
# B.M. Trager. On the integration of algebraic functions. PhD thesis, MIT, Computer Science, 1984.
140
+ # https://dspace.mit.edu/bitstream/handle/1721.1/15391/12487590-MIT.pdf
139
141
Ky = base_ring (E)
140
142
K = base_ring (Ky)
141
143
y = E (gen (Ky))
142
144
f = modulus (E)
143
145
n = degree (f)
144
146
M_n_n = MatrixSpace (K, n, n)
145
147
MP_n_n = MatrixSpace (base_ring (K), n, n)
146
- D = resultant (f, derivative (f))
147
- println ()
148
+ D = resultant (f, derivative (f))
148
149
@assert isone (denominator (D))
149
150
D = numerator (D)
150
151
D = 1 // leading_coefficient (D) * D
@@ -163,14 +164,14 @@ function IntegralBasis(E::AbstractAlgebra.ResField{P}) where {T<:FieldElement, P
163
164
164
165
# Compute J, the Q-trace radical of V
165
166
ZE = zero (E)
166
- S = [p <= q ? bs[p ]* bs[q ] : ZE for p = 1 : n, q = 1 : n] # only upper triangle needed
167
+ S = [i <= j ? bs[i ]* bs[j ] : ZE for i = 1 : n, j = 1 : n] # only upper triangle needed
167
168
ZK = zero (K)
168
169
# TODO : optimize computation of TM, which is one of the bottlenecks.
169
170
# Compute only upper triangle of TM, lower triangle by symmetry:
170
- TM = [p <= q ? numerator (sum ([coeff (data (S[p,q ]* y^ j ), j ) for j = 0 : n- 1 ])) : ZK for p = 1 : n, q = 1 : n]
171
- for p = 1 : n
172
- for q = 1 : p- 1
173
- TM[p,q] = TM[q,p ]
171
+ TM = [i <= j ? numerator (sum ([coeff (data (S[i, j ]* y^ l ), l ) for l = 0 : n- 1 ])) : ZK for i = 1 : n, j = 1 : n]
172
+ for i = 1 : n
173
+ for j = 1 : p- 1
174
+ TM[i, j] = TM[j, i ]
174
175
end
175
176
end
176
177
H = hnf (vcat (MP_n_n (TM), MP_n_n (Q)))[1 : n,:] # Hermite normal form
0 commit comments