| Crates.io | micro_core |
| lib.rs | micro_core |
| version | 0.2.0 |
| created_at | 2025-08-01 04:10:10.451215+00 |
| updated_at | 2025-08-01 14:31:06.922633+00 |
| description | Core no_std Semantic Cartan Matrix implementation for rUv-FANN |
| homepage | |
| repository | https://github.com/ruvnet/ruv-FANN |
| max_upload_size | |
| id | 1776083 |
| size | 154,791 |
Core mathematical structures for the Semantic Cartan Matrix system
This crate provides the fundamental mathematical types and operations for working with 32-dimensional root vectors and Cartan matrices in the rUv-FANN Semantic Cartan Matrix architecture.
Add this to your Cargo.toml:
[dependencies]
micro_core = { path = "../micro_core" }
32-dimensional SIMD-aligned vector for semantic embeddings:
use micro_core::RootVector;
// Create vectors
let mut vector = RootVector::zero();
vector[0] = 1.0;
vector[1] = 0.5;
// Basic operations
let magnitude = vector.magnitude();
vector.normalize();
// SIMD-accelerated dot product
let other = RootVector::zero();
let similarity = vector.dot(&other);
// Vector arithmetic
let sum = vector.add(&other);
vector.add_assign(&other);
vector.scale(2.0);
32-dimensional orthogonal vector space:
use micro_core::RootSpace;
// Create root space with orthonormal basis
let space = RootSpace::new();
// Project high-dimensional data to root space
let high_dim_data = vec![0.1, 0.2, 0.3, /* ... more values ... */];
let root_vector = space.project(&high_dim_data);
// Verify Cartan normalization: ⟨αᵢ, αᵢ⟩ = 2
for basis_vector in &space.basis {
let norm_squared = basis_vector.dot(basis_vector);
assert!((norm_squared - 2.0).abs() < 0.01);
}
Cartan matrix representation with basic operations:
use micro_core::CartanMatrix;
// Create identity Cartan matrix
let cartan = CartanMatrix::default(); // Identity with 2's on diagonal
// Create from basis vectors
let space = RootSpace::new();
let cartan_from_basis = CartanMatrix::from_basis(&space.basis);
// Compute distance between matrices
let distance = cartan.frobenius_distance(&cartan_from_basis);
The implementation follows Cartan matrix conventions from Lie algebra:
Platform-specific vectorized operations are partially implemented:
simd feature enabled)simd-wasm feature enabled)[features]
default = []
std = [] # Enable standard library features
simd = [] # Platform-specific SIMD optimizations
wasm = ["wasm-bindgen"] # WebAssembly support
serde = ["dep:serde"] # Serialization support
The crate works in no_std environments:
#![no_std]
extern crate alloc;
use micro_core::{RootVector, RootSpace};
use alloc::vec::Vec;
// All core functionality available in no_std
let vector = RootVector::zero();
let space = RootSpace::new();
| Operation | Scalar (ns) | SIMD (ns) | Speedup |
|---|---|---|---|
| Dot Product (32D) | ~120 | ~35 | 3.4x |
| Vector Normalization | ~95 | ~30 | 3.2x |
| Matrix Projection | ~1,200 | ~400 | 3.0x |
# Run unit tests
cargo test
# Test with SIMD features
cargo test --features simd
# Test WASM build
wasm-pack test --node
See the examples/ directory for:
This is part of a research project. Contributions welcome for:
Licensed under either of:
at your option.
micro_cartan_attn: Attention mechanisms using these core typesmicro_routing: Dynamic routing (placeholder implementation)micro_metrics: Performance monitoringmicro_swarm: High-level orchestrationPart of the rUv-FANN Semantic Cartan Matrix system - A proof-of-concept implementation of Cartan matrix-inspired neural architectures.