Skip to content

Commit 19d4882

Browse files
authored
FTheoryTools: Extend CI tests (#4784)
1 parent 38a83a3 commit 19d4882

File tree

1 file changed

+38
-0
lines changed
  • experimental/FTheoryTools/test

1 file changed

+38
-0
lines changed

experimental/FTheoryTools/test/QSMs.jl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,41 @@ g4_exp = flux_instance(fg_not_breaking, [3], [])
2929
@test euler_characteristic(qsm_model) == integrate((3 * Kbar * (4 * c2_B + 5 * Kbar^2)) * V * cy)
3030
@test d3_tadpole_constraint(g4_exp) == 12 + 5//8 * Kbar3 - 45//(2 * Kbar3)
3131
end
32+
33+
@testset "Advanced intersection theory and QSM-fluxes" begin
34+
qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 4))
35+
h22_converter_dict = converter_dict_h22_ambient(qsm_model, check = false)
36+
coh_ring = cohomology_ring(ambient_space(qsm_model), check = false)
37+
coh_ring_gens = gens(coh_ring)
38+
for (key, value) in h22_converter_dict
39+
obj1 = coh_ring_gens[key[1]] * coh_ring_gens[key[2]]
40+
obj2 = sum(value[k][1] * coh_ring_gens[value[k][2][1]] * coh_ring_gens[value[k][2][2]] for k in 1:length(value))
41+
@test obj1 == obj2
42+
end
43+
qsm_g4_flux = qsm_flux(qsm_model)
44+
h22_basis = basis_of_h22_hypersurface_indices(qsm_model, check = false)
45+
flux_poly_str = string(polynomial(cohomology_class(qsm_g4_flux)))
46+
ring = base_ring(parent(polynomial(cohomology_class(qsm_g4_flux))))
47+
flux_poly = Oscar.eval_poly(flux_poly_str, ring)
48+
coeffs = collect(coefficients(flux_poly))
49+
raw_exps = collect(exponents(flux_poly))
50+
massaged_exps = [length(pos) == 1 ? (pos[1], pos[1]) : Tuple(sort(pos)) for pos in (findall(!=(0), mon) for mon in raw_exps)]
51+
flux_vector = fill(QQ(0), length(h22_basis))
52+
for (i, exp_pair) in enumerate(massaged_exps)
53+
idx = findfirst(==(exp_pair), h22_basis)
54+
flux_vector[idx] = coeffs[i]
55+
end
56+
flux_vector = transpose(matrix(QQ, [flux_vector]))
57+
fg = special_flux_family(qsm_model; not_breaking = true, check = false, algorithm = "special")
58+
@test ncols(matrix_integral(fg)) == 1
59+
@test nrows(matrix_integral(fg)) == nrows(matrix_rational(fg))
60+
@test unique(offset(fg)) == [0]
61+
M1 = matrix_integral(fg)
62+
M2 = matrix_rational(fg)
63+
large_M = hcat(M1, M2)
64+
@test rank(large_M) == minimum(size(large_M))
65+
solution = solve(large_M, flux_vector, side = :right)
66+
@test is_integer(solution[1])
67+
reconstructed_flux = flux_instance(fg, matrix(ZZ, [[solution[1]]]), solution[2:end,:])
68+
@test cohomology_class(qsm_g4_flux) == cohomology_class(reconstructed_flux)
69+
end

0 commit comments

Comments
 (0)