Skip to content

Commit

Permalink
I hate lin. alg.
Browse files Browse the repository at this point in the history
  • Loading branch information
fieker committed Nov 7, 2024
1 parent 52c9e9d commit 5edb844
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/NumField/NfAbs/MultDep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,11 @@ function syzygies_units_mod_tor(A::Vector{FacElem{AbsSimpleNumFieldElem, AbsSimp
U = matrix(FlintZZ, length(uu), length(uu[end][2]), reduce(vcat, [x[2] for x = uu]))
U = hcat(U[:, 1:length(u)], U[:, r+1:ncols(U)])
end

U = saturate(U)

_, U = hnf_with_transform(transpose(U))

k = base_ring(A[1])

U = inv(U)
Expand All @@ -350,13 +353,14 @@ function syzygies_units_mod_tor(A::Vector{FacElem{AbsSimpleNumFieldElem, AbsSimp

#so basis is A[indep] cat A[dep] ^U
#rels: A[tor], .. * V
nt = zero_matrix(ZZ, length(A), length(dep) + length(indep))
nt = zero_matrix(ZZ, length(A), length(A))
for i=1:length(indep)
nt[i, indep[i]] = 1
nt[indep[i], i] = 1
end
for i=1:length(dep)
nt[i+length(indep), dep[i]] = 1
nt[dep[i], i+length(indep)] = 1
end
@assert matrix([collect(1:length(A))]) * nt == matrix([vcat(indep, dep)])
rel = nt*transpose(V)
return nt*transpose(U), rel
end
Expand Down

0 comments on commit 5edb844

Please sign in to comment.