Constructors
The main way to construct GKM graphs is using one of the constructors provided in the page Examples. The construction of a GKM graph from scratch is possible but not advised.
Example
Here we construct the $2$-dimensional projective space from scratch.
julia> using GKMtools, OscarLet us consider the coordinate torus $T=(\mathbb{C}^*)^3$ acting on $\mathbb{P}^2$:
\[(t_0, t_1, t_2) \cdot [x_0:x_1:x_2] = [t_0x_0:t_1x_1:t_2x_2]\]
The fixed points are
\[p_0 = [1:0:0], p_1 = [0:1:0], p_2 = [0:0:1].\]
Let us construct the character lattice of $T$. It is a Oscar free module.
julia> M = free_module(ZZ, 3) # also possible to use QQ, but we want to see the integral structure
Free module of rank 3 over ZZ
julia> t_0, t_1, t_2 = gens(M)
3-element Vector{AbstractAlgebra.Generic.FreeModuleElem{ZZRingElem}}:
(1, 0, 0)
(0, 1, 0)
(0, 0, 1)
julia> characters = (t_0, t_1, t_2)
((1, 0, 0), (0, 1, 0), (0, 0, 1))We have $3$ fixed points and the one-dimensional $T$-orbits connect every pair of fixed points, so the underlying GKM graph is a triangle.
julia> g = Graph{Undirected}(3); # Oscar 3-vertices graph with no edges
julia> add_edge!(g, 1, 2); add_edge!(g, 1, 3); add_edge!(g, 2, 3);Let us construct the vertices of our GKM graph. Our vertex contains a string which is its label. The label appears when we print the GKM graph, it does not have any other goal. Two vertices cannot have the same label.
julia> vertex_labels = Vertex.([
"p_0 = [1:0:0]",
"p_1 = [0:1:0]",
"p_2 = [0:0:1]",
])
3-element Vector{Vertex}:
Vertex("p_0 = [1:0:0]")
Vertex("p_1 = [0:1:0]")
Vertex("p_2 = [0:0:1]")Let us now define the values of the axial map. For each vertex p, we define a vector A of FlagWeight{ZZRingElem}, which will contain the value of the axial map. In such a way that A[i] will give the value of the i-flag starting from the vertex p. That will be nothing more that an element of $M$. We start by constructing a vector of length equal to the number of vertices, storing all those vectors A.
julia> flags = [
FlagWeight{ZZRingElem}[]
for _ in 1:3
]
3-element Vector{Vector{FlagWeight{ZZRingElem}}}:
[]
[]
[]At any point $p_i$, the tangent weight pointing toward $p_j$ is $t_j-t_i$. For each edge e, edge_flags[e]=(a, b) means that this edge defines the flag number a of the vertex src(e) and the flag number b of the vertex dst(e).
julia> edge_flags = Dict{Edge,Tuple{Int,Int}}();
julia> for e in edges(g)
i = src(e)
j = dst(e)
A_i = characters[j] - characters[i]
# Opposite orientations of the same invariant P¹ have
# opposite tangent weights.
push!(flags[i], FlagWeight{ZZRingElem}(A_i))
push!(flags[j], FlagWeight{ZZRingElem}(-A_i))
edge_flags[e] = (
length(flags[i]),
length(flags[j]),
)
endAssemble the raw combinatorial GKM data.
julia> core_data = GKMCombinatorialData{
ZZRingElem,
Vertex,
FlagWeight{ZZRingElem},
}(
g,
M,
vertex_labels,
flags,
edge_flags,
)
GKM Combinatorial Data
Graph: Undirected graph with 3 nodes and 3 edges
Character Lattice: Free module of rank 3 over ZZ
Vertex Labels: ["p_0 = [1:0:0]", "p_1 = [0:1:0]", "p_2 = [0:0:1]"]
Flag weights defined at 3 vertices
Finally, construct the GKM graph. A connection will be given automatically.
julia> P2 = gkm_graph(core_data)
GKM graph with 3 nodes, valency 2 and axial function:
p_1 = [0:1:0] -> p_0 = [1:0:0] => (1, -1, 0)
p_2 = [0:0:1] -> p_0 = [1:0:0] => (1, 0, -1)
p_2 = [0:0:1] -> p_1 = [0:1:0] => (0, 1, -1)
Algorithmic connection for GKM graph with 3 nodes and valency 2Useful functions
Oscar.core — Function
core(G::AbstractGKMGraph) -> GKMCombinatorialDataReturn the combinatorial data underlying G.
Oscar.graph — Function
graph(data::GKMCombinatorialData) -> Graph
graph(G::AbstractGKMGraph) -> GraphReturn the undirected graph underlying combinatorial data or a GKM graph.
GKMtools.num_edges — Function
num_edges(G::AbstractGKMGraph) -> IntReturn the number of edges of G.
GKMtools.num_vertices — Function
num_vertices(G::AbstractGKMGraph) -> IntReturn the number of vertices of G.
GKMtools.vertices_structure — Function
vertices_structure(data::GKMCombinatorialData)
vertices_structure(G::AbstractGKMGraph)Return the vector of vertex-label objects, in vertex-index order. Use label to obtain the display string of one vertex.
Hecke.lattice — Function
lattice(data::GKMCombinatorialData)
lattice(G::AbstractGKMGraph)Return the character lattice of the torus acting on the GKM graph.
GKMtools.flags — Function
flags(data::GKMCombinatorialData, v::Int)
flags(G::AbstractGKMGraph, v::Int)Return the ordered vector of flags at vertex v, including standalone flags.
Oscar.edges — Function
edges(G::AbstractGKMGraph)Return an iterator over the unoriented edges of G.
Oscar.vertices — Function
vertices(data::GKMCombinatorialData)
vertices(G::AbstractGKMGraph)Return an iterator over the vertex indices.
GKMtools.label — Function
label(G::AbstractGKMGraph, v::Int) -> StringReturn the display label of vertex v.
AbstractAlgebra.degree — Function
degree(G::AbstractGKMGraph, v::Int) -> IntReturn the graph-theoretic degree of vertex v. Standalone flags do not contribute to this degree.
GKMtools.find_vertex_index — Function
find_vertex_index(vertex_label::String, G::AbstractGKMGraph) -> IntReturn the index of the vertex whose display label is vertex_label. An AssertionError is raised if no vertex has that label.
GKMtools.compact_flags — Function
compact_flags(G::AbstractGKMGraph, v::Int) -> Vector{Int}Return the sorted indices of the flags at vertex v which belong to edges. Standalone flags are omitted.
Oscar.weight — Function
weight(data::GKMCombinatorialData, v::Int, i::Int)
weight(G::AbstractGKMGraph, v::Int, i::Int)
weight(data::GKMCombinatorialData, e::Edge)
weight(G::AbstractGKMGraph, e::Edge)Return an axial weight. The (v, i) forms return the weight of the i-th flag at vertex v. The edge forms orient the weight from src(e) to dst(e); reversing e therefore negates the result.
Examples
julia> H7 = gkm_graph_of_toric(hirzebruch_surface(NormalToricVariety, 7))
GKM graph with 4 nodes, valency 2 and axial function:
2 -> 1 => (-1, 0, 1, 0)
3 -> 2 => (-7, -1, 0, 1)
4 -> 1 => (0, -1, -7, 1)
4 -> 3 => (1, 0, -1, 0)
Algorithmic connection for GKM graph with 4 nodes and valency 2
julia> weight_class(H7, Edge(3, 2))
-7*t1 - t2 + t4GKMtools.other_vertex — Function
other_vertex(G::AbstractGKMGraph, v::Int, i::Int) -> IntReturn the vertex opposite to the i-th flag at vertex v.
This is the vertex on the other side of the corresponding edge. Return 0 if the flag is standalone.
GKMtools.print_labels — Function
print_labels(G::AbstractGKMGraph)Print all strings of the label of the vertices of G with their vertex numbers.
Examples
julia> R = root_system(:A, 2);
julia> G = generalized_gkm_flag(R)
GKM graph with 6 nodes, valency 3 and axial function:
s1 -> id => (1, -1, 0)
s2*s1 -> s1 => (0, 1, -1)
s1*s2*s1 -> id => (1, 0, -1)
s1*s2*s1 -> s2*s1 => (1, -1, 0)
s2 -> id => (0, 1, -1)
s2 -> s2*s1 => (-1, 0, 1)
s1*s2 -> s1 => (1, 0, -1)
s1*s2 -> s1*s2*s1 => (0, -1, 1)
s1*s2 -> s2 => (1, -1, 0)
Birkhoff-Grothendieck connection for GKM graph with 6 nodes and valency 3
julia> print_labels(G)
1 -> id
2 -> s1
3 -> s2*s1
4 -> s1*s2*s1
5 -> s2
6 -> s1*s2GKMtools.number_vertex_of_label — Function
number_vertex_of_label(G::AbstractGKMGraph, label::String) -> IntReturn the vertex number of a given label. An error is raised if no vertex has that label.
Examples
julia> R = root_system(:A, 2);
julia> G = generalized_gkm_flag(R);
julia> number_vertex_of_label(G, "id")
1
julia> number_vertex_of_label(G, "s1")
2