harness-space-0.1.0 has been yanked.
Space Crate
A Rust library providing mathematical structures and operations for topological spaces, simplicial complexes, and graphs. This crate is designed to support computational topology and geometry applications.
Features
-
Topological Spaces: Implementation of fundamental topological concepts
- Sets with basic operations (union, intersection, difference)
- Topological spaces with neighborhoods and open sets
- Metric spaces with distance functions
- Normed and inner product spaces
-
Simplicial Complexes: Tools for working with simplicial complexes
- Simplex representation (points, edges, triangles, etc.)
- Chain complexes with boundary operations
- Support for arbitrary coefficient rings
-
Graph Theory: Flexible graph data structures
- Support for both directed and undirected graphs
- Basic graph operations and set operations
- Vertex and edge point representation
Usage
Topological Spaces
use ;
// Define your own space type
Simplicial Complexes
use ;
// Create a simplex (e.g., a triangle)
let triangle = new;
// Create a simplicial complex
let mut complex = new;
complex.join_simplex;
// Compute boundaries
let boundary = complex.;
Graphs
use ;
use HashSet;
// Create a graph
let mut vertices = new;
vertices.insert;
vertices.insert;
let mut edges = new;
edges.insert;
let graph: = new;
Dependencies
itertools: For combinatorial operationsnum: For numeric traits and operations
Examples
Creating a Simplicial Complex
use ;
// Create a tetrahedron
let mut complex = new;
complex.join_simplex;
Working with Graphs
use ;
use HashSet;
// Create a directed graph
let vertices: = .into_iter.collect;
let edges: = .into_iter.collect;
let graph: = new;