How hellas-ai/open-hypergraphs works
File structure
• Top-level: Cargo.toml, src/, examples/, tests/.
• src/ contains self-contained modules:
– array: parallel array back-end
– category: abstract category interfaces and spiders
– finite_function: category of finite functions
– functor: functor traits and optic transformations
– hypergraph & open_hypergraph: core hypergraph and open-hypergraph structures
– indexed_coproduct, semifinite, lax: general constructions used by core types
– eval.rs, operations.rs, layer.rs: evaluation engine and layering logic
• examples/ shows user-facing entry points; tests/ verify each module.
• No external services or databases—pure library code.
README for additional insights
• Features: tensor & composition, functors (including reverse differentiation), data-parallel layering.
• Examples illustrate how end users define and evaluate circuits.
Main components and their relationships
a. User API (examples/**)
b. Core types
– open_hypergraph module (user‐facing graph type)
– hypergraph module (underlying graph structure)
– category module (abstract categorical interface)
– functor module (transforms between categories)
c. Supporting algebraic constructions
– finite_function, indexed_coproduct, lax, semifinite
d. Execution engine
– layer.rs (data-parallel layering)
– array module (vector/array operations for parallelism)
e. Operations (combinators) in operations.rs
Architectural patterns and principles
• Modular layering: each algebraic concept in its own module.
• Separation of interface (traits in category, functor) vs. implementation (finite_function, hypergraph).
• Plug-in extensibility: new categories or functors can be added by implementing traits.
• Data-parallel core: array/vec back-end used by evaluation and layering.