Sheaf Interface
The Sheaf Interface defines the abstract API for all network sheaves in the package. All concrete sheaf types (e.g. EuclideanSheaf) implement this interface, providing the combinatorial data (graph, stalks, restriction maps) and the linear‑algebra operations needed to compute coboundaries, Laplacians, and perform linear‑algebraic tasks such as finding global sections.
Below is a quick reference of the most frequently used methods. For a deeper walk‑through, see the tutorial pages linked from the navigation bar.
Core abstract type
abstract type AbstractNetworkSheaf endRepresents a sheaf defined on a graph.
Conceptually, a network sheaf consists of:
- an underlying graph,
- vertex and edge stalk dimensions,
- restriction maps for each incident vertex–edge pair.
Concrete subtypes must provide access to this structure through the methods listed below, but they are not required to use any particular internal representation.
Public API
| Function | Brief description |
|---|---|
vertex_stalks(s::AbstractNetworkSheaf) | Return a vector of dimensions of vertex stalks. |
edge_stalks(s::AbstractNetworkSheaf) | Return a dictionary mapping each edge to its stalk dimension. |
edge_stalk_dimensions(s::AbstractNetworkSheaf) | Return a vector of edge‑stalk dimensions ordered by graph edges. |
underlying_graph(s::AbstractNetworkSheaf) | Return the SimpleGraph on which the sheaf is defined. |
get_vertex_stalk(s::AbstractNetworkSheaf, v::Int) | Dimension of the stalk at vertex v. |
get_edge_stalk(s::AbstractNetworkSheaf, v1::Int, v2::Int) | Dimension of the stalk on edge (v1,v2). |
get_restriction_map(s::AbstractNetworkSheaf, v1::Int, v2::Int) | Return the restriction matrix from vertex v1 to the edge (v1,v2). |
add_vertex_stalk!(s::AbstractNetworkSheaf, stalk_dim::Int) | Append a new vertex with the given stalk dimension, updating the graph. |
add_sheaf_edge!(s::AbstractNetworkSheaf, v1::Int, v2::Int, rm1, rm2) | Add an edge between v1 and v2 together with its two restriction maps. |
coboundary_map(s::AbstractNetworkSheaf) | Construct the coboundary operator as a block‑sparse matrix. |
sheaf_laplacian(s::AbstractNetworkSheaf) | Return the Laplacian operator (as a function). |
All of these functions are lightweight wrappers that delegate to the concrete implementation (e.g. EuclideanSheaf). They are exported from the package and documented automatically via @autodocs, so the reference page below contains the full signature list.
Minimal example
using CellularSheaves
# 1‑dimensional stalks (R) at each vertex
stalks = [1, 1, 1]
# create an empty Euclidean sheaf
F = EuclideanSheaf{Float64}(stalks)
# add an edge with identity restriction maps
add_sheaf_edge!(F, 1, 2, [1], [1])See the Core Sheaf Workflows guide.
API Reference
CellularSheaves.NetworkSheaves.SheafInterface.AbstractNetworkSheaf — Type
AbstractNetworkSheafAn abstract type for network sheaves. A network sheaf is a cellular sheaf on a graph, i.e. a sheaf on a 1-dimensional cell complex. It consists of: - A graph G = (V, E) - A stalk Sv for each vertex v in V - A stalk Se for each edge e in E - A restriction map r{e->v} : Se -> S_v for each incident vertex-edge pair (v, e)
CellularSheaves.NetworkSheaves.SheafInterface.add_sheaf_edge! — Method
add_sheaf_edge!(
s::AbstractNetworkSheaf,
v1,
v2,
rm1,
rm2
) -> Int64
Add a new edge to the network sheaf with specified restriction maps.
Arguments
s: The network sheaf to modifyv1: The first vertex of the edgev2: The second vertex of the edgerm1: The restriction map from vertex v1 to the edgerm2: The restriction map from vertex v2 to the edge
Returns
- Int: The number of edges in the sheaf after addition
See also
CellularSheaves.NetworkSheaves.SheafInterface.add_vertex_stalk! — Method
add_vertex_stalk!(s::AbstractNetworkSheaf, stalk) -> Bool
Add a new vertex stalk to the network sheaf.
Arguments
s: The network sheaf to modifystalk: The dimension of the new vertex stalk to add
Returns
- Nothing: The sheaf is modified in-place
See also
CellularSheaves.NetworkSheaves.SheafInterface.coboundary_map — Method
coboundary_map(
s::AbstractNetworkSheaf
) -> BlockSparseMatrixCSC{_A, Int64} where _A
Compute the coboundary map of a network sheaf.
Arguments
s: The network sheaf
Returns
- AbstractMatrix: The coboundary map as a matrix-like linear operator. Implementations may return a block-sparse matrix representation supporting operations such as
*andadjoint.
See also
CellularSheaves.NetworkSheaves.SheafInterface.edge_stalks — Method
edge_stalks(
s::AbstractNetworkSheaf
) -> Dict{UnorderedPair{Int64}, Int64}
Get the edge stalks of a network sheaf.
Arguments
s: The network sheaf
Returns
- Dict{UnorderedPair{Int}, Int}: Mapping from edge (as unordered vertex pair) to stalk dimension
See also
CellularSheaves.NetworkSheaves.SheafInterface.get_edge_stalk — Method
get_edge_stalk(s::AbstractNetworkSheaf, v1, v2) -> Int64
Get the dimension of the stalk at a specific edge.
Arguments
s: The network sheafv1: The first vertex of the edgev2: The second vertex of the edge
Returns
- Int: Dimension of the edge stalk on edge (v1, v2)
See also
CellularSheaves.NetworkSheaves.SheafInterface.get_restriction_map — Method
get_restriction_map(
s::AbstractNetworkSheaf,
v1,
v2
) -> Matrix
Get the restriction map from vertex v1 to the edge (v1, v2).
Arguments
s: The network sheafv1: The source vertexv2: The target vertex (defines the edge with v1)
Returns
- Matrix: The restriction map matrix from vertex v1 stalk to edge (v1, v2) stalk
See also
CellularSheaves.NetworkSheaves.SheafInterface.get_vertex_stalk — Method
get_vertex_stalk(s::AbstractNetworkSheaf, v) -> Int64
Get the dimension of the stalk at a specific vertex.
Arguments
s: The network sheafv: The vertex index
Returns
- Int: Dimension of the vertex stalk at vertex
v
See also
CellularSheaves.NetworkSheaves.SheafInterface.nullspace_trajectory_family — Method
nullspace_trajectory_family(
ts,
z_p,
null_basis;
amplitude,
include_negative
) -> Array{BlockArrays.BlockVector{_A, R} where R<:(AbstractVector{<:AbstractVector{_A}}), 1} where _A
Construct a basis-indexed family of feasible controlled trajectories from an affine feasible-space parameterization.
Arguments
ts: controlled trajectory objectz_p: particular feasible trajectory in public coordinatesnull_basis: matrix whose columns span endpoint-preserving feasible perturbations
Returns
- Vector of trajectory objects, one (or two, if signed) per basis column.
CellularSheaves.NetworkSheaves.SheafInterface.sheaf_laplacian — Method
sheaf_laplacian(
s::AbstractNetworkSheaf
) -> CellularSheaves.NetworkSheaves.EuclideanSheaves.var"#sheaf_laplacian##0#sheaf_laplacian##1"{BlockSparseMatrixCSC{_A, Int64}} where _A
Compute the sheaf Laplacian of a network sheaf.
Arguments
s: The network sheaf
Returns
- Function: The sheaf Laplacian operator (as a function that takes a vector and returns a vector)
See also
coboundary_mapsheaf_laplacian_matrix— computes the matrix representation of the sheaf Laplacian
CellularSheaves.NetworkSheaves.SheafInterface.underlying_graph — Method
underlying_graph(
s::AbstractNetworkSheaf
) -> Graphs.SimpleGraphs.SimpleGraph
Get the underlying graph of a network sheaf.
Arguments
s: The network sheaf
Returns
- Graphs.SimpleGraph: The graph on which the sheaf is defined
See also
CellularSheaves.NetworkSheaves.SheafInterface.vertex_stalks — Method
vertex_stalks(s::AbstractNetworkSheaf) -> Vector{Int64}
Get the vertex stalks of a network sheaf.
Arguments
s: The network sheaf
Returns
- Vector{Int}: Dimensions of each vertex stalk, where the i-th element corresponds to the dimension of the stalk at vertex i
See also