Skip to content

teerthsharma/lambda-topo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda-Topo: Topological Memory System

Breaking the Von Neumann Bottleneck through Topological Signatures.

Stars License Python


Overview

Lambda-Topo is a topological data analysis system that transforms raw data into compact topological signatures for efficient storage and retrieval. It combines two research tracks:


Live Stats

Metric Value
Points Processed
Signatures Generated
Memory Queries
Uptime

Stats refresh on deployment. For real-time monitoring, see [live dashboard link].


Theoretical Foundation

Lambda-Topo is grounded in Topological Data Analysis (TDA), a field that uses techniques from algebraic topology to extract robust geometric features from data.

Persistent Homology

At its core, the system computes persistent homology — a method that tracks topological features (connected components, loops, voids) across a filtration of scales:

  • H₀ (H0): Connected components — measures how data clusters and separates
  • H₁ (H1): Loops/cycles — detects cyclic structures, holes, and rings in data
  • H₂ (H2): Voids — captures higher-dimensional cavities

The persistence of a feature — how long it exists across the filtration — encodes its geometric significance. Long-lived features are true structure; short-lived features are noise.

Barcodes and Persistence Diagrams

The output of persistent homology is a barcode (multi-set of intervals) or persistence diagram (points in 2D). Each bar represents one topological feature; its length equals its persistence.

Lambda-Topo transforms these barcodes into Hilbert coefficients — fixed-length vectors that capture the shape of the persistence distribution. These coefficients are:

  • Rotation and translation invariant (ideal for shape matching)
  • Compact (fixed dimension regardless of input size)
  • Queryable via FAISS for sub-millisecond similarity search

Why Topology?

Traditional ML operates in feature space — two structurally identical point clouds can appear unrelated if their coordinates differ. Lambda-Topo operates in shape space, where topology is the invariant:

Structural identity → Topological equivalence → Persistent homology

This provides:

  • Noise robustness — persistence filters out insignificant features
  • Compression — barcode of 10k points → ~50 coefficients
  • Foundation for geometric deep learning, topological neural networks, and spatial reasoning

See:

Topological Memory

  • Index any data (point clouds, embeddings, images) by its shape
  • Barcode-aware retrieval minimizes Von Neumann bottleneck data movement

Manifold Intelligence

  • Unsupervised manifold training for physics + geometry applications
  • Classical mechanics, nuclear physics, differential geometry

Core Architecture

Data Input
    |
    v
Topological Signature       <- ripser (persistent homology)
Generation                  <- H0/H1 barcodes -> Hilbert coefficients
    |
    v
Knowledge Equation          <- Persistence polynomials -> LLM prompts
Generation
    |
    v
Memory Store                <- FAISS (FlatL2, IVF, HNSW indexes)
(Topological Index)

Features

Topological Memory Track

  • Persistent Homology — Uses ripser for sub-second barcode computation on 10k+ point clouds
  • Fixed-Length Signatures — Hilbert coefficient vectors truncated/padded to fixed length for efficient indexing
  • Barcode-Aware Retrieval — Coarse-to-fine similarity search using topological shape matching
  • FAISS Integration — Production-grade similarity search with multiple index types
  • LLM Integration — Turn persistence polynomials directly into reasoning prompts

Manifold Intelligence Track

  • Unsupervised Manifold Training — TSNE, Isomap, LLE, MDS, PCA with automatic best-selection
  • Physics CLI — Measure topological properties for classical mechanics and nuclear physics data
  • Composite Scoring — Silhouette score + reconstruction error for manifold quality assessment
  • Visualization — PNG plots comparing manifold embeddings side-by-side

Both Tracks

  • Physics Measurement Suite — Topological tensor analysis for physics data
  • Modular Architecture — Easy extension to H1, H2 barcodes, vineyards, multiparameter persistence
  • No heavy dependencies — Core needs only numpy, ripser, faiss, sklearn

Installation

git clone https://github.com/teerthsharma/lambda-topo.git
cd lambda-topo
pip install -r requirements.txt

Quick Start

# Run the topological memory demo
python demo/turn_data_into_formula.py

# Run manifold trainer (Swiss roll dataset)
python -m manifold_trainer

# Run physics measurement CLI
python physics_cli.py --type classical --plot
python physics_cli.py --type nuclear --plot

Project Structure

lambda-topo/
|-- lambda_shappire/          # Core topological analysis library
|   |-- topology.py           # Persistent homology, barcodes, Hilbert coefficients
|   |-- memory.py             # FAISS-backed topological memory store
|-- manifold_trainer/          # Unsupervised manifold selection system
|-- demo/
|   |-- turn_data_into_formula.py   # End-to-end demo
|-- hollow_manifold_sim.py    # EM hollow manifold simulator
|-- physics_cli.py            # Physics measurement CLI
|-- manifold_plots/           # Manifold embedding visualizations
|-- physics_plots/            # Physics analysis visualizations
|-- ROADMAP.md                # Future development plan
|-- MVP_SUMMARY.md            # Technical deep-dive
|-- requirements.txt

Why Topological Signatures?

Traditional similarity search (cosine, L2) operates in raw feature space — two structurally identical point clouds can appear unrelated if their coordinates differ. Lambda-Topo operates in shape space:

Two images of the same digit
    -> Convert to point clouds (edges + keypoints)
    -> Compute persistent homology (H0 barcode -- connected components)
    -> Extract Hilbert coefficients -> persistence polynomial
    -> Nearly identical polynomials
    -> Retrieval matches by topology, not pixels

This is the mathematical foundation for:

  • Topological Data Analysis (TDA) in machine learning
  • Shape matching in computer vision
  • Molecular fingerprinting in drug discovery
  • Cosmic structure analysis in astrophysics

Performance

Barcode computation (10k points): ~0.8s via ripser Signature indexing (100k vectors): ~2s with FAISS IVFFlat Similarity search (top-10): <1ms with HNSW Manifold training (1k Swiss roll): <10s for all 5 algorithms


Roadmap

See ROADMAP.md for:

  • LLM framework integrations (LangChain, LlamaIndex, HuggingFace)
  • Image + text processing pipelines
  • H1 and H2 barcode support
  • Production API (FastAPI + persistence)
  • Vineyards and multiparameter persistence

References

  • Edelsbrunner, Letscher, Zomorodian. Topological Persistence and Simplification. Discrete & Computational Geometry, 2000.
  • Ghrist. Barcodes: The Persistent Topology of Data. Bulletin of the AMS, 2008.
  • Chazal & Michel. An Introduction to Topological Data Analysis. JMLR, 2021.
  • Zomorodian & Carlsson. Computing Persistent Homology. Discrete & Computational Geometry, 2005.
  • Bauer, Kerber, Reininghaus. Clear and Compress: Computing Persistent Homology in Three Steps. EG Workshop on Computational Topology, 2014.
  • Wu, Gahdaie, Zhang, Hu. Topological Data Analysis for Deep Learning. ICML Workshop, 2020.
  • Hensel et al. A Introduction to Topological Data Analysis for Physicists. arXiv, 2024.

Citation

@software{lambda_topo,
  author = {Teerth Sharma},
  title = {Lambda-Topo: Topological Memory System},
  url = {https://github.com/teerthsharma/lambda-topo},
  year = {2024}
}

License

MIT

About

Topological Memory System — TDA-based storage and retrieval with ripser + FAISS; manifold intelligence for physics.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages