Skip to content

Commit 2597903

Browse files
committed
[FTheoryTools] Convenience methods for creation of flux instances
1 parent 57a6f28 commit 2597903

File tree

1 file changed

+68
-1
lines changed
  • experimental/FTheoryTools/src/FamilyOfG4Fluxes

1 file changed

+68
-1
lines changed

Diff for: experimental/FTheoryTools/src/FamilyOfG4Fluxes/methods.jl

+68-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,34 @@ julia> rat_combination = matrix(QQ, [[5//2]])
3434
[5//2]
3535
3636
julia> flux_instance(fgs, int_combination, rat_combination, check = false)
37+
G4-flux candidate
38+
- Elementary quantization checks: not executed
39+
- Transversality checks: not executed
40+
- Non-abelian gauge group: breaking pattern not analyzed
41+
- Tadpole cancellation check: not executed
42+
43+
julia> flux_instance(fgs, Int[], [], check = false)
44+
G4-flux candidate
45+
- Elementary quantization checks: not executed
46+
- Transversality checks: not executed
47+
- Non-abelian gauge group: breaking pattern not analyzed
48+
- Tadpole cancellation check: not executed
49+
50+
julia> flux_instance(fgs, [3], [], check = false)
51+
G4-flux candidate
52+
- Elementary quantization checks: not executed
53+
- Transversality checks: not executed
54+
- Non-abelian gauge group: breaking pattern not analyzed
55+
- Tadpole cancellation check: not executed
56+
57+
julia> flux_instance(fgs, [], [5//2], check = false)
58+
G4-flux candidate
59+
- Elementary quantization checks: not executed
60+
- Transversality checks: not executed
61+
- Non-abelian gauge group: breaking pattern not analyzed
62+
- Tadpole cancellation check: not executed
63+
64+
julia> flux_instance(fgs, [3], [5//2], check = false)
3765
G4-flux candidate
3866
- Elementary quantization checks: not executed
3967
- Transversality checks: not executed
@@ -45,7 +73,7 @@ function flux_instance(fgs::FamilyOfG4Fluxes, int_combination::ZZMatrix, rat_com
4573
@req ncols(int_combination) == 1 "int_combination is expected to be a single column vector"
4674
@req ncols(rat_combination) == 1 "rat_combination is expected to be a single column vector"
4775
@req nrows(int_combination) == ncols(matrix_integral(fgs)) "Number of specified integers must match the number of integral combinations in G4-flux family"
48-
@req nrows(rat_combination) == ncols(matrix_rational(fgs)) "Number of specified rationals must match the number of integral combinations in G4-flux family"
76+
@req nrows(rat_combination) == ncols(matrix_rational(fgs)) "Number of specified rationals must match the number of rational combinations in G4-flux family"
4977
m1 = matrix_integral(fgs) * int_combination
5078
m2 = matrix_rational(fgs) * rat_combination
5179
gens = chosen_g4_flux_basis(model(fgs), check = check)
@@ -74,6 +102,45 @@ function flux_instance(fgs::FamilyOfG4Fluxes, int_combination::ZZMatrix, rat_com
74102
end
75103

76104

105+
function flux_instance(fgs::FamilyOfG4Fluxes, int_coeffs::Vector{Int}, rat_coeffs::Vector{Rational{Int}}; check::Bool = true)
106+
if length(int_coeffs) == 0 && length(rat_coeffs) == 0
107+
m = model(fgs)
108+
r = cohomology_ring(ambient_space(m), check = check)
109+
return G4Flux(m, CohomologyClass(ambient_space(m), zero(r)))
110+
end
111+
@req all(x -> x isa Int, int_coeffs) "Provided integral coefficient is not an integer"
112+
@req all(x -> x isa Rational{Int64}, rat_coeffs) "Provided integral coefficient is not an integer"
113+
114+
m_int = matrix(ZZ, [int_coeffs])
115+
if length(int_coeffs) == 0
116+
m_int = zero_matrix(ZZ, 1, ncols(matrix_integral(fgs)))
117+
end
118+
if length(int_coeffs) > 0
119+
@req length(int_coeffs) == ncols(matrix_integral(fgs)) "Number of specified integers must match the number of integral combinations in G4-flux family"
120+
end
121+
m_rat = matrix(QQ, [rat_coeffs])
122+
if length(rat_coeffs) == 0
123+
m_rat = zero_matrix(QQ, 1, ncols(matrix_rational(fgs)))
124+
end
125+
if length(rat_coeffs) > 0
126+
@req length(rat_coeffs) == ncols(matrix_rational(fgs)) "Number of specified rationals must match the number of rational combinations in G4-flux family"
127+
end
128+
return flux_instance(fgs, m_int, m_rat, check = check)
129+
end
130+
131+
function flux_instance(fgs::FamilyOfG4Fluxes, int_coeffs::Vector{Any}, rat_coeffs::Vector{Rational{Int}}; check::Bool = true)
132+
return flux_instance(fgs, Vector{Int}(int_coeffs), rat_coeffs, check = check)
133+
end
134+
135+
function flux_instance(fgs::FamilyOfG4Fluxes, int_coeffs::Vector{Int}, rat_coeffs::Vector{Any}; check::Bool = true)
136+
return flux_instance(fgs, int_coeffs, Vector{Rational{Int}}(rat_coeffs), check = check)
137+
end
138+
139+
function flux_instance(fgs::FamilyOfG4Fluxes, int_coeffs::Vector{Any}, rat_coeffs::Vector{Any}; check::Bool = true)
140+
return flux_instance(fgs, Vector{Int}(int_coeffs), Vector{Rational{Int}}(rat_coeffs), check = check)
141+
end
142+
143+
77144
@doc raw"""
78145
random_flux_instance(fgs::FamilyOfG4Fluxes; check::Bool = true)
79146

0 commit comments

Comments
 (0)