harness-space

Crates.ioharness-space
lib.rsharness-space
version0.7.0
created_at2025-04-29 13:05:30.114064+00
updated_at2025-05-23 19:55:06.059064+00
descriptionThe library for topological and other spaces
homepage
repositoryhttps://github.com/harness-labs/space
max_upload_size
id1653513
size252,341
Colin Roberts (Autoparallel)

documentation

README

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);
Commit count: 38

cargo fmt