Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion experimental/FTheoryTools/docs/src/g4.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ random_flux_instance(fgs::FamilyOfG4Fluxes)
For convenience, a random physically consistent flux can also be generated directly from a model:

```@docs
random_flux(m::AbstractFTheoryModel; not_breaking::Bool = false)
random_flux(m::AbstractFTheoryModel)
```

### Recovering a Flux Family from a Flux Instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,26 @@ end
### Attributes for flux families (not exported, rather for serialization overhaul)
######################################################################################

@attr QQMatrix function matrix_integral_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true)
return matrix_integral(special_flux_family(m, completeness_check))
@attr QQMatrix function matrix_integral_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return matrix_integral(special_flux_family(m, completeness_check = completeness_check, rng = rng))
end

@attr QQMatrix function matrix_rational_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true)
return matrix_rational(special_flux_family(m, completeness_check))
@attr QQMatrix function matrix_rational_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return matrix_rational(special_flux_family(m, completeness_check = completeness_check, rng = rng))
end

@attr Vector{QQFieldElem} function offset_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true)
return offset(special_flux_family(m, completeness_check))
@attr Vector{QQFieldElem} function offset_quant_transverse(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return offset(special_flux_family(m, completeness_check = completeness_check, rng = rng))
end

@attr QQMatrix function matrix_integral_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true)
return matrix_integral(special_flux_family(m, not_breaking = true; completeness_check))
@attr QQMatrix function matrix_integral_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return matrix_integral(special_flux_family(m, not_breaking = true; completeness_check = completeness_check, rng = rng))
end

@attr QQMatrix function matrix_rational_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true)
return matrix_rational(special_flux_family(m, not_breaking = true; completeness_check))
@attr QQMatrix function matrix_rational_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return matrix_rational(special_flux_family(m, not_breaking = true; completeness_check = completeness_check, rng = rng))
end

@attr Vector{QQFieldElem} function offset_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true)
return offset(special_flux_family(m, not_breaking = true; completeness_check))
@attr Vector{QQFieldElem} function offset_quant_transverse_nobreak(m::AbstractFTheoryModel; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
return offset(special_flux_family(m, not_breaking = true; completeness_check = completeness_check, rng = rng))
end
8 changes: 4 additions & 4 deletions experimental/FTheoryTools/src/FamilyOfG4Fluxes/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ julia> using Random;
julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 2021), rng = Random.Xoshiro(1234))
Hypersurface model over a concrete base

julia> fgs = special_flux_family(qsm_model, completeness_check = false)
julia> fgs = special_flux_family(qsm_model, completeness_check = false, rng = Random.Xoshiro(1234))
Family of G4 fluxes:
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
- Non-abelian gauge group: breaking pattern not analyzed

julia> d3_tadpole_constraint(fgs);
julia> d3_tadpole_constraint(fgs, rng = Random.Xoshiro(1234));
```
"""
@attr QQMPolyRingElem function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; completeness_check::Bool = true)
@attr QQMPolyRingElem function d3_tadpole_constraint(fgs::FamilyOfG4Fluxes; completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())

# Entry checks
m = model(fgs)
Expand Down Expand Up @@ -270,7 +270,7 @@ julia> d3_tadpole_constraint(fgs);
my_tuple = Tuple(sort([basis_indices[l1]..., basis_indices[l2]...]))

if arxiv_doi(m) == "10.48550/arXiv.1511.03209"
change = sophisticated_intersection_product(ambient_space(m), my_tuple, hypersurface_equation(m), inter_dict, s_inter_dict, data)
change = sophisticated_intersection_product(ambient_space(m), my_tuple, hypersurface_equation(m), inter_dict, s_inter_dict, data; rng)
else
change = get!(inter_dict, my_tuple) do
return QQ(integrate(cohomology_class(ambient_space(m), polynomial(basis[l1]) * polynomial(basis[l2]) * cy); completeness_check))
Expand Down
24 changes: 15 additions & 9 deletions experimental/FTheoryTools/src/FamilyOfG4Fluxes/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ Create a random element of a family of G4-fluxes.
Verifying those properties can be very time consuming. To skip these consistency checks,
pass the optional keyword argument `consistency_check=false`.

!!! note "Randomness"
The random source can be set with the optional argument `rng`

# Examples
```jldoctest; setup = :(Oscar.LazyArtifacts.ensure_artifact_installed("QSMDB", Oscar.LazyArtifacts.find_artifacts_toml(Oscar.oscardir)))
julia> using Random;
Expand All @@ -202,23 +205,23 @@ Family of G4 fluxes:
- Transversality checks: not executed
- Non-abelian gauge group: breaking pattern not analyzed

