Crate harness_space

Source
Expand description

Crates.io - harness-space docs.rs - harness-space License: AGPL v3

§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 harness_space::definitions::{Set, TopologicalSpace, MetricSpace};

// Define your own space type
struct MySpace {
    // ... implementation details
}

struct MyPoint {
    // ... implementation details
}

impl Set for MySpace {
    type Point = MyPoint;
    // ... implement set operations
}

impl TopologicalSpace for MySpace {
    type Point = MyPoint;
    type OpenSet = MyOpenSet;
    // ... implement topological operations
}

§Simplicial Complexes

use harness_space::complexes::{Simplex, SimplicialComplex};

// Create a simplex (e.g., a triangle)
let triangle = Simplex::new(2, vec![0, 1, 2]);

// Create a simplicial complex
let mut complex = SimplicialComplex::new();
complex.join_element(triangle);

§Graphs

use harness_space::graph::{Graph, Undirected};
use std::collections::HashSet;

// Create a graph
let mut vertices = HashSet::new();
vertices.insert(1);
vertices.insert(2);

let mut edges = HashSet::new();
edges.insert((1, 2));

let graph = Graph::<usize, Undirected>::new(vertices, edges);

Modules§

cloud
Cloud - Vector Set in N-dimensional Space
complexes
Complexes Module
definitions
Core Definitions for Mathematical Spaces
filtration
Defines traits for building filtered topological spaces.
graph
Graph implementation with support for both directed and undirected graphs.
homology
Homology Module
lattice
Lattice Module
prelude
The prelude for the space crate.
set
Set Module
sheaf
Sheaf Module