Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
Showing only changes of commit ef33b8ee10 - Show all commits

View File

@ -31,7 +31,7 @@ if n_pos + n_neg == size(gram, 1)
else else
printbad("Degenerate subspace") printbad("Degenerate subspace")
end end
sig_rem = Int64[ones(2-n_pos); -ones(3-n_neg)] sig_rem = Int64[ones(1-n_pos); -ones(4-n_neg)]
unk = hcat(a, b, c) unk = hcat(a, b, c)
M = matrix_space(F, 5, 5) M = matrix_space(F, 5, 5)
big_gram = M(F.([ big_gram = M(F.([
@ -75,3 +75,11 @@ else
printbad("Didn't recover Gram matrix. Instead, got:") printbad("Didn't recover Gram matrix. Instead, got:")
end end
display(big_gram_recovered) display(big_gram_recovered)
# this should be a solution
hand_solution = [0 0 1 0 0; 0 0 -1 2 2; 0 0 0 1 -1; 1 0 0 0 0; 0 1 0 0 0]
unmix = Rational{Int64}[[1//2 1//2; 1//2 -1//2] zeros(Int64, 2, 3); zeros(Int64, 3, 2) Matrix{Int64}(I, 3, 3)]
hand_solution_diag = unmix * hand_solution
big_gram_hand_recovered = transpose(hand_solution_diag) * diagm([1; -ones(Int64, 4)]) * hand_solution_diag
println("Gram matrix from hand-written solution:")
display(big_gram_hand_recovered)