julia> random_flux_instance(fgs, completeness_check = false, consistency_check = false)
julia> random_flux_instance(fgs, completeness_check = false, consistency_check = false, rng = Random.Xoshiro(1234))
G4-flux candidate
- Elementary quantization checks: not executed
- Transversality checks: not executed
- Non-abelian gauge group: breaking pattern not analyzed
- Tadpole cancellation check: not computed
```
"""
function random_flux_instance(fgs::FamilyOfG4Fluxes; completeness_check::Bool = true, consistency_check::Bool = true)
function random_flux_instance(fgs::FamilyOfG4Fluxes; completeness_check::Bool = true, consistency_check::Bool = true, rng::AbstractRNG = Random.default_rng())
int_combination = zero_matrix(ZZ, ncols(matrix_integral(fgs)), 1)
rat_combination = zero_matrix(QQ, ncols(matrix_rational(fgs)), 1)
for i in 1:ncols(matrix_integral(fgs))
int_combination[i] = rand(-100:100)
int_combination[i] = rand(rng, -100:100)
end
for i in 1:ncols(matrix_rational(fgs))
numerator = rand(-100:100)
denominator = rand(1:100)
numerator = rand(rng, -100:100)
denominator = rand(rng, 1:100)
rat_combination[i] = numerator // denominator
end
return flux_instance(fgs, int_combination, rat_combination; completeness_check, consistency_check)
Expand Down Expand Up @@ -246,22 +249,25 @@ Create a random ``G_4``-flux on a given F-theory model.
Verifying those properties can be very time consuming. To skip these consistency checks,
pass the optional keyword argument `consistency_check=false`.

!!! note "Randomness"
The random source can be set with the optional argument `rng`

# Examples
```jldoctest; setup = :(Oscar.LazyArtifacts.ensure_artifact_installed("QSMDB", Oscar.LazyArtifacts.find_artifacts_toml(Oscar.oscardir)))
julia> using Random;

julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 2021), rng = Random.Xoshiro(1234))
Hypersurface model over a concrete base

