Skip to content

Commit

Permalink
[FTheoryTools] Add new literature model constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAround committed Dec 23, 2023
1 parent f90b826 commit 00814c9
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "1",
"arxiv_data": {
"id": "1109.3454",
"doi": "10.48550/arXiv.1109.3454",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "2",
"arxiv_data": {
"id": "1208.2695",
"doi": "10.48550/arXiv.1208.2695",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "3",
"arxiv_data": {
"id": "1208.2695",
"doi": "10.48550/arXiv.1208.2695",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "4",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "5",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "6",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "7",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "8",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "9",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "10",
"arxiv_data": {
"id": "1212.2949",
"doi": "10.48550/arXiv.1212.2949",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "11",
"arxiv_data": {
"id": "1507.05954",
"doi": "10.48550/arXiv.1507.05954",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"model_index": "12",
"arxiv_data": {
"id": "1507.05954",
"doi": "10.48550/arXiv.1507.05954",
Expand Down
76 changes: 60 additions & 16 deletions experimental/FTheoryTools/src/LiteratureModels/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,40 @@ 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))
1
```
For convenience, we also support a simplified constructor. Instead of the meta data of the article,
this constructor accepts an integer, which specifies the position of this model in our database.
```jldoctest
julia> B2 = projective_space(NormalToricVariety, 2)
Normal toric variety
julia> b = torusinvariant_prime_divisors(B2)[1]
Torus-invariant, prime divisor on a normal toric variety
julia> w = literature_model(3, base_space = B2, model_sections = Dict("b" => b), completeness_check = false)
Construction over concrete base may lead to singularity enhancement. Consider computing singular_loci. However, this may take time!
Weierstrass model over a concrete base -- U(1) Weierstrass model based on arXiv paper 1208.2695 Eq. (B.19)
julia> length(singular_loci(w))
1
```
"""
function literature_model(; doi::String="", arxiv_id::String="", version::String="", equation::String="", model_parameters::Dict{String,<:Any} = Dict{String,Any}(), base_space::FTheorySpace = affine_space(NormalToricVariety, 0), model_sections::Dict{String, <:Any} = Dict{String,Any}(), completeness_check::Bool = true)

# (1) Find the model
model_dict = _find_model(doi, arxiv_id, version, equation)
return literature_model(model_dict; model_parameters = model_parameters, base_space = base_space, model_sections = model_sections, completeness_check = completeness_check)
end

function literature_model(k::Int; model_parameters::Dict{String,<:Any} = Dict{String,Any}(), base_space::FTheorySpace = affine_space(NormalToricVariety, 0), model_sections::Dict{String, <:Any} = Dict{String,Any}(), completeness_check::Bool = true)
model_dict = _find_model(k)
return literature_model(model_dict; model_parameters = model_parameters, base_space = base_space, model_sections = model_sections, completeness_check = completeness_check)
end

function literature_model(model_dict::Dict{String, Any}; model_parameters::Dict{String,<:Any} = Dict{String,Any}(), base_space::FTheorySpace = affine_space(NormalToricVariety, 0), model_sections::Dict{String, <:Any} = Dict{String,Any}(), completeness_check::Bool = true)


# (2) Deal with model parameters
# (1) Deal with model parameters
if haskey(model_dict, "model_parameters")
needed_model_parameters = string.(model_dict["model_parameters"])

Expand Down Expand Up @@ -137,16 +160,13 @@ function literature_model(; doi::String="", arxiv_id::String="", version::String
end



#######################################################
# 2. Helper function to find the specified model
#######################################################

function _find_model(doi::String, arxiv_id::String, version::String, equation::String)

# Check that we have at least some information...
@req any(s -> s != "", [doi, arxiv_id, version, equation]) "No information provided; cannot perform look-up"

# Create list of possible candidate files
file_index = JSON.parsefile(joinpath(@__DIR__, "index.json"))
candidate_files = Vector{String}()
for k in 1:length(file_index)
Expand All @@ -157,9 +177,23 @@ function _find_model(doi::String, arxiv_id::String, version::String, equation::S
push!(candidate_files, string(file_index[k]["file"]))
end
end
return _process_candidates(candidate_files)
end

# Check if we found exactly one file, i.e., we were able to identify the model uniquely
@req length(candidate_files) != 0 "We could not find any models matching the given identifiers"
function _find_model(l::Int)
@req l >= 1 "Model index must be at least 1"
file_index = JSON.parsefile(joinpath(@__DIR__, "index.json"))
candidate_files = Vector{String}()
for k in 1:length(file_index)
if get(file_index[k], "model_index", nothing) == string(l)
push!(candidate_files, string(file_index[k]["file"]))
end
end
return _process_candidates(candidate_files)
end

function _process_candidates(candidate_files::Vector{String})
@req length(candidate_files) != 0 "We could not find any models matching the given model index"
@req(length(candidate_files) == 1,
begin
dicts = map(f -> JSON.parsefile(joinpath(@__DIR__, "Models/" * f)), candidate_files)
Expand All @@ -170,18 +204,12 @@ function _find_model(doi::String, arxiv_id::String, version::String, equation::S
strings = ["doi: $(dois[i]), arxiv_id: $(ids[i]), version: $(versions[i]), equation: $(equations[i])" for i in 1:length(dicts)]
"We could not uniquely identify the model. The matched models have the following data:\n$(reduce((s1, s2) -> s1 * "\n" * s2, strings))"
end)

# Create dictionary
model_dict = JSON.parsefile(joinpath(@__DIR__, "Models/" * candidate_files[1]))
# Add literature identifier. For this, remove 'model' from the front and '.json' from the end of the file name.
model_dict["literature_identifier"] = candidate_files[1][6:end - 5]

# Return the dictionary
return model_dict
end



#######################################################
# 3. Constructing models over concrete bases
#######################################################
Expand Down Expand Up @@ -392,3 +420,19 @@ function _set_model_attribute(m::AbstractFTheoryModel, m_dict::Dict{String, Any}
end
end
end



#######################################################
# 6. Function to display all known literature models
#######################################################

function display_all_literature_models()
file_index = JSON.parsefile(joinpath(@__DIR__, "index.json"))
sorted_dicts = sort(file_index, by = x -> parse(Int, x["model_index"]))
for dict in sorted_dicts
print("Model $(dict["model_index"]):\n")
print(dict)
print("\n\n")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# named model*.json in the Models directory

# Currently, this stores the following data for quick searching of models:
# * model_index
# * arXiv data
# -arXiv ID
# -arXiv DOI
Expand All @@ -27,6 +28,8 @@ function _create_literature_model_index()
for model in models
model_data = JSON.parsefile(model_directory * model)

model_index_dict = Dict("model_index" => get(model_data, "model_index", ""))

arxiv_data = get(model_data, "arxiv_data", false)
if arxiv_data != false
arxiv_dict = Dict(
Expand Down Expand Up @@ -59,7 +62,7 @@ function _create_literature_model_index()
metadata_dict = Dict{String,Union{String,Vector{Any}}}()
end

index_entry = merge(arxiv_dict, journal_dict, metadata_dict)
index_entry = merge(model_index_dict, arxiv_dict, journal_dict, metadata_dict)
index_entry["file"] = model
if !isempty(index_entry)
push!(index, index_entry)
Expand Down
2 changes: 1 addition & 1 deletion experimental/FTheoryTools/src/LiteratureModels/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"journal_section":"3","arxiv_page":"10","journal_page":"9","arxiv_id":"1109.3454","arxiv_equation":"3.1","arxiv_version":"2","journal_doi":"10.1016/j.nuclphysb.2011.12.013","journal_equation":"3.1","arxiv_section":"3","journal":"Nucl. Phys. B","file":"model1109_3454.json","title":"$G_4$ flux, chiral matter and singularity resolution in F-theory compactifications","arxiv_doi":"10.48550/arXiv.1109.3454","authors":["Sven Krause","Christoph Mayrhofer","Timo Weigand"]},{"journal_section":"B","arxiv_page":"32","journal_page":"33","arxiv_id":"1208.2695","arxiv_equation":"B.5","arxiv_version":"2","journal_doi":"10.1007/JHEP10(2012)128","journal_equation":"B.5","arxiv_section":"B","journal":"JHEP","file":"model1208_2695-1.json","title":"F-Theory and the Mordell-Weil Group of Elliptically-Fibered Calabi-Yau Threefolds","arxiv_doi":"10.48550/arXiv.1208.2695","authors":["David R. Morrison","Daniel S. Park"]},{"journal_section":"B","arxiv_page":"34","journal_page":"34","arxiv_id":"1208.2695","arxiv_equation":"B.19","arxiv_version":"2","journal_doi":"10.1007/JHEP10(2012)128","journal_equation":"B.19","arxiv_section":"B","journal":"JHEP","file":"model1208_2695-2.json","title":"F-Theory and the Mordell-Weil Group of Elliptically-Fibered Calabi-Yau Threefolds","arxiv_doi":"10.48550/arXiv.1208.2695","authors":["David R. Morrison","Daniel S. Park"]},{"journal_section":"","arxiv_page":"19","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"3.2","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"3.1","journal":"JHEP","file":"model1212_2949-1.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"31","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"3.42","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"3.2","journal":"JHEP","file":"model1212_2949-2.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"37","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"4.1","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"4.1","journal":"JHEP","file":"model1212_2949-3.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"44","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"4.23","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"4.2","journal":"JHEP","file":"model1212_2949-4.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.1","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-5.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.7","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-6.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.13","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-7.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"17","journal_page":"","arxiv_id":"1507.05954","arxiv_equation":"3.4","arxiv_version":"2","journal_doi":"10.1007/JHEP11(2015)204","journal_equation":"","arxiv_section":"3","journal":"JHEP","file":"model1507_05954-1.json","title":"General U(1)×U(1) F-theory compactifications and beyond: geometry of unHiggsings and novel matter structure","arxiv_doi":"10.48550/arXiv.1507.05954","authors":["Mirjam Cvetič","Denis Klevers","Hernan Piragua","Washington Taylor"]},{"journal_section":"","arxiv_page":"71","journal_page":"","arxiv_id":"1507.05954","arxiv_equation":"A.1","arxiv_version":"2","journal_doi":"10.1007/JHEP11(2015)204","journal_equation":"","arxiv_section":"A","journal":"JHEP","file":"model1507_05954-2.json","title":"General U(1)×U(1) F-theory compactifications and beyond: geometry of unHiggsings and novel matter structure","arxiv_doi":"10.48550/arXiv.1507.05954","authors":["Mirjam Cvetič","Denis Klevers","Hernan Piragua","Washington Taylor"]}]
[{"journal_section":"3","arxiv_page":"10","journal_page":"9","arxiv_id":"1109.3454","arxiv_equation":"3.1","arxiv_version":"2","journal_doi":"10.1016/j.nuclphysb.2011.12.013","journal_equation":"3.1","arxiv_section":"3","journal":"Nucl. Phys. B","file":"model1109_3454.json","title":"$G_4$ flux, chiral matter and singularity resolution in F-theory compactifications","arxiv_doi":"10.48550/arXiv.1109.3454","model_index":"1","authors":["Sven Krause","Christoph Mayrhofer","Timo Weigand"]},{"journal_section":"B","arxiv_page":"32","journal_page":"33","arxiv_id":"1208.2695","arxiv_equation":"B.5","arxiv_version":"2","journal_doi":"10.1007/JHEP10(2012)128","journal_equation":"B.5","arxiv_section":"B","journal":"JHEP","file":"model1208_2695-1.json","title":"F-Theory and the Mordell-Weil Group of Elliptically-Fibered Calabi-Yau Threefolds","arxiv_doi":"10.48550/arXiv.1208.2695","model_index":"2","authors":["David R. Morrison","Daniel S. Park"]},{"journal_section":"B","arxiv_page":"34","journal_page":"34","arxiv_id":"1208.2695","arxiv_equation":"B.19","arxiv_version":"2","journal_doi":"10.1007/JHEP10(2012)128","journal_equation":"B.19","arxiv_section":"B","journal":"JHEP","file":"model1208_2695-2.json","title":"F-Theory and the Mordell-Weil Group of Elliptically-Fibered Calabi-Yau Threefolds","arxiv_doi":"10.48550/arXiv.1208.2695","model_index":"3","authors":["David R. Morrison","Daniel S. Park"]},{"journal_section":"","arxiv_page":"19","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"3.2","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"3.1","journal":"JHEP","file":"model1212_2949-1.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"4","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"31","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"3.42","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"3.2","journal":"JHEP","file":"model1212_2949-2.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"5","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"37","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"4.1","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"4.1","journal":"JHEP","file":"model1212_2949-3.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"6","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"44","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"4.23","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"4.2","journal":"JHEP","file":"model1212_2949-4.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"7","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.1","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-5.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"8","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.7","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-6.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"9","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"49","journal_page":"","arxiv_id":"1212.2949","arxiv_equation":"5.13","arxiv_version":"2","journal_doi":"10.1007/JHEP04(2013)061","journal_equation":"","arxiv_section":"5.1","journal":"JHEP","file":"model1212_2949-7.json","title":"The Tate Form on Steroids: Resolution and Higher Codimension Fibers","arxiv_doi":"10.48550/arXiv.1212.2949","model_index":"10","authors":["Craig Lawrie","Sakura Schäfer-Nameki"]},{"journal_section":"","arxiv_page":"17","journal_page":"","arxiv_id":"1507.05954","arxiv_equation":"3.4","arxiv_version":"2","journal_doi":"10.1007/JHEP11(2015)204","journal_equation":"","arxiv_section":"3","journal":"JHEP","file":"model1507_05954-1.json","title":"General U(1)×U(1) F-theory compactifications and beyond: geometry of unHiggsings and novel matter structure","arxiv_doi":"10.48550/arXiv.1507.05954","model_index":"11","authors":["Mirjam Cvetič","Denis Klevers","Hernan Piragua","Washington Taylor"]},{"journal_section":"","arxiv_page":"71","journal_page":"","arxiv_id":"1507.05954","arxiv_equation":"A.1","arxiv_version":"2","journal_doi":"10.1007/JHEP11(2015)204","journal_equation":"","arxiv_section":"A","journal":"JHEP","file":"model1507_05954-2.json","title":"General U(1)×U(1) F-theory compactifications and beyond: geometry of unHiggsings and novel matter structure","arxiv_doi":"10.48550/arXiv.1507.05954","model_index":"12","authors":["Mirjam Cvetič","Denis Klevers","Hernan Piragua","Washington Taylor"]}]
1 change: 1 addition & 0 deletions experimental/FTheoryTools/src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export blow_up
export calabi_yau_hypersurface
export coordinate_ring
export discriminant
export display_all_literature_models
export family_of_spaces
export fiber_ambient_space
export generating_sections
Expand Down
Loading

0 comments on commit 00814c9

Please sign in to comment.