Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 7 additions & 4 deletions experimental/FTheoryTools/src/HypersurfaceModels/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ end

Return the singular loci of the Weierstrass model equivalent to the given hypersurface model,
along with the order of vanishing of ``(f, g, \Delta)`` at each locus and the corresponding
refined Tate fiber type. See [singular_loci(w::WeierstrassModel)](@ref) for more details.
refined Tate fiber type. See [`singular_loci(w::WeierstrassModel)`](@ref) for more details.

Raises an error if no such Weierstrass model is known.

Expand All @@ -297,6 +297,7 @@ model (see [BMT25](@cite BMT25) for background), in order to demonstrate this fu
!!! warning
The classification of singularities is performed using a Monte Carlo algorithm, involving randomized sampling.
While reliable in practice, this probabilistic method may occasionally yield non-deterministic results.
The random seed can be set with the optional argument `rng`.
Comment thread
HereAround marked this conversation as resolved.
Outdated

# Examples
```jldoctest
Expand Down Expand Up @@ -324,12 +325,14 @@ Weierstrass model over a concrete base

julia> set_weierstrass_model(h, w)

julia> length(singular_loci(h))
julia> using Random;

julia> length(singular_loci(h; rng = Random.Xoshiro(1234)))
2
```
"""
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(h::HypersurfaceModel)
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(h::HypersurfaceModel; rng::AbstractRNG = Random.default_rng())
@req base_space(h) isa NormalToricVariety "Singular loci currently only supported for toric varieties as base space"
@req has_attribute(h, :weierstrass_model) || has_attribute(h, :global_tate_model) "No corresponding Weierstrass model or global Tate model is known"
return has_attribute(h, :weierstrass_model) ? singular_loci(weierstrass_model(h)) : singular_loci(global_tate_model(h))
return has_attribute(h, :weierstrass_model) ? singular_loci(weierstrass_model(h); rng) : singular_loci(global_tate_model(h); rng)
end
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ Construction over concrete base may lead to singularity enhancement. Consider co

Weierstrass model over a concrete base -- U(1) Weierstrass model based on arXiv paper 1208.2695 Eq. (B.19)

julia> length(singular_loci(w))
julia> using Random;

julia> length(singular_loci(w; rng = Random.Xoshiro(1234)))
1
```

Expand All @@ -102,7 +104,9 @@ Construction over concrete base may lead to singularity enhancement. Consider co

Weierstrass model over a concrete base -- U(1) Weierstrass model based on arXiv paper 1208.2695 Eq. (B.19)

julia> length(singular_loci(w))
julia> using Random;

julia> length(singular_loci(w; rng = Random.Xoshiro(1234)))
1
```

Expand Down
11 changes: 7 additions & 4 deletions experimental/FTheoryTools/src/TateModels/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,12 @@ end

Return the singular loci of the Weierstrass model equivalent to the given Tate model,
along with the order of vanishing of ``(f, g, \Delta)`` at each locus and the corresponding
refined Tate fiber type. See [singular_loci(w::WeierstrassModel)](@ref) for more details.
refined Tate fiber type. See [`singular_loci(w::WeierstrassModel)`](@ref) for more details.

!!! warning
The classification of singularities is performed using a Monte Carlo algorithm, involving randomized sampling.
While reliable in practice, this probabilistic method may occasionally yield non-deterministic results.
The random seed can be set with the optional argument `rng`.
Comment thread
HereAround marked this conversation as resolved.
Outdated

Below, we demonstrate this functionality by computing the singular loci of a Type ``III`` Tate model
[KMSS11](@cite). In this case, the Tate sections are factored as follows:
Expand Down Expand Up @@ -360,13 +361,15 @@ Assuming that the first row of the given grading is the grading under Kbar

Global Tate model over a not fully specified base

julia> sort([k[2:3] for k in singular_loci(t)])
julia> using Random;

julia> sort([k[2:3] for k in singular_loci(t; rng = Random.Xoshiro(1234))])
2-element Vector{Tuple{Tuple{Int64, Int64, Int64}, String}}:
((0, 0, 1), "I_1")
((1, 2, 3), "III")
```
"""
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(t::GlobalTateModel)
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(t::GlobalTateModel; rng::AbstractRNG = Random.default_rng())
@req (base_space(t) isa NormalToricVariety || base_space(t) isa FamilyOfSpaces) "Singular loci of global Tate model currently only supported for toric varieties and families of spaces as base space"
return singular_loci(weierstrass_model(t))
return singular_loci(weierstrass_model(t); rng)
end
4 changes: 2 additions & 2 deletions experimental/FTheoryTools/src/TateModels/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Determine the fiber of a (singular) global Tate model over a particular base loc
!!! warning
This method may run for very long time and is currently not tested as part of the regular OSCAR CI due to its excessive run times.
"""
function analyze_fibers(model::GlobalTateModel, centers::Vector{<:Vector{<:Integer}})
function analyze_fibers(model::GlobalTateModel, centers::Vector{<:Vector{<:Integer}}; rng::AbstractRNG = Random.default_rng())

# This method only works if the model is defined over a toric variety over toric scheme
@req base_space(model) isa NormalToricVariety "Analysis of fibers currently only supported for toric variety as base space"
Expand All @@ -23,7 +23,7 @@ function analyze_fibers(model::GlobalTateModel, centers::Vector{<:Vector{<:Integ
lin = ideal_of_linear_relations(tas);

# Singular loci
sing_loc = singular_loci(model)
sing_loc = singular_loci(model; rng)

# Pick out the singular loci that are more singular than an I_1
# Then keep only the locus and not the extra info about it
Expand Down
11 changes: 7 additions & 4 deletions experimental/FTheoryTools/src/WeierstrassModels/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,21 @@ Advanced technical details are available in [BMT25](@cite BMT25).

!!! warning
The classification of singularities is based on a Monte Carlo algorithm, which involves random sampling.
While extensively tested and highly reliable, the method’s probabilistic nature may lead to non-deterministic results in rare cases.
While reliable in practice, this probabilistic method may occasionally yield non-deterministic results.
The random seed can be set with the optional argument `rng`.
Comment thread
HereAround marked this conversation as resolved.
Outdated

# Examples
```jldoctest
julia> w = weierstrass_model_over_projective_space(3)
Weierstrass model over a concrete base

julia> length(singular_loci(w))
julia> using Random;

julia> length(singular_loci(w; rng = Random.Xoshiro(1234)))
1
```
"""
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(w::WeierstrassModel)
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(w::WeierstrassModel; rng::AbstractRNG = Random.default_rng())
@req (base_space(w) isa NormalToricVariety || base_space(w) isa FamilyOfSpaces) "Singular loci of Weierstrass model is currently only supported for toric varieties and families of spaces as base space"
B = irrelevant_ideal(base_space(w))
d_primes = factor(discriminant(w))
Expand All @@ -202,7 +205,7 @@ julia> length(singular_loci(w))
g_order = valuation(g, p)
ords = (f_order, g_order, d_order)
I = ideal([p])
kodaira_types[i] = (I, ords, _kodaira_type(I, ords, w))
kodaira_types[i] = (I, ords, _kodaira_type(I, ords, w; rng))
end
sort!(kodaira_types, by = x -> (x[2][2], x[2][3]))
return kodaira_types
Expand Down
10 changes: 4 additions & 6 deletions experimental/FTheoryTools/src/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ _count_factors(poly::QQMPolyRingElem) = mapreduce(p -> p[end], +, absolute_prima

_string_from_factor_count(poly::QQMPolyRingElem, string_list::Vector{String}) = string_list[_count_factors(poly)]

function _kodaira_type(id::MPolyIdeal{<:MPolyRingElem}, ords::Tuple{Int64, Int64, Int64}, w::WeierstrassModel; rand_seed::Union{Int64, Nothing} = nothing)
function _kodaira_type(id::MPolyIdeal{<:MPolyRingElem}, ords::Tuple{Int64, Int64, Int64}, w::WeierstrassModel; rng::AbstractRNG = Random.default_rng())
f_ord = ords[1]
g_ord = ords[2]
d_ord = ords[3]
Expand Down Expand Up @@ -198,12 +198,10 @@ function _kodaira_type(id::MPolyIdeal{<:MPolyRingElem}, ords::Tuple{Int64, Int64
# five times and see if we get agreement among all of the results
num_gens = ngens(parent(f))
gauge2s, f2s, g2s, d2s = [], [], [], []
if rand_seed != nothing
Random.seed!(rand_seed)
end
rng = MersenneTwister()
Comment thread
HereAround marked this conversation as resolved.
Outdated
Comment thread
HereAround marked this conversation as resolved.
Outdated
for _ in 1:5
coord_inds = randperm(num_gens)[1:end-2]
rand_ints = rand(-100:100, num_gens - 2)
coord_inds = randperm(rng, num_gens)[1:end-2]
rand_ints = rand(rng, -100:100, num_gens - 2)

push!(gauge2s, evaluate(forget_decoration(gens(id)[1]), coord_inds, rand_ints))
push!(f2s, evaluate(forget_decoration(f), coord_inds, rand_ints))
Expand Down
5 changes: 4 additions & 1 deletion experimental/FTheoryTools/test/hypersurface_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# 1: Hypersurface models over concrete bases
#############################################################

using Random
our_rng = Random.Xoshiro(1234)

B3 = projective_space(NormalToricVariety, 3)
ambient_space_of_fiber = weighted_projective_space(NormalToricVariety, [2,3,1])
set_coordinate_names(ambient_space_of_fiber, ["x", "y", "z"])
Expand All @@ -25,7 +28,7 @@ end
@test_throws ArgumentError weierstrass_model(h)
@test_throws ArgumentError global_tate_model(h)
@test_throws ArgumentError discriminant(h)
@test_throws ArgumentError singular_loci(h)
@test_throws ArgumentError singular_loci(h; rng = our_rng)
end

@testset "Saving and loading hypersurface models over concrete base space" begin
Expand Down
47 changes: 25 additions & 22 deletions experimental/FTheoryTools/test/literature_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# 1: Literature Tate model over concrete base
#############################################################

using Random
our_rng = Random.Xoshiro(1234)

B3 = projective_space(NormalToricVariety, 3)
Kbar = anticanonical_divisor_class(B3)
w = torusinvariant_prime_divisors(B3)[1]
Expand All @@ -16,7 +19,7 @@ D = classes_of_tunable_sections_in_basis_of_Kbar_and_defining_classes(t1)
@test parent(tate_section_a6(t1)) == cox_ring(base_space(t1))
@test parent(tate_polynomial(t1)) == cox_ring(ambient_space(t1))
@test parent(discriminant(t1)) == cox_ring(base_space(t1))
@test length(singular_loci(t1)) == 2
@test length(singular_loci(t1; rng = our_rng)) == 2
@test dim(base_space(t1)) == 3
@test dim(ambient_space(t1)) == 5
@test is_base_space_fully_specified(t1) == true
Expand Down Expand Up @@ -97,7 +100,7 @@ w1 = literature_model(arxiv_id = "1208.2695", equation = "B.19", base_space = B2
@test parent(weierstrass_section_g(w1)) == cox_ring(base_space(w1))
@test parent(weierstrass_polynomial(w1)) == cox_ring(ambient_space(w1))
@test parent(discriminant(w1)) == cox_ring(base_space(w1))
@test length(singular_loci(w1)) == 1
@test length(singular_loci(w1; rng = our_rng)) == 1
@test dim(base_space(w1)) == 2
@test dim(ambient_space(w1)) == 4
@test is_base_space_fully_specified(w1) == true
Expand Down Expand Up @@ -160,7 +163,7 @@ t3 = literature_model(arxiv_id = "1109.3454", equation = "3.1")
@test parent(tate_section_a6(t3)) == cox_ring(base_space(t3))
@test parent(tate_polynomial(t3)) == cox_ring(ambient_space(t3))
@test parent(discriminant(t3)) == cox_ring(base_space(t3))
@test length(singular_loci(t3)) == 2
@test length(singular_loci(t3; rng = our_rng)) == 2
@test dim(base_space(t3)) == 3
@test dim(ambient_space(t3)) == 5
@test is_base_space_fully_specified(t3) == false
Expand Down Expand Up @@ -261,7 +264,7 @@ w2 = literature_model(arxiv_id = "1208.2695", equation = "B.19", completeness_ch
@test parent(weierstrass_section_g(w2)) == cox_ring(base_space(w2))
@test parent(weierstrass_polynomial(w2)) == cox_ring(ambient_space(w2))
@test parent(discriminant(w2)) == cox_ring(base_space(w2))
@test length(singular_loci(w2)) == 1
@test length(singular_loci(w2; rng = our_rng)) == 1
@test dim(base_space(w2)) == 2
@test dim(ambient_space(w2)) == 4
@test is_base_space_fully_specified(w2) == false
Expand Down Expand Up @@ -326,7 +329,7 @@ b2 = anticanonical_divisor(B2)
w5 = literature_model(arxiv_id = "1507.05954", equation = "A.1", completeness_check = false, base_space = B2, defining_classes = Dict("s8" => b2, "a1" => b, "a2" => b, "a3" => b))

@testset "Test defining data for literature Weierstrass model over concrete base" begin
@test length(singular_loci(w4)) == 1
@test length(singular_loci(w4; rng = our_rng)) == 1
@test dim(base_space(w4)) == 2
@test dim(ambient_space(w4)) == 4
@test is_base_space_fully_specified(w4) == true
Expand All @@ -344,7 +347,7 @@ b = torusinvariant_prime_divisors(B2)[1]
w6 = literature_model(3, base_space = B2, defining_classes = Dict("b" => b), completeness_check = false)

@testset "Test defining data for literature model defined by model index" begin
@test length(singular_loci(w6)) == 1
@test length(singular_loci(w6; rng = our_rng)) == 1
@test dim(base_space(w6)) == 2
@test dim(ambient_space(w6)) == 4
@test is_base_space_fully_specified(w6) == true
Expand Down Expand Up @@ -783,20 +786,20 @@ foah16_B3_weier = literature_model(arxiv_id = "1408.4808", equation = "3.203", t
@test parent(explicit_model_sections(foah14_B3_weier)["s7"]) == cox_ring(base_space(foah14_B3_weier))
@test parent(explicit_model_sections(foah15_B3_weier)["s7"]) == cox_ring(base_space(foah15_B3_weier))
@test parent(explicit_model_sections(foah16_B3_weier)["s7"]) == cox_ring(base_space(foah16_B3_weier))
@test [k[2:3] for k in singular_loci(foah1_B3_weier)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah2_B3_weier)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah3_B3_weier)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah4_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah5_B3_weier)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah6_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah7_B3_weier)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah8_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah9_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah10_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah11_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah12_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah13_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 4), "Split I_4")]
@test [k[2:3] for k in singular_loci(foah14_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah15_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah16_B3_weier)] == [((0, 0, 1), "I_1"), ((0, 0, 3), "Split I_3"), ((0, 0, 3), "Split I_3"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah1_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah2_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah3_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah4_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah5_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah6_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah7_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1")]
@test [k[2:3] for k in singular_loci(foah8_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah9_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah10_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah11_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah12_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah13_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 4), "Split I_4")]
@test [k[2:3] for k in singular_loci(foah14_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 3), "Split I_3")]
@test [k[2:3] for k in singular_loci(foah15_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2"), ((0, 0, 2), "Non-split I_2")]
@test [k[2:3] for k in singular_loci(foah16_B3_weier; rng = our_rng)] == [((0, 0, 1), "I_1"), ((0, 0, 3), "Split I_3"), ((0, 0, 3), "Split I_3"), ((0, 0, 3), "Split I_3")]
end
Loading
Loading