Skip to content

Commit 03c24f5

Browse files
HereAroundfingolfin
andcommitted
[FTheoryTools] Code improvements
Co-authored-by: Max Horn <max@quendi.de>
1 parent 19c19fb commit 03c24f5

4 files changed

Lines changed: 12 additions & 19 deletions

File tree

experimental/FTheoryTools/src/FamilyOfG4Fluxes/attributes.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; check::Bool = true)
155155
if arxiv_doi(m) == "10.48550/arXiv.1511.03209"
156156
S = cox_ring(ambient_space(m))
157157
gS = gens(cox_ring(ambient_space(m)))
158-
linear_relations = matrix(QQ, matrix(ZZ, rays(ambient_space(m))))
158+
linear_relations = matrix(QQ, rays(ambient_space(m)))
159159
scalings = [c.coeff for c in S.d]
160160
mnf = Oscar._minimal_nonfaces(ambient_space(m))
161161
sr_ideal_pos = [Vector{Int}(Polymake.row(mnf, i)) for i in 1:Polymake.nrows(mnf)]
@@ -173,8 +173,7 @@ function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; check::Bool = true)
173173
numb_rat_parameters = ncols(matrix_rational(fgs))
174174

175175
# Create a polynomial ring with parameters ai for the integral_parameters and ri for the rational parameters
176-
gens_strings = vcat([["a$(k)" for k in 1:numb_int_parameters], ["r$(k)" for k in 1:numb_rat_parameters]]...)
177-
amb_ring, gens = polynomial_ring(QQ, gens_strings)
176+
amb_ring, my_gens = polynomial_ring(QQ, "a#" => 1:numb_int_parameters, "r#" => 1: numb_rat_parameters)
178177

179178
# Extract ambient space basis of G4-flux candidates used to express flux family in
180179
basis = ambient_space_models_of_g4_fluxes(m, check = check)
@@ -207,7 +206,8 @@ function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; check::Bool = true)
207206
for l1 in 1:length(basis)
208207
for l2 in 1:length(basis)
209208

210-
gen1[l1] * gen2[l2] == 0 && continue
209+
val = gen1[l1] * gen2[l2]
210+
is_zero(val) && continue
211211

212212
my_tuple = Tuple(sort([basis_indices[l1]..., basis_indices[l2]...]))
213213

@@ -219,13 +219,13 @@ function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; check::Bool = true)
219219
end
220220
end
221221

222-
inter_number += gen1[l1] * gen2[l2] * change
222+
inter_number += val * change
223223

224224
end
225225
end
226226

227227
# Update the D3-tadpole constraint polynomial
228-
tadpole_constraint_polynomial += inter_number * gens[k1] * gens[k2]
228+
tadpole_constraint_polynomial += inter_number * my_gens[k1] * my_gens[k2]
229229

230230
end
231231
end

experimental/FTheoryTools/src/FamilyOfG4Fluxes/special_constructors.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ properties.
88
This family is modelled by the restriction of cohomology classes on the toric
99
ambient space to the hypersurface in question. In the toric ambient space,
1010
those cohomology classes are vertical, i.e. are of the form $a \wedge b$ for
11-
$a,b \in H^(1,1)(X_\Sigma)$ with $X_\Sigma$. Note that this does NOT mean that
11+
$a,b \in H^(1,1)(X_\Sigma)$ with $X_\Sigma$. Note that this does NOT mean that
1212
they are vertical on the hypersurface, which defines the actual F-theory
1313
geometry. We further subject this family to the consistency conditions for
1414
being well-quantized. Unless explicitly asked differently, it is this family of
@@ -159,7 +159,7 @@ function well_quantized_ambient_space_models_of_g4_fluxes(m::AbstractFTheoryMode
159159
# (2) Compute data, that is frequently used by the sophisticated intersection product below
160160
S = cox_ring(ambient_space(m))
161161
gS = gens(cox_ring(ambient_space(m)))
162-
linear_relations = matrix(QQ, matrix(ZZ, rays(ambient_space(m))))
162+
linear_relations = matrix(QQ, rays(ambient_space(m)))
163163
scalings = [c.coeff for c in S.d]
164164
mnf = Oscar._minimal_nonfaces(ambient_space(m))
165165
sr_ideal_pos = [Vector{Int}(Polymake.row(mnf, i)) for i in 1:Polymake.nrows(mnf)]
@@ -400,7 +400,7 @@ function well_quantized_and_vertical_ambient_space_models_of_g4_fluxes(m::Abstra
400400
# (2) Compute data, that is frequently used by the sophisticated intersection product below
401401
S = cox_ring(ambient_space(m))
402402
gS = gens(cox_ring(ambient_space(m)))
403-
linear_relations = matrix(QQ, matrix(ZZ, rays(ambient_space(m))))
403+
linear_relations = matrix(QQ, rays(ambient_space(m)))
404404
scalings = [c.coeff for c in S.d]
405405
mnf = Oscar._minimal_nonfaces(ambient_space(m))
406406
sr_ideal_pos = [Vector{Int}(Polymake.row(mnf, i)) for i in 1:Polymake.nrows(mnf)]
@@ -735,7 +735,7 @@ function well_quantized_and_vertical_and_no_non_abelian_gauge_group_breaking_amb
735735
# (2) Compute data, that is frequently used by the sophisticated intersection product below
736736
S = cox_ring(ambient_space(m))
737737
gS = gens(cox_ring(ambient_space(m)))
738-
linear_relations = matrix(QQ, matrix(ZZ, rays(ambient_space(m))))
738+
linear_relations = matrix(QQ, rays(ambient_space(m)))
739739
scalings = [c.coeff for c in S.d]
740740
mnf = Oscar._minimal_nonfaces(ambient_space(m))
741741
sr_ideal_pos = [Vector{Int}(Polymake.row(mnf, i)) for i in 1:Polymake.nrows(mnf)]

experimental/FTheoryTools/src/G4Fluxes/attributes.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ function d3_tadpole_constraint(gf::G4Flux; check::Bool = true)
105105
cy = polynomial(cohomology_class(toric_divisor_class(ambient_space(m), degree(hypersurface_equation(m)))))
106106
numb = QQ(euler_characteristic(m; check = check)//24 - 1//2*integrate(cohomology_class(ambient_space(m), polynomial(cohomology_class(gf)) * polynomial(cohomology_class(gf)) * cy); check = check))
107107
set_attribute!(gf, :d3_tadpole_constraint, numb)
108-
if numb >= 0 && is_integer(numb)
109-
set_attribute!(gf, :passes_tadpole_cancellation_check, true)
110-
else
111-
set_attribute!(gf, :passes_tadpole_cancellation_check, false)
112-
end
108+
set_attribute!(gf, :passes_tadpole_cancellation_check, (numb >= 0 && is_integer(numb)))
113109
return numb::QQFieldElem
114110
end

experimental/FTheoryTools/src/G4Fluxes/properties.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ G4-flux candidate
183183
@req base_space(m) isa NormalToricVariety "Tadpole cancellation checks for G4-flux currently supported only for toric base"
184184
@req ambient_space(m) isa NormalToricVariety "Tadpole cancellation checks for G4-flux currently supported only for toric ambient space"
185185
numb = d3_tadpole_constraint(g4, check = false)
186-
if numb >= 0 && is_integer(numb)
187-
return true
188-
end
189-
return false
186+
return numb >= 0 && is_integer(numb)
190187
end
191188

192189

0 commit comments

Comments
 (0)