julia> rf = random_flux(qsm_model, completeness_check = false)
julia> rf = random_flux(qsm_model, completeness_check = false, rng = Random.Xoshiro(1234))
G4-flux candidate
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
- Non-abelian gauge group: breaking pattern not analyzed
- Tadpole cancellation check: not computed
```
"""
function random_flux(m::AbstractFTheoryModel; not_breaking::Bool = false, completeness_check::Bool = true)
family = special_flux_family(m; not_breaking, completeness_check)
return random_flux_instance(family, completeness_check = completeness_check, consistency_check = false)
function random_flux(m::AbstractFTheoryModel; not_breaking::Bool = false, completeness_check::Bool = true, rng::AbstractRNG = Random.default_rng())
family = special_flux_family(m; not_breaking, completeness_check, rng = rng)
return random_flux_instance(family, completeness_check = completeness_check, consistency_check = false, rng = rng)
end
8 changes: 4 additions & 4 deletions experimental/FTheoryTools/src/FamilyOfG4Fluxes/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ julia> using Random;
julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 2021), rng = Random.Xoshiro(1234))
Hypersurface model over a concrete base

julia> gf = special_flux_family(qsm_model, completeness_check = false)
julia> gf = special_flux_family(qsm_model, completeness_check = false, rng = Random.Xoshiro(1234))
Family of G4 fluxes:
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
Expand Down Expand Up @@ -111,7 +111,7 @@ julia> using Random;
julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 2021), rng = Random.Xoshiro(1234))
Hypersurface model over a concrete base

julia> gf = special_flux_family(qsm_model, completeness_check = false)
julia> gf = special_flux_family(qsm_model, completeness_check = false, rng = Random.Xoshiro(1234))
Family of G4 fluxes:
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
Expand Down Expand Up @@ -185,7 +185,7 @@ julia> using Random;
julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters = Dict("k" => 2021), rng = Random.Xoshiro(1234))
Hypersurface model over a concrete base

julia> gf = special_flux_family(qsm_model, completeness_check = false)
julia> gf = special_flux_family(qsm_model, completeness_check = false, rng = Random.Xoshiro(1234))
Family of G4 fluxes:
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
Expand All @@ -194,7 +194,7 @@ Family of G4 fluxes:
julia> breaks_non_abelian_gauge_group(gf)
true

julia> gf3 = special_flux_family(qsm_model, not_breaking = true, completeness_check = false)
julia> gf3 = special_flux_family(qsm_model, not_breaking = true, completeness_check = false, rng = Random.Xoshiro(1234))
Family of G4 fluxes:
- Elementary quantization checks: satisfied
- Transversality checks: satisfied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (1) Compute the intersection product of an algebraic cycle with a hypersurface.
# ---------------------------------------------------------------------------------------------------------

function sophisticated_intersection_product(v::NormalToricVariety, indices::NTuple{4, Int64}, hypersurface_equation::MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}, inter_dict::Dict{NTuple{4, Int64}, ZZRingElem}, s_inter_dict::Dict{String, ZZRingElem}, data::NamedTuple)
function sophisticated_intersection_product(v::NormalToricVariety, indices::NTuple{4, Int64}, hypersurface_equation::MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}, inter_dict::Dict{NTuple{4, Int64}, ZZRingElem}, s_inter_dict::Dict{String, ZZRingElem}, data::NamedTuple; rng::AbstractRNG = Random.default_rng())

# (A) Have we computed this intersection number in the past? If so, just use that result...
indices = Tuple(sort(collect(indices)))
Expand All @@ -21,7 +21,7 @@ function sophisticated_intersection_product(v::NormalToricVariety, indices::NTup
# (C) Deal with self-intersection and should-never-happen case.
distinct_variables = Set(indices)
if length(distinct_variables) < 4 && length(distinct_variables) >= 1
return intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data)
return intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data; rng)
end
if length(distinct_variables) == 0
println("WEIRD! THIS SHOULD NEVER HAPPEN! INFORM THE AUTHORS!")
Expand All @@ -41,7 +41,7 @@ function sophisticated_intersection_product(v::NormalToricVariety, indices::NTup

# D.2 If pt == 0, then we are not looking at a transverse intersection. So take an equivalent cycle and try again...
if is_zero(pt_reduced)
return intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data)
return intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data; rng)
end

# D.3 If pt is constant and non-zero, then the intersection is trivial.
Expand Down Expand Up @@ -145,7 +145,7 @@ function sophisticated_intersection_product(v::NormalToricVariety, indices::NTup
println("TRYING WITH EQUIVALENT CYCLE")
println("")
=#
numb = intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data)
numb = intersection_from_equivalent_cycle(v, indices, hypersurface_equation, inter_dict, s_inter_dict, data; rng)
s_inter_dict[string([pt_reduced, gs_reduced, remaining_vars, reduced_scaling_relations])] = numb
return numb

Expand All @@ -157,12 +157,12 @@ end
# (2) Compute the intersection product from a rationally equivalent cycle.
# ---------------------------------------------------------------------------------------------------------

function intersection_from_equivalent_cycle(v::NormalToricVariety, indices::NTuple{4, Int64}, hypersurface_equation::MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}, inter_dict::Dict{NTuple{4, Int64}, ZZRingElem}, s_inter_dict::Dict{String, ZZRingElem}, data::NamedTuple)
coeffs_list, tuple_list = Oscar._rationally_equivalent_cycle(v, indices, data)
function intersection_from_equivalent_cycle(v::NormalToricVariety, indices::NTuple{4, Int64}, hypersurface_equation::MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}, inter_dict::Dict{NTuple{4, Int64}, ZZRingElem}, s_inter_dict::Dict{String, ZZRingElem}, data::NamedTuple; rng::AbstractRNG = Random.default_rng())
coeffs_list, tuple_list = Oscar._rationally_equivalent_cycle(v, indices, data; rng)
intersect_numb = 0
for k in 1:length(tuple_list)
if !is_zero(coeffs_list[k])
intersect_numb += coeffs_list[k] * sophisticated_intersection_product(v, tuple_list[k], hypersurface_equation, inter_dict, s_inter_dict, data)
intersect_numb += coeffs_list[k] * sophisticated_intersection_product(v, tuple_list[k], hypersurface_equation, inter_dict, s_inter_dict, data; rng)
end
end
@req is_integer(intersect_numb) "Should have expected to find only integer intersection numbers, but found $intersect_numb for $indices"
Expand Down Expand Up @@ -239,11 +239,11 @@ end
# (4) A function to find a rationally equivalent algebraic cycle.
# ---------------------------------------------------------------------------------------------------------

function _rationally_equivalent_cycle(v::NormalToricVariety, indices::NTuple{4, Int64}, data::NamedTuple)
function _rationally_equivalent_cycle(v::NormalToricVariety, indices::NTuple{4, Int64}, data::NamedTuple; rng::AbstractRNG = Random.default_rng())

# Identify positions of the single and triple variable
positions = [i for (i, val) in pairs(indices) if count(==(val), indices) >= 2]
power_variable = isempty(positions) ? indices[rand(1:length(indices))] : indices[rand(positions)]
power_variable = isempty(positions) ? indices[rand(rng, 1:length(indices))] : indices[rand(rng, positions)]
other_variables = collect(Set(filter(!=(power_variable), indices)))
pos_power_variable = findfirst(==(power_variable), indices)

Expand All @@ -255,9 +255,7 @@ function _rationally_equivalent_cycle(v::NormalToricVariety, indices::NTuple{4,

# On top, at a random combination of linear relations, which do not involve the variables in question
ker = nullspace(simpler_matrix)[2]
A_offset = sum(rand([-1, 0, 1]) * ker[:, my_index] for my_index in 1:ncols(ker))
#max_numb = 50
#A_offset = sum(rand(vcat(-max_numb:-1,1:max_numb)) * ker[:, my_index] for my_index in 1:ncols(ker))
A_offset = sum(rand(rng, [-1, 0, 1]) * ker[:, my_index] for my_index in 1:ncols(ker))

# Now form the relation in case...
employed_relation = -sum((data.linear_relations[:, k] .* (A[k,1] + A_offset[k,1])) for k in 1:nrows(A))
Expand Down
Loading
Loading